Author Topic: Number of guest  (Read 3723 times)

0 Members and 1 Guest are viewing this topic.

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Number of guest
« on: January 04, 2003, 02:28:37 PM »
Here i am again, i'm a little bit further , but still trying.
I want to make visible on the site to my visitors how many people are using 4images
Can someone please take another look and tell me how i make the numbers of the guest and users visable
I think it should be possible even with 1.61

Thanks in advance

http://www.foto-janssen.nl

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Number of guest
« Reply #1 on: January 04, 2003, 06:20:06 PM »
unfortunetly I dont have chance compare v1.6 with v1.7 script, so
here is stats script from v1.7. (/includes/stats.php)
backup your file and change it to this code:
Code: [Select]
<?php

//----------------------------------------------------- 
//--- Show number of Users ---------------------------- 
//----------------------------------------------------- 
   
$sql "SELECT COUNT&#40;*&#41; as users 
          FROM "
.USERS_TABLE.
          WHERE user_id <> "
.GUEST
  
$row $site_db->query_firstrow&#40;$sql&#41;; 

  
$total_users "".$lang['users'&#93;."<B> ".$row['users'&#93;."</B>\n"; 
  
  
$site_template->register_vars&#40;"total_users", $total_users&#41;; 
unset&#40;$total_users&#41;; 

//----------------------------------------------------- 
//--- Hits -------------------------------------------- 
//----------------------------------------------------- 
   
$sql "SELECT SUM&#40;image_hits&#41; AS sum 
          FROM "
.IMAGES_TABLE
  
$row $site_db->query_firstrow&#40;$sql&#41;; 

  
$sum = &#40;isset&#40;$row['sum'&#93;&#41;&#41; ? $row['sum'&#93; &#58; 0; 
  
$total_hits "".$lang['total_hits'&#93;."<B> ".$row['sum'&#93;."</B>\n"; 
  
  
$site_template->register_vars&#40;"total_hits", $total_hits&#41;; 
unset&#40;$total_hits&#41;; 

//----------------------------------------------------- 
//--- Votes ------------------------------------------- 
//----------------------------------------------------- 
   
$sql "SELECT SUM&#40;image_votes&#41; AS sum 
          FROM "
.IMAGES_TABLE
  
$row $site_db->query_firstrow&#40;$sql&#41;; 

  
$sum = &#40;isset&#40;$row['sum'&#93;&#41;&#41; ? $row['sum'&#93; &#58; 0; 
  
$total_votes "".$lang['total_votes'&#93;."<B> ".$row['sum'&#93;."</B>\n"; 
  
  
$site_template->register_vars&#40;"total_votes", $total_votes&#41;; 
unset&#40;$total_votes&#41;; 

//----------------------------------------------------- 
//--- Downloads --------------------------------------- 
//----------------------------------------------------- 
   
$sql "SELECT SUM&#40;image_downloads&#41; AS sum 
          FROM "
.IMAGES_TABLE
  
$row $site_db->query_firstrow&#40;$sql&#41;; 

  
$sum = &#40;isset&#40;$row['sum'&#93;&#41;&#41; ? $row['sum'&#93; &#58; 0; 
  
$total_downloads "".$lang['total_downloads'&#93;."<B> ".$row['sum'&#93;."</B>\n"; 
  
  
$site_template->register_vars&#40;"total_downloads", $total_downloads&#41;; 
unset&#40;$total_downloads&#41;; 

//----------------------------------------------------- 
//--- Comments ---------------------------------------- 
//----------------------------------------------------- 
   
$sql "SELECT SUM&#40;image_comments&#41; AS sum 
          FROM "
.IMAGES_TABLE
  
$row $site_db->query_firstrow&#40;$sql&#41;; 

  
$sum = &#40;isset&#40;$row['sum'&#93;&#41;&#41; ? $row['sum'&#93; &#58; 0; 
  
$total_comments "".$lang['total_comments'&#93;."<B> ".$row['sum'&#93;."</B>\n"; 
  
  
$site_template->register_vars&#40;"total_comments", $total_comments&#41;; 
unset&#40;$total_comments&#41;; 
?>
see if it's gonna work.
good luck. ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Number of guest
« Reply #2 on: January 04, 2003, 07:57:03 PM »
I found the problem
in sessions.php it was set to be visable for ADMIN, when i changed it to guest it was visible for everybody

Many regards to everybody