#1 2002-12-11 19:32:16

Banned

visitors online

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.

Code:

<?php include("usersonline.php"); ?>

<- this is what i insert in normal php

i would insert useronline.php between:

Code:

  $infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />"; 
  $infos.= $lang['recent_image']." ".$conf['periode_courte']." ".$lang['days'];

Please help me

 

#2 2002-12-11 23:48:48

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13934

Re: visitors online

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

 

#3 2002-12-11 23:59:06

Banned

Re: visitors online

yes i tried everything and nothing worked. How can i modify this script? Got any idea?

 

#4 2002-12-12 00:02:23

Banned

Re: visitors online

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

 

#5 2002-12-12 00:05:10

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13934

Re: visitors online

show me your file useronline.php

Offline

 

#6 2002-12-12 00:10:03

Banned

Re: visitors online

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]

 

#7 2002-12-12 00:14:30

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13934

Re: visitors online

replace

Code:

echo "There " . ($usersOnline != 1 ? "are" : "is") . " $usersOnline user" . ($usersOnline != 1 ? "s" : "") . " online. ";

by

Code:

$text_user_online = "There " . ($usersOnline != 1 ? "are" : "is") . " $usersOnline user" . ($usersOnline != 1 ? "s" : "") . " online. ";

and in diapo.php (version 1.2), insert

Code:

include("usersonline.php");  
$infos.= $text_user_online;

after

Code:

$infos.= $lang['connected_user_male']." : ".$user['pseudo']."<br />";

Offline

 

#8 2002-12-12 00:22:56

Lucifix
Member
2002-12-12
34

Re: visitors online

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

 

#9 2002-12-12 00:27:42

Lucifix
Member
2002-12-12
34

Re: visitors online

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

 

#10 2002-12-12 00:33:23

Lucifix
Member
2002-12-12
34

Re: visitors online

its ok! i figured that out by my self   :idea:

Offline

 

#11 2002-12-12 02:26:22

darkcarnival
Member
2002-12-04
32

Re: visitors online

i got a different kind of useronline. can i put it on the gallery?


a metal fan? check out Metal Station: http://metalstation.4gigs.com/

Offline

 

#12 2002-12-12 10:57:05

Lucifix
Member
2002-12-12
34

Re: visitors online

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

 

#13 2002-12-12 21:19:28

darkcarnival
Member
2002-12-04
32

Re: visitors online

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.


a metal fan? check out Metal Station: http://metalstation.4gigs.com/

Offline

 

#14 2002-12-13 00:46:21

Lucifix
Member
2002-12-12
34

Re: visitors online

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

 

#15 2002-12-13 21:41:41

darkcarnival
Member
2002-12-04
32

Re: visitors online

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.


a metal fan? check out Metal Station: http://metalstation.4gigs.com/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2025 · Contact