0分类的默认显示在首页.不同的分类id号.会自动显示在相应频道

一,/diy/dayrui/models/Navigator_model.php100行 及174行增加  'cateid' => $data['cateid']二,/diy/dayrui/controllers/admin/Navigator.php322行及429增加'cateids' => $this->select_category($this->category_share_model->get_data(), $data['cateid'], 'name=\'data[cateid]\'', fc_lang('只在首页显示')),46行 增加'cateid' => array('ismain' => 1,'fieldname' => 'cateid','fieldtype' => 'Text','setting' => array('option' => array('width' => 200,))),172行 增加$str.= "<td>\$cateid</td>";100行左右增加一行,引入category_share_model模型$this->load->model('navigator_model');$this->load->model('category_share_model');并在里面增加一个函数.用来读取所有分类public function select_category($data, $id = 0, $str = '', $default = ' -- ', $onlysub = 0, $is_push = 0, $is_first = 0) {$cache = md5(dr_array2string($data).dr_array2string($id).$str.$default.$onlysub.$is_push.$is_first.$this->member['uid']);if ($cache_data = $this->get_cache_data($cache)) {return $cache_data;}$tree = array();$first = 0; // 第一个可用栏目$string = '<select class=\'form-control\' '.$str.'>';if ($default) {$string.= "<option value='0'>$default</option>";}if (is_array($data)) {foreach($data as $t) {// 外部链接不显示if ($t['tid'] == 2) {continue;}// 验证权限if (MODULE_PCATE_POST) {// 父栏目可发布时的权限if ($is_push) {if (IS_MEMBER && !$this->module_rule[$t['id']]['add']) {// 会员中心用户发布权限if ($is_push && $t['child']) {$t['html_disabled'] = 1;} else {continue;}} elseif (IS_ADMIN && !$this->is_category_auth($t['id'], 'add') && !$this->is_category_auth($t['id'], 'edit')) {// 后台角色发布和修改权限if ($is_push && $t['child']) {$t['html_disabled'] = 1;} else {continue;}}} else {// 是否可选子栏目$t['html_disabled'] = $onlysub ? 1 : 0;}// 选中操作$t['selected'] = '';if (is_array($id)) {$t['selected'] = in_array($t['id'], $id) ? 'selected' : '';} elseif(is_numeric($id)) {$t['selected'] = $id == $t['id'] ? 'selected' : '';}} else {// 正常栏目权限if ($is_push && $t['child'] == 0) {if (IS_MEMBER && !$this->module_rule[$t['id']]['add']) {continue;} elseif (IS_ADMIN && !$this->is_category_auth($t['id'], 'add') && !$this->is_category_auth($t['id'], 'edit')) {continue;}}// 选中操作$t['selected'] = '';if (is_array($id)) {$t['selected'] = in_array($t['id'], $id) ? 'selected' : '';} elseif(is_numeric($id)) {$t['selected'] = $id == $t['id'] ? 'selected' : '';}// 是否可选子栏目$t['html_disabled'] = $onlysub && $t['child'] != 0 ? 1 : 0;}// 第一个可用子栏目if ($first == 0 && $t['child'] == 0) {$first = $t['id'];}unset($t['permission'], $t['setting'], $t['catids'], $t['url']);$tree[$t['id']] = $t;}}$str = "<option value='\$id' \$selected>\$spacer \$name</option>";$str2 = "<optgroup label='\$spacer \$name'></optgroup>";$this->load->library('dtree');$this->dtree->init($tree);$string.= $this->dtree->get_tree_category(0, $str, $str2);$string.= '</select>';if ($is_first) {$mark = "value='";$first2 = (int)substr($string, strpos($string, $mark) + strlen($mark));$first = $first2 ? $first2 : $first;}$data = $is_first ? array($string, $first) : $string;if ($tree) {$this->set_cache_data($cache, $data, 7200);}return $data;}三.数据库增加dr_1_navigator  了cateid字段四. 后台模板./diy/dayrui/templates/admin/navigator_index.html<th align="left">{fc_lang('名称')}</th>增加一列
<th align="center" width="80">{fc_lang('友链栏目')}</th>另外,增加或编辑友情链接的模板也要修改.增加分类字段框navigator_add.html里面增加<div class="form-group"><label class="col-md-2 control-label">{fc_lang('所属栏目')}:</label><div class="col-md-9"><label>{$cateids}</label></div></div>五./templates/pc/web/lww885/common/index_list.html 及link.html 模板link.html模板调用修改为<div class="link w_clearfix"><p class="link_t">友情链接</p><div class="link_a">{php $catid=($catid=='')?0:$catid;$query='select * from @#1_navigator where type=4 and cateid='.$catid;}{list action=sql sql='$query' }<a href="{$t.url}">{$t.name}</a>{/list}{$error}
</div>  </div>

POSCMS 后台友情链接增加所属栏目分类功能相关推荐

  1. 易优cms 后台友情链接开启nofollow无效的问题 Eyoucms快速入门

    nofollow 是HTML页面中a标签的属性值.这个标签的意义是告诉搜索引擎"不要追踪此网页上的链接或不要追踪此特定链接".nofollow是HTML页面中a标签的属性值. 有些 ...

  2. POSCMS 后台自定义链接友情链接增加搜索功能

    后台友情太多.管理是个问题.所以增加搜索功能.可以快速定位并删除 一,修改/diy/dayrui/controllers/admin/Navigator.phppublic function inde ...

  3. php实现栏目三种类型,WordPress后台edit-tags.php里无限栏目分类实现

    在 WordPress 里 http://localhost/wordpress3.6.1/wp-admin/edit-tags.php?taxonomy=category 这个链接可以显示 WP 里 ...

  4. 织梦后台友情链接网站Logo图片路径变成flixnk和后台内容编辑器里行内样式变成stxyle...

    后台图片友情链接flink变成fli<x>nk 后台内容编辑器里行内样式变成st<x>yle 解决方法 1.打开 /include/datalistcp.class.php 文 ...

  5. PHPCMS调用后台友情链接代码

    {if !$catid}<div class="yqlj"><div class="hd"><h2>友情链接 / link ...

  6. dede织梦友情链接分类调用代码

    DEDE织梦友情链接分类调用代码 {dede:flink row='24' titlelen="24" typeid="5"} [field:link /] { ...

  7. favicon自动获取_wordpress网站友情链接页面使用DNSPod自动获取网站favicon图标教程...

    在网站的友情链接页面,经常可以看到网站的图标增加美感.在以前,有些是直接使用favicon.ico地址读取,但是确有弊端那就是很多网站首页并没有favicon.ico,就不可靠.还有一部分人采用的是谷 ...

  8. 织梦友链的php文件是什么,织梦调用友情链接方法

    在大型的网站中,友情链接也是有分类的,不同类型的友情链接在放置的位置上还是在模板文件中都对网站有着很大的影响,typeid是调用友情链接分类的,typeid为0或为空时表示全部类型,1为综合网站,2为 ...

  9. 软件_迅速增加博客友情链接[博]

    博客原文地址:脚本_采集博客友情链接 新建博客后,百度收录往往非常慢,除了常规的keywords优化,较易实现且效果较好的就是增加友情链接了. 友情链接的添加可以分成2个步骤 1,找寻博客友情链接 2 ...

最新文章

  1. 【OpenCV 4开发详解】图像二值化
  2. Maven jdk.1.7
  3. rsa加密算法java实例,java实现的RSA加密算法详解
  4. 如何利用CycleGAN实现男女性别转换
  5. jdk1.8之HashMap
  6. 通过实例理解 JDK8 的 CompletableFuture
  7. poj 1847 Tram 最短路 dijkstra、floyed
  8. Windows 7 / Windows 10 安装 IPX/SPX
  9. 3.9 限制root远程登录
  10. [开源]STM32F103RBT6最小系统,LEDx2,KEYx4
  11. Intel® QAT 助力Nginx压缩处理
  12. 原始套接字Raw Socket基础-- WSADATA wsaData(转)
  13. 怎么能快速学会计算机,初学者怎样学习电脑能够快速入门(免费科普电脑基础知识)...
  14. 附加类型”XXXX“的实体失败,因为相同类型的其他实体已具有相同的主键值。在使用 “Attach“ 方法或者将实体的状态设置为 “Unchanged“ 或 “Modified“
  15. chrome浏览器无法访问此网站并且响应时间长的方法
  16. 学习Spherical Harmonics的简记
  17. 2022危险化学品经营单位安全管理人员特种作业证考试题库模拟考试平台操作
  18. ps更换证件照底色(视频版)
  19. 一个程序员的成长进阶路径
  20. Apache Impala: Impala的java开发

热门文章

  1. 税务计算机违规外联整改报告,县地税局开展税务业务专网及其终端“违规外联”检查...
  2. Ubuntu安装ESPNET(搞了一个多月)
  3. Multi-UA V Cooperative Exploringfor the Unknown Indoor EnvironmentBased on Dynamic Target Tracking翻译
  4. iphone及ipad屏幕尺寸参考
  5. 威联通搭建Frp实现内网穿透
  6. linux 信号sigabrt,關於Linux中的SIGABRT信號
  7. iOS m3u8本地缓存播放(控制下载并发、暂停恢复)
  8. Web.17.EL表达式JSTL标签的使用
  9. 会计专业与计算机专业结合复合型,我国会计电算化的现状、问题及对策
  10. 【Neo4j】CQL基本语法