Getting random img and data in CPG Template pages Getting random img and data in CPG Template pages
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Getting random img and data in CPG Template pages

Started by Gephri, January 18, 2007, 02:46:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gephri

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

vuud

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
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

doctoreast

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

doctoreast


*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

vuud

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
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

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

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco