PDA

View Full Version : Non-vBulletin pages (a little question)


Slugsnack
12-13-2008, 10:36 PM
Okay, so I'm trying to make my non-vbulletin page look like this:

http://dump.stoleyour.net/uploads/891e42dcf2.png

As you can see they have it so on their Non-vBulletin page you can see birthdays, who's online, as well as log in (at the top).

When I set up my non-vbulletin page, it worked perfectly, I could add anything I wanted to it. The only problem I was having was making it so users could log in, and we could see who's online, and also I couldn't add my user legend.

My question today is how can I make it so that my statistics will work correctly using the Non-vBulletin pages article that has been posted. Someone posted it, and I tried it but it didn't work. It didn't show "who's online, birthdays and events". And I also want a log-in field towards the top. But that leads to another issue. I'm using a completevB design (all of their like log in stuff is in the nava template) and I also wanted that to be there and work.

Is there anyway I could make this work?

Lynne
12-13-2008, 10:44 PM
In order to have the who's online, birthdays, and events, you basically need to copy a large part of the index.php page into your page. The login field should be there if you see the navbar since it is from the navbar template.

Slugsnack
12-13-2008, 10:54 PM
Could you tell me the portion to add, and if I add it to my TEST Template (in the adminCP) or the test.php page that I've made.

I tried ripping a portion of it out, and it didn't work to well and that's when I came here.

Lynne
12-13-2008, 11:11 PM
It's pretty well commented. It says "TODAY'S BIRTHDAYS" above the stuff for the birthdays and similar for the other items. You pretty much need the whole page. I'd copy that index page and call it mypage.php, copy the FORUMHOME template to TEST and change any instance of FORUMHOME (the template) in the mypage.php to TEST.

Slugsnack
12-14-2008, 12:12 AM
Okay well, this is what I did....

test.php:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
define('CSRF_PROTECTION', true);
define('CSRF_SKIP_LIST', '');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('holiday');

// get special data templates from the datastore
$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue',
'blogstats',
'blogcategorycache',
);

// pre-cache templates used by all actions
$globaltemplates = array(
'ad_forumhome_afterforums',
'FORUMHOME',
'forumhome_event',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_nopost',
'forumhome_forumbit_level2_post',
'forumhome_lastpostby',
'forumhome_loggedinuser',
'forumhome_moderator',
'forumhome_subforumbit_nopost',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_nopost',
'forumhome_subforumseparator_post',
'forumhome_markread_script',
'forumhome_birthdaybit'
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_bigthree.php');
require_once(DIR . '/includes/functions_forumlist.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;

// get permissions to view forumhome
if (!($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
{
print_no_permission();
}

if (empty($foruminfo['forumid']))
{
// show all forums
$forumid = -1;
}
else
{
// check forum permissions
$_permsgetter_ = 'index';
$forumperms = fetch_permissions($foruminfo['forumid']);

if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']))
{
print_no_permission();
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

// draw nav bar
$navbits = array();
$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
foreach ($parentlist AS $forumID)
{
$forumTitle =& $vbulletin->forumcache["$forumID"]['title'];
$navbits['forumdisplay.php?' . $vbulletin->session->vars['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);
}

$today = vbdate('Y-m-d', TIMENOW, false, false);


// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // 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(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'complete',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
// ### TODAY'S BIRTHDAYS #################################################
if ($vbulletin->options['showbirthdays'])
{
if (!is_array($vbulletin->birthdaycache)
OR ($today != $vbulletin->birthdaycache['day1'] AND $today != $vbulletin->birthdaycache['day2'])
OR !is_array($vbulletin->birthdaycache['users1'])
)
{
// Need to update!
require_once(DIR . '/includes/functions_databuild.php');
$birthdaystore = build_birthdays();
DEVDEBUG('Updated Birthdays');
}
else
{
$birthdaystore = $vbulletin->birthdaycache;
}

switch ($today)
{
case $birthdaystore['day1']:
$birthdaysarray = $birthdaystore['users1'];
break;

case $birthdaystore['day2']:
$birthdaysarray = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$birthdaybits = array();

foreach ($birthdaysarray AS $birthday)
{
eval('$birthdaybits[] = "' . fetch_template('forumhome_birthdaybit') . '";');
}

$birthdays = implode(', ', $birthdaybits);

if ($stylevar['dirmark'])
{
$birthdays = str_replace('<!--rlm-->', $stylevar['dirmark'], $birthdays);
}

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

// ### TODAY'S EVENTS #################################################
if ($vbulletin->options['showevents'])
{
require_once(DIR . '/includes/functions_calendar.php');

$future = gmdate('n-j-Y' , TIMENOW + 86400 + 86400 * $vbulletin->options['showevents']);

if (!is_array($vbulletin->eventcache) OR $future != $vbulletin->eventcache['date'])
{
// Need to update!
$eventstore = build_events();
DEVDEBUG('Updated Events');
}
else
{
$eventstore = $vbulletin->eventcache;
}

unset($eventstore['date']);
$events = array();
$eventcount = 0;

foreach ($eventstore AS $eventid => $eventinfo)
{
$offset = $eventinfo['dst'] ? $vbulletin->userinfo['timezoneoffset'] : $vbulletin->userinfo['tzoffset'];
$eventstore["$eventid"]['dateline_from_user'] = $eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
$eventstore["$eventid"]['dateline_to_user'] = $eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;
$gettime = TIMENOW - $vbulletin->options['hourdiff'];
$iterations = 0;
$todaydate = getdate($gettime);

if (!$eventinfo['singleday'] AND !$eventinfo['recurring'] AND $eventinfo['dateline_from_user'] < gmmktime(0, 0, 0, $todaydate['mon'], $todaydate['mday'], $todaydate['year']))
{
$sub = -3;
}
else if ($eventinfo['holidayid'])
{
$sub = -2;
}
else if ($eventinfo['singleday'])
{
$sub = -1;
}
else
{
$sub = $eventinfo['dateline_from_user'] - (86400 * (intval($eventinfo['dateline_from_user'] / 86400)));
}

if ($vbulletin->userinfo['calendarpermissions']["$eventinfo[calendarid]"] & $vbulletin->bf_ugp_calendarpermissions['canviewcalendar'] OR ($eventinfo['holidayid'] AND $vbulletin->options['showholidays']))
{
if ($eventinfo['userid'] == $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['calendarpermissions']["$eventinfo[calendarid]"] & $vbulletin->bf_ugp_calendarpermissions['canviewothersevent'] OR ($eventinfo['holidayid'] AND $vbulletin->options['showholidays']))
{
if (!$eventinfo['recurring'] AND !$vbulletin->options['showeventtype'] AND !$eventinfo['singleday'] AND cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year']))
{
$events["$eventid"][] = $gettime . "_$sub";
}
else
{
while ($iterations < $vbulletin->options['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 (!$vbulletin->options['showeventtype'])
{
$events["$eventid"][] = $gettime . "_$sub";
}
else
{
$events["$gettime"][] = $eventid;
}
$eventcount++;
}

$iterations++;
$gettime += 86400;
}
}
}
}
}

if (!empty($events))
{
if ($vbulletin->options['showeventtype'])
{
ksort($events, SORT_NUMERIC);
}
else
{
function groupbyevent($a, $b)
{
if ($a[0] == $b[0])
{
return 0;
}
else
{
$values1 = explode('_', $a[0]);
$values2 = explode('_', $b[0]);
if ($values1[0] != $values2[0])
{
return ($values1[0] < $values2[0]) ? -1 : 1;
}
else
{
// Same day events. Check the event start time to order them properly (compare number of seconds from 00:00)
return ($values1[1] < $values2[1]) ? -1 : 1;
}
}
}
uasort($events, 'groupbyevent');
// this crazy code is to remove $sub added above that ensures a event maintains its position after the sort
// if associative values are the same
foreach($events AS $eventid => $times)
{
foreach ($times AS $key => $time)
{
$events["$eventid"]["$key"] = intval($time);
}
}
}

$upcomingevents = '';
foreach($events AS $index => $value)
{
$pastevent = 0;
$pastcount = 0;

$comma = $eventdates = $daysevents = '';
if (!$vbulletin->options['showeventtype'])
{ // Group by Event // $index = $eventid
$eventinfo = $eventstore["$index"];
if (empty($eventinfo['recurring']) AND empty($eventinfo['singleday']))
{ // ranged event -- show it from its real start and real end date (vbgmdate)
$fromdate = vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_from_user'], false, true, false, true);
$todate = vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_to_user'], false, true, false, true);
if ($fromdate != $todate)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $fromdate, $todate);
}
else
{
$eventdates = vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_from_user'], false, true, false, true);
}
$day = vbdate('Y-n-j', $eventinfo['dateline_from_user'], false, false);
}
else
{
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($vbulletin->options['dateformat'], $pastevent, false, true, false));
}
$pastcount = 0;
$pastevent = $dateline;
}
if (!$day)
{
$day = vbdate('Y-n-j', $dateline, false, false, false);
}
$eventdates .= $comma . vbdate($vbulletin->options['dateformat'], $dateline, false, true, false);
$comma = ', ';
}
if ($pastcount)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $eventdates, vbdate($vbulletin->options['dateformat'], $pastevent, false, true, false));
}
}

if ($eventinfo['holidayid'])
{
$callink = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;day=$day\">" . $vbphrase['holiday' . $eventinfo['holidayid'] . '_title'] . "</a>";
}
else
{
$callink = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
}
else
{ // Group by Date
$eventdate = vbdate($vbulletin->options['dateformat'], $index, false, true, false);

$day = vbdate('Y-n-j', $index, false, false, false);
foreach($value AS $key => $eventid)
{
$eventinfo = $eventstore["$eventid"];
if ($eventinfo['holidayid'])
{
$daysevents .= $comma . '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;day=$day\">" . $vbphrase['holiday' . $eventinfo['holidayid'] . '_title'] . "</a>";
}
else
{
$daysevents .= $comma . '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
$comma = ', ';
}
}

($hook = vBulletinHook::fetch_hook('forumhome_event')) ? eval($hook) : false;
eval('$upcomingevents .= "' . fetch_template('forumhome_event') . '";');
}
// memory saving
unset($events, $eventstore);
}
$show['upcomingevents'] = iif ($upcomingevents, true, false);
$show['todaysevents'] = iif ($vbulletin->options['showevents'] == 1, true, false);
}
else
{
$show['upcomingevents'] = false;
}

// ### LOGGED IN USERS #################################################
$activeusers = '';
if (($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 2 OR ($vbulletin->options['displayloggedin'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine'])
{
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$numbervisible = 0;
$numberregistered = 0;
$numberguest = 0;

$hook_query_fields = $hook_query_joins = $hook_query_where = '';
($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser_ query')) ? eval($hook) : false;

$forumusers = $db->query_read_slave("
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, infractiongroupid
$hook_query_fields
FROM " . TABLE_PREFIX . "session AS session
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
$hook_query_joins
WHERE session.lastactivity > $datecut
$hook_query_where
" . iif($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 3, "ORDER BY username ASC") . "
");

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'],
'infractiongroupid' =>& $vbulletin->userinfo['infractiongroupid'],
)
);
}
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]"]++;
}
fetch_musername($loggedin);

($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser' )) ? eval($hook) : false;

if (fetch_online_status($loggedin))
{
$numbervisible++;
$show['comma_leader'] = ($activeusers != '');
eval('$activeusers .= "' . fetch_template('forumhome_loggedinuser') . '";');
}
}

// memory saving
unset($userinfos, $loggedin);

$db->free_result($forumusers);

$totalonline = $numberregistered + $numberguest;
$numberinvisible = $numberregistered - $numbervisible;

// ### MAX LOGGEDIN USERS ################################
if (intval($vbulletin->maxloggedin['maxonline']) <= $totalonline)
{
$vbulletin->maxloggedin['maxonline'] = $totalonline;
$vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
build_datastore('maxloggedin', serialize($vbulletin->maxloggedin), 1);
}

$recordusers = vb_number_format($vbulletin->maxloggedin['maxonline']);
$recorddate = vbdate($vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxonlinedate'], true);
$recordtime = vbdate($vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxonlinedate']);

$show['loggedinusers'] = true;
}
else
{
$show['loggedinusers'] = false;
}

// ### GET FORUMS & MODERATOR iCACHES ########################
cache_ordered_forums(1, 1);
if ($vbulletin->options['showmoderatorcolumn'])
{
cache_moderators();
}
else if ($vbulletin->userinfo['userid'])
{
cache_moderators($vbulletin->userinfo['userid']);
}

// define max depth for forums display based on $vbulletin->options[forumhomedepth]
define('MAXFORUMDEPTH', $vbulletin->options['forumhomedepth']);

$forumbits = construct_forum_bit($forumid);
eval('$forumhome_markread_script = "' . fetch_template('forumhome_markread_script') . '";');

// ### BOARD STATISTICS #################################################

// get total threads & posts from the forumcache
$totalthreads = 0;
$totalposts = 0;
if (is_array($vbulletin->forumcache))
{
foreach ($vbulletin->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
$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);
$newusername = $vbulletin->userstats['newusername'];
$newuserid = $vbulletin->userstats['newuserid'];
$activemembers = vb_number_format($vbulletin->userstats['activemembers']);
$show['activemembers'] = ($vbulletin->options['activememberdays'] > 0 AND ($vbulletin->options['activememberoptions'] & 2)) ? true : false;

eval('$ad_location[\'ad_forumhome_afterforums\'] = "' . fetch_template('ad_forumhome_afterforums') . '";');

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');

/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 12:43, Mon Aug 18th 2008
|| # CVS: $RCSfile$ - $Revision: 26941 $
|| ################################################## ##################
\*================================================ ======================*/
?>


making a new post due to character limit

Slugsnack
12-14-2008, 12:12 AM
And the code in my template called TEST:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">Text</td>
</tr>
</table>

<!-- /main -->

$ad_location[ad_TEST_afterforums]

<!-- what's going on box -->
<script type="text/javascript">
<!--

setup_memberlegend = function(tobj)
{
prefix = ''
suffix = ''

if (tobj.getAttribute('ital'))
{
prefix += '<em>'
suffix += '</em>'
}

if (tobj.getAttribute('undr'))
{
prefix += '<u>'
suffix += '</u>'
}

if (tobj.getAttribute('bold'))
{
prefix += '<b>'
suffix += '</b>'
}

if (tobj.getAttribute('line'))
{
prefix += '<s>'
suffix += '</s>'
}

if (tobj.getAttribute('clr'))
{
prefix += '<span style="color:' + tobj.getAttribute('clr') + ';">'
suffix += '</span>'
}



fetch_object('memberlegend').innerHTML = prefix + tobj.getAttribute('group') + suffix
}

-->
</script>

<div class="tcat_hp">
<div class="tcat_right">
<div class="tcat_left">
$vbphrase[whats_going_on]
</div>
</div>
</div>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
$template_hook[TEST_wgo_pos1]
<if condition="$show['loggedinusers']">
<!-- logged-in users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('TEST_activeusers')"><img id="collapseimg_TEST_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_TEST_activeusers].gif" alt="" border="0" /></a>
<a href="online.php$session[sessionurl_q]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
</td>
</tr>
</tbody>
<tbody id="collapseobj_TEST_activeusers" style="$vbcollapse[collapseobj_TEST_activeusers]">
<tr>
<td class="alt2"><a href="online.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td>
<td class="alt1" width="100%">
<div class="smallfont">
<div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
<div>$activeusers</div>
</div>
</td>
</tr>
</tbody>
<!-- end logged-in users -->
<tbody> <tr> <td class="thead" colspan="2"> <a style="float: right;" href="#top" onclick="return toggle_collapse('TEST_legend')"><img src=$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_TEST_legend].gif alt="" name="collapseimg_TEST_legend" width="16" height="16" border="0" id="collapseimg_TEST_legend"></a> <a href="showgroups.php$session[sessionurl_q]" rel="nofollow">User Legend </a></td>
</tr> </tbody> <tbody id="collapseobj_TEST_legend" style=""> <tr> <td class="alt2"><a href="showgroups.php$session[sessionurl_q]" rel="nofollow"><img title="Legend" src="$stylevar[imgdir_misc]/whos_online.gif" alt="Legend" border="0"></a></td> <td class="alt1" width="100%">
<div style="float:left;"><strong>Legend</strong>:</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Founder" bold="y" clr="#b76565" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#b76565;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Administrator" bold="y" clr="#e01919" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#e01919;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Super Moderator" bold="y" clr="#5b93cd" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#5b93cd;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Moderators" bold="y" clr="#5cc653" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#5cc653;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="+ Elite Member (Life Time)" bold="y" clr="#000000" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#000000;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Donator(Weekly)" bold="y" clr="#fcbe15" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#fcbe15;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Premium Member(Monthly)" bold="y" clr="#b1d226" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#b1d226;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Reviewed Staff" bold="y" clr="#ca6be3" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#ca6be3;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Validating" ital="y" clr="gray" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#000000;"></div>
</div>
<div style="float:left;">&nbsp;</div>
<div class="alt2" style="float:left;height:8px;width:8px;padding:0px;" group="Banned" bold="y" clr="#c2956a" onmouseover="setup_memberlegend(this)" onmouseout="fetch_object('memberlegend').innerHTML = ''">
<div class="tborder" style="height:8px;width:8px;background:#c2956a;"></div>
</div>

<div style="float:left;width:10px;height:1px;">&nbsp;</div>
<div style="float:left;" id="memberlegend"></div> </td> </tr> </tbody>
<!-- End User Legend by Digitalus -->

</if>
$template_hook[TEST_wgo_pos2]
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('TEST_stats')"><img id="collapseimg_TEST_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_TEST_stats].gif" alt="" border="0" /></a>
<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
</td>
</tr>
</tbody>
<tbody id="collapseobj_TEST_stats" style="$vbcollapse[collapseobj_TEST_stats]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
<td class="alt1" width="100%">
<div class="smallfont">
<div>
$vbphrase[threads]: $totalthreads,
$vbphrase[posts]: $totalposts,
$vbphrase[members]: $numbermembers<if condition="$show['activemembers']">,
<span title="<phrase 1="$vboptions[activememberdays]">$vbphrase[within_the_last_x_days]</phrase>">$vbphrase[active_members]: $activemembers</span>
</if>
</div>
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
$template_hook[TEST_wgo_stats]
</div>
</td>
</tr>
</tbody>
$template_hook[TEST_wgo_pos3]
<if condition="$show['birthdays']">
<!-- today's birthdays -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('TEST_birthdays')"><img id="collapseimg_TEST_birthdays" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_TEST_birthdays].gif" alt="" border="0" /></a>
$vbphrase[todays_birthdays]
</td>
</tr>
</tbody>
<tbody id="collapseobj_TEST_birthdays" style="$vbcollapse[collapseobj_TEST_birthdays]">
<tr>
<td class="alt2"><a href="calendar.php?$session[sessionurl]do=getday&amp;day=$today&amp;sb=1"><img src="$stylevar[imgdir_misc]/birthday.gif" alt="$vbphrase[view_birthdays]" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$birthdays</div></td>
</tr>
</tbody>
<!-- end today's birthdays -->
</if>
$template_hook[TEST_wgo_pos4]
<if condition="$show['upcomingevents']">
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('TEST_events')"><img id="collapseimg_TEST_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_TEST_events].gif" alt="" border="0" /></a>
<if condition="$show['todaysevents']">$vbphrase[todays_events]<else /><phrase 1="$vboptions[showevents]">$vbphrase[upcoming_events_for_the_next_x_days]</phrase></if>
</td>
</tr>
</tbody>
<tbody id="collapseobj_TEST_events" style="$vbcollapse[collapseobj_TEST_events]">
<tr>
<td class="alt2"><a href="calendar.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/calendar.gif" alt="$vbphrase[calendar]" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$upcomingevents</div></td>
</tr>
</tbody>
</if>
$template_hook[TEST_wgo_pos5]
</table>
<br />
<!-- end what's going on box -->

<!-- icons and login code -->
<table cellpadding="0" cellspacing="2" border="0" width="100%">
<tr valign="bottom">
<td>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[contains_new_posts]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_contains_new_posts]</td>
</tr>
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old.gif" alt="$vbphrase[contains_no_new_posts]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_contains_no_new_posts]</td>
</tr>
<if condition="$vboptions['showlocks']">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old_lock.gif" alt="$vbphrase[a_closed_forum]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_is_closed_for_posting]</td>
</tr>
</if>
</table>
</td>
<if condition="!$show['guest']">
<!-- member logout -->
<td align="$stylevar[right]"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')"><phrase 1="$bbuserinfo[username]">$vbphrase[log_out_x]</phrase></a></td>
<!-- end member logout -->
</if>
</tr>
</table>
<!-- / icons and login code -->

$footer
</body>
</html>
</body>
</html>


This is what I'm seeing, it's progessing and I can see the userlegend and such as I wished, but what I circled, and put in a square(member info) still isn't working!!:
http://dump.stoleyour.net/uploads/7ff569b85e.png


I can't get it working....

Lynne
12-14-2008, 02:39 AM
You can't eval the template before you have the variables available to use. You need to put all the code from the index.php page immediately after where it says MAIN SCRIPT - before the navbits stuff (and the evaled TEST template).

Slugsnack
12-14-2008, 03:53 AM
Okay, I"m not understanding what you're saying. Could you show me a prime example or something?

Lynne
12-14-2008, 04:06 AM
Your test.php is messed up. You have two "DEFINE IMPORTANT CONSTANTS" sections, two "DEFINE IMPORTANT CONSTANTS" sections, etc. You need to put them all together into one (and then get rid of the duplicate stuff you have).

But, besides that, what I was talking about is under (the second) MAIN SCRIPT area, you have this:

$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
// ### TODAY'S BIRTHDAYS ##################
all the other index.php script here.You need to have the eval of the TEST template at the bottom of the page:

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
eval('print_output("' . fetch_template('TEST') . '");');And, as I also said above, you don't want FORUMHOME in there, you wanted to replace all instances of FORUMHOME with TEST, so either move the eval of TEST as I said here (and remove the eval of FORUMHOME), or replace FORUMHOME with TEST.

Slugsnack
12-14-2008, 04:38 AM
Okay, I got it to work thank you!

I deleted

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
// ### TODAY'S BIRTHDAYS ##################
all the other index.php script here.

And at the end like you said put

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
eval('print_output("' . fetch_template('TEST') . '");');

Instead of

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
eval('print_output("' . fetch_template('FORUMHOME') . '");');


And now it works 100%!! Thank you so much Lynne