东坡dp超级tag管理

1、调用最新10个tag

<?
$tsql=$empire->query("select * from {$dbtbpre}enewstags order by tagid desc limit 10");
while($tr=$empire->fetch($tsql)){
	$tagurl=dp_itagLink($tr['tagid']);
?>
	<li><a href="" rel="external nofollow" ><?=$tr['tagname']?></a>(<?=$tr['num']?>)</li>
<?}?>

2、按分类调用TAG

<?
$tcsql=$empire->query("select * from {$dbtbpre}enewstagsclass where classid>0 order by classid desc");
while($tcr=$empire->fetch($tcsql)){
	$tagclassurl=dp_itagClassLink($tcr['classid']);
?>
   <div class="showtag">
	<h3><a href="<?=$tagclassurl?>" rel="external nofollow"  rel="external nofollow" ><?=$tcr['classname']?></a></h3>
         <ul>
	<?
	$tsql=$empire->query("select * from {$dbtbpre}enewstags where cid=".$tcr['classid']." order by tagid desc limit 10");
	while($tr=$empire->fetch($tsql)){
		$tagurl=dp_itagLink($tr['tagid']);
	?>
		<li><a href="<?=$tagurl?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ><?=$tr['tagname']?></a>(<?=$tr['num']?>)</li>
	<?
	}
	?>
        </ul>
  </div>
<?
}
?>

3、按照tag拼音字母顺序调用

<?php
$zm_r=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
?>
<div class="zmlist">
	字母:
	<?
	foreach($zm_r as $zm){
	?>
		<a href="#<?=$zm?>" rel="external nofollow" ><?=strtoupper($zm)?></a>
	<?
	}
	?>
</div>
<div class="taglist">
<?
foreach($zm_r as $zm){
?>
<h3><a name="<?=$zm?>"><?=strtoupper($zm)?></a></h3>
<ul>
	<?
		$zsql=$empire->query("select tagid from {$dbtbpre}dp_tagsadd where py like '".$zm."%' order by tagid desc");
		while($zr=$empire->fetch($zsql)){
			$t=$empire->fetch1("select * from {$dbtbpre}enewstags where tagid='$zr[tagid]' limit 1");
			$tagurl=dp_itagLink($zr[tagid]);
			?>
			<li><a href="<?=$tagurl?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ><?=$t['tagname']?></a></li>
			<?
		}
	?>
</ul>
<?
}
?>
</div>

 

4、在栏目页模板,根据tag分类绑定的栏目,调用此栏目下的TAG

<?php
$bdsql=$empire->query("select * from {$dbtbpre}dp_itag_class where modid='$navclassid'");
while($bdr=$empire->fetch($bdsql)){
	$cid=$bdr['classid'];
	$tcsql=$empire->query("select * from {$dbtbpre}enewstagsclass where classid='$cid' order by classid desc");
	while($tcr=$empire->fetch($tcsql)){
		$tagclassurl=dp_itagClassLink($tcr['classid']);
	?>
	   <div class="showtag">
		<h3><a href="<?=$tagclassurl?>" rel="external nofollow"  rel="external nofollow" ><?=$tcr['classname']?></a></h3>
			 <ul>
		<?
		$tsql=$empire->query("select * from {$dbtbpre}enewstags where cid=".$tcr['classid']." order by tagid desc limit 10");
		while($tr=$empire->fetch($tsql)){
			$tagurl=dp_itagLink($tr['tagid']);
		?>
			<li><a href="<?=$tagurl?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow" ><?=$tr['tagname']?></a>(<?=$tr['num']?>)</li>
		<?
		}
		?>
			</ul>
	  </div>
	<?
	}
}
?>

 

 

 

 

 

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

栗子博客 网站 东坡dp超级tag管理 https://www.lizi.tw/web/22646.html

建筑工地上施工员,闲暇时弄个博客打发时间,

常见问题
  • 1、杰齐1.7仅适用于PHP5.2 2、需Zend支持 3、尽量使用宝塔面板 4、尽量使用Windows 系统,关关对Linux支持不太友好。
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

东坡dp超级tag管理-海报

分享本文封面