如果有人用我那个Emlog6.0特别版
下面介绍友情分类获取方式
效果可以去我邻居看
获取所有链接分类
- <?php
- function getLinkSort(){
- global $CACHE;
- $sortlink_cache = $CACHE->readCache('sortlink'); ?>
- <?php foreach($sortlink_cache as $value):?>
- <li sid="<?php echo $value['linksort_id']; ?>"><?php echo $value['linksort_name']; ?></li>
- <?php endforeach; ?>
- <?php }?>
按分类显示链接
- <?php
- function sortLinks(){
- $db = Database::getInstance();
- global $CACHE;
- $sortlink_cache = $CACHE->readCache('sortlink');
- foreach($sortlink_cache as $value){
- $out .= '<dl id="item'.$value['linksort_id'].'"><dt>'.$sortlink_cache[$value['linksort_id']]['linksort_name'].'</dt><ul>';
- $links = $db->query ("SELECT * FROM ".DB_PREFIX."link WHERE linksortid='$value[linksort_id]' AND hide='n' order by id DESC");
- while ($row = $db->fetch_array($links)){
- $out .='<li><a href="'.$row['siteurl'].'" title="'.$row['description'].'" target="_blank">'.$row['sitename'].'</a></li>';
- }
- $out .='</ul></dl>';
- }
- echo $out;
- }?>
获取指定分类链接
- <?php
- function getOneSortLink($num) {
- $db = Database::getInstance();
- $sql = "SELECT * FROM ".DB_PREFIX."link WHERE linksortid='1' and hide='n' LIMIT 0,$num";
- $list = $db->query($sql);
- while($row = $db->fetch_array($list)){ ?>
- <a href="<?php echo $row['siteurl']; ?>" target="_blank"><?php echo $row['sitename']; ?></a>
- <?php } ?>
- <?php } ?>
更喜欢分类显示
@闲鱼: 我也是,分类比较清楚些