Overall Stats on main page (like on aardvark)

mucka_tbfm

Mucka Jay
Is this possible and easy to do? At the bottom of the aardvark main page you would get the table with the overall stats in so just wondered if I could add this?
 

Mark

Administrator
Staff member
should be able to just edit table_wrapper template and paste this:

Code:
<div style="width: 300px;margin: 0 auto;">
<table cellspacing="1" cellpadding="1">
<tr><th class="stats_top" colspan="3">{$lng->stats_overall}</th></tr>
<tr><td class="stats1" colspan="3">{$stats_overall_average}</td></tr>
<tr><td class="stats2" width="33%">{$lng->g_in}</td><td class="stats2" width="33%">{$lng->g_out}</td><td class="stats2" width="33%">{$lng->g_pv}</td></tr>
<tr><td class="stats2">{$in_avg}</td><td class="stats2">{$out_avg}</td><td class="stats2">{$pv_avg}</td></tr>
<tr><td class="stats1" colspan="3">{$lng->stats_overall_total}</td></tr>
<tr><td class="stats2" width="33%">{$lng->g_in}</td><td class="stats2" width="33%">{$lng->g_out}</td><td class="stats2" width="33%">{$lng->g_pv}</td></tr>
<tr><td class="stats2">{$in_overall}</td><td class="stats2">{$out_overall}</td><td class="stats2">{$pv_overall}</td></tr>
</table>
</div>
 

mucka_tbfm

Mucka Jay
Hi Mark, I put this code firstly into the table_wrapper but then into wrapper as that is more like where I wanted it.

The table structure shows (headings etc) but no values are displayed. Any idea what we should do?
 

Mark

Administrator
Staff member
Sounds like you would need to copy the queries into a new plugin that would be available on all pages. Since you put the code in wrapper, can you verify all the stats show up as expected when you visit the overall stats page?

I'll check back with you tommorow and we'll get something working, just packing it up for the night
 

mucka_tbfm

Mucka Jay
No its not picking up the stats that way.

We tried replacing {$pv_overall} with {$unq_pv_overall} and then again with {$tot_pv_overall} and that gave us stats for the site at the bottom of each page that we went to.

We just want the overall stats to show in the footer. We would like the total unqiues and total overalls showing up.
 

Basti

Administrator
Staff member
We tried replacing {$pv_overall} with {$unq_pv_overall} and then again with {$tot_pv_overall} and that gave us stats for the site at the bottom of each page that we went to.
Yes those are the right tags to use

We just want the overall stats to show in the footer. We would like the total unqiues and total overalls showing up.
? You just said it works, so what you mean with this?
 

mucka_tbfm

Mucka Jay
We want the OUR SITE'S overall stats not a particular site which just happens to be the one at the bottom of each page
 

Basti

Administrator
Staff member
That vl do not track. Get some tracking software or build your own. The overall stats was ever since ( yes also in aardvark ) meant to display user stats added together, not your toplist website visitor count
 

Mark

Administrator
Staff member
no he just wants the exact same behavior as the old aardvark overall stats (we removed this because of performance VS usefulness)

You can make a new file in plugins/overallstats/global_start.php and add the big query in there.


no time to test and troubleshott this, but perhaps it gets you started.
PHP:
    $stats = $DB->fetch("SELECT SUM(unq_pv_overall), SUM(tot_pv_overall), SUM(unq_in_overall), SUM(tot_in_overall), SUM(unq_out_overall), SUM(tot_out_overall),
                         SUM(unq_pv_0_daily), SUM(unq_pv_1_daily), SUM(unq_pv_2_daily), SUM(unq_pv_3_daily), SUM(unq_pv_4_daily), SUM(unq_pv_5_daily), SUM(unq_pv_6_daily), SUM(unq_pv_7_daily), SUM(unq_pv_8_daily), SUM(unq_pv_9_daily), SUM(tot_pv_0_daily), SUM(tot_pv_1_daily), SUM(tot_pv_2_daily), SUM(tot_pv_3_daily), SUM(tot_pv_4_daily), SUM(tot_pv_5_daily), SUM(tot_pv_6_daily), SUM(tot_pv_7_daily), SUM(tot_pv_8_daily), SUM(tot_pv_9_daily),
                         SUM(unq_in_0_daily), SUM(unq_in_1_daily), SUM(unq_in_2_daily), SUM(unq_in_3_daily), SUM(unq_in_4_daily), SUM(unq_in_5_daily), SUM(unq_in_6_daily), SUM(unq_in_7_daily), SUM(unq_in_8_daily), SUM(unq_in_9_daily), SUM(tot_in_0_daily), SUM(tot_in_1_daily), SUM(tot_in_2_daily), SUM(tot_in_3_daily), SUM(tot_in_4_daily), SUM(tot_in_5_daily), SUM(tot_in_6_daily), SUM(tot_in_7_daily), SUM(tot_in_8_daily), SUM(tot_in_9_daily),
                         SUM(unq_out_0_daily), SUM(unq_out_1_daily), SUM(unq_out_2_daily), SUM(unq_out_3_daily), SUM(unq_out_4_daily), SUM(unq_out_5_daily), SUM(unq_out_6_daily), SUM(unq_out_7_daily), SUM(unq_out_8_daily), SUM(unq_out_9_daily), SUM(tot_out_0_daily), SUM(tot_out_1_daily), SUM(tot_out_2_daily), SUM(tot_out_3_daily), SUM(tot_out_4_daily), SUM(tot_out_5_daily), SUM(tot_out_6_daily), SUM(tot_out_7_daily), SUM(tot_out_8_daily), SUM(tot_out_9_daily),
                         SUM(unq_pv_0_weekly), SUM(unq_pv_1_weekly), SUM(unq_pv_2_weekly), SUM(unq_pv_3_weekly), SUM(unq_pv_4_weekly), SUM(unq_pv_5_weekly), SUM(unq_pv_6_weekly), SUM(unq_pv_7_weekly), SUM(unq_pv_8_weekly), SUM(unq_pv_9_weekly), SUM(tot_pv_0_weekly), SUM(tot_pv_1_weekly), SUM(tot_pv_2_weekly), SUM(tot_pv_3_weekly), SUM(tot_pv_4_weekly), SUM(tot_pv_5_weekly), SUM(tot_pv_6_weekly), SUM(tot_pv_7_weekly), SUM(tot_pv_8_weekly), SUM(tot_pv_9_weekly),
                         SUM(unq_in_0_weekly), SUM(unq_in_1_weekly), SUM(unq_in_2_weekly), SUM(unq_in_3_weekly), SUM(unq_in_4_weekly), SUM(unq_in_5_weekly), SUM(unq_in_6_weekly), SUM(unq_in_7_weekly), SUM(unq_in_8_weekly), SUM(unq_in_9_weekly), SUM(tot_in_0_weekly), SUM(tot_in_1_weekly), SUM(tot_in_2_weekly), SUM(tot_in_3_weekly), SUM(tot_in_4_weekly), SUM(tot_in_5_weekly), SUM(tot_in_6_weekly), SUM(tot_in_7_weekly), SUM(tot_in_8_weekly), SUM(tot_in_9_weekly),
                         SUM(unq_out_0_weekly), SUM(unq_out_1_weekly), SUM(unq_out_2_weekly), SUM(unq_out_3_weekly), SUM(unq_out_4_weekly), SUM(unq_out_5_weekly), SUM(unq_out_6_weekly), SUM(unq_out_7_weekly), SUM(unq_out_8_weekly), SUM(unq_out_9_weekly), SUM(tot_out_0_weekly), SUM(tot_out_1_weekly), SUM(tot_out_2_weekly), SUM(tot_out_3_weekly), SUM(tot_out_4_weekly), SUM(tot_out_5_weekly), SUM(tot_out_6_weekly), SUM(tot_out_7_weekly), SUM(tot_out_8_weekly), SUM(tot_out_9_weekly),
                         SUM(unq_pv_0_monthly), SUM(unq_pv_1_monthly), SUM(unq_pv_2_monthly), SUM(unq_pv_3_monthly), SUM(unq_pv_4_monthly), SUM(unq_pv_5_monthly), SUM(unq_pv_6_monthly), SUM(unq_pv_7_monthly), SUM(unq_pv_8_monthly), SUM(unq_pv_9_monthly), SUM(tot_pv_0_monthly), SUM(tot_pv_1_monthly), SUM(tot_pv_2_monthly), SUM(tot_pv_3_monthly), SUM(tot_pv_4_monthly), SUM(tot_pv_5_monthly), SUM(tot_pv_6_monthly), SUM(tot_pv_7_monthly), SUM(tot_pv_8_monthly), SUM(tot_pv_9_monthly),
                         SUM(unq_in_0_monthly), SUM(unq_in_1_monthly), SUM(unq_in_2_monthly), SUM(unq_in_3_monthly), SUM(unq_in_4_monthly), SUM(unq_in_5_monthly), SUM(unq_in_6_monthly), SUM(unq_in_7_monthly), SUM(unq_in_8_monthly), SUM(unq_in_9_monthly),  SUM(tot_in_0_monthly), SUM(tot_in_1_monthly), SUM(tot_in_2_monthly), SUM(tot_in_3_monthly), SUM(tot_in_4_monthly), SUM(tot_in_5_monthly), SUM(tot_in_6_monthly), SUM(tot_in_7_monthly), SUM(tot_in_8_monthly), SUM(tot_in_9_monthly),
                         SUM(unq_out_0_monthly), SUM(unq_out_1_monthly), SUM(unq_out_2_monthly), SUM(unq_out_3_monthly), SUM(unq_out_4_monthly), SUM(unq_out_5_monthly), SUM(unq_out_6_monthly), SUM(unq_out_7_monthly), SUM(unq_out_8_monthly), SUM(unq_out_9_monthly), SUM(tot_out_0_monthly), SUM(tot_out_1_monthly), SUM(tot_out_2_monthly), SUM(tot_out_3_monthly), SUM(tot_out_4_monthly), SUM(tot_out_5_monthly), SUM(tot_out_6_monthly), SUM(tot_out_7_monthly), SUM(tot_out_8_monthly), SUM(tot_out_9_monthly)
                         FROM {$CONF['sql_prefix']}_stats", __FILE__, __LINE__);

    // Get rid of SUM() in array keys
    foreach ($stats as $key => $value) {
      $new_key = str_replace(array('SUM(', ')'), '', $key);
      $stats[$new_key] = $value;
      unset($stats[$key]);
    }
 
    $stats = array_map('number_format', $stats);
    $TMPL = array_merge($TMPL, $stats);    $TMPL = array_merge($TMPL, $stats);
 

mucka_tbfm

Mucka Jay
Mmm, not sure how. I made a new page called global_start.php and put the above code into it and put it in correct path but I am lost as to what to do next. Sorry, I may sound like I know what I am doing but I am not really that good with it hahaha!
 

Basti

Administrator
Staff member
new page? Thats where you think wrong maybe.
Make yourself a new php file called global_start.php
In there you paste what Mark said. Then you upload that file into the overall stats plugins via ftp

And thats its. Now you have your {$unq_pv_overall} etc which you already seem to use in your wrapper.html file ( if i understood you correctly )
 

mucka_tbfm

Mucka Jay
Sorry, badly worded. I uploaded a file as named above into the folder as named above but as you see from the site, it is making no difference.

Maybe I will go back and look at the first bit of code I was given and make sure that is right. Start again and work through, I am sure I will get there eventually! Thanks again.
 

Basti

Administrator
Staff member
You still have the wrong tags in ur wrapper
{$in_overall} {$out_overall} {$pv_overall}

its unq_in_overall etc, like you mentioned in your earlier post. Then it will work
 
Top