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: Picture since last visit  (Read 2995 times)

0 Members and 1 Guest are viewing this topic.

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Picture since last visit
« on: May 20, 2008, 07:45:45 pm »

hello

How I can display the last picture since the last visit. like in a forum the last post since the last visit?

I want that display in the in the infobox after the login with LOGIN_FORM from the modpack.

is that possible?
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Picture since last visit
« Reply #1 on: May 20, 2008, 09:09:51 pm »

You would need to compare the users last logout time with the time you uploaded the file; in {prefix)_pictures table, the upload time is recorded as "ctime" and the last login time is stored in the database. But, you would need to add a new column to the users database to register the time the user logged out, and only update this when logout is clicked. You cant use the user_lastvisit column for this as this is updated when the user logs in, this way the lastvist time will always be greater than the time the last file was uploaded as lastvisit is updated before you have a chance to see if any new files have been added, by making a new column and storing the logout time you can check for new files and only update the logout time when logout is actioned.

Then you could calculate whether any new files were added by comparing the new logout column with ctime from the pictures table. Note. to make life easier you should enter the logout times into the database in the same time format as ctime is stored as (which i think is a 16 figure TIMESTAMP). That way it would make the calculation easier (a simple if (logout_time < ctime) { //show information } ).
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.