| [ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/e_list.php,v $ 14 | $Revision: 1.8 $ 15 | $Date: 2006/05/17 18:10:23 $ 16 | $Author: mcfly_e107 $ 17 +----------------------------------------------------------------------------+ 18 */ 19 if (!defined('e107_INIT')) { exit; } 20 21 if(!$forum_install = $sql -> db_Select("plugin", "*", "plugin_path = 'forum' AND plugin_installflag = '1' ")) 22 { 23 return; 24 } 25 26 $LIST_CAPTION = $arr[0]; 27 $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); 28 29 $bullet = $this -> getBullet($arr[6], $mode); 30 31 if($mode == "new_page" || $mode == "new_menu" ) 32 { 33 $lvisit = $this -> getlvisit(); 34 $qry = " 35 SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies 36 FROM #forum_t AS t 37 LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id 38 LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 39 LEFT JOIN #user AS u ON t.thread_user = u.user_id 40 LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id 41 WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' 42 AND t.thread_datestamp > $lvisit 43 ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]); 44 } 45 else 46 { 47 $qry = " 48 SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name 49 FROM #forum_t AS t 50 LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 51 LEFT JOIN #user AS u ON t.thread_user = u.user_id 52 LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id 53 WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' 54 ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]); 55 56 } 57 58 if(!$results = $sql->db_Select_gen($qry)) 59 { 60 $LIST_DATA = LIST_FORUM_2; 61 } 62 else 63 { 64 $forumArray = $sql->db_getList(); 65 $path = e_PLUGIN."forum/"; 66 67 foreach($forumArray as $forumInfo) 68 { 69 extract($forumInfo); 70 71 //last user 72 $r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, ".")); 73 $r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1)); 74 if (strstr($thread_lastuser, chr(1))) { 75 $tmp = explode(chr(1), $thread_lastuser); 76 $r_name = $tmp[0]; 77 } 78 $thread_lastuser = $r_id; 79 80 //user 81 $u_id = substr($thread_user, 0, strpos($thread_user, ".")); 82 $u_name = substr($thread_user, (strpos($thread_user, ".")+1)); 83 $thread_user = $u_id; 84 85 if ($thread_anon) { 86 $tmp = explode(chr(1), $thread_anon); 87 $thread_user = $tmp[0]; 88 $thread_user_ip = $tmp[1]; 89 } 90 91 $gen = new convert; 92 $r_datestamp = $gen->convert_date($thread_lastpost, "short"); 93 if($thread_total_replies) 94 { 95 $LASTPOST = ""; 96 if($lp_name) 97 { 98 $LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>"; 99 } 100 else 101 { 102 if($thread_lastuser{0} == "0") 103 { 104 $LASTPOST = substr($thread_lastuser, 2); 105 } 106 else 107 { 108 //$LASTPOST = NFPM_L16; 109 } 110 } 111 $LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>"; 112 } 113 else 114 { 115 $LASTPOST = " - "; 116 $LASTPOSTDATE = ""; 117 } 118 119 if($parent_name == "") 120 { 121 $parent_name = $thread_name; 122 } 123 $rowheading = $this -> parse_heading($parent_name, $mode); 124 if($parent_id) 125 { 126 $lnk = $thread_id.".post"; 127 } 128 else 129 { 130 $lnk = $thread_id; 131 } 132 $HEADING = "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>"; 133 $AUTHOR = ($arr[3] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : ""); 134 $CATEGORY = ($arr[4] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : ""); 135 $DATE = ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : ""); 136 $ICON = $bullet; 137 $VIEWS = $thread_views; 138 $REPLIES = $thread_total_replies; 139 if($thread_total_replies) 140 { 141 $INFO = "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]"; 142 } 143 else 144 { 145 $INFO = "[ ".LIST_FORUM_3." ".intval($tviews)." ]"; 146 } 147 $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); 148 } 149 } 150 151 152 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |