Author Topic: [1.7 / 1.7.1] Image dl counter does not update when dl from lightbox  (Read 10029 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
If u download images from lightbox, the download counter for each image does not getting updated.

Step 1.
Open /download.php
Find:
Code: [Select]
  $sql = "SELECT cat_id, image_media_file, image_download_urlreplace with:
Code: [Select]
  $image_ids = array();
  $sql = "SELECT cat_id, image_media_file, image_download_url, image_id


Step 1.2.
Find next:
Code: [Select]
        unset($file_data);Add after:
Code: [Select]
        $image_ids[] = $image_row['image_id'];

Step 1.3.
Find next:
Code: [Select]
    if ($file_added) {Add after:
Code: [Select]
      if ($user_info['user_level'] != ADMIN) {
        $sql = "UPDATE ".IMAGES_TABLE."
                SET image_downloads = image_downloads + 1
                WHERE image_id IN (".trim(implode(", ", $image_ids)).")";
        $site_db->query($sql);
      }



NOTE: Because there are atleast two simular parts in the file that will match with strings that u need to find, u'll need only the fist matching lines that are in between line
Code: [Select]
if ($action == "lightbox") {and
Code: [Select]
elseif ($image_id) {
« Last Edit: December 07, 2005, 12:44:06 AM by V@no »