PDA

View Full Version : Coppermine cpmfetch plugin


SuperJETT
04-20-2006, 05:18 PM
I have Coppermine installed/working in integrated mode thanks to Hellcat and https://vborg.vbsupport.ru/showthread.php?t=101995

What I'm trying to do now is add a random image from the gallery on the index.php. I have the php code to do it, and that is functioning fine, but after reading/studying how plugins are done I've realized I'm out of my league.

Here is the code that pulls a random image
<?php
include "./cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();
?>

Ideally I'd like a variable like $cpmfetch or something that I could stick in any template, and then maybe later expand it to include all the functionality of cpmfetch so it can be directed at a specific gallery, or multiple images, etc.

Can someone either help me along to build this into a plugin or do it for me and the other Coppermine users?

Thanks!