PDA

View Full Version : Show who's online on an external page ??


Nassou
05-09-2008, 10:48 PM
Hello !

I would like to show user online on forum on my page web !

How ?

Dismounted
05-10-2008, 04:57 AM
You need to replicate the processes that go on in index.php. You will need basic PHP/MySQL knowledge to do this.

Nassou
05-10-2008, 10:57 AM
Yes , i have modified a script to show a statitic

<?php

error_reporting(7);

//################################################## #
// A MODIFIER LE REPERTOIRE YOUR/PAT
//################################################## #

chdir('/home/xxxxxxxxxxx/forum');

//################################################## #
// Fichier a inclure
//################################################## #

require_once('./global.php');

//################################################## #
// Recuperation des donnees dans la base
//################################################## #
// Nombre de messages sur le forum !
$countposts=$db->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
// Nombre de membres sur le forum bien ?videmment
$numbersmembers=$db->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
//Nombre de discussions sur le forum :P
$countthreads=$db->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);
//Le dernier cochon MDR
$getnewestusers=$db->query_first("SELECT userid,username FROM user ORDER BY joindate DESC LIMIT 1");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
echo "$numbermembers membres et $totalposts messages et $totalthreads Discussions ! useronline on forum :??????????? ";

useronline is the probleme !

Dismounted
05-10-2008, 11:16 AM
The whole block of code is available in index.php.