query($sql); $f = 0; $list = ""; while($row=$db->fetch_array($rs)){ $photo = get_attachment("node",$row['id'],"cover"); if(file_exists("./".$photo["path"].'original/'.$photo["file_name"])){ list($width, $height, $type, $attr) = getimagesize("./".$photo["path"].'original/'.$photo["file_name"]); if($height<=$width){ $imgset = 'width="119"'; }else{ $imgset = 'height="149"'; } $img = ''; } else { if($row['cover']!=0&&$row['cover']!='') { $sql_cover = "SELECT * FROM `file_managed` WHERE `fid` = '".$row['cover']."' AND `status` = '1' LIMIT 0,1"; $row_cover = $db->getrow($sql_cover); if($row_cover['filename']!=''){ if( file_exists('./upload/products/original/'.$row_cover['filename'])){ list($width, $height, $type, $attr) = getimagesize('./upload/products/original/'.$row_cover['filename']); if($height<=$width){ $imgset = 'width="119"'; }else{ $imgset = 'height="149"'; } $img = ''; } else { $img = ''; } } else { $img = ''; } } else { $img = ''; } } if ($f == 0) { $list .= ''; } $padding = 'class="padding_new_arrival"'; if ($f == 4) $padding = ''; $list .= '
'.$img.'
'.$row['title'].'
'; $f++; if ($f == 5) { $list .= ''; $f = 0; } } if ($f > 0 && $f < 5) { while($f > 0 && $f < 5) { $list .= ''; $f++; } $list .= ''; $f = 0; } $sql = "SELECT * FROM `news` where `display` = '1' ORDER BY `sorting` ASC, `date` DESC LIMIT 0,4"; $rs = $db->query($sql); $news_list = ""; $f = 0; while($row=$db->fetch_array($rs)){ $photo = get_attachment("news",$row['id'],"photo"); $class='news_item_right'; if($f%2==0) $class='news_item'; $news_list .= '
'.$row['date'].'
'.$row['name'].'
'; if($f%2==1) $news_list .='
'; $f++; } $sql = "SELECT * FROM `node` where `status` = '1' AND `type` = 'book' AND `popular` <> '0' ORDER BY `popular` ASC LIMIT 0,3"; $rs = $db->query($sql); $popular_list = ""; while($row=$db->fetch_array($rs)){ $photo = get_attachment("node",$row['id'],"cover"); if(file_exists("./".$photo["path"].'original/'.$photo["file_name"])){ list($width, $height, $type, $attr) = getimagesize("./".$photo["path"].'original/'.$photo["file_name"]); if($height<=$width){ $imgset = 'width="98"'; }else{ $imgset = 'height="102"'; } $img = ''; } else { if($row['cover']!=0&&$row['cover']!='') { $sql_cover = "SELECT * FROM `file_managed` WHERE `fid` = '".$row['cover']."' AND `status` = '1' LIMIT 0,1"; $row_cover = $db->getrow($sql_cover); if($row_cover['filename']!=''){ if( file_exists('./upload/products/original/'.$row_cover['filename'])){ list($width, $height, $type, $attr) = getimagesize('./upload/products/original/'.$row_cover['filename']); if($height<=$width){ $imgset = 'width="98"'; }else{ $imgset = 'height="102"'; } $img = ''; } else { $img = ''; } } else { $img = ''; } } else { $img = ''; } } $popular_list .= ''; } $sql = "SELECT * FROM `node` where `status` = '1' AND `type` = 'book' AND `popular` <> '0' ORDER BY `popular` ASC LIMIT 3,7"; $rs = $db->query($sql); $f =0; while($row=$db->fetch_array($rs)){ $class = "popular_item"; if($f==6) $class="popular_item_last"; $popular_list .= '
'; $f++; } ?> Spring Sino