Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 04-13-2007, 03:30 PM
witty's Avatar
witty Offline
pp veteran
 
Join Date: Mar 2007
Posts: 72
EXIF_CAPTURE_DATE format

Hi,

Is there a hack or script, or whatever, available for making the format of EXIF_CAPTURE_DATE a bit more "user friendly"?

Right now, the format displays as:

2006:10:05 16:14:28

I'd prefer it to be displayed in the same format as (my) IMAGE_DATETIME

Oct 5, 2006 - 16:14:28

Possible?


-Witty
Reply With Quote
  #2  
Old 04-13-2007, 04:00 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
yeah pretty much, perhaps I can whip something up provided I have the time.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #3  
Old 04-13-2007, 04:14 PM
witty's Avatar
witty Offline
pp veteran
 
Join Date: Mar 2007
Posts: 72
Hi,

Great thanks... much appreciated. It's not like it's deal-breaker or anything, but my blog sort of depends on image capture times moreso than image posting times. So having a format that's easier to read would be cool.


-Witty
Reply With Quote
  #4  
Old 04-13-2007, 04:43 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Ok here ya go: I'm assuming your running version 1.6: open functions_exif.php in your includes folder. Use an ASCII editor, preferably one that understands unix style text files.

Go to line 77
PHP Code:
$capture_date $exif_result['DateTimeOriginalSubIFD']; // Date and Time 
Add the following code below that line:

PHP Code:
$capture_date gmdate('M j, Y - H:i'strtotime($capture_date)+(3600*$cfgrow['timezone'])); 
Save, upload and enjoy.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #5  
Old 04-13-2007, 06:08 PM
witty's Avatar
witty Offline
pp veteran
 
Join Date: Mar 2007
Posts: 72
Hi,

Will it work in 1.5 (I suppose I could just try it)? I haven't upgraded to 1.6 yet... which I will as soon as I'm done building the site. Thanks!


-Witty

EDIT:

OK, just tried it. It "works", but somehow changes all of the dates to:

Dec 31, 1969 - 23:59
Reply With Quote
  #6  
Old 04-13-2007, 08:47 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
ok, I'll look at it later.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #7  
Old 04-15-2007, 10:04 AM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Try this:
PHP Code:
$capture_date gmdate('M j, Y - H:i'$capture_date+(3600*$cfgrow['timezone'])); 
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #8  
Old 04-15-2007, 01:04 PM
dhdesign's Avatar
dhdesign Offline
pixelpost guru
 
Join Date: Mar 2007
Location: Ohio
Posts: 431
Thought this was a neat idea, so I just tried the latest code that you posted, and this is the date that I am getting with mine:

Jan 1, 1970 - 00:00
Reply With Quote
  #9  
Old 04-15-2007, 01:50 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Go to the function replace_exif_tags ($language_full, $image_exif, $tpl). Place the following line right after the {

PHP Code:
global $cfgrow
Go to line 78
PHP Code:
$capture_date $exif_result['DateTimeOriginalSubIFD']; // Date and Time 
replace with:

PHP Code:
$capture_date date($cfgrow['dateformat'],strtotime($exif_result['DateTimeOriginalSubIFD'])); // Date and Time 
Save, upload and enjoy.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #10  
Old 04-15-2007, 02:04 PM
dhdesign's Avatar
dhdesign Offline
pixelpost guru
 
Join Date: Mar 2007
Location: Ohio
Posts: 431
Still not working for me - after the above changes, I get:

Dec 31, 1969 - 20:00

Just wondering - my PP install is on a server that is using PHP version 5.1.4. Could that be causing a conflict with your proposed changes?
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 07:17 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs