| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:01:31 2008 ] | [ PHPWind 4.3.2 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 require_once ('global.php'); 3 require_once (R_P.'require/header.php'); 4 require_once (R_P.'require/forum.php'); 5 include_once(D_P.'data/bbscache/forumcache.php'); 6 include_once(D_P.'data/bbscache/forum_cache.php'); 7 8 !$windid && Showmsg('not_login'); 9 !$_G['show'] && Showmsg('groupright_show'); 10 $db_showperpage = 16; 11 12 $fidoff=0; 13 $query = $db->query("SELECT fid,password,allowvisit FROM pw_forums WHERE type!='category'"); 14 while ($rt = $db->fetch_array($query)){ 15 if($db_recycle && $rt['fid'] == $db_recycle || $rt['password'] || $rt['allowvisit'] && strpos($rt['allowvisit'],",$groupid,") === false){ 16 is_numeric($rt['fid']) && $fidoff .= ','.$rt['fid']; 17 } 18 } 19 $sqladd = "a.fid NOT IN($fidoff) AND t.ifcheck=1"; 20 if($pwuser || is_numeric($uid)){ 21 if ($pwuser){ 22 $rt = $db->get_one("SELECT uid,username FROM pw_members WHERE username='$pwuser'"); 23 $errorname = $pwuser; 24 }elseif(is_numeric($uid)){ 25 $rt = $db->get_one("SELECT uid,username FROM pw_members WHERE uid='$uid'"); 26 } 27 if(!$rt){ 28 Showmsg('user_not_exists'); 29 }else{ 30 $uid = $rt['uid']; 31 $owner = $rt['username']; 32 $sqladd .= " AND a.uid='$uid'"; 33 } 34 } 35 36 if(is_numeric($fid) && $fid > 0){ 37 $sqladd .= " AND a.fid='$fid'"; 38 $forumcache = str_replace("<option value=\"$fid\">","<option value=\"$fid\" selected>",$forumcache); 39 } 40 $type_1 = $type_2 = ''; 41 if ($type == 1){ 42 $sqladd .= " AND a.type='img'"; 43 $type_1 = "selected"; 44 } elseif($type == 2) { 45 $sqladd .= " AND a.type!='img'"; 46 $type_2 = "selected"; 47 } 48 if(!$action){ 49 (!is_numeric($page) || $page<1) && $page = 1; 50 $limit = "LIMIT ".($page-1)*$db_showperpage.",$db_showperpage"; 51 $rt = $db->get_one("SELECT COUNT(*) AS sum FROM pw_attachs a LEFT JOIN pw_threads t USING(tid) WHERE $sqladd"); 52 $pages = numofpage($rt['sum'],$page,ceil($rt['sum']/$db_showperpage),"show.php?uid=$uid&fid=$fid&type=$type&"); 53 54 $query = $db->query("SELECT a.aid,a.uid,a.attachurl,a.type,a.fid,a.tid,a.pid,a.name,a.descrip,t.subject,m.username FROM pw_attachs a LEFT JOIN pw_threads t ON t.tid=a.tid LEFT JOIN pw_members m ON m.uid=a.uid WHERE $sqladd ORDER BY aid DESC $limit"); 55 while($rt = $db->fetch_array($query)){ 56 if(file_exists($attachdir.'/'.$rt['attachurl'])){ 57 $rt['a_url']=$attachpath.'/'.$rt['attachurl']; 58 } elseif($attach_url){ 59 $rt['a_url']=$attach_url.'/'.$rt['attachurl']; 60 } else{ 61 continue; 62 } 63 !$rt['pid'] && $rt['pid'] = 'tpc'; 64 $rt['fname'] = $forum[$rt['fid']]['name']; 65 $rt['uploadtime'] = get_date($rt['uploadtime']); 66 if(!$rt['descrip']){ 67 $rt['descrip'] = substrs($rt['subject'],20); 68 } 69 $showdb[] = $rt; 70 } 71 require_once PrintEot('show');footer(); 72 }else{ 73 $rt=$db->get_one("SELECT a.aid,a.uid,a.attachurl,a.type,a.fid,a.tid,a.pid,a.name,a.descrip,t.subject,m.username FROM pw_attachs a LEFT JOIN pw_threads t ON t.tid=a.tid LEFT JOIN pw_members m ON m.uid=a.uid WHERE a.aid='$aid'"); 74 if($rt){ 75 if(file_exists($attachdir.'/'.$rt['attachurl'])){ 76 $rt['a_url']=$attachpath.'/'.$rt['attachurl']; 77 } elseif($attach_url){ 78 $rt['a_url']=$attach_url.'/'.$rt['attachurl']; 79 } 80 }else{ 81 Showmsg('pic_not_exists'); 82 } 83 $uid = $rt['uid']; 84 $type = 1; 85 $owner = $rt['username']; 86 !$rt['pid'] && $rt['pid']='tpc'; 87 !$rt['descrip'] && $rt['descrip'] = substrs($rt['subject'],20); 88 require_once PrintEot('show');footer(); 89 } 90 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |