Stats on frontpage. (sidebar)

Here we can make tutorials ... how to ...
it will make it more easy to start with our new sites.

Stats on frontpage. (sidebar)

Postby admin » September 17th, 2010, 11:36 pm

People had ask me this question a few times ... how to make stats on the frontpage:

I think some of us allready use stats on our sites and some not.
and some people don´t know how to do ...

Maybee you have more stats code.
Please comments it here ... so we can have a better stats code on our sites.


Now I will explain how to do: (the code is ...)

total members:
Code: Select all
{stats:count="members",online="0",cache_time=1,cache_name="totalmembers"}


online members:
Code: Select all
{stats:count="members",online="1",cache_time=1,cache_name="totalonline"}


example for 2.5.3:
insert the code in your header.tpl or homepage.tpl
find this code:
Code: Select all
<div id="sidebar">
{polls:polls="",limit="1"}
...the stats code here ...


here is how I did it on my site (2.5.3)
Code: Select all
<div id="sidebar_wrap">
<div id="sidebar">

<br>total members:
{stats:count="members",online="0",cache_time=1,cache_name="totalmembers"}
<br>online members:
{stats:count="members",online="1",cache_time=1,cache_name="totalonline"}

{polls:polls="",limit="1"}
<div class="banner_sidebar">
{banners:group="sidebar"}


but on 2.5.5 it is little different
you must insert the code in sidebar.tpl
find {polls:polls=""} in the bottom of the page.
and the code will be like this:
Code: Select all
{polls:polls=""}
<br>total members:
{stats:count="members",online="0",cache_time=1,cache_name="totalmembers"}
<br>online members:
{stats:count="members",online="1",cache_time=1,cache_name="totalonline"}
<div class="banner">{banners:group="sidebar"}</div>


I use tags <br> so it will be like this:
total members
total online


if you don´t ... it should be like this:
total members total online

some templates has sidebar in header.tpl some in homepage.tpl
and the newer versions of vldpersonals have it in sidebar.tpl
so we can do it in different way but only ask and I try to explain how !

I had try the code in both 2.5.3 and 2.5.5 and know it´s working !
I had try to get man/woman stats to working but no success with it.
//gugu
Admin VldMods Forum
User avatar
admin
Site Admin
 
Posts: 105
Joined: 13 Aug 2010
Location: sweden
Knowledge: 6
Vld Version: 2.7
Vld Site: http://www.love2u.se

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron