"About",
"type" => "subhead"),
array( "name" => "About sidebar text state",
"desc" => "Enable or disable the about text in the sidebar.",
"id" => $shortname."_about_state",
"std" => "Enabled",
"type" => "select",
"options" => array("Enabled","Disabled")),
array( "name" => "About",
"type" => "title"),
array( "type" => "open"),
array( "name" => "Title",
"desc" => "Enter a title to be displayed in your sidebar about text. Default currently set to 'About'",
"id" => $shortname."_about_title",
"std" => "",
"type" => "text"),
array( "name" => "Image URL",
"desc" => "Provide the full path to a 80x80 image of yourself. Leave blank if you don't have one.",
"id" => $shortname."_image_url",
"std" => "",
"type" => "text"),
array( "name" => "Message",
"desc" => "Input the content of about text. Tell us about yourself and your blog.",
"id" => $shortname."_about_message",
"type" => "textarea",
"options" => array("rows" => "5",
"cols" => "30")),
array( "name" => "About URL",
"desc" => "Provide the full path to a more detailed about page. Leave blank if you don't have one.",
"id" => $shortname."_about_url",
"std" => "",
"type" => "text"),
array( "name" => "Navigation",
"type" => "subhead"),
array( "name" => "Exclude pages from sidebar navigation",
"id" => $shortname."_pages_to_exclude",
"desc" => "Page ID's you don't want displayed in your navigation. Use a comma-delimited list, eg. 1,2,3",
"std" => "",
"type" => "text"),
array( "name" => "Sidebar Feed Box",
"type" => "subhead"),
array( "name" => "Feed box state",
"desc" => "Enable or disable the feed box in the sidebar.",
"id" => $shortname."_feed_state",
"std" => "Enabled",
"type" => "select",
"options" => array("Enabled","Disabled")),
array( "name" => "Feed box title text",
"id" => $shortname."_feed_title",
"desc" => "Title of your feed box.",
"std" => "Feeds",
"type" => "text"),
array( "name" => "Feed box intro text",
"id" => $shortname."_feed_intro",
"desc" => "Enter your feed intro text here.",
"std" => "Get updates delivered to your reader or your inbox:",
"type" => "textarea",
"options" => array("rows" => "5",
"cols" => "30") ),
array( "name" => "Feedburner email updates link",
"id" => $shortname."_feed_email",
"desc" => "Enter your feed email link here. Do not paste the entire link code, just the URL.<a href=" http://www.feedburner.com/fb/a/emailverifySubmit?feedId=000000&loc=en_US
">Subscribe to Your Feed by Email</a>",
"std" => "http://www.feedburner.com/fb/a/emailverifySubmit?feedId=YOURFEEDID&loc=en_US",
"type" => "textarea",
"options" => array("rows" => "2",
"cols" => "30") ),
array( "name" => "Header",
"type" => "subhead"),
array( "name" => "Header code",
"id" => $shortname."_header_code",
"desc" => "If you use Javascript or need any other code in your header just copy and paste it here.
It will be inserted before the closing </header>
tag.",
"std" => "",
"type" => "textarea",
"options" => array("rows" => "5",
"cols" => "30") ),
array( "name" => "Social Bookmarks",
"type" => "subhead"),
array( "name" => "Social bookmarks code",
"id" => $shortname."_social_code",
"desc" => "If you want to add any social bookmarking code right after your posts just copy and paste it here.",
"std" => "",
"type" => "textarea",
"options" => array("rows" => "5",
"cols" => "30") ),
array( "name" => "Footer",
"type" => "subhead"),
array( "name" => "Copyright notice",
"id" => $shortname."_copyright_name",
"desc" => "Enter your copyright info above.",
"std" => "Your Name Here",
"type" => "text"),
array( "name" => "Stats code",
"id" => $shortname."_stats_code",
"desc" => "If you use Google Analytics or any other tracking script in your footer just copy and paste it here.
The script will be inserted before the closing </body>
tag.",
"std" => "",
"type" => "textarea",
"options" => array("rows" => "5",
"cols" => "30") ),
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&saved=true");
die;
}
}
add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
//add_theme_page($themename . 'Header Options', 'Header Options', 'edit_themes', basename(__FILE__), 'headimage_admin');
function headimage_admin(){
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo '
'.$themename.' settings saved.
'.$themename.' settings reset.
Welcome to the R755 Options menu. If you have any questions add a comment to the R755 theme page.
]*>.*?
)%ims', '\n$1\n', $content); if ($wp_version < '2.3') { $content = preg_replace_callback('!
]*)>(.*?)!ims', 'tguy_cmu_escape_backslash_callback', $content); } $content = preg_replace_callback('!
]*)>(?:\r\n|\n|\r|)(.*?)(?:\r\n|\n|\r|)
!ims', 'tguy_cmu_encode_xml_callback', $content);
return $content;
}
function tguy_cmu_tidy_code($content) {
$content = preg_replace_callback('!]*)>(.*?)!ims', 'tguy_cmu_unescape_qq_callback', $content); $content = preg_replace_callback('!
]*)>(.*?)
!ims', 'tguy_cmu_untexturize_code_callback', $content);
return $content;
}
function tguy_cmu_encode_xml_callback($matches) {
$attributes = $matches[1];
$escapedContent = $matches[2];
$attrMatches = array();
$markup = 'default';
if (0 < preg_match('!^(.*?)\s+(?:markup|allow)="([^"]*)"(.*)$!i', $attributes, $attrMatches)) {
$markup = strtolower($attrMatches[2]);
$attributes = $attrMatches[1] . $attrMatches[3];
}
if ($markup == 'default') {
if (0 < preg_match('!^(.*)lang="([^"]*)"(.*)$!i', $attributes, $attrMatches)) {
$lang = strtolower($attrMatches[2]);
$attributes = $attrMatches[1] . $attrMatches[3];
if ($lang == 'html' || $lang == 'xhtml') {
$markup = 'none';
}
}
}
if ($markup == 'all') {
} else {
if ($markup == 'none' || $markup == '') {
$allowedTags = '';
} else if ($markup == 'default' || $markup == 'tags') { // 'tags' allowed for backward compatibility
$allowedTags = 'em|strong|b|i|ins|del|a|span|comment';
} else {
$allowedTags = preg_replace('!\s+!', '|', trim($markup));
}
$escapedContent = htmlspecialchars($escapedContent, ENT_NOQUOTES);
if ($allowedTags != '') {
$escapedContent = preg_replace_callback('!</?('.$allowedTags.')( .*?)?>!is',
'tguy_cmu_unescape_tag', $escapedContent);
if (false !== strpos($allowedTags, 'comment')) {
$escapedContent = preg_replace_callback('|<!--.*?-->|is',
'tguy_cmu_unescape_tag', $escapedContent);
}
}
}
return "$escapedContent
";
}
function tguy_cmu_unescape_tag($matches) {
return str_replace(
array(">", "<", """, "&"),
array(">", "<", "\"", "&"),
$matches[0]);
}
function tguy_cmu_escape_backslash_callback($matches) {
return "".str_replace('\\', '\\\\', $matches[2]).""; } function tguy_cmu_unescape_qq_callback($matches) { return "
".str_replace('\"', '"', $matches[2]).""; } function tguy_cmu_untexturize_code_callback($matches) { $fancy = array('×', '‘', '’', '′', '“', '”', '″', '—', '–', '…', '“'); $plain = array('x' ,'\'' , '\'' , '\'' , '"' , '"' , '"' , '--' , '--' , '...' , '``' ); return "
".str_replace($fancy, $plain, $matches[2])."
";
}
// ===== Add Meta Noindex Rules on Singular Comment Page Section ======
function wpi_comment_paging_noindex_meta()
{ global $wp_query;
if (version_compare( (float) get_bloginfo('version'), 2.7, '>=') ){
if ($wp_query->is_singular && get_option('page_comments')){ // comments paging enabled
if (isset($wp_query->query['cpage'])
&& absint($wp_query->query['cpage']) >= 1 ){
echo ''.PHP_EOL;
}
}
}
}
add_action('wp_head','wpi_comment_paging_noindex_meta');
// ===== Add a Microid to all Comments ================================
function comment_add_microid($classes) {
$c_email=get_comment_author_email();
$c_url=get_comment_author_url();
if (!empty($c_email) && !empty($c_url)) {
$microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$c_email).sha1($c_url));
$classes[] = $microid;
}
return $classes;
}
add_filter('comment_class','comment_add_microid');
// ===== Seperate Pings ===============================================
function list_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>