Author Topic: removing hit counters for database optimization  (Read 3189 times)

0 Members and 1 Guest are viewing this topic.

Offline tutton

  • Newbie
  • *
  • Posts: 13
    • View Profile
removing hit counters for database optimization
« on: January 07, 2011, 10:19:06 PM »
Hello,

I don't just mean the counters themselves like from the templates I'd like to remove the scripts that keep track of the hits to optimize the database.

thanks

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: removing hit counters for database optimization
« Reply #1 on: January 08, 2011, 04:38:54 AM »
details.php:
// Update Hits
if ($user_info['user_level'] != ADMIN) {
  
$sql "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = 
$image_id";
  
$site_db->query($sql);
}


categories.php:
//Update Category Hits
if ($user_info['user_level'] != ADMIN && $page == 1) {
  
$sql "UPDATE ".CATEGORIES_TABLE."
          SET cat_hits = cat_hits + 1
          WHERE cat_id = 
$cat_id";
  
$site_db->query($sql);
}
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 tutton

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: removing hit counters for database optimization
« Reply #2 on: January 08, 2011, 11:51:55 AM »
V@no you know I'm sending a huge donation as soon as I can afford it this software is AWESOME!