Photo of the day / week etc, with auto archive albums. Photo of the day / week etc, with auto archive albums.
 

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

Photo of the day / week etc, with auto archive albums.

Started by Casper, February 07, 2005, 01:16:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Casper

Photo of the Day / Week hack

This hack adds an admin settable photo of the Day, Photo of the Week, or both, to a gallery, without the need to move files around between albums.

These selected photos can be displayed on the gallery index page, or any other page on the site, or in their own page.

This hack also adds archive albums, which will display the previous selected photos, in reverse date order.


Although these are set as photos of the day or week, it is easy to change this to month or year etc, simply by changing 2 lines in the language file.

Included in the download are instructions how to edit existing files, plus the extra files needed.  These files are version 1.4 ready, so 1 minor edit is required to each for use with 1.3x, and is explained in the docs.

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

onuzu


Tranz

Quote from: onuzu on February 13, 2005, 11:48:51 PM
I didn't find editpics.php
It should already exist in your gallery files. If not, did you get the installation from elsewhere?

MonkeyManx

I couldnt find the second step in editpics
$reset_votes  = isset($_POST['reset_votes'.$pid]);

Casper

my mistake, sorry.

In version 1.3, the code to look for here is;

$reset_votes  = isset($HTTP_POST_VARS['reset_votes'.$pid]);
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

Joachim Müller

Casper, this is a great mod. Can this be made into a plugin after cpg1.4.x release?

Joachim

MonkeyManx

I had a few issues while installing this. The fourth find was kind of fuzzy, and I think i messed something up. Look at the picture below. What did i mess up?

Casper

@ MonkeyManx

what version are you using.  That radio button exists in version 1.4, but not in 1.3x.  It is the 'Set as my icon' button.

Are yousure you have not mixed upfiles from both versions.  Please give the exact version of coppermine you are using, and the cvs version id of the editpics.php file you have, which will look something like this;

// CVS version: $Id: editpics.php,v 1.7 2004/08/16 09:29:52 gaugau Exp $
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

MonkeyManx

i am using version 1.3.2. It is possable that I mixed 1.3 and 1.4 files. The POTD works its just that the extra button is there.

CVS version: $Id: editpics.php,v 1.7 2004/08/16 09:29:52 gaugau Exp $

MonkeyManx

Is this automated, or must you move the current potd to the archive each day?

Casper

You have to move it, at the same time you add the new one, otherwise it stays as the current potd.
This is explained in the docs.
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

MonkeyManx

It would be sweet if the the admin could add the potd/w to a query, then each day it automatically updated with whatever has been in the query longest.

photoshopabuser

#12
I have attempted to put this in my 1.33 gallery at rocklobsters.net and was able to choose a POTW but I can't get the image to show up on my gallery home page. The table shows up with all the text data but no image.

Am I missing something obvious? Thanks in advance.

Edit: I got it to work by archiving one image to POTW and the new image showed. Now I get this error msg when I click on View Archive:
Fatal error: Undefined class name 'cpgpluginapi' in /www/j/xxxxxx/htdocs/pictures/include/functions.inc.php on line 723

Casper

That error means you have used the file include/functions.inc.php from the package, which is meant for version 1.4x.

The instructions in the docs that come with the download for use with 1.3x tell you how to prepare the files you need using the 1.3x files.

You should get a fresh copy of the 1.3.3 functions.inc.php, and make the changes to that, then make sure you have follwed the rest of the instructions, and it should work.
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

photoshopabuser

Thanks man!

In my best Homer Simpson voice.......D'oh
I thought I fixed all of them....obviously not.... :-[

photoshopabuser

Hello Again!

I rechecked everything and it is done right as far as I can tell. I did apply the 1.3x changes and the
Fatal error: Undefined class name 'cpgpluginapi' in
still comes up. Could there be some different code out there that I am not seeing? The 'cpgpluginapi' line of code  is included in both of the install instructions.

Very Cool concept btw!

Casper

My apologies, I missed that, which should have come out of the 1.3 change.

Please find this line of code, which is in there twice, and simply delete it;

$rowset = CPGPluginAPI::filter('thumb_caption_lastup',$rowset);
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

photoshopabuser

Thanks Casper!

I was thinking about doing that but am not that good at php yet and had visions of the whole thing imploding  ;)
This is a very nice addition man. Your creativity is appreciated!

leotan

How do I remove it if I accidentally choose a wrong picture? Can I take it out of the ptd?

Casper

There is no way to do this at the moment, without going into the database to amend the entry in the pictures table.

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