企业分站如何调用图片信息的二级分类

日期: 2021-09-23 12:43:45 人气: -

<!--?php require_once(dirname(__FILE__).'/include/config.inc.php');
//初始化参数检测正确性
$cid = empty($cid) ? 5 : intval($cid);
$tid = empty($tid) ? 5 : intval($tid);
?-->

 

 

在调用的页面顶上一定要加上这段代码“5”就是你要调用图片列表里面 ID

 

<?php
                        $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `parentid`=5 AND `checkinfo`=true ORDER BY orderid ASC");
                        while($row = $dosql->GetArray())
                        {
                                echo '<li><h3>'.$row['classname'].'</h3><ul>';
       
                                $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `parentid`=".$row['id']." AND `checkinfo`=true ORDER BY orderid ASC",$row['id']);
                                while($row2 = $dosql->GetArray($row['id']))
                                {
                                        $gourl = 'product.php?cid='.$row2['id'];

                                        echo '<li><a href="'.$gourl.'"';
                                        if($tid == $row2['id']) echo 'class="on"';
                                        echo '>'.$row2['classname'].'</a></li>';
                                }
                               
                                echo '</ul></li>';
                        }
                        ?>

这里是调用栏目代码
注意我已经将伪静态规则去掉了。