//****************首頁顯示最新相冊***************************
//WiWet.com Toufu製作
case 'supe_image_index':
global $supe;
supe_dbconnect();
$limit = 10;
$conditions = 'WHERE tblITEM.folder=1 AND tblITEM.type=\'image\' AND tblITEM.itemid=tblIMG.itemid';
$query = $supe['db']->query("SELECT tblITEM.itemid, tblITEM.username, tblITEM.subject, tblIMG.image, tblIMG.imagenum FROM {$supe[tablepre]}spaceitems tblITEM, {$supe[tablepre]}spaceimages tblIMG $conditions ORDER BY dateline DESC LIMIT $limit", 'SILENT');
$additem = '';
$items = array();
while($item = $supe['db']->fetch_array($query))
{
$imgsrc = '<img src="http://www.tshopping.com.tw/attachments/'.$item['image'].'" title="'.$item['subject'].' ('.$item['imagenum'].'張) - '.$item['username'].'" width="160" height="120" >';
$items[] = '<em><a href="'.$supe['siteurl'].'?action/viewspace/itemid/'.$item['itemid'].'.html" target="_blank">'.$imgsrc.'</a></em> ';
}
if($items)
{
for($i = 0; $i < $limit; $i++)
{ $additem .=$items[$i];}
}
else
{
$additem = 'SQL error, cannot select anything';
}
$data = $additem;
break;
//****************首頁顯示最新相冊***************************
歡迎光臨 TShopping (http://www.tshopping.com.tw/) | Powered by Discuz! X3.2 |