Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: incorrect "last viewed" date/time  (Read 5543 times)

0 Members and 1 Guest are viewing this topic.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
incorrect "last viewed" date/time
« on: February 20, 2005, 09:42:41 pm »

On my local system, it shows for last viewed:
Dec 31, 1969 at 04:33 PM (in db ctime: 1095277307)
On my web host system:
Aug 08, 2011 at 12:51 AM (in db ctime: 1101028774)

Local system would have the latest files, and I synchronised the remote files, so they should be updated. Also ran update.php

Other dates in gallery are correct.

Timezone difference in Config: -8

local: Windows, Apache 2, MySQL 4.1.8-nt
remote: Linux, Apache 1.33, MySQL 4.0.22

both: php 4.3.10
« Last Edit: February 25, 2005, 12:50:09 pm by Abbas Ali »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: incorrect "last viewed" date/time
« Reply #1 on: February 21, 2005, 08:28:36 am »

On the local system, I installed a brand new installation of dev version to have a bridged installation. Last viewed shows:
Jan 01, 1970 at 12:33 AM

So it's not some holdover that might have existed in the previous dev version.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: incorrect "last viewed" date/time
« Reply #2 on: February 24, 2005, 11:35:31 pm »

I fixed it but I'm not sure if it was kosher...

In functions.inc.php
FIND:
Code: [Select]
        case 'lasthits': // Last viewed pictures
                if ($META_ALBUM_SET && $CURRENT_CAT_NAME) {
                        $album_name = $lang_meta_album_names['lasthits'].' - '. $CURRENT_CAT_NAME;
                } else {
                        $album_name = $lang_meta_album_names['lasthits'];
                }
                $query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET";
                $result = cpg_db_query($query);
                $nbEnr = mysql_fetch_array($result);
                $count = $nbEnr[0];
                mysql_free_result($result);

                //if($select_columns != '*') $select_columns .= ', UNIX_TIMESTAMP(mtime) as mtime, aid, hits, lasthit_ip, owner_id, owner_name';
                $select_columns = '*'; //allows building any data into any thumbnail caption

REPLACE last line with:
Code: [Select]
                $select_columns = '*, UNIX_TIMESTAMP(mtime) as mtime'; //allows building any data into any thumbnail caption

I'm not sure if it is ok since it is already a SELECT * and I added more columns. But it worked.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: incorrect "last viewed" date/time
« Reply #3 on: February 25, 2005, 12:49:24 pm »

Modified the code as suggested by TranzeNDance and marking this thread as fixed.
Logged
Chief Geek at Ranium Systems
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.