Picture since last visit Picture since last visit
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Picture since last visit

Started by DaBe, May 20, 2008, 07:45:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DaBe

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?

just_some_guy

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 } ).
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