大前端DUX主题首页添加推荐模块及联系模块方法 [ 网站地图 ]

发表于:2018-9-28 浏览:62 作者:zhaods 来源:互联网

关键字:大前端dux主题,模块

描述: 1、打开根目录下的options.php文件,搜索“选择分类设置为网站公告”,在其下一行添加以下代码: olclass="linenums"style="box-sizing:border-box;margin:0px0px0px30px;padding:0px;l

 1、打开根目录下的options.php文件,搜索“选择分类设置为网站公告”,在其下一行添加以下代码:

  1. $options[] = array("name" => __("首页公告", "haoui"), "type" => "heading");
  2. $options[] = array("id" => "site_notice_s", "std" => false, "desc" => __("显示公告模块", "haoui"), "type" => "checkbox");
  3. $options[] = array("name" => __("显示标题", "haoui"), "id" => "site_notice_title", "desc" => "建议4字内,默认:网站公告", "std" => "网站公告", "type" => "text");
  4. $options[] = array("name" => __("选择分类设置为网站公告", "haoui"), "id" => "site_notice_cat", "options" => $options_categories, "type" => "select");
  5. $options[] = array(‘name‘ => __(‘强烈推荐‘, ‘haoui‘), ‘type‘ => ‘heading‘);
  6. $options[] = array(‘id‘ => ‘site_tuijian_s‘, ‘std‘ => false, ‘desc‘ => __(‘显示推荐模块‘, ‘haoui‘), ‘type‘ => ‘checkbox‘);
  7. $options[] = array(‘name‘ => __(‘显示标题‘, ‘haoui‘), ‘id‘ => ‘site_tuijian_title‘, ‘desc‘ => ‘建议4字内,默认:强烈推荐‘, ‘std‘ => ‘强烈推荐‘, ‘type‘ => ‘text‘);
  8. $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‘);
  9. $options[] = array(‘name‘ => __(‘按钮 ‘, ‘haoui‘) , ‘id‘ => ‘site_tuijian_button‘ , ‘desc‘ => ‘按钮文字‘, ‘std‘ => ‘点击查看‘, ‘type‘ => ‘text‘);
  10. $options[] = array(‘id‘ => ‘site_tuijian_url‘ , ‘desc‘ => __(‘按钮链接‘, ‘haoui‘), ‘std‘ => ‘http://www.andykwok.cc/‘, ‘type‘ => ‘text‘);
  11. $options[] = array(‘id‘ => ‘site_tuijian_blank‘ , ‘std‘ => false, ‘desc‘ => __(‘新窗口打开‘, ‘haoui‘), ‘type‘ => ‘checkbox‘);
  12.  
  13. $options[] = array(‘name‘ => __(‘联系我们‘, ‘haoui‘), ‘type‘ => ‘heading‘);
  14. $options[] = array(‘id‘ => ‘site_aboutus_s‘, ‘std‘ => false, ‘desc‘ => __(‘显示联系我们模块‘, ‘haoui‘), ‘type‘ => ‘checkbox‘);
  15. $options[] = array(‘name‘ => __(‘显示标题‘, ‘haoui‘), ‘id‘ => ‘site_aboutus_title‘, ‘desc‘ => ‘可自定义,默认:联系我们‘, ‘std‘ => ‘联系我们‘, ‘type‘ => ‘text‘);
  16. $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找开,搜索:

  1. echo "\t\t</ul>\r\n\t</div>\r\n";

在其实上面添加以下代码:

  1. if ($s_aboutus && _hui("site_aboutus_s")) {
  2. echo "\t\t\t\t<li class=\"item item-04";
  3. echo $s_aboutus && !$s_notice ? " active" : "";
  4. echo "\">\r\n\t\t\t\t\t<h2>\r\n\t\t\t\t\t\t";
  5. echo _hui("site_aboutus_text") ? _hui("site_aboutus_text") : "联系我们";
  6. echo "\t\t\t\t\t</h2>\r\n\t\t\t\t</li>\r\n\t\t\t";

搜索:

  1.  echo "\t\t</ul>\r\n\t\t<ul class=\"widget-navcontent\">\r\n\t\t\t";

在其上面添加以下代码:

  1. if ($s_tuijian) {
  2. echo "<li";
  3. echo $s_tuijian && !$s_notice ? " class=\"active\"" : "";
  4. echo ">强烈推荐</li>";
  5. }
  6. if ($s_aboutus) {
  7. echo "<li";
  8. echo $s_aboutus && !$s_notice ? " class=\"active\"" : "";
  9. echo ">联系我们</li>";

搜索:

  1. _moloader("mo_get_user_page", false);

在其后添加以下代码:

  1.  $s_tuijian = _hui("site_tuijian_s");
  2. $s_aboutus = _hui("site_aboutus_s");

PS:将更改过的options.php和mo_notice.php文件上传覆盖(注意备份),上传文件后登陆后台,然后在外观DUX主题设置中找到推荐和联系模板开启即可。


版权所有 域名频道(www.dns110.com) 沪ICP备05004089号