Changeset 1599
- Timestamp:
- 09/05/2004 12:24:28 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r1547 r1599 14 14 $posts_per_page = get_settings('posts_per_page'); 15 15 $what_to_show = get_settings('what_to_show'); 16 $archive_mode = get_settings('archive_mode');17 16 $date_format = get_settings('date_format'); 18 17 $time_format = get_settings('time_format'); -
trunk/wp-admin/edit-form-advanced.php
r1505 r1599 10 10 <?php 11 11 12 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));13 14 12 if (0 == $post_ID) { 15 13 $form_action = 'post'; … … 19 17 } 20 18 21 if (get_settings('use_pingback')) { 22 $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 23 } else { 24 $form_pingback = ''; 25 } 19 $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 26 20 27 21 $form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />'; 28 22 29 if (get_settings('use_trackback')) {30 23 $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="' . __('Help on trackbacks') . '">' . __('<strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br /> 31 24 <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>'; … … 38 31 $pings .= '</ul>'; 39 32 } 40 } else { 41 $form_trackback = ''; 42 } 33 43 34 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="' . __('Save and Continue Editing') . '" />'; 44 35 -
trunk/wp-admin/edit-form-comment.php
r1503 r1599 1 1 <?php 2 3 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));4 2 5 3 $submitbutton_text = __('Edit Comment »'); -
trunk/wp-admin/edit-form.php
r1505 r1599 2 2 <div class="wrap"> 3 3 <?php 4 5 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));6 7 4 $form_action = 'post'; 8 5 $form_extra = ''; 9 6 10 if (get_settings('use_pingback')) { 11 $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 12 } else { 13 $form_pingback = ''; 14 } 7 $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 15 8 16 if (get_settings('use_trackback')) { 17 $form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') . 9 $form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') . 18 10 '<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>'; 19 } else { 20 $form_trackback = ''; 21 } 11 22 12 23 13 $saveasdraft = ''; -
trunk/wp-admin/edit-page-form.php
r1528 r1599 2 2 <div class="wrap"> 3 3 <?php 4 5 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));6 7 4 $form_action = 'post'; 8 5 $form_extra = ''; -
trunk/wp-admin/link-categories.php
r1551 r1599 29 29 include_once('admin-header.php'); 30 30 31 if ($user_level < get_settings('links_minadminlevel'))31 if ($user_level < 5) 32 32 die (__("Cheatin' uh ?")); 33 33 … … 92 92 die(sprintf(__("Can't delete the <strong>%s</strong> link category: this is the default one"), $cat_name)); 93 93 94 if ($user_level < get_settings('links_minadminlevel'))94 if ($user_level < 5) 95 95 die (__("Cheatin' uh ?")); 96 96 … … 208 208 include_once("./admin-header.php"); 209 209 210 if ($user_level < get_settings('links_minadminlevel'))210 if ($user_level < 5) 211 211 die (__("Cheatin' uh ?")); 212 212 … … 281 281 $standalone=0; 282 282 include_once ("./admin-header.php"); 283 if ($user_level < get_settings('links_minadminlevel')) {283 if ($user_level < 5) { 284 284 die(__("You have do not have sufficient permissions to edit the link categories for this blog. :)")); 285 285 } -
trunk/wp-admin/link-import.php
r1551 r1599 18 18 $standalone = 0; 19 19 include_once('admin-header.php'); 20 if ($user_level < get_settings('links_minadminlevel'))20 if ($user_level < 5) 21 21 die (__("Cheatin’ uh?")); 22 22 … … 75 75 $standalone = 0; 76 76 include_once('admin-header.php'); 77 if ($user_level < get_settings('links_minadminlevel'))77 if ($user_level < 5) 78 78 die (__("Cheatin' uh ?")); 79 79 ?> -
trunk/wp-admin/link-manager.php
r1551 r1599 90 90 91 91 // check the current user's level first. 92 if ($user_level < get_settings('links_minadminlevel'))92 if ($user_level < 5) 93 93 die (__("Cheatin' uh ?")); 94 94 … … 103 103 $results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $wpdb->links LEFT JOIN $wpdb->users ON link_owner = ID WHERE link_id in ($all_links)"); 104 104 foreach ($results as $row) { 105 if ( !get_settings('links_use_adminlevels') ||($user_level >= $row->user_level)) { // ok to proceed105 if (($user_level >= $row->user_level)) { // ok to proceed 106 106 $ids_to_change[] = $row->link_id; 107 107 } … … 123 123 124 124 // check the current user's level first. 125 if ($user_level < get_settings('links_minadminlevel'))125 if ($user_level < 5) 126 126 die (__("Cheatin' uh ?")); 127 127 … … 163 163 164 164 // check the current user's level first. 165 if ($user_level < get_settings('links_minadminlevel'))165 if ($user_level < 5) 166 166 die (__("Cheatin' uh ?")); 167 167 … … 200 200 $auto_toggle = get_autotoggle($link_category); 201 201 202 if ($user_level < get_settings('links_minadminlevel'))202 if ($user_level < 5) 203 203 die (__("Cheatin' uh ?")); 204 204 … … 251 251 $auto_toggle = get_autotoggle($link_category); 252 252 253 if ($user_level < get_settings('links_minadminlevel'))253 if ($user_level < 5) 254 254 die (__("Cheatin' uh ?")); 255 255 … … 284 284 $link_id = (int) $_GET['link_id']; 285 285 286 if ($user_level < get_settings('links_minadminlevel'))286 if ($user_level < 5) 287 287 die (__("Cheatin' uh ?")); 288 288 … … 307 307 $xfn = true; 308 308 include_once ('admin-header.php'); 309 if ($user_level < get_settings('links_minadminlevel')) {309 if ($user_level < 5) { 310 310 die(__('You do not have sufficient permissions to edit the links for this blog.')); 311 311 } … … 572 572 $standalone=0; 573 573 include_once ("./admin-header.php"); 574 if ($user_level < get_settings('links_minadminlevel')) {574 if ($user_level < 5) { 575 575 die(__("You do not have sufficient permissions to edit the links for this blog.")); 576 576 } … … 722 722 $show_buttons = 1; // default 723 723 724 if ( get_settings('links_use_adminlevels') && ($link->user_level > $user_level)) {724 if ($link->user_level > $user_level) { 725 725 $show_buttons = 0; 726 726 } -
trunk/wp-admin/menu.php
r1573 r1599 37 37 $submenu['options-general.php'][15] = array(__('Reading'), 5, 'options-reading.php'); 38 38 $submenu['options-general.php'][20] = array(__('Discussion'), 5, 'options-discussion.php'); 39 $submenu['options-general.php'][25] = array(__('Miscellaneous'), 5, 'options-misc.php'); 40 $submenu['options-general.php'][30] = array(__('Permalinks'), 5, 'options-permalink.php'); 41 $submenu['options-general.php'][35] = array(__('Link Manager'), 5, 'options.php?option_group_id=8'); 39 $submenu['options-general.php'][25] = array(__('Permalinks'), 5, 'options-permalink.php'); 40 $submenu['options-general.php'][30] = array(__('Miscellaneous'), 5, 'options-misc.php'); 42 41 43 42 $self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']); -
trunk/wp-admin/options-discussion.php
r1463 r1599 104 104 <p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://wiki.wordpress.org/index.php/SpamWords">Common spam words</a>.') ?></p> 105 105 <p> 106 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo get_settings('moderation_keys'); ?></textarea>106 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea> 107 107 </p> 108 108 </fieldset> … … 111 111 </p> 112 112 </form> 113 </div> 114 <?php include( "admin-footer.php")?>113 </div> 114 <?php include('./admin-footer.php'); ?> -
trunk/wp-admin/options-general.php
r1551 r1599 52 52 <tr valign="top"> 53 53 <th width="33%" scope="row"><?php _e('Weblog title:') ?></th> 54 <td><input name="blogname" type="text" id="blogname" value="<?php echo htmlspecialchars(get_settings('blogname')); ?>" size="40" /></td>54 <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td> 55 55 </tr> 56 56 <tr valign="top"> 57 57 <th scope="row"><?php _e('Tagline:') ?></th> 58 <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php echo htmlspecialchars(get_settings('blogdescription')); ?>" size="45" />58 <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" /> 59 59 <br /> 60 60 <?php _e('In a few words, explain what this weblog is about.') ?></td> … … 62 62 <tr valign="top"> 63 63 <th scope="row"><?php _e('WordPress address (URI):') ?></th> 64 <td><input name="siteurl" type="text" id="siteurl" value="<?php echo get_settings('siteurl'); ?>" size="40" class="code" /></td>64 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td> 65 65 </tr> 66 66 <tr valign="top"> 67 67 <th scope="row"><?php _e('Blog address (URI):') ?></th> 68 <td><input name="home" type="text" id="home" value="<?php echo get_settings('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td>68 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td> 69 69 </tr> 70 70 <tr valign="top"> 71 71 <th scope="row"><?php _e('E-mail address:') ?> </th> 72 <td><input name="admin_email" type="text" id="admin_email" value="<?php echo get_settings('admin_email'); ?>" size="40" class="code" />72 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" /> 73 73 <br /> 74 74 <?php _e('This address is used only for admin purposes.') ?></td> … … 94 94 <tr> 95 95 <th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th> 96 <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php echo get_settings('gmt_offset'); ?>" />96 <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" /> 97 97 <?php _e('hours') ?> </td> 98 98 </tr> … … 103 103 <tr> 104 104 <th scope="row"><?php _e('Default date format:') ?></th> 105 <td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /><br />105 <td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br /> 106 106 <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('date_format'), current_time('timestamp')); ?></strong></td> 107 107 </tr> 108 108 <tr> 109 109 <th scope="row"><?php _e('Default time format:') ?></th> 110 <td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /><br />110 <td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br /> 111 111 <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td> 112 112 </tr> -
trunk/wp-admin/options-misc.php
r1429 r1599 22 22 } 23 23 24 $wpvarstoreset = array('action','standalone' , 'option_group_id');24 $wpvarstoreset = array('action','standalone'); 25 25 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 26 26 $wpvar = $wpvarstoreset[$i]; … … 45 45 46 46 <div class="wrap"> 47 48 <form name="form1" method="post" action="options.php">49 <input type="hidden" name="action" value="update" /> 50 <input type="hidden" name=" action" value="update" /> <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','default_geourl_lat','default_geourl_lon','use_default_geourl'" />51 <fieldset class="options">52 <legend>53 <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />54 <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend>55 56 57 58 59 <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php echo get_settings('fileupload_realpath'); ?>" size="50" /><br />60 <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?>61 62 63 64 65 66 67 <input name="fileupload_url" type="text" id="fileupload_url" value="<?php echo get_settings('fileupload_url'); ?>" size="50" /><br />68 <?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?>69 70 71 72 73 <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_settings('fileupload_maxk'); ?>" size="4" />74 75 76 77 78 <td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php echo get_settings('fileupload_allowedtypes'); ?>" size="40" />79 80 <?php _e('Recommended: <code>jpg jpeg png gif</code>') ?></td>81 82 83 84 85 <?php86 for ($i = 1; $i < 11; $i++) {87 if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'";88 else $selected = '';47 <h2><?php _e('Miscellaneous Options') ?></h2> 48 <form name="miscoptions" method="post" action="options.php"> 49 <input type="hidden" name="action" value="update" /> 50 <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate','weblogs_xml_url','links_updated_date_format','links_recently_updated_prepend','links_recently_updated_append','default_geourl_lat','default_geourl_lon','use_default_geourl'" /> 51 <fieldset class="options"> 52 <legend> 53 <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> /> 54 <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend> 55 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 56 <tr> 57 <th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th> 58 <td> 59 <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php form_option('fileupload_realpath'); ?>" size="50" /><br /> 60 <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?> 61 62 </td> 63 </tr> 64 <tr> 65 <th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th> 66 <td> 67 <input name="fileupload_url" type="text" id="fileupload_url" value="<?php form_option('fileupload_url'); ?>" size="50" /><br /> 68 <?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?> 69 </td> 70 </tr> 71 <tr> 72 <th scope="row"><?php _e('Maximum size:') ?> </th> 73 <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php form_option('fileupload_maxk'); ?>" size="4" /> 74 <?php _e('Kilobytes (KB)') ?></td> 75 </tr> 76 <tr> 77 <th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th> 78 <td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php form_option('fileupload_allowedtypes'); ?>" size="40" /> 79 <br /> 80 <?php _e('Recommended: <code>jpg jpeg png gif</code>') ?></td> 81 </tr> 82 <tr> 83 <th scope="row"><?php _e('Minimum level to upload:') ?></th> 84 <td><select name="fileupload_minlevel" id="fileupload_minlevel"> 85 <?php 86 for ($i = 1; $i < 11; $i++) { 87 if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'"; 88 else $selected = ''; 89 89 echo "\n\t<option value='$i' $selected>$i</option>"; 90 } 91 ?> 92 </select></td> 93 </tr> 94 </table> 95 </fieldset> 96 <fieldset class="options"> 97 <legend> 98 <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> /> 99 <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend> 100 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 101 <tr> 102 <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th> 103 <td> 104 <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php echo get_settings('default_geourl_lat'); ?>" size="50" /> 105 </td> 106 </tr> 107 <tr> 108 <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th> 109 <td> 110 <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php echo get_settings('default_geourl_lon'); ?>" size="50" /> 111 </td> 112 </tr> 113 <tr> 114 <th scope="row"> </th> 115 <td><label> 116 <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> /> 117 <?php _e('Use default location values if none specified.') ?></label></td> 118 </tr> 90 } 91 ?> 92 </select></td> 93 </tr> 94 </table> 95 </fieldset> 96 <fieldset class="options"> 97 <legend> 98 <input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_settings('use_linksupdate')); ?> /> 99 <label for="use_linksupdate"><?php _e('Track Link’s Update Times') ?></label></legend> 100 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 101 <tr> 102 <th width="33%" valign="top" scope="row"><?php _e('Update file:') ?> </th> 103 <td> 104 <input name="weblogs_xml_url" type="text" id="weblogs_xml_url" value="<?php form_option('weblogs_xml_url'); ?>" size="50" /><br /> 105 <?php __('Recommended: <code>http://static.wordpress.org/changes.xml</code>') ?> 106 107 </td> 108 </tr> 109 <tr> 110 <th valign="top" scope="row"><?php _e('Updated link time format:') ?> </th> 111 <td> 112 <input name="links_updated_date_format" type="text" id="links_updated_date_format" value="<?php form_option('links_updated_date_format'); ?>" size="50" /> 113 </td> 114 </tr> 115 <tr> 116 <th scope="row"><?php _e('Prepend updated with:') ?> </th> 117 <td><input name="links_recently_updated_prepend" type="text" id="links_recently_updated_prepend" value="<?php form_option('links_recently_updated_prepend'); ?>" size="50" /></td> 118 </tr> 119 <tr> 120 <th valign="top" scope="row"><?php _e('Append updated with:') ?></th> 121 <td><input name="links_recently_updated_append" type="text" id="links_recently_updated_append" value="<?php form_option('links_recently_updated_append'); ?>" size="50" /></td> 122 </tr> 123 </table> 124 <p><?php printf(__('A link is "recent" if it has been updated in the past %s minutes.'), '<input name="links_recently_updated_time" type="text" id="links_recently_updated_time" size="3" value="' . get_settings('links_recently_updated_time'). '" />' ) ?></p> 125 </fieldset> 126 <fieldset class="options"> 127 <legend> 128 <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> /> 129 <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend> 130 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 131 <tr> 132 <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th> 133 <td> 134 <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php form_option('default_geourl_lat'); ?>" size="50" /> 135 </td> 136 </tr> 137 <tr> 138 <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th> 139 <td> 140 <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php form_option('default_geourl_lon'); ?>" size="50" /> 141 </td> 142 </tr> 143 <tr> 144 <th scope="row"> </th> 145 <td><label> 146 <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> /> 147 <?php _e('Use default location values if none specified.') ?></label></td> 148 </tr> 149 </table> 150 </fieldset> 151 <p> 152 <label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> 153 </p> 154 <p class="submit"> 155 <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 156 </p> 157 </form> 158 </div> 119 159 120 </table> 121 </fieldset> 122 <p> 123 <label> 124 <input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> 125 <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> 126 </p> 127 <p class="submit"> 128 <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 129 </p> 130 </form> 131 </div> 132 <?php include("admin-footer.php") ?> 160 <?php include('./admin-footer.php'); ?> -
trunk/wp-admin/options-permalink.php
r1567 r1599 30 30 $home_path = ABSPATH; 31 31 } 32 33 require_once('./optionhandler.php');34 32 35 33 if (isset($_POST['submit'])) { -
trunk/wp-admin/options-reading.php
r1500 r1599 44 44 45 45 <div class="wrap"> 46 <h2><?php _e('Reading Options') ?></h2> 47 <form name="form1" method="post" action="options.php"> 48 <input type="hidden" name="action" value="update" /> 49 <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " /> 50 <fieldset class="options"> 51 <legend><?php _e('Front Page') ?></legend> 52 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 53 <tr valign="top"> 54 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 55 <td><input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo get_settings('posts_per_page'); ?>" size="3" /> 56 <select name="what_to_show" id="what_to_show" > 57 <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option> 58 <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option> 59 </select> </td> 60 </tr> 61 </table> 62 </fieldset> 46 <h2><?php _e('Reading Options') ?></h2> 47 <form name="form1" method="post" action="options.php"> 48 <input type="hidden" name="action" value="update" /> 49 <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " /> 50 <fieldset class="options"> 51 <legend><?php _e('Front Page') ?></legend> 52 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 53 <tr valign="top"> 54 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 55 <td> 56 <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> 57 <select name="what_to_show" id="what_to_show" > 58 <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option> 59 <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option> 60 </select> 61 </td> 62 </tr> 63 </table> 64 </fieldset> 63 65 64 <fieldset class="options"> 65 <legend><?php _e('Syndication Feeds') ?></legend> 66 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 67 <tr valign="top"> 68 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 69 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo get_settings('posts_per_rss'); ?>" size="3" /> 70 <?php _e('posts') ?></td> 71 </tr> 72 <tr valign="top"> 73 <th scope="row"><?php _e('For each article, show:') ?> </th> 74 <td><label> 75 <input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /> 76 <?php _e('full text') ?></label> <br /> 77 <label> 78 <input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> 79 <?php _e('summary') ?></label> </td> 80 </tr> 81 </table> 82 </fieldset> 83 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 84 <tr valign="top"> 85 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th> 86 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" /> 87 <br /> 88 <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td> 89 </tr> 90 </table> 91 <p> 92 <label> 93 <input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> /> 94 <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label> 95 </p> 96 <p class="submit"> 97 <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 98 </p> 99 </form> 66 <fieldset class="options"> 67 <legend><?php _e('Syndication Feeds') ?></legend> 68 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 69 <tr valign="top"> 70 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 71 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td> 72 </tr> 73 <tr valign="top"> 74 <th scope="row"><?php _e('For each article, show:') ?> </th> 75 <td> 76 <label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /><?php _e('full text') ?></label><br /> 77 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /><?php _e('summary') ?></label> 78 </td> 79 </tr> 80 </table> 81 </fieldset> 82 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 83 <tr valign="top"> 84 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th> 85 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br /> 86 <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td> 87 </tr> 88 </table> 89 <p> 90 <label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> /> 91 <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label> 92 </p> 93 <p class="submit"> 94 <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 95 </p> 96 </form> 100 97 </div> 101 <?php include( "admin-footer.php")?>98 <?php include('./admin-footer.php'); ?> -
trunk/wp-admin/options-writing.php
r1429 r1599 64 64 <tr valign="top"> 65 65 <th width="33%" scope="row"> <?php _e('Size of the writing box:') ?></th> 66 <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo get_settings('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />66 <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " /> 67 67 <?php _e('lines') ?></td> 68 68 </tr> … … 93 93 <p><?php printf(__('Enter the sites that you would like to notify when you publish a new post. For a list of some recommended sites to ping please see <a href="%s">Update Services</a> on the wiki. Separate multiple URIs by line breaks.'), 'http://wiki.wordpress.org/index.php/UpdateServices') ?></p> 94 94 95 <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php echo get_settings('ping_sites'); ?></textarea>95 <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php form_option('ping_sites'); ?></textarea> 96 96 </fieldset> 97 97 <fieldset class="options"> … … 102 102 <tr valign="top"> 103 103 <th scope="row"><?php _e('Mail server:') ?></th> 104 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php echo get_settings('mailserver_url'); ?>" size="40" />104 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" /> 105 105 <label for="port"><?php _e('Port:') ?></label> 106 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php echo get_settings('mailserver_port'); ?>" size="6" />106 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" /> 107 107 </td> 108 108 </tr> 109 109 <tr valign="top"> 110 110 <th width="33%" scope="row"><?php _e('Login name:') ?></th> 111 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php echo get_settings('mailserver_login'); ?>" size="40" /></td>111 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td> 112 112 </tr> 113 113 <tr valign="top"> 114 114 <th scope="row"><?php _e('Password:') ?></th> 115 115 <td> 116 <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php echo get_settings('mailserver_pass'); ?>" size="40" />116 <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" /> 117 117 </td> 118 118 </tr> -
trunk/wp-admin/options.php
r1597 r1599 23 23 } 24 24 25 $wpvarstoreset = array('action','standalone' , 'option_group_id');25 $wpvarstoreset = array('action','standalone'); 26 26 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 27 27 $wpvar = $wpvarstoreset[$i]; … … 38 38 } 39 39 } 40 if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id'];41 require_once('./optionhandler.php');42 $non_was_selected = 0;43 if (!isset($_GET['option_group_id'])) {44 $option_group_id = 1;45 $non_was_selected = 1;46 }47 40 48 41 switch($action) { … … 53 46 $any_changed = 0; 54 47 55 // iterate through the list of options in this group56 // pull the vars from the post57 // validate ranges etc.58 // update the values59 48 if (!$_POST['page_options']) { 60 49 foreach ($_POST as $key => $value) { … … 67 56 68 57 $options = $wpdb->get_results("SELECT $wpdb->options.option_id, option_name, option_type, option_value, option_admin_level FROM $wpdb->options WHERE option_name IN ($option_names)"); 69 // die(var_dump($options));70 58 71 59 // HACK … … 85 73 } 86 74 if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_val = 'closed'; 87 if ($new_val !== $old_val) { 88 $query = "UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"; 89 $result = $wpdb->query($query); 90 //if( in_array($option->option_name, $nonbools)) die('boo'.$query); 91 if (!$result) { 92 $dB_errors .= sprintf(__(" SQL error while saving %s. "), $this_name); 93 } else { 94 ++$any_changed; 95 } 75 if ($new_val !== $old_val) 76 $result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"); 96 77 } 97 78 } 98 } // end foreach99 79 unset($cache_settings); // so they will be re-read 100 80 get_settings('siteurl'); // make it happen now … … 105 85 } 106 86 107 if ( isset($dB_errors) || isset($validation_message) ) { 108 if ($message != '') { 109 $message .= '<br />'; 110 } 111 $message .= $dB_errors . '<br />' . $validation_message; 112 } 113 114 $referred = str_replace(array('&updated=true', '?updated=true') , '', $_SERVER['HTTP_REFERER']); 115 if (strstr($referred, '?')) $goback = $referred . '&updated=true'; 116 else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; 87 $referred = str_replace('?updated=true' , '', $_SERVER['HTTP_REFERER']); 88 $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; 117 89 header('Location: ' . $goback); 118 90 break; … … 120 92 default: 121 93 $standalone = 0; 122 include_once( "./admin-header.php");94 include_once('./admin-header.php'); 123 95 if ($user_level <= 6) { 124 96 die(__("You have do not have sufficient permissions to edit the options for this blog.")); … … 129 101 130 102 <div class="wrap"> 131 <h2> <?php echo $current_desc; ?></h2>132 <form name="form" action=" <?php echo $this_file; ?>" method="post">103 <h2>All options</h2> 104 <form name="form" action="options.php" method="post"> 133 105 <input type="hidden" name="action" value="update" /> 134 <input type="hidden" name="option_group_id" value="<?php echo $option_group_id; ?>" /> 135 <table width="90%" cellpadding="2" cellspacing="2" border="0"> 106 <table width="98%"> 136 107 <?php 137 //Now display all the options for the selected group.138 if ('all' == $_GET['option_group_id']) :139 108 $options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); 140 endif;141 109 142 110 foreach ($options as $option) : 143 if ('all' == $_GET['option_group_id']) $option->option_type = 3; 144 echo "\t<tr><td width='10%' valign='top'>" . get_option_widget($option, ($user_level >= $option->option_admin_level), '</td><td width="15%" valign="top" style="border: 1px solid #ccc">'); 145 echo "\t</td><td valign='top' class='helptext'>$option->option_description</td></tr>\n"; 111 $value = htmlspecialchars($option->option_value); 112 echo " 113 <tr> 114 <th scope='row'><label for='$option->option_name'>$option->option_name</label></th> 115 <td><input type='text' name='$option->option_name' id='$option->option_name' size='30' value='$value' /></td> 116 <td>$option->option_description</td> 117 </tr>"; 146 118 endforeach; 147 119 ?> … … 151 123 </div> 152 124 153 <div class="wrap"> 125 154 126 <?php 155 if ($current_long_desc != '') {156 echo $current_long_desc;157 }158 ?>159 </div>160 <?php161 } // end else a group was selected162 127 break; 163 128 } // end switch -
trunk/wp-admin/post.php
r1572 r1599 733 733 $ping_status = get_settings('default_ping_status'); 734 734 $post_pingback = get_settings('default_pingback_flag'); 735 $default_post_cat = get_settings('default_post_category');736 735 737 736 include('edit-page-form.php'); … … 783 782 $ping_status = get_settings('default_ping_status'); 784 783 $post_pingback = get_settings('default_pingback_flag'); 785 $default_post_cat = get_settings('default_post_category');786 784 787 785 if (get_settings('advanced_edit')) { … … 797 795 798 796 <?php 799 $bookmarklet_height= (get_settings('use_trackback')) ? 460 :420;797 $bookmarklet_height= 420; 800 798 801 799 if ($is_NS4 || $is_gecko) { -
trunk/wp-admin/profile.php
r1551 r1599 108 108 case 'IErightclick': 109 109 110 111 $bookmarklet_tbpb = (get_settings('use_trackback')) ? '&trackback=1' : ''; 112 $bookmarklet_tbpb .= (get_settings('use_pingback')) ? '&pingback=1' : ''; 113 $bookmarklet_height= (get_settings('use_trackback')) ? 590 : 550; 110 $bookmarklet_height= 550; 114 111 115 112 ?> … … 147 144 $profiledata=get_userdata($user_ID); 148 145 149 $bookmarklet_tbpb = (get_settings('use_trackback')) ? '&trackback=1' : ''; 150 $bookmarklet_tbpb .= (get_settings('use_pingback')) ? '&pingback=1' : ''; 151 $bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440; 146 $bookmarklet_height= 440; 152 147 153 148 if (isset($updated)) { ?> -
trunk/wp-admin/upgrade-functions.php
r1598 r1599 153 153 154 154 function upgrade_all() { 155 populate_options(); 155 156 upgrade_071(); 156 157 upgrade_072(); … … 159 160 upgrade_110(); 160 161 upgrade_130(); 161 162 // Options that should not exist 163 $obs_options = array(''); 164 } 165 166 167 // .71 stuff 162 } 163 164 function populate_options() { 165 166 $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 167 add_option('siteurl', $guessurl, 'WordPress web address'); 168 add_option('blogfilename', '', 'Default file for blog'); 169 add_option('blogname', 'My Weblog', 'Blog title'); 170 add_option('blogdescription', '', 'Short tagline'); 171 add_option('new_users_can_blog', 0); 172 add_option('users_can_register', 1); 173 add_option('admin_email', 'you@example.com'); 174 add_option('start_of_week', 1); 175 add_option('use_balanceTags', 1); 176 add_option('use_smilies', 1); 177 add_option('require_name_email', 1); 178 add_option('comments_notify', 1); 179 add_option('posts_per_rss', 10); 180 add_option('rss_excerpt_length', 50); 181 add_option('rss_use_excerpt', 0); 182 add_option('use_fileupload', 0); 183 add_option('fileupload_realpath', ABSPATH . 'wp-content'); 184 add_option('fileupload_url', get_option('siteurl') . '/wp-content'); 185 add_option('fileupload_allowedtypes', 'jpg jpeg gif png'); 186 add_option('fileupload_maxk', 300); 187 add_option('fileupload_minlevel', 6); 188 add_option('mailserver_url', 'mail.example.com'); 189 add_option('mailserver_login', 'login@example.com'); 190 add_option('mailserver_pass', 'password'); 191 add_option('mailserver_port', 110); 192 add_option('default_category', 1); 193 add_option('default_comment_status', 'open'); 194 add_option('default_ping_status', 'open'); 195 add_option('default_pingback_flag', 1); 196 add_option('default_post_edit_rows', 9); 197 add_option('posts_per_page', 10); 198 add_option('what_to_show', 'posts'); 199 add_option('date_format', 'F j, Y'); 200 add_option('time_format', 'g:i a'); 201 add_option('use_geo_positions', 0); 202 add_option('use_default_geourl', 0); 203 add_option('default_geourl_lat', 0); 204 add_option('default_geourl_lon', 0); 205 add_option('weblogs_xml_url', 'http://static.wordpress.org/changes.xml'); 206 add_option('links_updated_date_format', 'F j, Y g:i a'); 207 add_option('links_recently_updated_prepend', '<em>'); 208 add_option('links_recently_updated_append', '</em>'); 209 add_option('links_recently_updated_time', 120); 210 add_option('comment_moderation', 0); 211 add_option('moderation_notify', 1); 212 add_option('permalink_structure'); 213 add_option('gzipcompression', 0); 214 add_option('hack_file', 0); 215 add_option('blog_charset', 'utf-8'); 216 add_option('moderation_keys'); 217 add_option('active_plugins'); 218 add_option('home'); 219 add_option('category_base'); 220 add_option('ping_sites', 'http://rpc.pingomatic.com/'); 221 add_option('advanced_edit', 0); 222 add_option('comment_max_links', 2); 223 224 // Delete unused options 225 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls'); 226 foreach ($unusedoptions as $option) : 227 delete_option($option); 228 endforeach; 229 } 168 230 169 231 function upgrade_071() { … … 205 267 ) 206 268 "); 207 208 // Guess a site URI209 $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUEST_URI);210 $option_data = array( //base options from b2cofig211 "1" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (1,'siteurl', 3, '$guessurl', 'siteurl is your blog\'s URL: for example, \'http://example.com/wordpress\'', 8, 30)",212 "2" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (2,'blogfilename', 3, 'index.php', 'blogfilename is the name of the default file for your blog', 8, 20)",213 "3" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (3,'blogname', 3, 'my weblog', 'blogname is the name of your blog', 8, 20)",214 "4" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (4,'blogdescription', 3, 'babblings!', 'blogdescription is the description of your blog', 8, 40)",215 //"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (6,'search_engine_friendly_urls', 2, '0', 'Querystring Configuration ** (don\'t change if you don\'t know what you\'re doing)', 8, 20)",216 "7" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (7,'new_users_can_blog', 2, '0', 'whether you want new users to be able to post entries once they have registered', 8, 20)",217 "8" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (8,'users_can_register', 2, '1', 'whether you want to allow users to register on your blog', 8, 20)",218 "54" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (54,'admin_email', 3, 'you@example.com', 'Your email (obvious eh?)', 8, 20)",219 // general blog setup220 "9" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (9 ,'start_of_week', 5, '1', 'day at the start of the week', 8, 20)",221 //"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (10,'use_preview', 2, '1', 'Do you want to use the \'preview\' function', 8, 20)",222 "14" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (14,'use_htmltrans', 2, '1', 'IMPORTANT! set this to false if you are using Chinese, Japanese, Korean, or other double-bytes languages', 8, 20)",223 "15" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (15,'use_balanceTags', 2, '1', 'this could help balance your HTML code. if it gives bad results, set it to false', 8, 20)",224 "16" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (16,'use_smilies', 2, '1', 'set this to true to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)",225 "17" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (17,'smilies_directory', 3, 'http://example.com/wp-images/smilies', 'the directory where your smilies are (no trailing slash)', 8, 40)",226 "18" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (18,'require_name_email', 2, '0', 'set this to true to require e-mail and name, or false to allow comments without e-mail/name', 8, 20)",227 "20" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (20,'comments_notify', 2, '1', 'set this to true to let every author be notified about comments on their posts', 8, 20)",228 //rss/rdf feeds229 "21" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (21,'posts_per_rss', 1, '10', 'number of last posts to syndicate', 8, 20)",230 "22" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (22,'rss_language', 3, 'en', 'the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 )', 8, 20)",231 "23" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (23,'rss_encoded_html', 2, '0', 'for b2rss.php: allow encoded HTML in <description> tag?', 8, 20)",232 "24" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (24,'rss_excerpt_length', 1, '50', 'length (in words) of excerpts in the RSS feed? 0=unlimited note: in b2rss.php, this will be set to 0 if you use encoded HTML', 8, 20)",233 "25" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",234 "29" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (29,'use_trackback', 2, '1', 'set this to false or true, whether you want to allow your posts to be trackback\'able or not note: setting it to false would also disable sending trackbacks', 8, 20)",235 "30" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (30,'use_pingback', 2, '1', 'set this to false or true, whether you want to allow your posts to be pingback\'able or not note: setting it to false would also disable sending pingbacks', 8, 20)",236 //file upload237 "31" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (31,'use_fileupload', 2, '0', 'set this to false to disable file upload, or true to enable it', 8, 20)",238 "32" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)",239 "33" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (33,'fileupload_url', 3, 'http://example.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)",240 "34" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, separated by spaces. example: \'jpg gif png\'', 8, 20)",241 "35" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)",242 "36" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)",243 "37" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'', 8, 30)",244 // email settings245 "38" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)",246 "39" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (39,'mailserver_login', 3, 'login@example.com', 'mailserver settings', 8, 20)",247 "40" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (40,'mailserver_pass', 3, 'password', 'mailserver settings', 8, 20)",248 "41" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (41,'mailserver_port', 1, '110', 'mailserver settings', 8, 20)",249 "42" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",250 "46" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",251 252 // default post stuff253 254 "55" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(55,'default_post_status', 5, 'publish', 'The default state of each new post', 8, 20)",255 "56" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(56,'default_comment_status', 5, 'open', 'The default state of comments for each new post', 8, 20)",256 "57" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(57,'default_ping_status', 5, 'open', 'The default ping state for each new post', 8, 20)",257 "58" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(58,'default_pingback_flag', 5, '1', 'Whether the \'PingBack the URLs in this post\' checkbox should be checked by default', 8, 20)",258 "59" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(59,'default_post_category', 7, '1', 'The default category for each new post', 8, 20)",259 "83" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(83,'default_post_edit_rows', 1, '9', 'The number of rows in the edit post form (min 3, max 100)', 8, 5)",260 261 // original options from options page262 "48" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (48,'posts_per_page', 1, '20','How many posts/days to show on the index page.', 4, 20)",263 "49" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (49,'what_to_show', 5, 'posts','Posts or days', 4, 20)",264 "50" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (50,'archive_mode', 5, 'monthly','Which \'unit\' to use for archives.', 4, 20)",265 "51" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (51,'time_difference', 6, '0', 'if you\'re not on the timezone of your server', 4, 20)",266 "52" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (52,'date_format', 3, 'n/j/Y', 'see note for format characters', 4, 20)",267 "53" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (53,'time_format', 3, 'g:i a', 'see note for format characters', 4, 20)", "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (84,'use_geo_positions', 2, '0', 'Turns on the geo url features of WordPress', 8, 20)",268 "85" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (85,'use_default_geourl', 2, '1','enables placement of default GeoURL ICBM location even when no other specified', 8, 20)",269 "86" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (86,'default_geourl_lat ', 8, 0.0, 'The default Latitude ICBM value - <a href=\"http://www.geourl.org/resources.html\" target=\"_blank\">see here</a>', 8, 20)",270 "87" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (87,'default_geourl_lon', 8, 0.0, 'The default Longitude ICBM value', 8, 20)",271 "60" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (60,'links_minadminlevel', 1, '5', 'The minimum admin level to edit links', 8, 10)",272 "61" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (61,'links_use_adminlevels', 2, '1', 'set this to false to have all links visible and editable to everyone in the link manager', 8, 20)",273 "62" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (62,'links_rating_type', 5, 'image', 'Set this to the type of rating indication you wish to use', 8, 10)",274 "63" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (63,'links_rating_char', 3, '*', 'If we are set to \'char\' which char to use.', 8, 5)",275 "64" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (64,'links_rating_ignore_zero', 2, '1', 'What do we do with a value of zero? set this to true to output nothing, 0 to output as normal (number/image)', 8, 20)",276 "65" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (65,'links_rating_single_image', 2, '1', 'Use the same image for each rating point? (Uses links_rating_image[0])', 8, 20)",277 "66" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (66,'links_rating_image0', 3, 'wp-links/links-images/tick.png', 'Image for rating 0 (and for single image)', 8, 40)",278 "67" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (67,'links_rating_image1', 3, 'wp-links/links-images/rating-1.gif', 'Image for rating 1', 8, 40)",279 "68" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (68,'links_rating_image2', 3, 'wp-links/links-images/rating-2.gif', 'Image for rating 2', 8, 40)",280 "69" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (69,'links_rating_image3', 3, 'wp-links/links-images/rating-3.gif', 'Image for rating 3', 8, 40)",281 "70" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (70,'links_rating_image4', 3, 'wp-links/links-images/rating-4.gif', 'Image for rating 4', 8, 40)",282 "71" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (71,'links_rating_image5', 3, 'wp-links/links-images/rating-5.gif', 'Image for rating 5', 8, 40)",283 "72" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (72,'links_rating_image6', 3, 'wp-links/links-images/rating-6.gif', 'Image for rating 6', 8, 40)",284 "73" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (73,'links_rating_image7', 3, 'wp-links/links-images/rating-7.gif', 'Image for rating 7', 8, 40)",285 "74" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (74,'links_rating_image8', 3, 'wp-links/links-images/rating-8.gif', 'Image for rating 8', 8, 40)",286 "75" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (75,'links_rating_image9', 3, 'wp-links/links-images/rating-9.gif', 'Image for rating 9', 8, 40)",287 "77" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (77,'weblogs_xml_url', 3, 'http://www.weblogs.com/changes.xml', 'Which file to grab from weblogs.com', 8, 40)",288 "78" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (78,'weblogs_cacheminutes', 1, '60', 'cache time in minutes (if it is older than this get a new copy)', 8, 10)",289 "79" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (79,'links_updated_date_format', 3, 'd/m/Y h:i', 'The date format for the updated tooltip', 8, 25)",290 "80" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (80,'links_recently_updated_prepend', 3, '>>', 'The text to prepend to a recently updated link', 8, 10)",291 "81" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (81,'links_recently_updated_append', 3, '<<', 'The text to append to a recently updated link', 8, 20)",292 "82" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (82,'links_recently_updated_time', 1, '120', 'The time in minutes to consider a link recently updated', 8, 20)"293 );294 295 foreach ($option_data as $option_id => $query) {296 if(!$wpdb->get_var("SELECT * FROM $wpdb->options WHERE option_id = '$option_id'")) {297 $wpdb->query($query);298 }299 }300 301 if (file_exists('../wp-links/links.config.php')) {302 include('../wp-links/links.config.php');303 304 // now update the database with those settings305 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_minadminlevel )."' WHERE option_id=60"; $q = $wpdb->query($query);306 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_use_adminlevels )."' WHERE option_id=61"; $q = $wpdb->query($query);307 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_type )."' WHERE option_id=62"; $q = $wpdb->query($query);308 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_char )."' WHERE option_id=63"; $q = $wpdb->query($query);309 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_ignore_zero )."' WHERE option_id=64"; $q = $wpdb->query($query);310 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_single_image )."' WHERE option_id=65"; $q = $wpdb->query($query);311 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image0 )."' WHERE option_id=66"; $q = $wpdb->query($query);312 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image1 )."' WHERE option_id=67"; $q = $wpdb->query($query);313 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image2 )."' WHERE option_id=68"; $q = $wpdb->query($query);314 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image3 )."' WHERE option_id=69"; $q = $wpdb->query($query);315 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image4 )."' WHERE option_id=70"; $q = $wpdb->query($query);316 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image5 )."' WHERE option_id=71"; $q = $wpdb->query($query);317 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image6 )."' WHERE option_id=72"; $q = $wpdb->query($query);318 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image7 )."' WHERE option_id=73"; $q = $wpdb->query($query);319 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image8 )."' WHERE option_id=74"; $q = $wpdb->query($query);320 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image9 )."' WHERE option_id=75"; $q = $wpdb->query($query);321 $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_cache_file )."' WHERE option_id=76"; $q = $wpdb->query($query);322 $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_xml_url )."' WHERE option_id=77"; $q = $wpdb->query($query);323 $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_cacheminutes )."' WHERE option_id=78"; $q = $wpdb->query($query);324 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_updated_date_format )."' WHERE option_id=79"; $q = $wpdb->query($query);325 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_prepend)."' WHERE option_id=80"; $q = $wpdb->query($query);326 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_append )."' WHERE option_id=81"; $q = $wpdb->query($query);327 $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_time )."' WHERE option_id=82"; $q = $wpdb->query($query);328 // end if links.config.php exists329 }330 331 269 } 332 270 … … 350 288 add_clean_index($wpdb->comments, 'comment_approved'); 351 289 352 353 // Options stuff354 if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_moderation'")) {355 $wpdb->query("INSERT INTO $wpdb->options356 (option_id, blog_id, option_name, option_can_override, option_type, option_value, option_width, option_height, option_description, option_admin_level)357 VALUES358 ('0', '0', 'comment_moderation', 'Y', '5',' none', 20, 8, 'If enabled, comments will only be shown after they have been approved.', 8)");359 }360 361 if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'moderation_notify'")) {362 $wpdb->query("INSERT INTO $wpdb->options363 (option_id, blog_id, option_name, option_can_override, option_type, option_value, option_width, option_height, option_description, option_admin_level)364 VALUES365 ('0', '0', 'moderation_notify' , 'Y', '2', '1', 20, 8, 'Set this to true if you want to be notified about new comments that wait for approval', 8)");366 }367 368 290 // Get the title and ID of every post, post_name to check if it already has a value 369 291 $posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''"); … … 384 306 } 385 307 } 386 387 if (!$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = 'permalink_structure'")) { // If it's not already there 388 $wpdb->query("INSERT INTO `$wpdb->options` 389 (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`) 390 VALUES 391 ('', '0', 'permalink_structure', 'Y', '3', '', '20', '8', 'How the permalinks for your site are constructed. See <a href=\"options-permalink.php\">permalink options page</a> for necessary mod_rewrite rules and more information.', '8');"); 392 } 393 394 if (!$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = 'gzipcompression'")) { // If it's not already there 395 $wpdb->query("INSERT INTO `$wpdb->options` 396 (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`) 397 VALUES 398 ('', '0', 'gzipcompression', 'Y', '2', '0', '20', '8', 'Whether your output should be gzipped or not. Enable this if you don’t already have mod_gzip running.', '8');"); 399 } 400 if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'hack_file'")) { 401 $wpdb->query("INSERT INTO `$wpdb->options` 402 ( `option_id` , `blog_id` , `option_name` , `option_can_override` , `option_type` , `option_value` , `option_width` , `option_height` , `option_description` , `option_admin_level` ) 403 VALUES 404 ('', '0', 'hack_file', 'Y', '2', '0', '20', '8', 'Set this to true if you plan to use a hacks file. This is a place for you to store code hacks that won’t be overwritten when you upgrade. The file must be in your wordpress root and called <code>my-hacks.php</code>', '8')"); 405 } 406 407 // fix upload users description 408 $wpdb->query("UPDATE $wpdb->options SET option_description = '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'' WHERE option_id = 37"); 409 // and file types 410 $wpdb->query("UPDATE $wpdb->options SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34"); 411 // add link to php date format. this could be to a wordpress.org page in the future 412 $wpdb->query("UPDATE $wpdb->options SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52"); 413 $wpdb->query("UPDATE $wpdb->options SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53"); 308 309 414 310 $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') 415 311 WHERE option_name LIKE 'links_rating_image%' 416 312 AND option_value LIKE 'wp-links/links-images/%'"); 417 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'comment_allowed_tags'"); 418 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'use_preview'"); 419 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'search_engine_friendly_urls'"); 313 420 314 // Multiple categories 421 315 maybe_create_table($wpdb->post2cat, " … … 496 390 497 391 // Convert passwords to MD5 and update table appropiately 498 499 392 $user_table = $wpdb->get_row("DESCRIBE $wpdb->users user_pass"); 500 393 if ($user_table->Type != 'varchar(32)') { … … 509 402 } 510 403 511 // Add blog_charset option512 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'blog_charset'")) {513 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)");514 }515 404 516 405 // Get the GMT offset, we'll use that later on … … 529 418 530 419 // Add a gmt_offset option, with value $gmt_offset 531 if (!get_settings('gmt_offset')) { 532 if(!$wpdb->get_var("SELECT * FROM $wpdb->options WHERE option_name = 'gmt_offset'")) { 533 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES ('gmt_offset', 8, $gmt_offset, 'The difference in hours between GMT and your timezone', 8)"); 534 } 535 536 } 420 add_option('gmt_offset', $gmt_offset); 537 421 538 422 // Check if we already set the GMT fields (if we did, then … … 568 452 // First we need to enlarge option_value so it can hold larger values: 569 453 $wpdb->query("ALTER TABLE `$wpdb->options` CHANGE `option_value` `option_value` TEXT NOT NULL"); 570 571 // Now an option for blog pinging 572 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'ping_sites'")) { 573 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('ping_sites', 3, 'http://rpc.pingomatic.com/', 8)"); 574 } 575 576 // Option for using the advanced edit screen by default 577 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'advanced_edit'")) { 578 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('advanced_edit', 5, '0', 8)"); 579 } 454 580 455 // Fix for CVS versions 581 456 $wpdb->query("UPDATE $wpdb->options SET option_type = '5' WHERE option_name = 'advanced_edit'"); 582 583 // Now an option for moderation words584 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'moderation_keys'")) {585 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('moderation_keys', 3, '', 8)");586 }587 588 // Option for plugins589 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'active_plugins'")) {590 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('active_plugins', 3, '', 8)");591 }592 593 // Option for max # of links per comment594 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_max_links'")) {595 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('comment_max_links', 3, '5', 8)");596 }597 598 // Option for different blog URL599 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'home'")) {600 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('home', 3, '', 8)");601 }602 603 // Option for category base604 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'category_base'")) {605 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, '', 8)");606 }607 608 // Delete unused options609 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file');610 foreach ($unusedoptions as $option) :611 delete_option($option);612 endforeach;613 457 614 458 // Forward-thinking … … 623 467 global $wpdb, $table_prefix; 624 468 625 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'default_email_category'")) { 626 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES('default_email_category', 1, '1', 'by default posts by email will have this category', 8)"); 627 } 628 629 if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'recently_edited'")) { 630 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('recently_edited', 3, '', 8)"); 631 } 469 add_option('default_email_category', 1, 'Posts by email go to this category'); 470 add_option('recently_edited'); 471 add_option('use_linksupdate', 0); 632 472 633 473 maybe_add_column($wpdb->options, 'autoload', "ALTER TABLE `$wpdb->options` ADD `autoload` ENUM( 'yes', 'no' ) NOT NULL ;"); -
trunk/wp-atom.php
r1575 r1599 14 14 <feed version="0.3" 15 15 xmlns="http://purl.org/atom/ns#" 16 xmlns:dc="http://purl.org/dc/elements/1.1/" 17 xml:lang="<?php echo get_settings('rss_language'); ?>"> 16 xmlns:dc="http://purl.org/dc/elements/1.1/"> 18 17 <title><?php bloginfo_rss('name') ?></title> 19 18 <link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" /> -
trunk/wp-blog-header.php
r1570 r1599 151 151 } 152 152 153 $archive_mode = get_settings('archive_mode');154 153 $use_gzipcompression = get_settings('gzipcompression'); 155 154 -
trunk/wp-commentsrss2.php
r1575 r1599 21 21 <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link> 22 22 <description><?php bloginfo_rss("description") ?></description> 23 <language><?php echo get_settings('rss_language'); ?></language>24 23 <pubDate><?php echo gmdate('r'); ?></pubDate> 25 24 <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> -
trunk/wp-includes/functions-post.php
r1589 r1599 218 218 219 219 // get permalink from post ID 220 function post_permalink($post_ID=0, $mode = 'id') { 221 global $wpdb; 222 global $querystring_start, $querystring_equal, $querystring_separator; 223 224 $blog_URL = get_settings('home') .'/'. get_settings('blogfilename'); 225 226 $postdata = get_postdata($post_ID); 227 228 // this will probably change to $blog_ID = $postdata['Blog_ID'] one day. 229 $blog_ID = 1; 230 231 if (!($postdata===false)) { 232 233 switch(strtolower($mode)) { 234 case 'title': 235 $title = preg_replace('/[^a-zA-Z0-9_\.-]/', '_', $postdata['Title']); 236 break; 237 case 'id': 238 default: 239 $title = "post-$post_ID"; 240 break; 241 } 242 243 // this code is blatantly derived from permalink_link() 244 $archive_mode = get_settings('archive_mode'); 245 switch($archive_mode) { 246 case 'daily': 247 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).substr($postdata['Date'],8,2).'#'.$title; 248 break; 249 case 'monthly': 250 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).'#'.$title; 251 break; 252 case 'weekly': 253 if((!isset($cacheweekly)) || (empty($cacheweekly[$postdata['Date']]))) { 254 $sql = "SELECT WEEK('".$postdata['Date']."') as wk"; 255 $row = $wpdb->get_row($sql); 256 $cacheweekly[$postdata['Date']] = $row->wk; 257 } 258 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).$querystring_separator.'w'.$querystring_equal.$cacheweekly[$postdata['Date']].'#'.$title; 259 break; 260 case 'postbypost': 261 $post_URL = $blog_URL.$querystring_start.'p'.$querystring_equal.$post_ID; 262 break; 263 } 264 } 265 266 return $post_URL; 220 function post_permalink($post_id = 0, $mode = '') { // $mode legacy 221 return get_permalink($post_id); 267 222 } 268 223 -
trunk/wp-includes/functions.php
r1597 r1599 314 314 } 315 315 316 function get_option($option) { 317 return get_settings($option); 318 } 319 320 function form_option($option) { 321 echo htmlspecialchars( get_option($option) ); 322 } 323 316 324 function get_alloptions() { 317 325 global $wpdb; … … 352 360 353 361 // thx Alex Stapleton, http://alex.vort-x.net/blog/ 354 function add_option($name, $value = '') { 355 // Adds an option if it doesn't already exist 362 function add_option($name, $value = '', $description = '') { 356 363 global $wpdb; 357 364 if ( is_array($value) || is_object($value) ) … … 361 368 $name = $wpdb->escape($name); 362 369 $value = $wpdb->escape($value); 363 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value) VALUES ('$name', '$value')"); 370 $description = $wpdb->escape($description); 371 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description) VALUES ('$name', '$value', '$description')"); 364 372 365 373 if($wpdb->insert_id) { -
trunk/wp-includes/links-update-xml.php
r1355 r1599 59 59 // is it old? 60 60 $modtime = filemtime($file); 61 if ((time() - $modtime) > ( get_settings('weblogs_cacheminutes')* 60)) {61 if ((time() - $modtime) > (1.5 * 60)) { 62 62 $update = true; 63 63 } -
trunk/wp-includes/template-functions-general.php
r1508 r1599 223 223 224 224 if ('' == $type) { 225 $type = get_settings('archive_mode');225 $type = 'monthly'; 226 226 } 227 227 -
trunk/wp-locations.php
r1575 r1599 18 18 if (get_settings('rss_use_excerpt')) { 19 19 ?> 20 <note><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length') , get_settings('rss_encoded_html')) ?>20 <note><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length')) ?> 21 21 </note> 22 22 <?php 23 23 } else { // use content 24 24 ?> 25 <note><?php the_excerpt_rss('', 0, '', get_settings('rss_excerpt_length') , get_settings('rss_encoded_html')) ?></note>25 <note><?php the_excerpt_rss('', 0, '', get_settings('rss_excerpt_length')) ?></note> 26 26 <?php 27 27 } // end else use content -
trunk/wp-mail.php
r1487 r1599 8 8 $time_difference = get_settings('gmt_offset') * 3600; 9 9 10 $phone_delim = get_settings('use_phoneemail'); 11 if (empty($phone_delim)) $phone_delim = '::'; 10 $phone_delim = '::'; 12 11 13 12 $pop3 = new POP3(); -
trunk/wp-rdf.php
r1575 r1599 26 26 <link><?php bloginfo_rss('url') ?></link> 27 27 <description><?php bloginfo_rss('description') ?></description> 28 <dc:language><?php echo get_settings('rss_language'); ?></dc:language>29 28 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></dc:date> 30 29 <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/> -
trunk/wp-rss.php
r1575 r1599 31 31 } else { // use content 32 32 ?> 33 <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length') , get_settings('rss_encoded_html')) ?></description>33 <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length')) ?></description> 34 34 <?php 35 35 } // end else use content -
trunk/wp-trackback.php
r1575 r1599 28 28 29 29 @header('Content-Type: text/xml; charset=' . get_settings('blog_charset')); 30 31 if (!get_settings('use_trackback'))32 trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');33 30 34 31 $pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $tb_id");
Note: See TracChangeset
for help on using the changeset viewer.