<?php
$themename = $dname.'主题';
$options = array(
"d_description", "d_keywords", "d_tui", "d_logo_w", "d_sticky_b", "d_sticky_count", "d_linkpage_cat", "d_tougao_b", "d_tougao_time", "d_tougao_mailto", "d_avatar_b", "d_avatarDate", "d_sideroll_b", "d_sideroll_1", "d_sideroll_2", "d_pingback_b", "d_autosave_b", "d_tqq_b", "d_tqq", "d_weibo_b", "d_weibo", "d_facebook_b", "d_facebook", "d_twitter_b", "d_twitter", "d_rss", "d_bdshare", "d_maillist_b", "d_maillist", "d_track_b", "d_track", "d_headcode_b", "d_headcode", "d_footcode_b", "d_footcode", "d_adsite_01_b", "d_adsite_01", "d_adindex_02_b", "d_adindex_02", "d_adindex_01_b", "d_adindex_01", "d_adindex_03_b", "d_adindex_03", "d_adpost_01_b", "d_adpost_01", "d_adpost_02_b", "d_adpost_02", "d_adpost_03_b", "d_adpost_03", "d_sign_b", "d_jquerybom_b", "d_ajaxpager_b", "d_thumbnail_b", "d_bdshare_b", "d_related_count", "d_post_views_b", "d_post_author_b", "d_post_comment_b", "d_post_time_b",
"t_appkey_tqq",
"t_appkey_tsina",
"t_appkey_t163",
"t_appkey_tsohu",
"article_content_fontsize",
"d_navfix",
"d_post_from_b",
"d_post_cat_b",
"d_post_from_s",
"d_tougao_contentmax",
"d_sticky_out_b",
"d_list_titletype_b",
"d_adsite_01_m",
"d_adindex_02_m",
"d_adindex_01_m",
"d_adindex_03_m",
"d_adpost_01_m",
"d_adpost_02_m",
"d_adpost_03_m",
"d_sidebar_m_b",
"d_tougao_contentmin"
);
function mytheme_add_admin() {
global $themename, $options;
if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {
if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
$op_value = isset($_REQUEST[ $value ]) ? $_REQUEST[ $value ] : '';
// if( isset($_REQUEST[ $value ]) )
update_option( $value, $op_value );
}
header("Location: admin.php?page=d8.php&saved=true");
die;
}
}
add_theme_page($themename." Options", $themename."设置", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_admin() {
global $themename, $options;
$i=0;
if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '<div class="updated settings-error"><p>'.$themename.'修改已保存</p></div>';
?>
<div class="wrap d_wrap">
<link rel="stylesheet" href="<?php bloginfo('template_url') ?>/admin/admin.css"/>
<h2><?php echo $themename; ?>设置
<span class="d_themedesc">设计师:<a href="//themebetter.com" target="_blank">浩子</a> <a href="//themebetter.com/theme/d8" target="_blank">访问<?php echo $themename; ?>主页</a></span>
</h2>
<form method="post" class="d_formwrap">
<table>
<thead>
<tr>
<th width="200"></th>
<th></th>
</tr>
</thead>
<tr>
<td class="d_tit">网站描述</td>
<td>
<input class="ipt-b" type="text" id="d_description" name="d_description" value="<?php echo dopt('d_description'); ?>">
</td>
</tr>
<tr>
<td class="d_tit">网站关键字</td>
<td>
<input class="ipt-b" type="text" id="d_keywords" name="d_keywords" value="<?php echo dopt('d_keywords'); ?>">
</td>
</tr>
<tr>
<td class="d_tit">最新消息</td>
<td>
<textarea name="d_tui" id="d_tui" type="textarea" rows=""><?php echo dopt('d_tui'); ?></textarea>
<span class="d_tip">最新消息显示在全站导航条下方,非常给力的推广位置</span>
</td>
</tr>
<tr>
<td class="d_tit">正文字体大小</td>
<td>
<input class="d_num" name="article_content_fontsize" id="article_content_fontsize" type="number" value="<?php if( dopt('article_content_fontsize') ) echo dopt('article_content_fontsize'); else echo '16'; ?>">px,默认14,建议在14-16之间
</td>
</tr>
<tr>
<td class="d_tit">Logo(标志)宽度</td>
<td>
<input class="d_num" name="d_logo_w" id="d_logo_w" type="number" value="<?php echo dopt('d_logo_w'); ?>"> px(像素)
<span class="d_tip">设置符合您站点Logo的宽度,Logo图片在主题igm文件夹下替换logo.png</span>
</td>
</tr>
<tr>
<td class="d_tit">首页置顶推荐</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_sticky_b" name="d_sticky_b" <?php if(dopt('d_sticky_b')) echo 'checked="checked"' ?>>开启
</label>
显示<input class="d_num" name="d_sticky_count" id="d_sticky_count" type="number" value="<?php echo dopt('d_sticky_count'); ?>">条 默认2条
<span class="d_tip">开启后请确保您的后台-文章中设置了3篇以上的置顶文章</span>
</td>
</tr>
<tr>
<td class="d_tit">手机端显示侧边栏</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_sidebar_m_b" name="d_sidebar_m_b" <?php if(dopt('d_sidebar_m_b')) echo 'checked="checked"' ?>>开启
</label>
</td>
</tr>
<tr>
<td class="d_tit">首页文章列表中排除置顶文章</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_sticky_out_b" name="d_sticky_out_b" <?php if(dopt('d_sticky_out_b')) echo 'checked="checked"' ?>>开启
</label>
</td>
</tr>
<tr>
<td class="d_tit">导航固定在顶部</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_navfix" name="d_navfix" <?php if(dopt('d_navfix')) echo 'checked="checked"' ?>>开启 (该功能在移动端无效)
</label>
</td>
</tr>
<tr>
<td class="d_tit">友情链接页面</td>
<td>
<label class="checkbox inline">
只显示分类ID为 <input name="d_linkpage_cat" id="d_linkpage_cat" type="text" value="<?php echo dopt('d_linkpage_cat'); ?>"> 的链接(id之间用英文逗号隔开),默认显示全部
</label>
</td>
</tr>
<tr>
<td class="d_tit">文章无特色图时不显示默认缩略图</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_thumbnail_b" name="d_thumbnail_b" <?php if(dopt('d_thumbnail_b')) echo 'checked="checked"' ?>>开启
</label>
</td>
</tr>
<tr>
<td class="d_tit">列表在手机端简化展示</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_list_titletype_b" name="d_list_titletype_b" <?php if(dopt('d_list_titletype_b')) echo 'checked="checked"' ?>>开启
</label>
</td>
</tr>
<tr>
<td class="d_tit">列表Ajax加载分页内容</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_ajaxpager_b" name="d_ajaxpager_b" <?php if(dopt('d_ajaxpager_b')) echo 'checked="checked"' ?>>开启
</label>
</td>
</tr>
<tr>
<td class="d_tit">列表文章属性开关</td>
<td>
<label class="checkbox inline">
<input type="checkbox" id="d_post_views_b" name="d_post_views_b" <?php if(dopt('d_post_views_b')) echo 'checked="checked"' ?>>不显示访客数
</label>
<label class="checkbox inline">
<input type="checkbox" id="d_post_author_b" name="d_post_author_b" <?php if(dopt('d_post_author_b')) echo 'checked="checked"' ?>>不显示作者
</label> &nbs
评论0
最新资源