<?php
class xiaohanOptions {
function getOptions() {
$options = get_option('xiaohan_options');
if (!is_array($options)) {
$options['indextitle'] = '';
$options['indexkeyword'] = '';
$options['indexdescription'] = '';
$options['icp'] = '';
$options['copyinfo'] = '';
$options['notice'] = false;
$options['notice_content'] = '';
$options['submenu'] = false;
$options['showcase_caption'] = false;
$options['showcase_title'] = '';
$options['showcase_content'] = '';
$options['ctrlentry'] = false;
$options['stat'] = false;
$options['stat_content'] = '';
$options['feed'] = false;
$options['feed_url'] = '';
$options['feed_email'] = false;
$options['feed_url_email'] = '';
$options['banner_link'] = '';
$options['banner_link_target'] = '';
$options['banner_link_xfn'] = '';
update_option('xiaohan_options', $options);
}
return $options;
}
function add() {
if(isset($_POST['xiaohan_save'])) {
$options = xiaohanOptions::getOptions();
$options['indextitle'] = stripslashes($_POST['indextitle']);
$options['indexkeyword'] = stripslashes($_POST['indexkeyword']);
$options['indexdescription'] = stripslashes($_POST['indexdescription']);
$options['icp'] = stripslashes($_POST['icp']);
$options['copyinfo'] = stripslashes($_POST['copyinfo']);
// notice
if ($_POST['notice']) {
$options['notice'] = (bool)true;
} else {
$options['notice'] = (bool)false;
}
$options['notice_content'] = stripslashes($_POST['notice_content']);
if ($_POST['submenu']) {
$options['submenu'] = (bool)true;
} else {
$options['submenu'] = (bool)false;
}
// showcase
if ($_POST['showcase_caption']) {
$options['showcase_caption'] = (bool)true;
} else {
$options['showcase_caption'] = (bool)false;
}
$options['showcase_title'] = stripslashes($_POST['showcase_title']);
$options['showcase_content'] = stripslashes($_POST['showcase_content']);
// stat
if ($_POST['stat']) {
$options['stat'] = (bool)true;
} else {
$options['stat'] = (bool)false;
}
$options['stat_content'] = stripslashes($_POST['stat_content']);
// feed
if ($_POST['feed']) {
$options['feed'] = (bool)true;
} else {
$options['feed'] = (bool)false;
}
$options['feed_url'] = stripslashes($_POST['feed_url']);
if ($_POST['feed_email']) {
$options['feed_email'] = (bool)true;
} else {
$options['feed_email'] = (bool)false;
}
$options['feed_url_email'] = stripslashes($_POST['feed_url_email']);
$options['banner_link'] = stripslashes($_POST['banner_link']);
$options['banner_link_target'] = stripslashes($_POST['banner_link_target']);
$options['banner_link_xfn'] = stripslashes($_POST['banner_link_xfn']);
update_option('xiaohan_options', $options);
} else {
xiaohanOptions::getOptions();
}
add_theme_page(__('主题设置', 'xiaohan'), __('主题设置', 'xiaohan'), 'edit_themes', basename(__FILE__), array('xiaohanOptions', 'display'));
}
function display() {
$options = xiaohanOptions::getOptions();
?>
<style>
.wrap{margin-left:20px;}
.wrap h2{border-bottom:1px #ddd solid;margin-bottom:15px;}
.wrap h3{background:#22749b;color:#fff;font-size:14px;height:30px;line-height:30px;width:120px;text-indent:10px;margin:0;}
.form-table th{width:100px;color:#00F}
.form-table {border-collapse:collapse;width:720px;margin-bottom:15px;}
.form-table td,.form-table th {border:#e0e1e1 solid 1px; font-size:12px;color:#565656; height:35px;line-height:35px;background:#fff;}
</style>
<form action="#" method="post" enctype="multipart/form-data" name="xiaohan_form" id="xiaohan_form">
<div class="wrap">
<h2><?php _e('Xiaohan Theme 主题设置', 'xiaohan'); ?></h2>
<h3>基础设置</h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<?php _e('首页标题', 'xiaohan'); ?>
</th>
<td>
<label>
<input name="indextitle" id="indextitle" size="60" class="code" value="<?php echo($options['indextitle']); ?>" />
</label>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('首页关键词', 'xiaohan'); ?>
</th>
<td>
<label>
<input name="indexkeyword" id="indexkeyword" size="60" class="code" value="<?php echo($options['indexkeyword']); ?>" />
</label>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('首页描述', 'xiaohan'); ?>
</th>
<td>
<label>
<textarea name="indexdescription" id="indexdescription" cols="50" rows="2" style="width:550px;font-size:12px;" class="code"><?php echo($options['indexdescription']); ?></textarea>
</label>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('ICP备案号', 'xiaohan'); ?>
</th>
<td>
<label>
<input name="icp" id="icp" size="60" class="code" value="<?php echo($options['icp']); ?>" />
</label>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('底部版权信息', 'xiaohan'); ?>
</th>
<td>
<label>
<textarea name="copyinfo" id="copyinfo" cols="50" rows="2" style="width:550px;font-size:12px;" class="code"><?php echo($options['copyinfo']); ?></textarea>
</label>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('统计代码', 'xiaohan'); ?>
<br/>
<small style="font-weight:normal;"><?php _e('HTML enabled', 'xiaohan'); ?></small>
</th>
<td>
<label>
<input name="stat" type="checkbox" value="checkbox" <?php if($options['stat']) echo "checked='checked'"; ?> />
</label><?php _e('底部添加统计代码', 'xiaohan'); ?>
<br/>
<label>
<textarea name="stat_content" id="stat_content" cols="50" rows="5" style="width:550px;font-size:12px;" class="code"><?php echo($options['stat_content']); ?></textarea>
</label>
<!-- showcase END -->
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Feed', 'xiaohan'); ?></th>
<td>
<label>
<input name="feed" type="checkbox" value="checkbox" <?php if($options['feed']) echo "checked='checked'"; ?> />
<?php _e('Custom feed.', 'xiaohan'); ?>
</label>
<?php _e('URL:', 'xiaohan'); ?> <input type="text" name="feed_url" id="feed_url" class="code" size="60" value="<?php echo($options['feed_url']); ?>">
<br/>
<label>
<input name="feed_email" type="checkbox" value="checkbox" <?php if($options['feed_email']) echo "checked='checked'"; ?> />
<?php _e('Email feed.', 'xiaohan'); ?>
</label>
<?php _e('URL:', 'xiaohan'); ?> <input type="text" name="feed_url_email" id="feed_url_email" class="code" size="60" value="<?php echo($options['feed_url_email']); ?>">
</td>
</tr>
</tbody>
</table>
<h3>功能设置</h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<?php _e('微博设置', 'xiaohan'); ?>
</th>
<td>
<!-- notice START -->
<label>
<input name="notice" type="checkbox" value="checkbox" <?php if($options['notice']) echo "checked='checked'"; ?> />
<?php _e('最新微博显示在首页的文章区域上方,输入你要做为微博栏目的ID '); ?>
<input name="notice_content" id="notice_content" size="20" class="code" value="<?php echo($options['notice_content']); ?>" />
</label>
<!-- notice END -->
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e('下拉菜单', 'xiaohan'); ?>
</th>
<td>
<!-- notice START -->
<l
没有合适的资源?快使用搜索试试~ 我知道了~
萧涵WordPress主题“Xiaohan V3.0”
共69个文件
gif:19个
jpg:16个
php:16个
5星 · 超过95%的资源 需积分: 10 82 下载量 90 浏览量
2012-09-22
09:38:08
上传
评论
收藏 709KB RAR 举报
温馨提示
增加微博功能,发文章的时候选择“Aside短文章”形式,即为微博格式,在主题设置中可以指定做为微博的栏目。这是本次升级的亮点,原先的公告去除。 增加下拉菜单功能,可以在主题设置中指定是否启动下拉菜单,另外要去自定义菜单中设置菜单项(WP自定义菜单教程),目前只支持二级菜单。 自定义顶部Banner图片以及图片链接,链接窗口打开方式,链接是否增加Nofollow属性。 减少插件使用,可自定义首页标题、Keywords标签、描述标签,之前不喜欢用All in one seo插件,又想自定义标题的同学现在可以无忧了。内容页的关键词标签是调用设置的文章标签,描述是调用自己写的摘要或截取文章内容前200字符。 减少插件使用,在首页等文章列表页自动获取内容摘要,目前为截取文章内容的第一段内容,并且也保留原有格式。现在不必再安装别的摘要插件了。 友情链接双排显示,之前有朋友反应说原来的友链单排显示太难看了,而且链接一旦多了,则会将页面拉得很长,现在不必担心这个问题了。 增加一个友情链接页面模板,只需在页面中添加一个别名为flinks的的页面,则会在这个页面显示所有的友情链接,也就是有一个单独的友链页面了。 修正了几处CSS错误,文章段落首段缩进2个字符,内容页有序列表和无序列表格式。 大致就是以上这些功能更新,具体的还要大家安装试了才能体会。希望大家提出宝贵意义,我一定会加以改进。下一个版本的首个功能将会增加多颜色风格选择,其他待定。。 本版网站:http://www.wuhzy.ocm
资源推荐
资源详情
资源评论
收起资源包目录
xiaohan.rar (69个子文件)
xiaohan
xiaohan
sidebar.php 6KB
functions.php 38KB
footer.php 899B
comments.php 8KB
index.php 3KB
images
right.gif 63B
stat.js 149B
comment_foot.gif 14KB
icon_qq.gif 596B
notice_bg.gif 206B
nav_hover.gif 5KB
warp.gif 63KB
ico.gif 44B
.DS_Store 6KB
icon_xianguo.gif 735B
comment_head.gif 2KB
headers
concave.jpg 38KB
cherryblossoms.jpg 80KB
concave-thumbnail.jpg 6KB
sunset.jpg 22KB
cherryblossoms-thumbnail.jpg 6KB
forestfloor-thumbnail.jpg 7KB
inkwell-thumbnail.jpg 4KB
path-thumbnail.jpg 4KB
berries-thumbnail.jpg 6KB
sunset-thumbnail.jpg 2KB
forestfloor.jpg 63KB
berries.jpg 59KB
inkwell.jpg 38KB
fern.jpg 25KB
fern-thumbnail.jpg 5KB
path.jpg 51KB
comment.js 2KB
blockquote.gif 273B
qqonline.gif 894B
bg.gif 19KB
icon_mail.gif 626B
right_top.gif 4KB
icons.gif 3KB
icon_google.gif 597B
ico-com.png 1KB
rss_ico.gif 3KB
ico-1.gif 44B
warp2.gif 58KB
arrows-ffffff.png 244B
zh_CN.po 12KB
clearbox.css 9KB
archive.php 3KB
404.php 241B
js
supersubs.js 3KB
clearbox.js 17KB
base.js 3KB
jquery-1.2.6.min.js 54KB
superfish.js 4KB
jquery.bgiframe.min.js 1KB
hoverIntent.js 3KB
header.php 5KB
author.php 3KB
screenshot.png 48KB
friendlink.php 1KB
page.php 1002B
category.php 4KB
zh_CN.mo 8KB
search.php 2KB
tag.php 2KB
superfish.css 3KB
single.php 6KB
style.css 16KB
searchform.php 428B
共 69 条
- 1
wqhjqsy
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页