Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
What can be done to get other sections of a website to show up on 'Who's Online' besides them being listed as 'private'. Is there some code I can insert into the page that will give it a name to show there? I have each page on my site verifying who they are with the UBBT cookie, and can track any logged in user on almost every page now. I still have a few sections to update from .asp, but most are .php now since I have added a few tables for custom data displayed upon user groups, etc. I know how to make any page in the ubb directory have a unique name, but I would like to do this on other directories on my site. Any direction, hints would be appreciated

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
funny you should ask.... I've been playing with this for hours.

There was a hack posted at the photo post site... which I haven't quite got working yet... but it said to add this into all your pages.... change the name of the O_What write for each page... and then add those words to your online.php language file.

Here's the code:

code:

$link = mysql_connect("localhost", "dbuser", "password") or die ('I cannot open the UBBThreads database.');
mysql_select_db ("threadsdb",$link)or die("Could not connect to UBBThreads database");

if ( IsSet($w3t_myname) ) $username = $w3t_myname;

if ( IsSet($w3t_myid) ) {
$query = "SELECT U_Username FROM w3t_Users WHERE U_Number=$w3t_myid";
$queryv = mysql_query($query,$link);
$results = mysql_fetch_array($queryv);
$username = $results[0];
}

if ( $username == "" ) {
$IP = $HTTP_SERVER_VARS{'REMOTE_ADDR'};
$username = "-ANON-$IP";
$status="a";
}
else $status="r";

$last = time();
$query = "REPLACE INTO w3t_Online
(O_Username,O_Last,O_What,O_Extra,O_Read,O_Type)
VALUES ('$username','$last','photopost','','','$status')";

$queryv = mysql_query($query,$link);
mysql_close( $link );



You have to substitue in database name, username and password. Then towards the bottom where it says 'photopost' you put whatever you want there, then add into your language file.

BUT... what isn't working for me is the $last
I don't get an entry into the table. But if I manually put a number there (within 10 minutes) then it works.... so I don't know if the time(); is what Threads is looking for.

When I look at the O_Last field with myphpadmin the time is a big long number which I don't quite understand.

If anyone knows how to tweak this to make it work... you could use it in any PHP page. Even if you aren't sending the threads headers.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Hmm, know what version of UBBT this was written for, and are you trying this on 6.1x yourself?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm trying this on 6.1

Actually Michael from ExtremeBikin (developer of PhotoPostPHP) posted it here:
http://www.photopost.com/forum/showthread.php?threadid=33767&referrerid=4731

It was designed to insert into your photopost scripts and update the Online table.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Josh, the above code works fine for me on SOME pages that I have made, based off the 4.3 IIP. I am still working on what extra info is required. I am narrowing it down, but I do not know what everything means in UBBT yet, so it's a bit of hunt-and-peck with me. I'll get this one figured out within a day or so, as I very much want to use it myself!

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Let me know what progress you make.
I also posted for more help at the photopost board (the link I gave).

If I figure it out this evening, I'll post.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Well, if the page is not a IIP page, then you can add this to the top to use the UBBT cookie. Then the above code works fine.

code:

$PathToThreads = "c:/inetpub/wwwroot/www.domain.com/ubbthreads/";

require ("{$PathToThreads}main.inc.php");
$userob = new user;
$user = $userob -> authenticate(U_Username);



This is what I add to each page, besides any PAL paths if used for menu's or whatever. Make sure there is only one path set to the main.inc.php or it seems to like giving an error about sql statement being redefined.

I'm still working on how to get this to work right on a IIP 4.3 page in a different dir than the UBBT directory.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
OK, I figured out how to get this to work on a IIP 4.3 page in a dir other than UBBT, put the above code towards the bottom of the page, just after:

code:

include "include/footer.php";



This will prevent the code from conflicting with the IIP info, which I am guessing there is a similarly named variable somewhere that is conflicting. But the code at the end seems to work fine so far. The IIP page already has the user verified, so there is no need to do it again.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369


I've still been unable to get this to work in photopost. It wont write the time correctly.

Did you leave the time function the way it was?

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Yep, I did not touch the ubbt.inc.php file at all. I don't have photopost installed. Is the page requiring the threads/ubbt.inc.php file so the time() function is available? Is there a variable in photopost that uses the same name? Try inserting the code you wrote at the bottom of the page to see if that makes a difference. It did on an IIP 4.3 page. Oh, and make sure the online.php file has the name in lower case, not caps.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I've tried putting it at the bottom. And it works fine if I manually put a number in for the $last value. For some reason it just doesnt' get the time function correct and thus the table must dump it.

I feel I'm close.

This is what I'm trying:
code:

require("/home/measurection/htdocs/forums/main.inc.php");
$userob = new user;
$user = $userob -> authenticate();
$Username = $user['U_Username'];

$link = mysql_connect("localhost", "dbuser", "dbpass")
or die ('I cannot open the UBBThreads database.');
mysql_select_db ("dbname",$link)or die("Could not connect to UBBThreads database");

if ( $Username == "" ) {
$IP = $HTTP_SERVER_VARS{'REMOTE_ADDR'};
$user = "-ANON-$IP";
$status="a";
}
else {
$status="r";
}

$last = time();
$query = "REPLACE INTO w3t_Online (O_Username,O_Last,O_What,O_Extra,O_Read,O_Type)
VALUES ('$Username','$last','photopostindex','','','$status')";

$queryv = mysql_query($query,$link);
mysql_close( $link );



Anyone have any idea of how to get the time function to properly call? ubbt.inc.php uses $Last, but that doesn't seem to work either.


Last edited by JoshPet; 09/10/2002 2:05 PM.
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Hmm, I'm using the code you first posts with no edits other than login, password and db name. Plus the lines of code at the top of the page to verify cookie and set path to main.inc.php. You just posted different code. Let me try this new code on my site to see if it works.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Your second code does not work for me, the first code does Go back to what you posted first I guess?

Try it on a php page on your site that is not in the photopost section to get it working, then it should be easier to see what is conflicting in the photopost section.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)