Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 10-12-2005, 11:52 PM
DarkWarriorXII DarkWarriorXII is offline
 
Join Date: Aug 2004
Location: New Jersey, USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I'm confused. :disappointed: Here's my file as of right now:

Code:
<?php 
// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 
// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', 'index'); // change this depending on your filename 
// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 
); 
// get special data templates from the datastore 
$specialtemplates = array( 
	'online',
); 
// pre-cache templates used by all actions 
$globaltemplates = array( 
	'homepage',
	'online',
	'forumhome_loggedinuser',
	'headinclude',
	'forumhome',
	'maxloggedin',
	'wol_spiders',
); 
// pre-cache templates used by specific actions 
$actiontemplates = array( 
	'online',
); 
// ######################### REQUIRE BACK-END ############################ 
chdir('/home/dwxii/talkcamp.com/');
require('./global.php');
 
// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 
$navbits = array(); 
$navbits[$parent] = 'Talk Camp Homepage'; 
$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('homepage') . '");'); 
eval('print_output("' . fetch_template('online') . '");'); 
 
// ### LOGGED IN USERS #################################################
$activeusers = '';
if ($vbulletin->options['displayloggedin'] AND !$show['search_engine'])
{
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$numbervisible = 0;
$numberregistered = 0;
$numberguest = 0;
$numberspiders = 0;
$forumusers = $db->query_read("
SELECT
user.username, (user.options & " . $vbulletin->bf_misc_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($vbulletin->options['displayloggedin'] == 1, "ORDER BY username ASC") . "
");
$spiders = $db->query_read("
SELECT user.username, session.useragent,user.userid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "session AS session
". iif($vbulletin->options['WOLguests'], " LEFT JOIN " . TABLE_PREFIX . "user AS user 
USING (userid) ", ", " . TABLE_PREFIX . "user AS user") ."
WHERE session.lastactivity > $datecut
". iif(!$vbulletin->options['WOLguests'], " AND session.userid = user.userid", "") 
."
ORDER BY session.userid
");		 
if ($vbulletin->userinfo['userid'])
{
// fakes the user being online for an initial page view of index.php
$vbulletin->userinfo['joingroupid'] = iif($vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['usergroupid']);
$userinfos = array
(
$vbulletin->userinfo['userid'] => array
(
	'userid' => $vbulletin->userinfo['userid'],
	'username' => $vbulletin->userinfo['username'],
	'invisible' => $vbulletin->userinfo['invisible'],
	'inforum' => 0,
	'lastactivity' => TIMENOW,
	'usergroupid' => $vbulletin->userinfo['usergroupid'],
	'displaygroupid' => $vbulletin->userinfo['displaygroupid'],
)
);
}
else
{
$userinfos = array();
}
$inforum = array();
while ($loggedin = $db->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;
}
}
if (!$vbulletin->userinfo['userid'] AND $numberguest == 0)
{
$numberguest++; 
}
foreach ($userinfos AS $userid => $loggedin)
{
$numberregistered++;
if ($userid != $vbulletin->userinfo['userid'])
{
$inforum["$loggedin[inforum]"]++;
}
$loggedin['musername'] = fetch_musername($loggedin);
($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser')) ? eval($hook) : false;
if (fetch_online_status($loggedin))
{
$numbervisible++;
eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
}
}
// memory saving 
 
$spiderlist = array();
while ($spidercand = $db->fetch_array($spiders))
{
	$userid = $spidercand['userid'];
	if (!empty($vbulletin->wol_spiders))
	{
	 if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', $spidercand['useragent'], $agent))
{
	$agent = strtolower($agent[1]);
	 $spider = $vbulletin->wol_spiders['agents']["$agent"];	 
					$key = $spider['name'];
	 if(array_key_exists($key,$spiderlist))
	{
		$spiderlist[$key] = $spiderlist[$key] + 1;
	}
	else 
	{
		 $spiderlist[$key] = 1;
 
	}
 
}
	}
}
while ($spidername = current($spiderlist)) 
{
	 if ($spidername > 1) {
	 $loggedin['musername'] = trim(key($spiderlist)) . "(" . $spidername.")";
	}
	else 
	{
	 $loggedin['musername'] = trim(key($spiderlist));
	}
	$loggedin['userid'] = 0;
	eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
	$numberspiders = $numberspiders + $spidername;
	next($spiderlist);
}
 
unset($userinfos, $loggedin);
$activeusers = substr($activeusers, 2); // get rid of initial comma
$db->free_result($forumusers);
	$numberguest = $numberguest - $numberspiders;
$totalonline = $numberregistered + $numberguest + $numberspiders;
$numberinvisible = $numberregistered - $numbervisible;
}
?>
and if you need the 'homepage' template, here it is:

Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title>TalkCamp.com Homepage</title>
$headinclude
</head>
<body>
$header
$navbar
 
<TABLE WIDTH="100%" valign="top"><TR><TD WIDTH="75%" valign="top">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="1">Message</td>
</tr>
		<tr>	
				<td class="thead">We're Under Construction, But Still Open!</td>
		</tr>
<tr>
<td class="alt1" colspan="1">
<p>Thanks for visiting TalkCamp.com! Right now, we're under construction, but check back soon for updates. In the mean time, feel free to <b><a href="register.php">register to our site</a></b> (for free) so you'll be set when we open.</p><p>Thanks,<br>Dave<br>Webmaster, Admin</p>
</td>
</tr>
</thead>
<thead>
<tr>
<td class="tcat" colspan="1">Welcome to Talk Camp!</td>
</tr>
<tr>
<td class="alt1" colspan="1">
<p>Welcome to TalkCamp.com! Talk Camp is an online community and website dedicated to those wonderful people who are known as camp counselors. We also serve other camp staff such as specialists, etc. It's the efforts of these people that allow thousands of kids around the world to have the best summers of their lives at camp! We are here to make your camp counseling experience even better. So please join us, become an active part of our community, and help spread the fun and joy of being a camp counselor!</p>
<center><b><a href="forum.php">Click here to go to the forums!</a></b><if condition="is_member_of($bbuserinfo, 1)"> or <br><b><a href="register.php">register</a></b> / <b><a href="login.php">log-in</a></b>!</if>
</td>
</tr>
</thead>
</table>
</TD><TD WIDTH="25%" valign="top">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" valign="top">
<thead valign="top">
<tr>
<td class="tcat" colspan="1">Mission Statement</td>
</tr>
<tr>
<td class="alt1" colspan="1">We are here to provide camp counselors and other camp staff with the best information available, as well as the best place to talk about their passion for camp counseling. We hope to make your camp experience the best it can possibly be!</td>
</tr>
</thead>
<thead>
<if condition="$vbulletin->options['externaljs']">
<!-- show latest active threads -->
<thead>
<tr>
<td class="tcat" colspan="1">
<a href="search.php?$session[sessionurl]do=getnew">Latest Active Threads</a>
</td>
</tr>
</thead>
<thead id="collapseobj_forumhome_external" style="$vbcollapse[collapseobj_forumhome_external]">
<tr>
 
<td class="alt1" width="100%">
 
<div class="smallfont">
<script type="text/javascript" src="external.php?type=js"></script> 
<script language="" type="text/javascript">
<!--
for (x = 0; x < 10; x++)
{
document.writeln("<img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/lastpost.gif\" alt=\"\" border=\"0\" /> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <span class=\"time\">($vbphrase[posted_by]: "+threads[x].poster+")</span><br />");
}
//-->
</script></div>
 
</td>
</tr>
</thead>
<!-- show latest active threads -->
</if>
</thead>
<thead>
<tr>
<td class="tcat" colspan="1">Users Online</td>
</tr>
<tr>
<td class="alt1" colspan="1">$online
</td>
</tr>
</thead>
</table>
</TD>
</TR>
</TABLE>
$footer
</body>
</html>
The 'online' template is just $activeusers because I have no idea.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04054 seconds
  • Memory Usage 2,488KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete