Author Topic: Stats's backend in frontend  (Read 2565 times)

0 Members and 1 Guest are viewing this topic.

Offline edonai

  • Newbie
  • *
  • Posts: 32
    • View Profile
Stats's backend in frontend
« on: August 28, 2009, 12:11:18 AM »
Hello, I would like to display the media file size and number of images awaiting validation in my statistics module on my homepage.



   
How do, to use the tags {}? Thank you for your answers.

Edonai

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: Stats's backend in frontend
« Reply #1 on: August 28, 2009, 01:36:37 AM »
What is your statistics module?
Here is a bare bone code that you can use
awaiting validation:
$sql "SELECT COUNT(*) as temp_images
        FROM "
.IMAGES_TEMP_TABLE;
$row $site_db->query_firstrow($sql);
$site_template->register_vars("awaiting_validation_num"$row['temp_images']); //register template tag {awaiting_validation_num}



media directory size (this will make a huge impact on your server performance)
$media_dir_size format_file_size(get_dir_size(MEDIA_PATH));
$site_template->register_vars("media_dir_size"$media_dir_size); //register template tag {media_dir_size}
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)