forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 PHPnuke/Postnuke Support => Topic started by: potatoeeh on February 02, 2005, 06:12:48 am

Title: [cpg1.2.2b for phpNuke only]: Picture of the Week block
Post by: potatoeeh on February 02, 2005, 06:12:48 am
I'm posting this here, because i dont think i have permissions to post this in the hacks/mods forum. I've created a "Picture of the Week" block/module for my install of coppermine(v1.22b) in PHP Nuke. I'm posting in case anyone is interested. the code probably doesnt live up to the standards of the rest of the coppermine/nuke code because it doesnt really take advantage of the language features, and some things have been hardcoded that probably should be made more dynamic. I'll leave it up to you to make it better if you desire.

I created a new block to go on the index/portal in the center thatll show the "picture of the week", pic's of the week are stored in a table (nuke_weeklypic) with date, img src and url information. the picture will "go live" on the date stored in that table, and will stay alive until the date at which the next picture is set to go live, admins set these dates via a mod to displayimage.php which allows them to set a date when viewing a potential picture of the week, and clicking on the appropriate button to add that record to the table.

things created/modded:
a block, to go on the index/portal page with the picture of the week
a module to show all past pictures of the week (admins can see pictures in the queue that havent gone live yet)
mod to displayimage.php to add the form that will add a picture to the nuke_weeklypic table.

install procedure: create the nuke_weeklypic table by hand, fields: date (YYYY-MM-DD), url(char[255]), src(char[255])
copy files into proper place (you might not wanna use my displayimage.php, you should probably just copy my mod out and paste it into your file)

code isnt terribly clean, its being posted here in case there is interest in adding this feature or something like it to coppermine.