Osdate : Hiding and Manipulating number of users online.

Anyone who starts a matchmaking site with Osdate has the same question. How to disable that “Members online: 0” statistics that sits on the main page.Here is how to disable or even manipulate all the user statistics like Members in Last Week, Pictures in Last Week and Members online etc.

We will modify 2 files – stats.tpl in your template directory and init.php in the root.

Settings in Stats.tpl- increment users

If you want to just increment the number of users online you can simply add that number to $online_users_count like this


For a new website however this number would always show as 5, since you would have 0 users online most of the time. You can also change other values here similarly like  $weekcnt for number of users last week, $weeksnaps for number of pictures last week etc.

Settings in init.php – Randomly increment users

Now, if you want the number of users to be incremented by a random number , you can do that too.  in Init.php , define a new function that returns a random number between 5 and 10. Assign this number to a string $online_random. 

Update initi.php

//Assigning a random number to $online_random

function update_random(){$temp_aj=rand(5,10); return $temp_aj;}
$t->assign(‘online_random’, update_random());

update stats.tpl with {$online_users_count+$online_random}

That’s it, next time everytime you refresh the page, you will see a random number of users online and nobody would suspect that your site is a non active site. This trick reduces the bounce rate of users who come to your site and seeing no users online, flee without registering.