Log in

View Full Version : WOL variable in VBPowered Pages


soundbarrierpro
04-08-2009, 03:48 PM
Will this work if added to the template of a vbpowered page?

Basically, I want the who's online block added on pages I create.

Thank you

--------------- Added 1239210886 at 1239210886 ---------------

@ Lynne

I found your article, I am using Gary Kings vbpowered pages. I have about 70 working pages

but when I add the code changes into the index.php everything goes haywire.

I don't get the "Add this" to the "Start and End"

I put the "Start" code right under this:
// ### LOGGED IN USERS #################################################


and I put the "End" code right before this:
// ### MAX LOGGEDIN USERS ################################

When I load the page, I get an error at line 540 message

Lynne
04-08-2009, 05:15 PM
You need to copy the code from your index.php file from where I say Start to where I say End. You add all that code to your page.

TNCclubman
04-08-2009, 05:46 PM
We should have a subforum for people to share additions they made for their vb powered pages. I think it would be really useful for everyone to share ideas that we've been able to get to work.

soundbarrierpro
04-08-2009, 05:49 PM
Ah, ok. Made the change.

Here's what I get on my page. Nothing shows up with me on the page.
************************************************** **********
Currently Active Users: ( members and guests)
Most users ever online was , at .

Lynne
04-08-2009, 06:03 PM
Did you start with the template and page code from the original article I linked to? My article is just stuff to ADD to the other page/template. You need to have a working page first before you add the stuff in my article.

soundbarrierpro
04-08-2009, 06:10 PM
Did you start with the template and page code from the original article I linked to? My article is just stuff to ADD to the other page/template. You need to have a working page first before you add the stuff in my article.

Yes, all my pages are Gary Kings vbpowered pages (which is your first suggested installed and working template/page article config). All are working. I added all the .php page changes. Then I added the change to the template which calls the .php page.

Lynne
04-08-2009, 06:55 PM
Why don't you post the code here. Use the php and html code tags when posting your php/template code.

soundbarrierpro
04-08-2009, 07:08 PM
Here's the template

$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" colspan="2">Channel 1</td>
</tr>
<tr>
<td class="tcat" colspan="2">
<div align="center">
<img src="http://www.mysite.com/picture.gif" width="71" height="62">
<br>
<a href="http://www.mysite.com">Site Info</a>
</div>
<br>
<DIV ALIGN=CENTER>
<h1 style="color:blue">
<font size="5" face="Arial">

My info here

</font>
</h1>
<br>
<DIV ALIGN=CENTER>

My info here

</DIV>
</tr>
<!-- logged-in users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
<a href="online.php$session[sessionurl_q]" rel="nofollow">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
<tr>
<td class="alt2"><a href="online.php$session[sessionurl_q]" rel="nofollow"><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 -->
</table>
$footer
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("xxxxxxxx");
pageTracker._trackPageview();
</script>
</body>
</html>

--------------- Added 1239221440 at 1239221440 ---------------

I can't post the page code. The AJAX just spins then times out when it tries to post

Lynne
04-08-2009, 07:13 PM
Well, the template looks fine. The only thing I can think of for the php is that you are evaling your own template before the code to create the activeusers is evaled. So, make sure that isn't so.

soundbarrierpro
04-08-2009, 07:20 PM
Well, the template looks fine. The only thing I can think of for the php is that you are evaling your own template before the code to create the activeusers is evaled. So, make sure that isn't so.

What does evaling mean?

I can tell you, I put this chunk of code at the end of my .php page after "Start main script"

// ### LOGGED IN USERS #################################################

code start and end here

Lynne
04-08-2009, 08:44 PM
You cannot put that chunk of code at the end of the php file. If you read the article, it says "Paste these lines into the main part of your page." If you look at Gary's article, this means before the template is evaled here:
eval('print_output("' . fetch_template('TEST') . '");');
I would put it somewhere above this line:
$navbits = array();

soundbarrierpro
04-09-2009, 12:54 PM
Hmm wierd. I responded to this earlier but it didn't show up?

Anyhow, thanks Lynne! It worked and all is well. As always I appreciate your expertise!:)