WC写的其他表相关信息调用,可以设定关联的表,数目
把下面标签信息复制另存为.bq格式,在后台导入,再按提示操作
相关文章<!--#empirecms.bq-phome.net#--!><p>表名:如 download,shop,photo</p><p>调用条数(选填):默认10条</p><!--#empirecms.bq-phome.net#--!>user_getotherkeys<!--#empirecms.bq-phome.net#--!>getotherkeys<!--#empirecms.bq-phome.net#--!>[getotherkeys]表名,条数[/getotherkeys]<!--#empirecms.bq-phome.net#--!>//---------------------------其他表相关文章 function user_getotherkeys($tbname,$sum=10){ global $empire,$navinfor; if(empty($navinfor['keyboard'])) { return ""; } $showdate='m-d'; //时间格式 $keyr=explode(',',$navinfor['keyboard']); $count=count($keyr); $keys=''; for($i=0;$i<$count;$i++) { if($i==0) { $or=''; } else { $or=' or '; } $keys.=$or."keyboard like '%".$keyr[$i]."%'"; } $sql=$empire->query('select * from phome_ecms_' . $tbname . ' where ('.$keys.') and titlepic<>\'\' and id<>'.$navinfor[id].' order by id limit '.$sum); while ($r = $empire->fetch ($sql)) { $titlerul=sys_returnbqtitlelink($r); $newstime=format_datetime($r['newstime'],$showdate); $r[smalltext]=sub($r[smalltext],0,70,false); $tkey.='<li class="img70x53"><div class="thumb"><a href="'.$titlerul.'" target="_blank"><img src="'.$r[titlepic].'" alt="'.$r[title].'" width="70" height="53"></a></div><p class="info"> <strong> <a href="'.$titlerul.'" title="'.$r[title].'">'.$r[title].'</a> </strong>'.$r[smalltext].'</p></li>'; } echo $tkey; }
其中70为截取的简介数 $r[smalltext]=sub($r[smalltext],0,70,false);
注:经测试,极耗资源,只适合数据少或者追求特殊效果的网站使用。标签里是我自己加的格式,要实现不同格式请自行修改。WC已承诺下个版本将会加强相关信息标签
演示: http://www.itdream.com.cn/design-pop/1314.html 效果如图:
上传以下图片:

|