'Regular Sidebar',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
}
/*
Plugin Name: Separate Comments & Pings
Plugin URI: http://urbangiraffe.com/plugins/separate-comment-pings/
Description: Removes all pings & trackbacks from comments and puts them into $pings.
Author: John Godley
Version: 1.0
Author URI: http://urbangiraffe.com/
*/
function ping_comments ($comments)
{
global $pings, $comment;
// Initialise the variables
$pings = $newcomments = array ();
// Loop through existing comments
foreach ($comments AS $comment)
{
if (get_comment_type () == 'comment')
$newcomments[] = $comment;
else
$pings[] = $comment;
}
// Return the comments without any pings
return $newcomments;
}
// Adjust comments number so comments_number() function is correct
function ping_comments_number ($num)
{
global $pings;
return $num - count ($pings);
}
// Hook into WordPress filters
add_filter ('get_comments_number', 'ping_comments_number');
add_filter ('comments_array', 'ping_comments');
/* wp options page --------------------------------------------------------------- */
$themename = "Amazona Theme";
$shortname = "amazona";
$options = array(
array( "type" => "open" ),
array(
"type" => "title",
"name" => "Amazona Theme Options",
"desc" => 'Customize amazona to your needs. If you have any questions about this theme,
go to Seo-Scout Amazona Page. I will add a detailed howto there.
If you accidentially destroyed these Options here, just click the RESET button.
Putting HTML-Code into these Option-Fields is possible (be careful).'
),
array(
"type" => "title",
"name" => "Header-Links",
"desc" => "Put up to 5 Links or one message into the top of the header.",
"image" => "5links.jpg"
),
/* header-links (5 pieces) */
array(
"name" => "Header-Link 1",
"desc" => "You can put up to 5 Links in the Top of the Header or one message. 1. Link in Header, above Searchform. Like to manually edit this? Go to /lib/navigation.php line 25ff.",
"id" => $shortname . "_link_1",
"std" => 'Link 1',
"type" => "textbox_small"
),
array(
"name" => "Header-Link 2",
"desc" => "2. Link in Header, above Searchform",
"id" => $shortname . "_link_2",
"std" => 'Link 2',
"type" => "textbox_small"
),
array(
"name" => "Header-Link 3",
"desc" => "3. Link in Header, above Searchform",
"id" => $shortname . "_link_3",
"std" => 'Link 3',
"type" => "textbox_small"
),
array(
"name" => "Header-Link 4",
"desc" => "4. Link in Header, above Searchform",
"id" => $shortname . "_link_4",
"std" => 'Link 4',
"type" => "textbox_small"
),
array(
"name" => "Header-Link 5",
"desc" => "5. Link in Header, above Searchform",
"id" => $shortname . "_link_5",
"std" => 'Link 5',
"type" => "textbox_small"
),
array(
"type" => "title",
"name" => "Very small message",
"desc" => "If you like, you can put an image or a small message next to the search-button. If you don't have any idea what to put there, delete the text and save.",
"image" => "smallmessage.jpg"
),
/* small message in header, nearby searchform */
array(
"name" => "Very Small Message in Head",
"desc" => "Content for the Textfield in Header, nearby Searchform. If you want to edit it manually (for example, to place a picture), go to /lib/navigation.php, line 73.",
"id" => $shortname . "_smallmessage",
"std" => "this is almost the maximum text that fits in here.",
"type" => "textbox_small"
),
array(
"type" => "title",
"name" => "About-Section",
"desc" => "Here you can place an informative text about you and this blog (what is it about?)",
"image" => "about.jpg"
),
/* short about section title */
array(
"name" => "Your About Title",
"desc" => "About-Section above Carousel: Put in a short Title. If you want to edit it manually, go to /lib/meta.inc.php.",
"id" => $shortname . "_about_title",
"std" => "Your short about section
",
"type" => "textbox_small"
),
/* short about section text */
array(
"name" => "Your About Text",
"desc" => "About-Section above Carousel: Put in an informative description text. If you want to edit it manually, go to /lib/meta.inc.php.",
"id" => $shortname . "_about_text",
"std" => 'Tell the people out there in 2-3 sentences what this blog is about and who you are. Use your main keywords here, as this text is visible on all pages
',
"type" => "textbox"
),
array(
"type" => "title",
"name" => "Amazon-Carousel",
"desc" => "This is the perfect spot for an Amazon.com Carousel, stuffed with your stuff. Or you can put a big picture or very important Text in here... This will be on all pages.",
"image" => "amazoncarousel.jpg"
),
/* Amazon Carousel Code */
array(
"name" => "Put in your Amazon.com Carousel code",
"desc" => "Go to Amazon.com, subscribe as affiliate partner and get your Amazon Carousel. To edit it manually, go to /lib/announce.inc.php, line 10ff.",
"id" => $shortname . "_carouselcode",
"type" => "textbox",
"std" => 'Suggestion: Amazon.com Carousel here.'
),
array(
"type" => "title",
"name" => "On Special (orange box)",
"desc" => "This is an attraktive spot for very important links or a super-important text (or a pic or something else).",
"image" => "onspecial.jpg"
),
/* on special orange box nearby carousel */
array(
"name" => "On Special (orange box)",
"desc" => "Special Content or Links in that orange box nearby amazon carousel. To edit it manually, go to /lib/announce.inc.php, line 21ff.",
"id" => $shortname . "_onspecial",
"std" =>
'On Special
Special Links or Content
',
"type" => "textbox"
),
array(
"type" => "title",
"name" => "Good Spot for Google Adsense",
"desc" => "This is a good spot for Google Adsense 250x250 px Advertising Block.",
"image" => "adsense.jpg"
),
/* adwords 250x250 above sidebar */
array(
"name" => "Google Adsense",
"desc" => "If you like, put in here your code for an Google Adsense Block 250x250 px; it will appear above the sidebar.",
"id" => $shortname . "_ga_250",
"std" => '',
"type" => "textbox"
),
array( "type" => "close" )
);
add_action( "admin_menu", "amazona_add_admin" );
function amazona_add_admin( )
{
global $themename, $shortname, $options;
if( isset( $_GET['page'] ) && $_GET['page'] == basename( __FILE__ ))
{
if( isset( $_REQUEST['action'] ) && '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" );
wp_redirect( "themes.php?page=functions.php&saved=true" );
die;
}
else if( isset( $_REQUEST['action'] ) && 'reset' == $_REQUEST['action'] )
{
foreach( $options as $value )
{
delete_option( $value['id'] );
}
#header( "Location: themes.php?page=functions.php&reset=true" );
wp_redirect( "themes.php?page=functions.php&reset=true" );
die;
}
}
add_theme_page( $themename . " Options", "" . $themename . " Options", 'edit_themes', basename( __FILE__ ), 'amazona_admin' );
}
function amazona_admin( )
{
global $themename, $shortname, $options;
if( $_REQUEST['saved'] ) echo '' . $themename . ' settings saved.
';
if( $_REQUEST['reset'] ) echo '' . $themename . ' settings reset.
';
?>