Exemple #1
0
 $pros['name'][$pcount] = $row['name'];
 $pros['model'][$pcount] = $row['model'];
 $pros['pic'][$pcount] = $row['pic'];
 $pros['dis'][$pcount] = $row['dis'];
 $pros['hot'][$pcount] = $row['hot'];
 $pros['new'][$pcount] = $row['new'];
 $pros['ord'][$pcount] = $row['ord'];
 if (empty($row['pic'])) {
     $pros['picurl'][$pcount] = '';
 } else {
     $pics = rtrim($row['pic'], ',');
     $pics = explode(',', $pics);
     sort($pics);
     //重新Sequence
     $pic = $pics[0];
     $pros['picurl'][$pcount] = getPicThumb($pic);
     //取得第一个圖片的url
 }
 $csql = "select path,name from `th_pro_class` where id=" . $row['cid'];
 $cquery = $db->query($csql);
 $crow = $db->fetch_array($cquery);
 $paths = explode('-', $crow['path']);
 $c = count($paths);
 //去0
 $varpath = "";
 for ($i = 0; $i < $c - 1; $i++) {
     $nsql = "select name from `th_pro_class` where ord='" . $paths[$i + 1] . "'";
     $nquery = $db->query($nsql);
     $nrow = $db->fetch_array($nquery);
     $varpath .= $nrow['name'] . '<br>↓<br>';
 }
Exemple #2
0
?>
      <div class="clear"></div>
      </ul>
      <!--<div><img src="images/pmt.png" width="960" height="120"></div>-->
	  <div style="color:#FA4511;font-weight:bold;margin-left:10px;margin-top:15px;margin-bottom:15px;font-size:24px;border-bottom:3px #FA4511 solid;width:140px;">Promotions</div>
      <ul>
      <?php 
$sql = "select id,name,pic from `th_pro_content` where dis=1 order by ord desc,id desc limit 8,16";
$query = $db->query($sql);
while ($row = $db->fetch_array($query)) {
    $pics = rtrim($row['pic'], ',');
    $pics = explode(',', $pics);
    sort($pics);
    $pic = $pics[0];
    if ($pic) {
        $picurl = getPicThumb($pic);
        $pic = '<img src="' . HOST . $picurl . '" alt="' . $name . '"/>';
    } else {
        $pic = '<img src="' . HOST . '/images/NoPic.jpg" alt="NoPic"/>';
    }
    $pname = $row['name'];
    $pid = $row['id'];
    ?>
      <li><?php 
    echo $pic;
    ?>
<h3><?php 
    echo $pname;
    ?>
</h3></li>
      <?php