Author Topic: Total Downloads on the index page.  (Read 5249 times)

0 Members and 1 Guest are viewing this topic.

Offline unite

  • Newbie
  • *
  • Posts: 48
    • View Profile
Total Downloads on the index page.
« on: July 12, 2006, 10:11:59 PM »
Well I think this should be easy but I cant seem to find the (tag) I want to show the (total downloads) on the index page. I just need the tag for it and I will place it in the code. Can anyone help... I have seen others sites with the stats showing on the index page but I cant find that mod either...

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Total Downloads on the index page.
« Reply #1 on: July 12, 2006, 10:28:33 PM »
... you can find "total downloads" and other statistics here :
... http://www.4homepages.de/forum/index.php?topic=6484.msg28576#msg28576
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline unite

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Total Downloads on the index page.
« Reply #2 on: July 13, 2006, 02:34:17 AM »
Yeah that's not exactly what I'm looking for and I cant read German. In the admin CP there is a stat for total downloads. I just need that bit of code so I can insert in on the index page.

Offline unite

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Total Downloads on the index page.
« Reply #3 on: July 13, 2006, 07:03:29 AM »
V@no can you help me with this? It seems simple enough I just cant seem to figure it out.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Total Downloads on the index page.
« Reply #4 on: July 13, 2006, 07:12:34 AM »
just install that mod and then use {total_downloads} in the templates...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Total Downloads on the index page.
« Reply #5 on: July 13, 2006, 10:19:30 AM »
... add this in your index.php ...
Code: [Select]
//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
 $sql = "SELECT SUM(image_downloads) AS sum
         FROM ".IMAGES_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_downloads = $row['sum'];
 $lang_total_downloads = $lang['total_downloads'];
 
 $site_template->register_vars("total_downloads", $total_downloads);
 $site_template->register_vars("lang_total_downloads", $lang_total_downloads);
 unset($total_downloads);
 unset($lang_total_downloads);

... and use this in your home.html ...
Code: [Select]
{total_downloads}
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...