Reply
Who's online code issues
Old 04-29-2008, 10:40 AM Who's online code issues
Skilled Talker

Posts: 63
Name: Holly Simon
I'm using a who's online script to generate the users online here

http://www.xfilesnews.com/index.php?...tpage&Itemid=1 - the bar at the bottom, with X users.

I'm trying to implement the bar across several sites (and besides weird css issues at the moment) I can't get the who's online script to work for two sites..

http://fiction.xfilesnews.net/index.php

It's not displaying there.

I have both pieces of code with this:

<?php include('/home/thinkey/public_html/network/online.php')

which is the path to the php script..obviously the script is working, just not on several sites (i'm looking for it to display global users online, therefore, shouldn't it be ok to have my own sites pointing to the same script?)

Anyone out there know the answer to this? Thanks.
Thinkey is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-29-2008, 10:44 AM Re: Who's online code issues
rogem002's Avatar
Webmaster Talker

Posts: 548
Name: Mike
Location: United Kingdom
It's most likely the cookie which the session key is stored is domain based.

Can you show us the code for the file "/home/thinkey/public_html/network/online.php" please?
__________________
Website Services
PHP Code:
if(Added_Talkupation($post) == TRUE){iHug($you);} 
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-29-2008, 10:49 AM Re: Who's online code issues
Skilled Talker

Posts: 63
Name: Holly Simon
Code:
<?
/**
 *
 * TG WHO'S ONLINE
 * Copyright 2005 - 2006 (c) TOXIC GOBLIN
 * http://www.toxicgoblin.com
 * 
 */
 
//Optional Database Connection Information
//**Uncomment the following 2 lines and edit the values if you do not already have an active database connection**
//
$db = mysql_connect("localhost", "db_name", "password") or die("Could not connect");
mysql_select_db("db_name");

//Fetch Time
$timestamp = time();
$timeout = $timestamp - 900;

//Insert User
$insert = mysql_query("INSERT INTO TG_whos_online (timestamp, ip, file) VALUES('$timestamp','".$_SERVER['REMOTE_ADDR']."','".$_SERVER['PHP_SELF']."')") or die("Error in who's online insert query!");
//Delete Users
$delete = mysql_query("DELETE FROM TG_whos_online WHERE timestamp<$timeout") or die("Error in who's online delete query!");
//Fetch Users Online
$result = mysql_query("SELECT DISTINCT ip FROM TG_whos_online") or die("Error in who's online result query!");
$users = mysql_num_rows($result);

//Show Who's Online
if($users == 1) {
print("$users User Online\n");
} else {
print("$users Users Online\n");
}
?>
I've changed the user and name of db and user name - i hope that's ok.

Just an FYI, the script would be located at www.driftmedia.ca/network/online.php through url - so xfilesnews.com and fiction.xfilesnews.net would be calling it from the same path in file (i hope that makes sense.

basically the directory structure is:

pub_html/network/
pub_html/xfilesnew/
pub_html/xfnfic/

just for example - they're all at the same level, just both sites are using different domains.
Thinkey is offline
Reply With Quote
View Public Profile
 
Old 04-29-2008, 11:05 AM Re: Who's online code issues
rogem002's Avatar
Webmaster Talker

Posts: 548
Name: Mike
Location: United Kingdom
From what I can see, I can only assume the page where it's not working is having problem including the file (There is a bit of lag). I recommend checking that you have not missed a ; somewhere.
__________________
Website Services
PHP Code:
if(Added_Talkupation($post) == TRUE){iHug($you);} 
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-29-2008, 11:10 AM Re: Who's online code issues
Skilled Talker

Posts: 63
Name: Holly Simon
Quote:
Originally Posted by rogem002 View Post
From what I can see, I can only assume the page where it's not working is having problem including the file (There is a bit of lag). I recommend checking that you have not missed a ; somewhere.
I copied/pasted the block of code...therefore i doubt it.

It's not working on 2 sites i attempted to paste the code on...what would be the odds that its missing a ; on both if i copied the block of code?
Thinkey is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Who's online code issues
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12361 seconds with 13 queries