I got script too see how many visitors are online. I dont know if that is illegal but i would put it in your gallery (actualy on my site :) )
I know how to insert php script in normal php page, but how do i insert it in diapo.php.
<?php include("usersonline.php"); ?>
<- this is what i insert in normal php
i would insert useronline.php between:
$infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />"; $infos.= $lang['recent_image']." ".$conf['periode_courte']." ".$lang['days'];
Please help me
sorry, but you can't insert the result of your script at the place you want. But you can modify this script to do it
Offline
yes i tried everything and nothing worked. How can i modify this script? Got any idea?
i tried to add this:
$infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />";
$infos.= $lang['connected_number']." ".include("./usersonline.php")."<br />";
$infos.= $lang['recent_image']." ".$conf['periode_courte']." ".$lang['days'];
but as you said it doesnt work.Well it does... but not where i want to. "my" script showed on top left side of the screen. But that is opposite where i want to lol
show me your file useronline.php
Offline
here it is:
<?php
include("dbinfo.php");
// Set length of session to twenty minutes
define("SESSION_LENGTH", 20);
$sConn = @mysql_connect($dbServer, $dbUser, $dbPass)
or die("Couldnt connect to database");
$dbConn = @mysql_select_db($dbName, $sConn)
or die("Couldnt select database $dbName");
$timeMax = time() - (60 * SESSION_LENGTH);
$result = mysql_query("select count(*) from usersOnline where unix_timestamp(dateAdded) >= '$timeMax'");
$usersOnline = mysql_result($result, 0, 0);
echo "There " . ($usersOnline != 1 ? "are" : "is") . " $usersOnline user" . ($usersOnline != 1 ? "s" : "") . " online. ";
?>
[/URL]http://www.devarticles.com/art/1/122/2[URL]
If you go on my main site you will see how it works:
[/URL]http://members.lycos.co.uk/lucifix/[URL][/URL]
replace
echo "There " . ($usersOnline != 1 ? "are" : "is") . " $usersOnline user" . ($usersOnline != 1 ? "s" : "") . " online. ";
by
$text_user_online = "There " . ($usersOnline != 1 ? "are" : "is") . " $usersOnline user" . ($usersOnline != 1 ? "s" : "") . " online. ";
and in diapo.php (version 1.2), insert
include("usersonline.php"); $infos.= $text_user_online;
after
$infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />";
Offline
man... you are genious!!! :D The script work!!!
I just need to put <br /> in and everything will be just fine 8)
next stop...
photo rating hehe j/k or not :rolleyes:
Lucifix
Offline
one more thing...
when i pust <br /> it says that there is. the code looks like this:
$infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />";
include("usersonline.php");
$infos.= $text_user_online "<br />";
$infos.= $lang['recent_image']." ".$conf['periode_courte']." ".$lang['days'];
Offline
its ok! i figured that out by my self :idea:
Offline
i got a different kind of useronline. can i put it on the gallery?
Offline
Dark: tell us what kind of useronline script are you using. Couse its difficulte to answer to your question if z0rglub dont know what code are you using etc. :)
Lucifix
Offline
well it almost like urs only it tells me and the users whos on and where. its called useronline pro.but i dont have a copy of the code with me,cause i always delete my codes once i upload them.
Offline
that will be hard... why dont u install the same script as i have. Its not complicated, and you will get on net all information how to install it. it will took max 30 min.
Lucifix
or you can tell us where did u get your script, so we could see code on net.
Offline
well cause mine is better.but i can download mine via FTP and ill show it. i did mod it cause it didnt work well with my server but shouldnt matter.
Offline