coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Gephri on January 18, 2007, 02:46:22 AM

Title: Getting random img and data in CPG Template pages
Post by: Gephri on January 18, 2007, 02:46:22 AM
I've struggles with this for so long - and just can't get it.
I can get CPMFetch to work beautifully showing random images and date (views and ranks) on php pages across my site and even in my bridged phpbb.  Problem is that I can not get this to show on my CPM template page because that is HTML.

anyone know how to get something like to following to work in CPM templates:
<?php include($DOCUMENT_ROOT "/gallery/cpmfetch/cpmfetch.php");
$styleguide = array(
"imagewidth" => '100',
"imageStyle" => "cpm_brdr",
"subtitle" => "<span class='fnt_9'>%h views<br />%v votes</span>",
"alttag" => "Click to see more photos in gallery");
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1,$styleguide);
?>



Edit: moderator made title more descriptive
Title: Re: Getting random img and data in HTML pages
Post by: vuud on January 18, 2007, 03:47:16 AM
Quote from: Gephri on January 18, 2007, 02:46:22 AM
I've struggles with this for so long - and just can't get it.
I can get CPMFetch to work beautifully showing random images and date (views and ranks) on php pages across my site and even in my bridged phpbb.  Problem is that I can not get this to show on my CPM template page because that is HTML.

anyone know how to get something like to following to work in CPM templates:
<?php include($DOCUMENT_ROOT "/gallery/cpmfetch/cpmfetch.php");
$styleguide = array(
"imagewidth" => '100',
"imageStyle" => "cpm_brdr",
"subtitle" => "<span class='fnt_9'>%h views<br />%v votes</span>",
"alttag" => "Click to see more photos in gallery");
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1,$styleguide);
?>


You should post in a template section maybe, stress to them that you have cpmfetch working, its just executing it from a template that is the problem.

I've done it before I think... I forget how though
Title: Re: Getting random img and data in HTML pages
Post by: doctoreast on January 20, 2007, 09:41:48 PM
This html file has an option for header/footer php includes in admin
section.  Just look at the code and move the footer include box and
use that for your include.  If you've got the know-how, create a
seperate block directive for a new include, or maybe search for that
option instead.
just my 2cents..
Mike
Title: Re: Getting random img and data in HTML pages
Post by: doctoreast on January 22, 2007, 12:57:37 AM

*Keep all of your script files in the cpmfetch folder,
was my lesson on getting this thing to work.
Called them from another include string in my
site pages.
Mike
Title: Re: Getting random img and data in HTML pages
Post by: vuud on January 22, 2007, 01:49:49 AM
Quote from: doctoreast on January 22, 2007, 12:57:37 AM
*Keep all of your script files in the cpmfetch folder,
was my lesson on getting this thing to work.
Called them from another include string in my
site pages.
Mike

Please post a code exerpt of what you were in php pages outside of the cpmfetch directory.

Thanks

Vuud
Title: Re: Getting random img and data in HTML pages
Post by: vuud on January 24, 2007, 04:57:07 PM
Quote from: doctoreast on January 22, 2007, 12:57:37 AM
*Keep all of your script files in the cpmfetch folder,
was my lesson on getting this thing to work.
Called them from another include string in my
site pages.
Mike

This is bad advice.  Since I can't get a response on this one - I advise people to not follow this.  It is pointless, an extra step and is just outright not needed.

I suspect what the problem was, and I think it had to do with not following instructions.

Vuud