# Wtf?

**URL:** <https://forums.speedlife.net/t/wtf/177973>\
**Category:** PittSpeed Off Topic\
**Created:** [November 1, 2005, 12:23pm UTC](https://forums.speedlife.net/t/wtf/177973 "2005-11-01T12:23:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShalerPunk](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/shalerpunk/32/5976_2.png) [@ShalerPunk](https://forums.speedlife.net/u/ShalerPunk)\
**Post date:** [November 1, 2005, 12:23pm UTC](https://forums.speedlife.net/t/wtf/177973/1 "2005-11-01T12:23:00Z")

</div>

INT)); if (! is\_array($foruminfo)) { $forumid = -1; } else { // draw nav bar $navbits = array(); $parentlist = array\_reverse(explode(’,’, substr($foruminfo[‘parentlist’], 0, -3))); foreach ($parentlist AS $forumID) { $forumTitle = $forumcache["$forumID"][‘title’]; $navbits[“forumdisplay.php?$session[sessionurl]f=$forumID”] = $forumTitle; } // pop the last element off the end of the $nav array so that we can show it without a link array\_pop($navbits); $navbits[’’] = $foruminfo[‘title’]; $navbits = construct\_navbits($navbits); } // ### WELCOME MESSAGE ################################################# if ($bbuserinfo[‘userid’]) { // registered user $showmemberwelcome = true; } else { // guest $showmemberwelcome = false; } $today = vbdate(‘Y-m-d’, TIMENOW, false, false); // ### TODAY’S BIRTHDAYS ################################################# if ($vboptions[‘showbirthdays’]) { $birthdaystore = unserialize($datastore[‘birthdaycache’]); if (!is\_array($birthdaystore) OR ($today != $birthdaystore[‘day1’] AND $today != $birthdaystore[‘day2’])) { // Need to update! require\_once(’./includes/functions\_databuild.php’); $birthdaystore = build\_birthdays(); DEVDEBUG(‘Updated Birthdays’); } switch($today) { case $birthdaystore[‘day1’]: $birthdays = $birthdaystore[‘users1’]; break; case $birthdaystore[‘day2’]; $birthdays = $birthdaystore[‘users2’]; break; } // memory saving unset($birthdaystore); $show[‘birthdays’] = iif ($birthdays, true, false); } else { $show[‘birthdays’] = false; } // ### TODAY’S EVENTS ################################################# if ($vboptions[‘showevents’]) { require\_once(’./includes/functions\_calendar.php’); $future = gmdate(‘n-j-Y’ , TIMENOW + 43200 + (86400 \* ($vboptions[‘showevents’] - 1))); $eventstore = unserialize($datastore[‘eventcache’]); if (!is\_array($eventstore) OR $future != $eventstore[‘date’]) { // Need to update! require\_once(’./includes/functions\_databuild.php’); $eventstore = build\_events(); DEVDEBUG(‘Updated Events’); } unset($eventstore[‘date’]); $events = array(); $eventcount = 0; foreach ($eventstore AS $eventid =\> $eventinfo) { $offset = iif (!$eventinfo[‘utc’], $bbuserinfo[‘tzoffset’], $bbuserinfo[‘timezoneoffset’]); $eventinfo[‘dateline\_from\_user’] = $eventinfo[‘dateline\_from’] + $offset \* 3600; $eventinfo[‘dateline\_to\_user’] = $eventinfo[‘dateline\_to’] + $offset \* 3600; $gettime = TIMENOW - $vboptions[‘hourdiff’]; $iterations = 0; if ($bbuserinfo[‘calendarpermissions’]["$eventinfo[calendarid]"] & CANVIEWCALENDAR OR ($eventinfo[‘holidayid’] AND $vboptions[‘showholidays’])) { if ($eventinfo[‘userid’] == $bbuserinfo[‘userid’] OR $bbuserinfo[‘calendarpermissions’]["$eventinfo[calendarid]"] & CANVIEWOTHERSEVENT OR ($eventinfo[‘holidayid’] AND $vboptions[‘showholidays’])) { while ($iterations \< $vboptions[‘showevents’]) { $addcache = false; $todaydate = getdate($gettime); if ($eventinfo[‘holidayid’] AND $eventinfo[‘recurring’] == 6) { if ($eventinfo[‘recuroption’] == “$todaydate[mon]|$todaydate[mday]”) { $addcache = true; } } else if (cache\_event\_info($eventinfo, $todaydate[‘mon’], $todaydate[‘mday’], $todaydate[‘year’])) { $addcache = true; } if ($addcache) { if (!$vboptions[‘showeventtype’]) { $events["$eventinfo[eventid]"][] = $gettime; } else { $events["$gettime"][] = $eventinfo[‘eventid’]; } $eventcount++; } $iterations++; $gettime += 86400; } } } } if (!empty($events)) { ksort($events, SORT\_NUMERIC); foreach($events AS $index =\> $value) { $pastevent = 0; $pastcount = 0; unset($eventdates, $comma, $daysevents); if (!$vboptions[‘showeventtype’]) { // Group by Event // $index = $eventid unset($day); foreach($value AS $key =\> $dateline) { if (($dateline - 86400) == $pastevent AND !$eventinfo[‘holidayid’]) { $pastevent = $dateline; $pastcount++; continue; } else { if ($pastcount) { $eventdates = construct\_phrase($vbphrase[‘event\_x\_to\_y’], $eventdates, vbdate($vboptions[‘dateformat’], $pastevent, false, true, false)); } $pastcount = 0; $pastevent = $dateline; } if (!$day) { $day = vbdate(‘Y-n-j’, $dateline, false, false, false); } $eventdates .= $comma . vbdate($vboptions[‘dateformat’], $dateline, false, true, false); $comma = ‘, ‘; $eventinfo = $eventstore["$index"]; } if ($pastcount) { $eventdates = construct\_phrase($vbphrase[‘event\_x\_to\_y’], $eventdates, vbdate($vboptions[‘dateformat’], $pastevent, false, true, false)); } if ($eventinfo[‘holidayid’]) { $callink = “” . $vbphrase[‘holiday\_title\_’ . $eventinfo[‘varname’]] . “”; } else { $callink = “$eventinfo[title]”; } } else { // Group by Date $eventdate = vbdate($vboptions[‘dateformat’], $index, false, true, false); $day = vbdate(‘Y-n-j’, $index, false, false); foreach($value AS $key =\> $eventid) { $eventinfo = $eventstore["$eventid"]; if ($eventinfo[‘holidayid’]) { $daysevents .= $comma . “” . $vbphrase[‘holiday\_title\_’ . $eventinfo[‘varname’]] . “”; } else { $daysevents .= $comma . “$eventinfo[title]”; } $comma = ‘, ‘; } } eval(’$upcomingevents .= "’ . fetch\_template(‘forumhome\_event’) . ‘";’); } // memory saving unset($events, $eventstore); } $show[‘upcomingevents’] = iif ($upcomingevents, true, false); $show[‘todaysevents’] = iif ($vboptions[‘showevents’] == 1, true, false); } else { $show[‘upcomingevents’] = false; } // ### LOGGED IN USERS ################################################# $activeusers = ‘’; if ($vboptions[‘displayloggedin’]) { $datecut = TIMENOW - $vboptions[‘cookietimeout’]; $numbervisible = 0; $numberregistered = 0; $numberguest = 0; $forumusers = $DB\_site-\>query(" SELECT user.username, (user.options & $\_USEROPTIONS[invisible]) AS invisible, user.usergroupid, session.userid, session.inforum, session.lastactivity, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid FROM " . TABLE\_PREFIX . “session AS session LEFT JOIN " . TABLE\_PREFIX . “user AS user ON(user.userid = session.userid) WHERE session.lastactivity \> $datecut " . iif($vboptions[‘displayloggedin’] == 1, “ORDER BY username ASC”) . " “); if ($bbuserinfo[‘userid’]) { // fakes the user being online for an initial page view of index.php $bbuserinfo[‘joingroupid’] = iif($bbuserinfo[‘displaygroupid’], $bbuserinfo[‘displaygroupid’], $bbuserinfo[‘usergroupid’]); $userinfos = array ( $bbuserinfo[‘userid’] =\> array ( ‘userid’ =\> $bbuserinfo[‘userid’], ‘username’ =\> $bbuserinfo[‘username’], ‘invisible’ =\> $bbuserinfo[‘invisible’], ‘inforum’ =\> 0, ‘lastactivity’ =\> TIMENOW, ‘usergroupid’ =\> $bbuserinfo[‘usergroupid’], ‘displaygroupid’ =\> $bbuserinfo[‘displaygroupid’], ) ); } else { $userinfos = array(); } $inforum = array(); while ($loggedin = $DB\_site-\>fetch\_array($forumusers)) { $userid = $loggedin[‘userid’]; if (!$userid) { // Guest $numberguest++; $inforum[”$loggedin[inforum]”]++; } else if (empty($userinfos[”$userid"]) OR ($userinfos["$userid"][‘lastactivity’] \< $loggedin[‘lastactivity’])) { $userinfos["$userid"] = $loggedin; } } foreach($userinfos AS $userid =\> $loggedin) { $numberregistered++; if ($userid != $bbuserinfo[‘userid’]) { $inforum["$loggedin[inforum]"]++; } $loggedin[‘musername’] = fetch\_musername($loggedin); if (fetch\_online\_status($loggedin)) { $numbervisible++; eval(’$activeusers .= “, ’ . fetch\_template(‘forumhome\_loggedinuser’) . '”;’); } } // memory saving unset($userinfos, $loggedin); $activeusers = substr($activeusers , 2); // get rid of initial comma $DB\_site-\>free\_result($loggedins); $totalonline = $numberregistered + $numberguest; $numberinvisible = $numberregistered - $numbervisible; // ### MAX LOGGEDIN USERS ################################ $maxusers = unserialize($datastore[‘maxloggedin’]); if (intval($maxusers[‘maxonline’]) \<= $totalonline) { $maxusers[‘maxonline’] = $totalonline; $maxusers[‘maxonlinedate’] = TIMENOW; build\_datastore(‘maxloggedin’, serialize($maxusers)); } $recordusers = $maxusers[‘maxonline’]; $recorddate = vbdate($vboptions[‘dateformat’], $maxusers[‘maxonlinedate’], true); $recordtime = vbdate($vboptions[‘timeformat’], $maxusers[‘maxonlinedate’]); $show[‘loggedinusers’] = true; } else { $show[‘loggedinusers’] = false; } // ### GET FORUMS & MODERATOR iCACHES ######################## cache\_ordered\_forums(1); if ($vboptions[‘showmoderatorcolumn’]) { cache\_moderators(); } else { $imodcache = array(); $mod = array(); } // define max depth for forums display based on $vboptions[forumhomedepth] define(‘MAXFORUMDEPTH’, $vboptions[‘forumhomedepth’]); $forumbits = construct\_forum\_bit($forumid); // ### BOARD STATISTICS ################################################# // get total threads & posts from the forumcache $totalthreads = 0; $totalposts = 0; if (is\_array($forumcache)) { foreach ($forumcache AS $forum) { $totalthreads += $forum[‘threadcount’]; $totalposts += $forum[‘replycount’]; } } $totalthreads = vb\_number\_format($totalthreads); $totalposts = vb\_number\_format($totalposts); // get total members and newest member from template $userstats = unserialize($datastore[‘userstats’]); $numbermembers = vb\_number\_format($userstats[‘numbermembers’]); $newusername = $userstats[‘newusername’]; $newuserid = $userstats[‘newuserid’]; // ### ALL DONE! SPIT OUT THE HTML AND LET’S GET OUTA HERE… ### eval(’$navbar = “’ . fetch\_template(‘navbar’) . '”;’); eval(‘print\_output("’ . fetch\_template(‘FORUMHOME’) . ‘");’); /_======================================================================_\ || #################################################################### || # Nullified By CAT Team || # CVS: $RCSfile: index.php,v $ - $Revision: 1.132.2.2 $ || #################################################################### \*======================================================================\*/ ?\>
