<?php
add_action('admin_menu', 'mytheme_page');
function mytheme_page (){
if ( count($_POST) > 0 && isset($_POST['mytheme_settings']) ){
$options = array ('l1','l2','l3','l4','l5','tad','sr','pp','bnr','cat','cat1','cat2','cat3','pp1','pp2','pp3','pp4','pp5','pp6','pp7','pp8','pp9','pp10','pp11','pp12','pp13','pp14','pp15','pp16','icp','t1','t2','t3','t4','t5','t6','t7','t8','t9','t10','t11','t12','t13','time','qq','tt',);
foreach ( $options as $opt ){
delete_option ( 'mytheme_'.$opt, $_POST[$opt] );
add_option ( 'mytheme_'.$opt, $_POST[$opt] );
}
}
add_theme_page(__('Jumei1.0 Options'), __('Jumei1.0 Options'), 'edit_themes', basename(__FILE__), 'mytheme_settings');
}
function mytheme_settings(){
?>
<style>
#wpbody-content{font-family:Microsoft YaHei,Century Gothic,Verdana;}
fieldset{width:100%;border:1px solid #aaa;padding-bottom:20px;margin-top:20px;-webkit-box-shadow:rgba(0,0,0,.2) 0px 0px 5px;-moz-box-shadow:rgba(0,0,0,.2) 0px 0px 5px;box-shadow:rgba(0,0,0,.2) 0px 0px 5px;}
legend{margin-left:5px;padding:0 5px;color:#028400;background:#FFF;cursor:pointer;}
textarea{width:100%;font-size:11px;border:1px solid #aaa;background:none;-webkit-box-shadow:rgba(0,0,0,.2) 1px 1px 2px inset;-moz-box-shadow:rgba(0,0,0,.2) 1px 1px 2px inset;box-shadow:rgba(0,0,0,.2) 1px 1px 2px inset;-webkit-transition:all .4s ease-out;-moz-transition:all .4s ease-out;}
textarea:focus{-webkit-box-shadow:rgba(0,0,0,.2) 0px 0px 8px;-moz-box-shadow:rgba(0,0,0,.2) 0px 0px 8px;box-shadow:rgba(0,0,0,.2) 0px 0px 8px;outline:none;}
.wrap form fieldset .floatleft { float: left; padding-left: 200px; font-weight: bold; color:#028400; }
.wrap form fieldset .floatleft2 { float: left; font-weight: bold; width: 345px; text-align: center;}
.wrap form fieldset .floatmiddle { font-weight: bold; float: left; text-align: center; width: 345px;}
.wrap form fieldset .floatright { font-weight: bold; float:left;text-align: center; width: 345px;padding-left: 20px; }
.floatleft,.floatleft2,.floatmiddle,.floatright{color:#F00}
.categoryid { padding-top: 10px; padding-right: 10px; padding-left: 12px;}
.alipay { clear: both; padding-top: 20px; *padding-top: 10px;}
.alipay a{text-decoration:none;color:#028400;}
.alipay a:hover{text-decoration:underline;color:#F0080;}
.wrap { clear: both; }
.xjlogo{ float: left; height: 67px; width: 259px; }
.xjlogo img{ height: height: 67px; width: 259px; }
.rssfeed ul{margin-top:14px}
.rssfeed ul li { float: left; text-decoration: none; background:url(<?php bloginfo('template_directory'); ?>/images/li.gif) 2px 3px no-repeat; text-indent: 20px; width: 274px;}
.rssfeed ul li a { font-size: 12px; text-decoration: none;color: #000;}
.rssfeed ul li a:hover { color:#028400;text-decoration:underline;}
table { table-layout: fixed; word-wrap:break-word; }
div { word-wrap:break-word; }
</style>
<div class="xjlogo">
<a href="http://www.xuejiancn.com" target=_"blank"><img src="<?php bloginfo('template_directory'); ?>/images/xuejian.gif" width="259" height="67" alt="雪箭博客" /></a>
</div>
<div class="rssfeed">
<?php // Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('http://www.xuejiancn.com/feed');
$maxitems = 9;
$items = array_slice($rss->items, 0, $maxitems);
?>
<ul>
<?php if (empty($items)) echo '<li>No items</li>';
else
foreach ( $items as $item ) : ?>
<li>
<a href='<?php echo $item['link']; ?>'
title='<?php echo $item['title']; ?>' target="_blank">
<?php echo mb_strimwidth($item['title'] , 0, 32, '…') ; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="alipay">你正在使用雪箭Wordpress主题Jumei1.0,获得技术支持请访问<a href="http://www.xuejiancn.com/" target="_blank">雪箭博客</a>;雪箭 <a href="http://wpa.qq.com/msgrd?v=3&uin=263507567&site=qq&menu=yes" target="_blank">QQ:263507567</a>。目前正在完善新版Jumei主题,引入面向对象思想、全新制作、XPanel管理后台,支持采集和淘点金,测试地址:<a href="http://www.nvxie80.com/" target="_blank">伊人女鞋</a>。 祝你使用愉快!</div>
<div class="study">
<dl>
</dl>
</div>
<div class="wrap">
<form method="post" action="">
<fieldset>
<legend><strong>NO.1 关注微博+订阅链接+页面创建所有分类</strong></legend>
<table class="form-table">
<tr>
<td><textarea name="l1" id="l1" rows="1" cols="1" onfocus="if(this.value=='http://weibo.com/u/2099577243') {this.value='';}this.style.color='#333';" onblur="if(this.value=='') {this.value='http://weibo.com/u/2099577243';this.style.color='#333';}"maxlength=""><?php echo stripslashes(get_option('mytheme_l1')); ?></textarea></td>
<td><textarea name="l2" id="l2" rows="1" cols="1" onfocus="if(this.value=='http://t.qq.com/MyFreeYouth') {this.value='';}this.style.color='#333';" onblur="if(this.value=='') {this.value='http://t.qq.com/MyFreeYouth';this.style.color='#333';}"maxlength=""><?php echo stripslashes(get_option('mytheme_l2')); ?></textarea></td>
<td><textarea name="l3" id="l3" rows="1" cols="1" onfocus="if(this.value=='http://user.qzone.qq.com/263507567') {this.value='';}this.style.color='#333';" onblur="if(this.value=='') {this.value='http://user.qzone.qq.com/263507567';this.style.color='#333';}"maxlength=""><?php echo stripslashes(get_option('mytheme_l3')); ?></textarea></td>
<td><textarea name="l4" id="l4" rows="1" cols="1" onfocus="if(this.value=='feed') {this.value='';}this.style.color='#333';" onblur="if(this.value=='') {this.value='feed';this.style.color='#333';}"maxlength=""><?php echo stripslashes(get_option('mytheme_l4')); ?></textarea></td>
<td><textarea name="l5" id="l5" rows="1" cols="1" onfocus="if(this.value=='archives') {this.value='';}this.style.color='#333';" onblur="if(this.value=='') {this.value='archives';this.style.color='#333';}"maxlength=""><?php echo stripslashes(get_option('mytheme_l5')); ?></textarea></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><strong>NO.2</strong></legend>
<div class="floatleft2">LOGO右侧广告620*80</div>
<div class="floatmiddle">幻灯右侧广告240*114*2+240*113*1</div>
<div class=" floatright">品牌位广告91*60*18</div>
<table class="form-table">
<tr>
<td><textarea name="tad" id="tad" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_tad')); ?></textarea></td>
<td><textarea name="sr" id="sr" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_sr')); ?></textarea></td>
<td><textarea name="pp" id="pp" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_pp')); ?></textarea></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><strong>NO.3</strong></legend>
<div class="floatleft2">推荐分类1广告344*334</div>
<div class="floatmiddle">推荐分类2广告344*334</div>
<div class=" floatright">推荐分类3广告344*334</div>
<table class="form-table">
<tr>
<td><textarea name="cat1" id="cat1" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_cat1')); ?></textarea></td>
<td><textarea name="cat2" id="cat2" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_cat2')); ?></textarea></td>
<td><textarea name="cat3" id="cat3" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_cat3')); ?></textarea></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><strong>NO.4</strong></legend>
<div class="floatleft2">滑块分类右侧广告219*488</div>
<div class="floatmiddle">分类和文章页Banner广告960*</div>
<div class=" floatright">分享与统计代码</div>
<table class="form-table">
<tr>
<td><textarea name="cat" id="cat" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_cat')); ?></textarea></td>
<td><textarea name="bnr" id="bnr" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_bnr')); ?></textarea></td>
<td><textarea name="tt" id="tt" rows="2" cols="1"><?php echo stripslashes(get_option('mytheme_tt')); ?></textarea></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><strong>NO.5 分类树设置</strong></legen