coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: RedSniper on October 12, 2006, 01:16:15 PM

Title: Mark recent galleries
Post by: RedSniper on October 12, 2006, 01:16:15 PM
Hello,

I'd like to put an image or text along the gallery name if a certain gallery is new or updated in the last month or so.
Has anyone done this before? I did a forum search, but the search terms I tried didn't really deliver anything on this subject.
Any help would be greatly appreciated!

Thanks!
Title: Re: Mark recent galleries
Post by: RedSniper on October 25, 2006, 09:11:55 PM
Please, is there anyone that can help me with this? I'm puzzled on how to tackle this :(
Title: Re: Mark recent galleries
Post by: Joachim Müller on October 25, 2006, 09:14:45 PM
Use bbcode (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#bbcode) in the album description.
Title: Re: Mark recent galleries
Post by: RedSniper on October 26, 2006, 10:41:41 PM
Thank you for your reply, but this is a manual action that I have to do when I add new galleries?
I'd like to automate it. Check the album's last update date/time and if it is within for example 1 month of the current date/time,
then put *New* behind the album title or something like that.

Is this possible at all?
Title: Re: Mark recent galleries
Post by: Joachim Müller on October 26, 2006, 11:11:47 PM
Possible if you code it.
Title: Re: Mark recent galleries
Post by: RedSniper on October 28, 2006, 04:26:11 PM
Ok I finally managed this myself. Thanks for the tips with the bbcode and stuff.
I know this change is not ideal (change to index.php, so might cause problems when upgrading), but it works fine for me now.

I changed

$alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);


to


if (time()-$alb_stat['last_upload'] < 2592000) //if the album is created or updated in the last month, put a "NEW icon" in the description
            {
            $alb_list[$alb_idx]['album_desc'] = bb_decode('[IMG]http://front242.digitality.be/gallery/themes/f242/images/new.gif[/IMG]'.$alb_thumb['description']);
            }
            else
            {
            $alb_list[$alb_idx]['album_desc'] = bb_decode('[IMG]http://front242.digitality.be/gallery/themes/f242/images/blank.gif[/IMG]'.$alb_thumb['description']);
            }