欢迎访问 舍力博客(www.shuyong.net)
<?php //获取含图片的最新文章 function sheli_img(){ $db = MySql::getInstance(); $sql = "SELECT blogid as g,filepath,(SELECT title FROM ".DB_PREFIX."blog where `gid`=g) as t FROM ".DB_PREFIX."attachment WHERE `filepath` LIKE '%jpg' OR `filepath` LIKE '%gif' OR `filepath` LIKE '%png' GROUP BY `blogid` ORDER BY `addtime` DESC LIMIT 0, 8"; $imgs = $db->query($sql); while($row = $db->fetch_array($imgs)){ $img .= '<li><a href="'.Url::log($row['g']).'" target="_blank" title="'.$row['t'].'"><img src="'.BLOG_URL.substr($row['filepath'],3,strlen($row['filepath'])).'" alt="'.$row['t'].'" /><span class="title">'.$row['t'].'</span></a></li> ';} echo $img;} sheli_img(); ?>
<?php $newtws_cache = $CACHE->readCache('newtw');echo $newtws_cache[0]['t'];?>
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。