Changeset 1250
- Timestamp:
- 10/25/07 01:18:52 (1 year ago)
- Files:
-
- branches/1.0/src/lib/lyceum-registration-functions.php (modified) (2 diffs)
- branches/1.0/src/lyceum/system-admin/setoption.php (modified) (1 diff)
- branches/1.0/src/lyceum/system-admin/settings.php (modified) (2 diffs)
- branches/1.0/src/lyceum/wp-admin/upgrade-schema.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/src/lib/lyceum-registration-functions.php
r1249 r1250 56 56 $now_gmt = gmdate('Y-m-d H:i:s'); 57 57 $post_content = $wpdb->escape(__(get_settings('example_post_body'))); 58 $post_title = $wpdb->escape(__( 'Hello world!'));58 $post_title = $wpdb->escape(__(get_settings('example_post_title'))); 59 59 $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt, comment_count) VALUES ($userid, '$now', '$now_gmt', '".$post_content."', '".$post_title."', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt', '1')"); 60 60 $postid=$wpdb->insert_id; … … 85 85 if( get_settings('create_example_page')){ 86 86 // First Page 87 $page_title = $wpdb->escape(__( 'About page example -- edit me!'));87 $page_title = $wpdb->escape(__(get_settings('example_page_title'))); 88 88 $page_content = $wpdb->escape(__(get_settings('example_page_body'))); 89 89 $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt, post_status, page_blog) VALUES ($userid, '$now', '$now_gmt', '".$page_content."', '".$page_title."', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'static', '$blog')"); branches/1.0/src/lyceum/system-admin/setoption.php
r1019 r1250 11 11 $_POST['value'] = preg_replace('|[;#]|', '', $_POST['value']);//since this script handles all the data coming in from settings.php, this can't be much more comprehensive 12 12 13 update_option($_POST['option'], stripslashes($_POST['value']));13 update_option($_POST['option'], $wpdb->unescape($_POST['value'])); 14 14 15 15 header("Location: settings.php"); branches/1.0/src/lyceum/system-admin/settings.php
r1249 r1250 331 331 332 332 <form method="post" action="setoption.php" class="lyceum_form"> 333 <?php echo tokeninput('setoption.php', 'example_post_title')?> 334 <input type="hidden" name="option" value="example_post_title" /> 335 336 <table class="FormTable"> 337 <col width="20%" /> 338 <col width="80%" /> 339 340 <tbody> 341 <tr> 342 <th scope="row"><label for="example_post_title">Example post title</label></th> 343 <td> 344 <input type="text" name="value" id="example_post_title" maxlength="100" value="<?php echo get_option('example_post_title') ?>" class="TextInput" /> 345 <input type="submit" value="Submit" name="submit" class="Button" /> 346 <div class="HelpText">The title of the example post.</div> 347 </td> 348 </tr> 349 </tbody> 350 </table> 351 </form> 352 353 354 <form method="post" action="setoption.php" class="lyceum_form"> 333 355 <?php echo tokeninput('setoption.php', 'example_post_body')?> 334 356 <input type="hidden" name="option" value="example_post_body" /> … … 369 391 <input type="submit" value="Submit" name="submit" class="Button" /> 370 392 <div class="HelpText">Should an example page be created when a new blog is created?</div> 393 </td> 394 </tr> 395 </tbody> 396 </table> 397 </form> 398 399 <form method="post" action="setoption.php" class="lyceum_form"> 400 <?php echo tokeninput('setoption.php', 'example_page_title')?> 401 <input type="hidden" name="option" value="example_page_title" /> 402 403 <table class="FormTable"> 404 <col width="20%" /> 405 <col width="80%" /> 406 407 <tbody> 408 <tr> 409 <th scope="row"><label for="example_page_title">Example page title</label></th> 410 <td> 411 <input type="text" name="value" id="example_page_title" maxlength="100" value="<?php echo get_option('example_page_title') ?>" class="TextInput" /> 412 <input type="submit" value="Submit" name="submit" class="Button" /> 413 <div class="HelpText">The title of the example page.</div> 371 414 </td> 372 415 </tr> branches/1.0/src/lyceum/wp-admin/upgrade-schema.php
r1249 r1250 341 341 add_option('example_post_body', 'Welcome to ' . get_settings('site_title') . '. This is your first post. Edit or delete it, then start blogging!'); 342 342 add_option('example_page_body', 'This is an example of a page. You may make as many pages as you like, and even structure them in a hierarchy. It\'s quite possible that you won\'t find a use for pages at all. However, one page you may wish to create is an "About" page, telling your readers a little bit about yourself and what you like to write about. Just edit this page, rename the title to "About", and replace this text. Of course, you may also delete this page entirely if you wish.'); 343 add_option('example_post_title', 'Hello world!'); 344 add_option('example_page_title', 'About page example -- edit me!'); 343 345 344 346 //// this is a little ugly
