首页
模板
模板分类
整站模板
商铺模板
功能插件
会员中心
企业官网
授权
定制
设计稿
设计稿分类
平台网站
企业官网
案例
案例分类
企业官网
B2B网站
行业平台
外贸平台
百科
百科分类
热门搜索
答网友问
技术文章
联系
联系我们
微信联系
标签大全
高级标签
系统标签
系统常量
系统常用变量
系统函数
网站设置
各模块连接
各模块名称
会员模块常用调用
会员信息
通用调用
头部header区域
底部footer区域
常用调用
常用调用
列表页
通用
供应
供应-求购-商城共用
知道
商城
公司
内容页
通用
文章
品牌
商铺页
商铺页
手机版
手机版
当前频道点击排行
<!--{tag("moduleid=$moduleid&condition=status=3 and addtime>$today_endtime-30*86400&catid=$catid&areaid=$cityid&order=hits desc&pagesize=".$MOD[page_shits])}-->
当前频道推荐1的文章
<!--{tag("moduleid=$moduleid&condition=status=3 and level=1&catid=$catid&areaid=$cityid&order=".$MOD[order]."&pagesize=".$MOD[page_srec])}-->
推荐图文
<!--{tag("moduleid=$moduleid&length=20&condition=status=3 and level=3 and thumb!=''&catid=$catid&areaid=$cityid&pagesize=".$MOD[page_srecimg]."&order=".$MOD[order]."&width=120&height=90&cols=2&template=thumb-table")}-->
万能子分类调用
<!--{php $tags=tag("table=category&condition=moduleid=5 and parentid=0&order=catid desc&template=null")}--> {loop $tags $t} <a href="{cat_url($t[catid])}">{$t[catname]}</a> {/loop} 可以调用任意分类的子分类, moduleid=5为模块id parentid=0 为上级分类id 调用顶级分类时为 0
多表联查指定分类的公司和会员信息
<!--{php $tags=tag("table=dt_member m,dt_company c&prefix=&condition=m.userid=c.userid and catids like '%,".$catid.",%'&catid=$catidareaid=$cityid&pagesize=10&page=$page&showpage=1&order=c.vip desc&template=list-company");}-->
随机排序
rand() 这个用在调用信息时随机排序时在调用标里使用, 示例 &order=rand()
调用指定行业的公司
<!--{tag("moduleid=4&condition=groupid=6&fenlei=1 and and catids like '%,".$catid.",%'&catid=3&areaid=$cityid&pagesize=2&order=fromtime desc&template=c_tu")}--> 指定行业语句 catids like '%,".$catid.",%'&catid=3
调用当前栏目名称
function cat_name($CAT) { global $MODULE, $db; if(!$CAT) return ''; $arrparentids = $CAT['catid']; $arrparentid = explode(',', $arrparentids); $pos = ''; $target = $target ? ' target="_blank"' : ''; $CATEGORY = array(); $result = $db->query("SELECt catid,moduleid,catname,linkurl FROM {$db->pre}category WHERe catid=($arrparentids)"); while($r = $db->fetch_array($result)) { $CATEGORY[$r['catid']] = $r; } foreach($arrparentid as $catid) { if(!$catid || !isset($CATEGORY[$catid])) continue; $pos .= ''.$CATEGORY[$catid]['catname'].''; } return $pos; } 在include/global.func.php里面插入这段代码,前台可以用{cat_name($CAT)}来获取当前栏目名称
距离发布时间函数
function timetodate2($show_time) { $now_time = date("Y-m-d H:i:s",time()); $now_time = strtotime($now_time); $dur = $now_time - $show_time; if($dur < 0){ return $the_time; }else{ if($dur < 60){ return $dur.'秒前'; }else{ if($dur < 3600){ return floor($dur/60).'分钟前'; }else{ if($dur < 86400){ return floor($dur/3600).'小时前'; }else{ if($dur < 259200){//3天内 return floor($dur/86400).'天前'; }else{ return date("Y-m-d H:i:s",$show_time); } } } } } }
公司LOGO调用方法
1、在/include中 查找到 global.func.php 这个文件 在这个文件中添加一个函数: function get_company_setting($userid, $key = '', $cache = '') { global $db; if($key) { $r = $db->get_one("SELECt * FROM {$db->pre}company_setting WHERe userid=$userid AND item_key='$key'", $cache); return $r ? $r['item_value'] : ''; } else { $setting = array(); if($cache) { $query = $db->query("SELECt * FROM {$db->pre}company_setting WHERe userid=$userid", $cache); } else { $query = $db->query("SELECt * FROM {$db->pre}company_setting WHERe userid=$userid", $cache); } while($r = $db->fetch_array($query)) { $setting[$r['item_key']] = $r['item_value']; } return $setting; } } 这个函数在module->company->global.func.php 中也有直接复制就行了 同时删掉 这个文件中的 这个函数,不然进company 会因为加载了两个同名函数而报错! 2、在首页需要显示logo的地方运用此函数 <!--{php $tags=tag("table=category&condition=parentid=0 and moduleid=4&order=listorder asc&template=null");}--> {loop $tags $i $t} <div id="xHTabC_{$i+1}" {if $i==0}class="newcar_con" style="display: block;margin-top: 10px; min-height:110px;"{/if} {if $i>0} class="newcar_con" style="display: none;margin-top: 10px; min-height:110px; "{/if} > <ul> <!--{php $tags2=tag("moduleid=4&condition=vip>0 and level>0 and catids like '%,".$t[catid].",%'&order=fromtime desc&template=null");}--> {loop $tags2 $t2} <li style="width:130px; overflow:hidden; float:left; min-height:110px;"> <div style="width:130px;text-align: center; height:110px; overflow:hidden; float:left; padding:0px"> <a href="{$t2[linkurl]}" target="_blank"><img src="{get_company_setting($t2[userid], $key = 'logo', $cache = '')}" width="80" height="80" alt=""/> <br><span>{$t2[company]}</span></a></div> </li> {/loop} </ul> </div> {/loop}
隔行加class
{if ($key%2==0)} class="top_end"{else} {/if} 从第一行加起 {if ($key%2==1)} class="top_end"{else} {/if} 从第二行加起
当日信息加红
列表页修改方法: module/sell/list.inc.php加上 $timetoday = strtotime(date("Y-m-d",time()));//今天0点的时间点 查找while($r = $db->fetch_array($result)) {后面的 $r['editdate'] = timetodate($r['edittime'], 5); 替换成 if ($r['edittime']>$timetoday){ $r['editdate'] = '<span style="color:red">'.timetodate($r['edittime'], 5).'</span>'; }else { $r['editdate'] = timetodate($r['edittime'], 5); } 在template/default/tag/list-sell.htm 查找{timetodate($t[edittime], $datetype)} 替换成 {$t[editdate]}
按用户发贴数量排名
功能:在任何需要的地方调用户公司排行,按该公司某个频道所发布的信息数量排序,发的多得排前面。 步骤: 在公共函数文件中添加以下函数 路径 include/global.func.php function ask_fxb($page) { global $db; $cat = array(); $page = intval($page); $result = $db->query("select b.username,b.linkurl,b.company,count(itemid) as nums from {$db->pre}know_answer as a,{$db->pre}company as b where a.username = b.username group by b.userid order by nums desc LIMIT 0,$page", 'CACHE'); while($r = $db->fetch_array($result)) { $cat[] = $r; } return $cat; } 在模板中调用 {php $tags=ask_fxb(3);} {loop $tags $i $t} <strong>{$i+1}</strong> <div class="today-laywer"> <a href="{$t[linkurl]}" target="_blank">{$t[company]}律师</a> </div> <em>[{$t[nums]}]</em> {/loop} 以上实例为我做项目时调用的问答频道回答数排名,调用数量为三条,如需要修改调用数量,修改ask_fxb(3)中的3即可。 函数解析: 如果要按用户在其它频道的发布数量排名,把{$db->pre}know_answer 改成其它频道的表即可,如供应的是 {$db->pre}sell_5 求购的是 {$db->pre}buy_6 function ask_fxb($page) { global $db; $cat = array(); $page = intval($page); $result = $db->query("select b.username,b.linkurl,b.company,count(itemid) as nums from {$db->pre}know_answer as a,{$db->pre}company as b where a.username = b.username group by b.userid order by nums desc LIMIT 0,$page", 'CACHE'); while($r = $db->fetch_array($result)) { $cat[] = $r; } return $cat; }
指分类的子分类
{php $maincata = get_maincat($child ? $catid : 77, $moduleid)} {loop $maincata $k $v} <a href="{$MOD[linkurl]}{$v[linkurl]}">{set_style($v[catname],$v[style])}{if !$cityid}({$v[item]}){/if}</a> {/loop} 其中的77为顶级分类的id
调用某一分类的信息
<!–{php $tags=tag (“moduleid=5&catid=1&length=40&condition=status=3&pagesize=10&datetype=2&order=ad dtime desc&template=null”);}–> {loop $tags $i $t} 这里是循环模板 {/loop} 其中 &catid=1 中的1为地区id 换成你要调用的即可。
调用某一地区的信息
<!–{php $tags=tag (“moduleid=5&areaid=1&length=40&condition=status=3&pagesize= 10&datetype=2&order=ad dtime desc&template=null”);}–> {loop $tags $i $t} 这里是循环模板 {/loop} 其中 &areaid=1 中的1为地区id 换成你要调用的即可。
调用地区
{php $mainarea = get_mainarea(0, $AREA)} {loop $mainarea $k $v} {if $k%2==0}<tr>{/if} <td><a href=”{$MOD[linkurl]}{rewrite(‘search.php?areaid=’.$v['areaid'].’&typeid=’.$typeid)}”>{$v[areaname]}</a></td> {if $k%2==1}</tr>{/if} {/loop} </table> 这个用于在模块首页,列表调用
最新供应信息
<!--{php $tags=tag("moduleid=5&condition=status=3&length=34&condition=status=3&pagesize=5&order=addtime desc&template=null");}--> {loop $tags $k $t} <li><span class="f_r">[{area_pos($t[areaid], '/', 1)}]</span><a href="{$t[linkurl]}" target="_blank" title="{$t[alt]}">{$t[title]}</a></li> {/loop}
热搜关健词调用
<!--{tag("moduleid=$searchid&table=keyword&condition=moduleid=$searchid and status=3&pagesize=10&order=total_search desc&template=list-search_kw")}-->
网站菜单调用
{loop $MODULE $m}{if $m[ismenu] && !$m[islink]}<a href="javascript:void(0);" onclick="setModule('{$m[moduleid]}','{$m[name]}')">{$m[name]}</a>{/if}{/loop}
咨询电话
13878897862
微信咨询
业务咨询