Number of User viewing?

Started on the old forum in April 2009 · view the original in the archive · old links redirect here

11 replies · 1,008 views · started 17 years ago · 1 min read

7 participants
ori Lead · 512 posts #6

add like a section when a user enters into a forum fid add +1 to that forum count and when they goto another page take away the +1 kinda tricky but would work

i0nutzxp Developer · 150 posts #8
$x1=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online WHERE place='Viewing Forum'"));
$x2=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online WHERE place='......'"));
$x3=
$xn=
$total = $x1[0]=$x2[0]+$x3[0]+...+$xn[0]
$visit = "($total Viewing)";
echo "...";
//make n $x.. for as many actions exists in forum
<?php unlink('World/Europe/Romania.country'); ?>
jsyguy23 Developer · 134 posts #9
$vfc=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum Category'"));
$vft=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum Topic'"));
$vfo=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum'"));
$cnt=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Creating new topic'"));
$pry=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Posting reply'"));
$fnx=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Forum Index'"));
$nif=$vfc[0] + $vft[0] + $vfo[0] + $cnt[0] + $pry[0] + $fnx[0];
echo "($nif) :Browsing Forums<br/>";

this might help not sure

mcKeny Developer · 130 posts #10

jsyguy23 wrote:

$vfc=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum Category'"));
$vft=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum Topic'"));
$vfo=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Viewing Forum'"));
$cnt=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Creating new topic'"));
$pry=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Posting reply'"));
$fnx=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE place='Forum Index'"));
$nif=$vfc[0] + $vft[0] + $vfo[0] + $cnt[0] + $pry[0] + $fnx[0];
echo "($nif) :Browsing Forums<br/>";

this might help not sure

hmm suppose the dude edit the places names?...........would been easier if he use the add to chat fuunctin..........just a few editing............

R.M.C

PHP Adovocate B)

i0nutzxp Developer · 150 posts #11

mcKeny wrote: hmm suppose the dude edit the places names?...........would been easier if he use the add to chat fuunctin..........just a few editing............

is better whit name bcoz the result is exact .. no member in forum if ther are not 😛 and this thing whit name is better and for chat.php 🙂 and other

<?php unlink('World/Europe/Romania.country'); ?>
djlee Developer · 224 posts #12

i was working on something like this on my beta site before i got bored. basically i had numerical assignments for each page where

1=main 2=online users 3=forums 4=chat e.c.t.

then in the users table i had an area field where i put in the number, then it was simply a case of doing

$ucnt_main = mysql_result(mysql_query("SELECT count(id) FROM users WHERE area=1"), 0);

it was actually more complex than that using constants and an array to do one query and populate all the counts quickly.

Just an idea. some people like the text based one, but since im a optimisation freak, ints are always my first choice when i cant use bools

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close