Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Getting random img and data in CPG Template pages  (Read 4973 times)

0 Members and 1 Guest are viewing this topic.

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Getting random img and data in CPG Template pages
« 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:
Code: [Select]
<?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
« Last Edit: January 25, 2007, 03:14:14 am by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Getting random img and data in HTML pages
« Reply #1 on: January 18, 2007, 03:47:16 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:
Code: [Select]
<?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
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Getting random img and data in HTML pages
« Reply #2 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
Logged

doctoreast

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Getting random img and data in HTML pages
« Reply #3 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Getting random img and data in HTML pages
« Reply #4 on: January 22, 2007, 01:49:49 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
Logged
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

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Getting random img and data in HTML pages
« Reply #5 on: January 24, 2007, 04:57:07 pm »

*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

Logged
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
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 15 queries.