应该是给这里吧 我也不是很明白 版主帮忙看看那 这个排序是显示最早的 我想反过来显式 就是最新上传的在前面谢谢。。。- $cachefile = S_ROOT.'./data/cache_index_pic.txt';
- if(check_network_cache('pic')) {
- $piclist = unserialize(sreadfile($cachefile));
- } else {
- $sqlarr = mk_network_sql('pic',
- array('picid', 'uid'),
- array('hot'),
- array('dateline'),
- array('dateline','hot')
- );
- extract($sqlarr);
- //显示数量
- $shownum = 12;
- $piclist = array();
- $query = $_SGLOBAL['db']->query("SELECT album.albumname, album.friend, space.username, space.name, space.namestatus, main.*
- FROM ".tname('pic')." main
- LEFT JOIN ".tname('album')." album ON album.albumid=main.albumid
- LEFT JOIN ".tname('space')." space ON space.uid=main.uid
- ORDER BY main.dateline LIMIT 0,$shownum");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- if(empty($value['friend'])) {
- $value['pic'] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
- $piclist[] = $value;
- }
- }
- if($_SGLOBAL['network']['pic']['cache']) {
- swritefile($cachefile, serialize($piclist));
- }
- }
- foreach($piclist as $key => $value) {
- realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
- $piclist[$key] = $value;
- }
复制代码 |