Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Display Date Taken under Thumbnail  (Read 7129 times)

0 Members and 1 Guest are viewing this topic.

ericsj

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Display Date Taken under Thumbnail
« on: November 29, 2004, 08:12:44 am »

Searched the boards -- found several requests for this with no replies or solutions.

By default, # of views is displayed on the thumbnail page.  What's the easiest way to change this to the date taken (from EXIF), or at least *add* this data alongside # of views.

Even a direction to the right area of code would be helpful, if not an answer.

Thanks in advance,
Eric
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Display Date Taken under Thumbnail
« Reply #1 on: November 30, 2004, 02:33:37 am »

This doesn't seem to be a feature request, it reads more like you want this ability now.  Moved to the appropriate board.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

ericsj

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Figured out a way to display EXIF dates below thumbs.
« Reply #2 on: December 01, 2004, 06:52:21 pm »

I came up with a solution that works for me, and so I'll present it as an option for the many seeking to display the EXIF date below the thumbnail.

I have the "Sort by EXIF" mod applied, and it works great.  I noticed that when you run the mod, it extracts the EXIF date to the variable $pdate, and proceeds to write it to the database for each photo's "ptime".  I noticed that it also converts this date to a human-readable format to display as text on the "results" page that you see after running the function.  That variable is called $newdate.

Well, showing the date below the thumbnails was more important to me than showing a title (I don't use the title field at present anyway).  So I just altered the script to write the date to the 'title' field.

In util.php:

After:
Code: [Select]
$query = "UPDATE $picturetbl SET ptime='$pdate' WHERE pid='$pid' ";
        MYSQL_QUERY($query);
I added:
Code: [Select]
$query = "UPDATE $picturetbl SET title='$newdate' WHERE pid='$pid' ";
 MYSQL_QUERY($query);
   

A few lines above that, it defines the date format for $newdate.  I altered this a little bit to be what I wanted:

Code: [Select]
$newdate = date('D, M jS Y \&\n\b\s\p\; g:i a', $pdate);
I have attached a screenshot crop of how it looks now.  Works great if you value the date display over photos having a user-defined title.  Hopefully someday a feature will be implemented into CPG so that a date display and title display could co-exist, but for now this is how I'm getting by.   ;)

Comments, please!  I know next to nothing about PHP, SQL, etc.  Is this an OK way of going about this?

Thanks!

[attachment deleted by admin]
« Last Edit: December 01, 2004, 09:07:32 pm by ericsj »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Removing Page Header from displayimage.php pages?? Help!
« Reply #3 on: December 01, 2004, 07:18:49 pm »

Very good, but you've attached this to the wrong thread.  I'll move it to your other thread.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

ericsj

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Display Date Taken under Thumbnail
« Reply #4 on: December 01, 2004, 09:07:21 pm »

Thanks Casper... got my windows mixed up there.

 ;D
Logged

vrviji

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Display Date Taken under Thumbnail
« Reply #5 on: January 10, 2005, 12:27:09 pm »

Hi,
I would like to display the EXIF date instead of the Upload date also. So,
Would I be able to do this fix ( as described above ) , if I have not applied the Sort by EXIF Mod ?

That is, would the field $pdate be available and contain the EXIF Picture Taken date.

And instead of replacing the title field, I would replace the Upload Date field with this date. THen, all the thumbnails would have the Date Taken displayed under the picture, instead of the date on which the picture was uploaded.

Thanks,

Viji Rajasundram
www.sundram.org
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.