In Progress

335118 Very Quick PHP Job

We have a chat room with our Social Network site. We need to display on home & profile page how many people are in the chat room.

Below are the full instructions on how you do it so this will be a very easy job.

Need it done ASAP so please only bid if you can do it now.

Thanks

You will need to write a custom code that is similar to the site_statstics_chat() in the include/[url removed, login to view]:

// THIS FUNCTION IS RUN WHEN GENERATING SITE STATISTICS

// INPUT:

// OUTPUT:

function site_statistics_chat(&$args)

{

global $database;

$statistics =& $args['statistics'];

// NOTE: CACHING WILL BE HANDLED BY THE FUNCTION THAT CALLS THIS

$total = $database->database_fetch_assoc($database->database_query("SELECT COUNT(chatuser_id) AS total FROM se_chatusers WHERE chatuser_lastupdate>".(time()-15)));

$statistics['chat'] = array(

'title' => 3510042,

'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )

);

/*

$total = $database->database_fetch_assoc($database->database_query("SELECT COUNT(chat_user_id) AS total FROM se_chat_users WHERE chat_user_session_lastupdate>".(time()-15)));

$statistics['im'] = array(

'title' => 3510043,

'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )

);

*/

}

// END site_statistics_chat() FUNCTION

After doing that, please make sure the function is imported into the [url removed, login to view] and you should call it and assign it as a smarty variable:

$chat_count = custom_stat_function();

$smarty->assign('chat_count', $chat_count);

Then in your [url removed, login to view] file you can call this variable with a code like this:

Chat count is equal to {$chat_count}

Skills: Anything Goes, PHP, Script Install

See more: social network code php, profile php code, job you can do from home, job that can be done from home, how to write a job bid, how to write a code in php, how to write a bid on a job, statistics job, profile.php, database caching, php job, chat php code, php file array, php room, custom function php, php include tpl, php file write array, php global variable, smarty php time, php script function, php quick profile, php function write, php array file, php smarty job, script chat social

About the Employer:
( 254 reviews ) Dublin, Ireland

Project ID: #2080930

Awarded to:

stanxp

An easy 10 mins job... check PM for more info. Best regards, Stan.

$15 USD in 0 days
(66 Reviews)
5.9