| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:57:59 2008 ] | [ vtiger Forums 1.1 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 ####################################################################### 3 ## ## 4 ## phpBB Fetch All - displays phpBB on any page ## 5 ## ----------------------------------------------------------------- ## 6 ## A portal example file. ## 7 ## ## 8 ####################################################################### 9 ## ## 10 ## Authors: Volker 'Ca5ey' Rattel <ca5ey@clanunity.net> ## 11 ## http://clanunity.net/portal_home.php ## 12 ## ## 13 ## This file is free software; you can redistribute it and/or modify ## 14 ## it under the terms of the GNU General Public License as published ## 15 ## by the Free Software Foundation; either version 2, or (at your ## 16 ## option) any later version. ## 17 ## ## 18 ## This file is distributed in the hope that it will be useful, ## 19 ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## 20 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## 21 ## GNU General Public License for more details. ## 22 ## ## 23 ####################################################################### 24 25 26 // 27 // This path points to the directory where phpBB is installed. Do 28 // not enter an URL here. The path must end with a trailing 29 // slash. 30 // 31 // Examples: 32 // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ccc/ 33 // --> $phpbb_root_path = './'; 34 // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ 35 // --> $phpbb_root_path = './ccc/'; 36 // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ddd/ 37 // --> $phpbb_root_path = '../ccc/'; 38 // 39 40 $phpbb_root_path = './'; 41 $PHP_SELF = 'portal_home.php'; 42 // 43 // this setting is for the clanunity site - ignore it 44 // 45 // $phpbb_root_path = './forum/'; 46 47 define ('IN_PHPBB', true); 48 49 if (!file_exists($phpbb_root_path . 'extension.inc')) 50 { 51 die ('<tt><b>phpBB Fetch All:</b> 52 $phpbb_root_path is wrong and does not point to your forum.</tt>'); 53 } 54 55 // 56 // phpBB related files 57 // 58 59 include_once ($phpbb_root_path . 'extension.inc'); 60 include_once ($phpbb_root_path . 'common.' . $phpEx); 61 include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx); 62 63 64 // 65 // Fetch All related files - we do need all these because the portal is a 66 // huge example 67 // 68 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx); 69 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.' . $phpEx); 70 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/users.' . $phpEx); 71 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/polls.' . $phpEx); 72 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx); 73 include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/forums.' . $phpEx); 74 75 // 76 // start session management 77 // 78 79 $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length); 80 init_userprefs($userdata); 81 82 // 83 // since we are demonstrating span pages we need to set the page offset 84 // 85 86 if (isset($HTTP_GET_VARS['start']) or isset($HTTP_POST_VARS['start'])) { 87 $CFG['posts_span_pages_offset'] = isset($HTTP_GET_VARS['start']) ? $HTTP_GET_VARS['start'] : $HTTP_POST_VARS['start']; 88 } 89 90 // sorting variable getting from post or get method, added by ashley. 91 $order_type = $HTTP_POST_VARS['order_type'] ? $HTTP_POST_VARS['order_type'] : $HTTP_GET_VARS['order_type']; 92 $order_column = $HTTP_POST_VARS['order_column'] ? $HTTP_POST_VARS['order_column'] : $HTTP_GET_VARS['order_column']; 93 //Added By David For Sorting : 94 if ($order_column != "") 95 { 96 setcookie("cookie_order", "$order_column", time() + 31536000,"/"); 97 } 98 else 99 $order_column = $_COOKIE['cookie_order']; 100 if ($order_type != "") 101 { 102 setcookie("cookie_type", "$order_type", time() + 31536000,"/"); 103 } 104 else 105 $order_type = $_COOKIE['cookie_type']; 106 107 108 109 // fetch new posts since last visit 110 $new_posts = phpbb_fetch_new_posts(); 111 112 // fetch user online, total posts, etc 113 $stats = phpbb_fetch_stats(); 114 115 // fetch five users by total posts 116 $top_poster = phpbb_fetch_top_poster(); 117 118 // fetch a random user 119 $random_user = phpbb_fetch_random_user(); 120 121 // fetch forum structure 122 // example for array 123 //$forums = phpbb_fetch_forums(array(2,3,4,5,6,7,8,11)); 124 $forums = phpbb_fetch_forums(); 125 126 127 // fetch user of a specific group 128 // this function is disabled because fetching without a specific 129 // user group can produces a lot of results (all registered users) 130 // and this may result in an internal server error. If you want to 131 // use this feature please specify the group id. 132 # $member = phpbb_fetch_users(); 133 134 // fetch a poll 135 $poll = phpbb_fetch_poll(); 136 137 // fetch a single topic by topic id 138 $download = phpbb_fetch_topics(0); 139 140 // fetch latest postings 141 $CFG['posts_trim_topic_number'] = 38; 142 $recent = phpbb_fetch_posts(null, POSTS_FETCH_LAST); 143 144 // fetch postings 145 $CFG['posts_trim_topic_number'] = 0; 146 $CFG['posts_span_pages'] = true; 147 $news = phpbb_fetch_posts(); 148 149 // 150 // these settings are for the clanunity site - ignore them 151 // 152 // $forums = phpbb_fetch_forums(5); 153 // $member = phpbb_fetch_users(83); 154 // $poll = phpbb_fetch_poll(12); 155 // $download = phpbb_fetch_topics(623); 156 // $CFG['posts_trim_topic_number'] = 25; 157 // $recent = phpbb_fetch_posts(12, POSTS_FETCH_LAST); 158 // $CFG['posts_trim_topic_number'] = 0; 159 // $CFG['posts_span_pages'] = true; 160 // $news = phpbb_fetch_posts(11); 161 162 // 163 // disconnect from the database 164 // 165 166 include ('includes/page_header.php'); 167 phpbb_disconnect(); 168 169 ?> 170 <!-- 171 <html> 172 <head> 173 <title>Welcome : vtiger Forums</title> 174 <style type="text/css"> 175 </style> 176 <script language="javascript"> 177 function SetLastVisit() 178 { 179 if (!document.LastVisitFrm.search_time.options[0].selected) 180 { 181 document.LastVisitFrm.submit(); 182 } 183 return true; 184 } 185 </script> 186 </head> 187 <body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5493B4"> 188 189 <table align="center" border="0" cellpadding="2" cellspacing="0" width="100%"> 190 191 <tr class="bodyline"> 192 193 <td> 194 --> 195 196 <!-- USER --> 197 <?php if ($userdata) { ?> 198 <center> 199 <table width="99.5%" cellpadding="3" cellspacing="1" border="0" class="forumline"> 200 <?php if ($userdata['session_logged_in']) { ?> 201 <span class="gensmall"> 202 <tr> 203 <td align="right" class="gensmall"><b><a href="<?php echo $phpbb_root_path; ?>privmsg.php?folder=inbox">You have 204 <?php if ($userdata['user_new_privmsg']) { echo $userdata['user_new_privmsg']; } else { echo 'no'; } ?> new message<?php echo $userdata['user_new_privmsg'] == 1 ? '' : 's' ?></a></b></td> 205 <td align="right" class="gensmall"><b><a href="<?php echo $phpbb_root_path; ?>search.php?search_id=newposts">View posts since last visit 206 (<?php echo $new_posts['total']; ?>)</a></b></td> 207 <td align="right" class="gensmall"><b><a href="<?php echo $phpbb_root_path; ?>search.php?search_id=egosearch">View your posts</a></b></td> 208 <td align="right" class="gensmall"><b><a href="<?php echo $phpbb_root_path; ?>search.php?search_id=unanswered">View unanswered posts</a></b></td> 209 </tr> 210 </span> 211 </table> 212 </center> 213 <?php } ?> 214 <?php } ?> 215 <!-- USER --> 216 217 <table border="0" cellpadding="2" cellspacing="1" width="100%"> 218 <tr> 219 <td align="right" width="100%"> 220 <!-- SPAN PAGES --> 221 <span class="gensmall"><b><?php echo phpbb_span_pages($CFG['posts_span_pages_numrows'], $CFG['posts_limit'], $CFG['posts_span_pages_offset'], false); ?></b></span> 222 <!-- SPAN PAGES --> 223 </td> 224 <tr> 225 </table> 226 227 <table border="0" cellpadding="2" cellspacing="1" width="100%"> 228 <tr> 229 <td valign="top" width="50%"> 230 231 232 233 <!-- FORUMS --> 234 235 <?php if ($forums) { ?> 236 <?php $bgcolor ="#E7E6E6" ?> 237 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="forumline"> 238 <tr> 239 <!-- th class="thTop" height="28" colspan="3">Forum</th --> 240 <!-- th class="thTop" height="28">Topics</th> 241 <th class="thTop" height="28">Posts</th --> 242 </tr> 243 <?php $last_cat = -1; ?> 244 <?php for ($i = 0; $i < count($forums); $i++) { ?> 245 246 <?php 247 if ($bgcolor == "#F3F3F3") 248 { 249 $bgcolor = "#F3F3F3"; 250 } 251 else 252 { 253 $bgcolor = "#F3F3F3"; 254 } ?> 255 256 <?php if ($last_cat != $forums[$i]['cat_id']) { ?> 257 <?php $last_cat = $forums[$i]['cat_id']; ?> 258 259 <tr> 260 <td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="<?php echo $phpbb_root_path; ?>index.php?c=<?php echo $forums[$i]['cat_id']; ?>"><font color="#000000"><?php echo $forums[$i]['cat_title']; ?></font></a></span></td> 261 </tr> 262 <?php } ?> 263 <tr> 264 <td bgcolor="<?php echo($bgcolor) ?>" width="5%" nowrap> </td> 265 <td bgcolor="<?php echo($bgcolor) ?>" align="left" width="10%" nowrap> 266 267 <span class="forumlink"> 268 <?php 269 $desc=$forums[$i]['forum_desc']; 270 $desc=strstr($desc, "<a"); 271 ?> 272 <a href="<?php echo $phpbb_root_path; ?>viewforum.php?f=<?php echo $forums[$i]['forum_id']; ?>" class="gensmall"><font color="#993300"><?php echo $forums[$i]['forum_name']; ?></font><?php if ($forums[$i]['topic_trimmed']) { echo '...'; } ?></a></b> 273 </span></td> 274 <td bgcolor="<?php echo($bgcolor) ?>" align="left" ><span class="gensmall"><?php echo($desc); ?></span> 275 </td> 276 </td> 277 </tr> 278 <?php } ?> 279 </table> 280 281 <p/> 282 <?php } ?> 283 <!-- FORUMS --> 284 285 </td> 286 287 288 <td valign="top" width="50%"> 289 290 <!-- RECENT --> 291 292 293 <?php 294 295 //Added By David For Sorting: 296 297 if (($order_type == 'ASEN') || ($order_type == "")) 298 { 299 $order_type = "DESC"; 300 } 301 else 302 { 303 $order_type = "ASEN"; 304 } 305 function swapImage($ocolumn,$orig_ocoloumn,$otype) 306 { 307 $uimage = "<img src=\"images/up.gif\" border=\"0\">"; 308 $dimage = "<img src=\"images/down.gif\" border=\"0\">"; 309 if ($otype == "DESC") 310 { 311 $image = $dimage; 312 } 313 else 314 { 315 $image = $uimage; 316 } 317 318 if ($ocolumn == "" && $orig_ocoloumn == "p.post_time") 319 return $image; 320 if ($ocolumn != $orig_ocoloumn) 321 { 322 $image = ""; 323 } 324 return $image; 325 } 326 327 328 if ($recent) { ?> 329 <?php $bgcolor ="#E7E6E6" ?> 330 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="forumline"> 331 <tr> 332 <!-- th class="forumHeader" height="28" align="center"colspan="4"><span class="thTop">Latest Discussion</span></th --> 333 </tr> 334 <tr> 335 <th align="left"><a href="portal_home.php?order_column=p.post_time&order_type=<?php echo $order_type; ?>"><font face="verdana" color="#000000">Time</font></a> <a href="portal_home.php?order_column=p.post_time&order_type=<?php echo $order_type; ?>"><?php echo swapImage($order_column,'p.post_time',$order_type); ?></a></font></th> 336 <th align="left"><font face="verdana"><a href="portal_home.php?order_column=t.topic_title&order_type=<?php echo $order_type; ?>"><font face="verdana" color="#000000">Latest Posts</font></a> <a href="portal_home.php?order_column=t.topic_title&order_type=<?php echo $order_type; ?>"><?php echo swapImage($order_column,'t.topic_title',$order_type); ?></a></th> 337 <th align="left"><font face="verdana"><a href="portal_home.php?order_column=f.forum_name&order_type=<?php echo $order_type; ?>"><font face="verdana" color="#000000">Forum</font> </a><a href="portal_home.php?order_column=f.forum_name&order_type=<?php echo $order_type; ?>"><?php echo swapImage($order_column,'f.forum_name',$order_type); ?></a></th> 338 <th align="left"><font face="verdana"><a href="portal_home.php?order_column=username&order_type=<?php echo $order_type; ?>"><font face="verdana" color="#000000">Post By</font></a> <a href="portal_home.php?order_column=username&order_type=<?php echo $order_type; ?>"><?php echo swapImage($order_column,'username',$order_type); ?></a></th> 339 </tr> 340 341 <?php for ($i = 0; $i < count($recent); $i++) { ?> 342 <?php 343 if ($bgcolor == "bglaternate1") 344 { 345 $bgcolor = "bglaternate2"; 346 } 347 else 348 { 349 $bgcolor = "bglaternate1"; 350 } ?> 351 <tr> 352 <td class="<?php echo($bgcolor) ?>" align="left" width="1%" nowrap> 353 <span class="gensmall"> 354 <?php echo date($CFG['date_format']. ' ' . $CFG['time_format'], $recent[$i]['post_time']); ?></td> 355 <td class="<?php echo($bgcolor) ?>" align="left" width="52%"> 356 <span class="gensmall"><a href="<?php echo $phpbb_root_path; ?>viewtopic.php?p=<?php echo $recent[$i]['post_id']; ?>#<?php echo $recent[$i]['post_id']; ?>"><font color="#535353"><?php echo $recent[$i]['topic_title']; ?><?php if ($recent[$i]['topic_trimmed']) { echo '...'; } ?></font></a></td> 357 <td class="<?php echo($bgcolor) ?>" align="left" width="30%"><span class="gensmall"><a href="<?php echo $phpbb_root_path; ?>viewforum.php?f=<?php echo $recent[$i]['forum_id']; ?>"><font color="#535353"><?php echo $recent[$i]['forum_name']; ?></font></a></td> 358 <td class="<?php echo($bgcolor) ?>" align="left" width="16%"><span class="gensmall"><a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $recent[$i]['user_id']; ?>"><font color="#535353"><?php echo $recent[$i]['username']; ?></font></a><br /></td> 359 <?php } ?> 360 </span> 361 </td> 362 </tr> 363 </table> 364 <?php } ?> 365 <!-- RECENT --> 366 367 <!-- SPAN PAGES --> 368 <div align="right"> 369 <span class="gensmall"><b><?php echo phpbb_span_pages($CFG['posts_span_pages_numrows'], $CFG['posts_limit'], $CFG['posts_span_pages_offset'], false); ?></b></span> 370 </div> 371 <!-- SPAN PAGES --> 372 373 374 <!-- MEMBER --> 375 <?php if ($member) { ?> 376 <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> 377 <tr> 378 <td class="catHead" height="28"><span class="cattitle"><?php echo $member[0]['group_name']; ?></span></td> 379 </tr> 380 <tr> 381 <td class="row1" align="left" width="100%"> 382 <span class="gensmall"> 383 <?php for ($i = 0; $i < count($member); $i++) { ?> 384 <a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $member[$i]['user_id']; ?>"><b><?php echo $member[$i]['username']; ?></b></a><?php if ($i < (count($member)-1)) { ?>, 385 <?php } ?> 386 <?php } ?> 387 </span> 388 </td> 389 </tr> 390 </table> 391 <?php } ?> 392 <!-- MEMBER --> 393 394 </td> 395 </tr> 396 </table> 397 398 <!--div align="center"><span class="copyright"><br /> 399 Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> <?php echo '2' . $board_config['version']; ?> © 2001, 2002 phpBB Group<br /></span></div> 400 401 </td> 402 </tr> 403 </table> 404 405 </body> 406 </html--> 407 <?php 408 include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 409 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |