UBB.Dev
Posted By: Helice Having non-ubbt pages show in Who's Online - 09/29/2002 12:16 AM
I really did try to search for the answer on this because I know it's been discussed before, but I couldn't turn any matching threads up.

I want to have other pages on my site that are unrelated to threads to show up in the Who's Online page.

I made a test.php page. I made sure that the cookie prefix is set to "/" for the whole site. I included the path to main.inc.php, I copied the authentication code, I added a line to the online.php language file... but nothing, I'm not getting past the authentication.

Can someone please either give me the answer in words of one syllable, or direct me towards some older threads where this has already been solved?

Thanks!
Posted By: JoshPet Re: Having non-ubbt pages show in Who's Online - 09/29/2002 12:25 AM
I've never gotten that method to work for me outside of the threads directory....even though my cookies are site wide.

I posted some other info about this here.

I personally have not gotten this working yet. I think the theory is right. I've just never gotten back to look at it.

I think Aglavalan got it to work for him.

Hope that helps a bit.

If I get a chance to get back to this, I'll post any progress I make.
All of my non-ubbt pages use the UBB.Thread header and footer and "register" in Who's Online.

There is a post around here somewhere with the code. If you can't find it. I'll post what I use that includes a few additions inculding a "printable page" option.
You mean like the "basic page" sort of thing?

I can get that to work within my threads directory. But get the "Private" when I'm outside the threads directory...even though cookies are site wide.
The first code JoshPet posted in that thread works with the cookie authentification code I added in the thread. I have it working on all pages in my site just fine.
Hi

This is what is done in my site in order to log visitors into who's online table.

1. copy main.inc.php file and rename it into mainbug.inc.php (so you have 2 files main.inc.php and mainbug.inc.php under.threads direcroty

2. Edit the mainbug.inc.php and find
code:
// DO NOT EDIT ANYTHING BELOW THIS LINE!
include("$thispath/ubbt.inc.php");



change that to:
code:
// DO NOT EDIT ANYTHING BELOW THIS LINE!
include("$thispath/ubbtbug.inc.php");



3. Copy ubbt.inc.php file and rename it into ubbtbug.inc.php (so you have 2 files also, ubbt.inc.php and ubbtbug.inc.php)

4. Edit ubbtbug.inc.php and find (line 290):
code:
// require the header.php file
if ($script['2'] != "top") {
if ($fheader) {
$header = "header_$Board.php";
}else {
$header = "header.php";
}
@include "$thispath/includes/$header";
}


change that into
code:
// require the header.php file
if ($script['2'] != "top") {
if ($fheader) {
$header = "header_$Board.php";
}else {
$header = "header_bug.php";
}
@include "$thispath/includes/$header";
}



Find (line 780):
code:
else {
$file = "footer.php";


change that into:
code:
else {
$file = "footer_bug.php";



5. Create a file name bug_online.php
and write the following code:
code:
<?
// Require the library
require ("./mainbug.inc.php");

// ---------------------
// Send the page to them
$html = new html;
$html -> send_header("Your page name",$Cat,0,0,0,0,$user);

// -------------
// Send a footer
$html -> send_footer();

?>



6. Create a blank files: header_bug.php and footer_bug.php and put them under "includes" direcroty

7. Open your languages file (online.php) and add:
code:
$ubbt_lang['bug_online'] = "My other page";



8. Add this line into your page that want to be tracked down:
code:
<IFRAME SRC="http://www.yourdomain.com/forum/bug_online.php" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=0 HEIGHT=0> <IMG SRC="http://www.yourdomain.com/forum/bug.gif" WIDTH=0 HEIGHT=0 BORDER=0></IFRAME>



9. Add blank image 1 x 1 pixel and named it bug.gif. Put this file to correspondent point 8 above:
<IMG SRC="http://www.yourdomain.com/forum/bug.gif" WIDTH=0 HEIGHT=0 BORDER=0>

It works for me, but maybe someone can help in more simple one.

© UBB.Developers