《CMS案例:phpcms v9其它模板调用友情链接分类及分类下的所有内容》要点:
本文介绍了CMS案例:phpcms v9其它模板调用友情链接分类及分类下的所有内容,希望对您有用。如果有疑问,可以联系我们。
相关主题:PHPCMS教程
- phpcms/modules/link/classes/link_tag.class.php
- publicfunction type_lists($data) {
- if (!in_array($data['listorder'], array('desc', 'asc'))) {
- $data ['listorder'] = 'desc';
- }
- $sql = array('module'=>ROUTE_M,'siteid'=>$data['siteid']);
- $r = $this->type_db->select($sql, '*', $data['limit'], 'listorder '.$data['listorder']);
- return new_html_special_chars($r);
- }
CMS教程修改为:
- publicfunction type_lists($data) {
- if (!in_array($data['listorder'], array('desc', 'asc'))) {
- $data ['listorder'] = 'desc';
- }
- $sql = array('module'=>'link','siteid'=>$data['siteid']);
- $r = $this->type_db->select($sql, '*', $data['limit'], 'listorder '.$data['listorder']);
- return new_html_special_chars($r);
- }
- {pc:link action="type_lists" listorder="desc" siteid="$siteid"}
- {loop $data $type_v}
- <div class="map_main main">
- <div class="m_map_fenlei">
- <a href="{$r[url]}"> <span>{$type_v[name]}</span></a>
- </div>
- <div class="h10"></div>
- <div class="m_map_lanmu">
- //维易PHP培训网 http://www.bcty365.com
- <ul>
- {pc:link action="lists" typeid="$type_v['type_id']" siteid="$siteid" linktype="1" order="desc" num="20" return="dat"}
- {loop $dat $v}
- <li><a href="{$v['url']}">{$v['name']}</a>|</li>
- {/loop} {/pc}
- {pc:link action="lists" typeid="$type_v['type_id']" siteid="$siteid" linktype="0" order="desc" num="20" page="$_GET[page]" return="dat"}
- {loop $dat $v}
- <li><a href="{$v['url']}">{$v['name']}</a>|</li>
- {/loop} {/pc}
- </ul>
- <div class="h10 clear "></div>
- </div>
- <div class="h30 top_border map_main" ></div>
- {/loop}
- {/pc}
CMS教程
转载请注明本页网址:
http://www.vephp.com/jiaocheng/6008.html