//this is weird, but it would appear there might be a bug with switch theme in that it doesn't switch the current_theme. But if we kill it then the code runs to reset it.
update_option('current_theme','');
}
unset($options['theme']);
// End Bonus Options - now process all the "normal" options.
foreach($optionsas$key=>$value){
// update all the options (we know they should all be set because this runs after populate_options()
update_option($key,$value);
}
// run through the permalink options here and set the blog to use them
// don't restrict this to site admins, because it throws an error if non site admins go to the URL. Instead, control it wtih the site admin test at the next level
if(function_exists('is_network_admin')){
//3.1+
add_submenu_page('settings.php','New Blog Defaults','New Blog Defaults','manage_sites','cets_blog_defaults_management_page',array(&$this,'cets_blog_defaults_management_page'));
}else{
//-3.1
add_submenu_page('ms-admin.php','New Blog Defaults','New Blog Defaults','manage_sites','cets_blog_defaults_management_page',array(&$this,'cets_blog_defaults_management_page'));
}
}
functioncets_blog_defaults_management_page(){
// Display the defaults that can be set by site admins
global$wpdb;
// only allow site admins to come here.
if(is_super_admin()==false){
wp_die(__('You do not have permission to access this page.'));
}
/* translators: date and time format for exact current time, mainly about timezones, see http://php.net/date */
$timezone_format=_x('Y-m-d G:i:s','timezone date format');
<inputtype="checkbox"name="blogname_flag"value="1"<?phpchecked('1',$opt[blogname_flag])?>/><?php_e("I understand this will overwrite the user's chosen blog name from the setup page.")?></td>
<spanid="utc-time"><?phpprintf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'),date_i18n($timezone_format,false,'gmt'));?></span>
<?phpif($opt['timezone_string']):?>
<spanid="local-time"><?phpprintf(__('Local time is <code>%1$s</code>'),date_i18n($timezone_format));?></span>
<?phpendif;?>
<br/>
<spanclass="description"><?php_e('Choose a city in the same timezone as you.');?></span>
<br/>
<span>
<?phpif($check_zone_info&&$tzstring):?>
<?php
$now=localtime(time(),true);
if($now['tm_isdst'])_e('This timezone is currently in daylight savings time.');
else_e('This timezone is currently in standard time.');
echo"\t<p>".__('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click “Save Changes” to update sample output.')."</p>\n";
<?php_e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display')?></label><br/>
<labelfor="use_balanceTags"><inputname="use_balanceTags"type="checkbox"id="use_balanceTags"value="1"<?phpchecked('1',$opt['use_balanceTags']);?>/><?php_e('WordPress should correct invalidly nested XHTML automatically')?></label>
</td>
</tr>
</table>
<h3><?php_e('Remote Publishing')?></h3>
<p><?phpprintf(__('To post to WordPress from a desktop blogging client or remote website that uses the Atom Publishing Protocol or one of the XML-RPC publishing interfaces you must enable them below.'))?></p>
<?php_e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)')?></td>
<inputname="default_pingback_flag"type="checkbox"id="default_pingback_flag"value="1"<?phpif($opt['default_pingback_flag']==1)echo('checked="checked"');?>/><?php_e('Attempt to notify any blogs linked to from the article (slows down posting.)')?></label>
<br/>
<labelfor="default_ping_status">
<inputname="default_ping_status"type="checkbox"id="default_ping_status"value="open"<?phpif($opt['default_ping_status']=='open')echo('checked="checked"');?>/><?php_e('Allow link notifications from other blogs (pingbacks and trackbacks.)')?></label>
<br/>
<labelfor="default_comment_status">
<inputname="default_comment_status"type="checkbox"id="default_comment_status"value="open"<?phpif($opt['default_comment_status']=='open')echo('checked="checked"');?>/><?php_e('Allow people to post comments on the article')?></label>
<br/>
<small><em><?phpecho'('.__('These settings may be overridden for individual articles.').')';?></em></small>
<inputtype="checkbox"name="require_name_email"id="require_name_email"value="1"<?phpif($opt['require_name_email']==1)echo('checked="checked"');?>/><?php_e('Comment author must fill out name and e-mail')?></label>
<?phpprintf(__('Automatically close comments on articles older than %s days'),'</label><input name="close_comments_days_old" type="text" id="close_comments_days_old" value="'.esc_attr($opt['close_comments_days_old']).'" class="small-text" />')?>
printf(__('Break comments into pages with %1$s comments per page and the %2$s page displayed by default'),'</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="'.esc_attr($opt['comments_per_page']).'" class="small-text" />',$default_comments_page);
printf(__('Comments should be displayed with the %s comments at the top of each page'),$comment_order);
?></label>
</fieldset></td>
</tr>
<trvalign="top">
<thscope="row"><?php_e('E-mail me whenever')?></th>
<td>
<labelfor="comments_notify">
<inputname="comments_notify"type="checkbox"id="comments_notify"value="1"<?phpif($opt['comments_notify']==1)echo('checked="checked"');?>/><?php_e('Anyone posts a comment')?></label>
<br/>
<labelfor="moderation_notify">
<inputname="moderation_notify"type="checkbox"id="moderation_notify"value="1"<?phpif($opt['moderation_notify']==1)echo('checked="checked"');?>/><?php_e('A comment is held for moderation')?></label>
</td>
</tr>
<trvalign="top">
<thscope="row"><?php_e('Before a comment appears')?></th>
<td>
<labelfor="comment_moderation">
<inputname="comment_moderation"type="checkbox"id="comment_moderation"value="1"<?phpif($opt['comment_moderation']==1)echo('checked="checked"');?>/><?php_e('An administrator must always approve the comment')?></label>
<br/>
<labelfor="comment_whitelist">
<inputtype="checkbox"name="comment_whitelist"id="comment_whitelist"value="1"<?phpif($opt['comment_whitelist']==1)echo('checked="checked"');?>/><?php_e('Comment author must have a previously approved comment')?></label>
<p><?phpprintf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'),'<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="'.$opt['comment_max_links'].'" />')?></p>
<p><?php_e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".')?></p>
<p><?php_e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".')?></p>
<p><?php_e('By default WordPress uses <a href="http://gravatar.com/">Gravatars</a> — short for Globally Recognized Avatars — for the pictures that show up next to comments. Plugins may override this.');?></p>
<?php// the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>
<tableclass="form-table">
<trvalign="top">
<thscope="row"><?php_e('Avatar display')?></th>
<td>
<?php
$yesorno=array(0=>__("Don’t show Avatars"),1=>__('Show Avatars'));
$ratings=array('G'=>__('G — Suitable for all audiences'),'PG'=>__('PG — Possibly offensive, usually for audiences 13 and above'),'R'=>__('R — Intended for adult audiences above 17'),'X'=>__('X — Even more mature than above'));
<?php_e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.');?><br/>
<p>Warning: It can be confusing for users to have these settings override the setting they choose on the sign up form. If you do not want to override user settings, select "Allow User Choice".</p>
<labelfor="blog-public"><?php_e('I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers and in public listings around this site.')?></label></p>
<p><?php_e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.');?></p>
<th><label><inputname="permalink_choice"type="radio"value="<?phpecho$structures[1];?>"class="tog"<?phpchecked($structures[1],$opt['permalink_structure']);?>/><?php_e('Day and name');?></label></th>
<td> </td>
</tr>
<tr>
<th><label><inputname="permalink_choice"type="radio"value="<?phpecho$structures[2];?>"class="tog"<?phpchecked($structures[2],$opt['permalink_structure']);?>/><?php_e('Month and name');?></label></th>
<p><?php_e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.')?></p>
<?phpelse:?>
<p><?php_e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.')?></p>
<td><fieldset><legendclass="screen-reader-text"><span><?php_e('Attempt to automatically embed all plain text URLs');?></span></legend>
<labelfor="embed_autourls"><inputname="embed_autourls"type="checkbox"id="embed_autourls"value="1"<?phpchecked('1',$opt['embed_autourls']);?>/><?php_e('Attempt to automatically embed all plain text URLs');?></label>
<p><?php_e('Enter links one per line with the name followed by an equals sign and a greater than sign and then the fully qualified link. Example: Google=>http://www.google.com')?></p>
<p><?php_e('Enter categories one per line with the name followed by an equals sign and a greater than sign and then the description => Nice Name => parent name. Example: Plugins=>Find out out about my plugins=>plugins=>code')?></p>
Sites that use a combination of BBPress and BuddyPress need all users to be subscribed to the blog on which BBPress is installed. The following section lets you do that. Note that you may add people to a comma-delimited list of blogs, but they will have the same role on each blog.
<td><inputname="add_user_to_blog_id"type="text"id="add_user_to_blog_id"size="30"value="<?phpecho($opt['add_user_to_blog_id']);?>"/><br/>Use Blog ID or comma-delimited list of ID's.</td>