本文最后更新于2016年12月15日,因长期没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
大前端DUX主题首页添加推荐模块及联系模块方法:
1、打开根目录下的options.php文件,搜索“选择分类设置为网站公告”,在其下一行添加以下代码:
$options[] = array("name" => __("首页公告", "haoui"), "type" => "heading"); $options[] = array("id" => "site_notice_s", "std" => false, "desc" => __("显示公告模块", "haoui"), "type" => "checkbox"); $options[] = array("name" => __("显示标题", "haoui"), "id" => "site_notice_title", "desc" => "建议4字内,默认:网站公告", "std" => "网站公告", "type" => "text"); $options[] = array("name" => __("选择分类设置为网站公告", "haoui"), "id" => "site_notice_cat", "options" => $options_categories, "type" => "select"); $options[] = array('name' => __('强烈推荐', 'haoui'), 'type' => 'heading'); $options[] = array('id' => 'site_tuijian_s', 'std' => false, 'desc' => __('显示推荐模块', 'haoui'), 'type' => 'checkbox'); $options[] = array('name' => __('显示标题', 'haoui'), 'id' => 'site_tuijian_title', 'desc' => '建议4字内,默认:强烈推荐', 'std' => '强烈推荐', 'type' => 'text'); $options[] = array('name' => __('显示文本', 'haoui'), 'id' => 'site_tuijian_text', 'desc' => '可自定义,默认:andykwok.cc强烈推荐:<strong>AndyKwok.cc分享所分享的</strong>', 'std' => 'andykwok.cc强烈推荐:andykwok.cc<br><strong>AndyKwok.cc最好的Blog</strong>', 'type' => 'textarea'); $options[] = array('name' => __('按钮 ', 'haoui') , 'id' => 'site_tuijian_button' , 'desc' => '按钮文字', 'std' => '点击查看', 'type' => 'text'); $options[] = array('id' => 'site_tuijian_url' , 'desc' => __('按钮链接', 'haoui'), 'std' => 'http://www.andykwok.cc/', 'type' => 'text'); $options[] = array('id' => 'site_tuijian_blank' , 'std' => false, 'desc' => __('新窗口打开', 'haoui'), 'type' => 'checkbox'); $options[] = array('name' => __('联系我们', 'haoui'), 'type' => 'heading'); $options[] = array('id' => 'site_aboutus_s', 'std' => false, 'desc' => __('显示联系我们模块', 'haoui'), 'type' => 'checkbox'); $options[] = array('name' => __('显示标题', 'haoui'), 'id' => 'site_aboutus_title', 'desc' => '可自定义,默认:联系我们', 'std' => '联系我们', 'type' => 'text'); $options[] = array('name' => __('显示文本', 'haoui'), 'id' => 'site_aboutus_text', 'desc' => '可自定义,默认:<h2>如有疑问,请留言或邮件咨询 <br>admin@andykwok.cc</h2>', 'std' => '<h2>如有疑问,请留言或邮件咨询 <br>admin@andykwok.cc</h2>', 'type' => 'textarea');
2、打开modules文件目录,找到文件no_notice.php找开,搜索:
echo "\t\t</ul>\r\n\t</div>\r\n";
在其实上面添加以下代码:
if ($s_aboutus && _hui("site_aboutus_s")) { echo "\t\t\t\t<li class=\"item item-04"; echo $s_aboutus && !$s_notice ? " active" : ""; echo "\">\r\n\t\t\t\t\t<h2>\r\n\t\t\t\t\t\t"; echo _hui("site_aboutus_text") ? _hui("site_aboutus_text") : "联系我们"; echo "\t\t\t\t\t</h2>\r\n\t\t\t\t</li>\r\n\t\t\t";
搜索:
echo "\t\t</ul>\r\n\t\t<ul class=\"widget-navcontent\">\r\n\t\t\t";
在其上面添加以下代码:
if ($s_tuijian) { echo "<li"; echo $s_tuijian && !$s_notice ? " class=\"active\"" : ""; echo ">强烈推荐</li>"; } if ($s_aboutus) { echo "<li"; echo $s_aboutus && !$s_notice ? " class=\"active\"" : ""; echo ">联系我们</li>";
搜索:
_moloader("mo_get_user_page", false);
在其后添加以下代码:
$s_tuijian = _hui("site_tuijian_s"); $s_aboutus = _hui("site_aboutus_s");
PS:将更改过的options.php和mo_notice.php文件上传覆盖(注意备份),上传文件后登陆后台,然后在外观DUX主题设置中找到推荐和联系模板开启即可。
签到成功!签到时间:下午7:50:17,每日签到,生活更精彩哦~
修改这个文件时no_notice.php遇到一点问题,能分享一下原文件吗?邮箱发我最好啦
弦念:http://www.2015110.com 前来拜访,欢迎互访!
DUX1.3部分代码改变了,这个方法貌似不合适了。
@李阳博客 可以的,尝试一下跟着文件改代码吧。
@Andy 嗯嗯,我已经做出来了。
@李阳博客 咋做的啊
好东西 谢谢分享
无法访问。。。
您好,你的这个该法现在的dux1.2 好像有点不一样,没改成功,如果您有时间的话,希望能出一个最新版的,万分感谢!
@游客123 修改版之前已经做好了,打算这几天内分享,到时候转告你。
@Andy 嗯,谢谢了
@Andy 随便问一下,你这个回复系统是什么插件?
@游客123 多说评论 你可以看看评论框下面 那里有链接的
@Andy 老大快分享吧
@废柴 DUX主题1.2版本取消加密修改版 已发布,欢迎前来下载!
@游客123 DUX主题1.2版本取消加密修改版 已发布,欢迎前来下载!