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: Embed CPMFetch into Coppermine Template?  (Read 4123 times)

0 Members and 1 Guest are viewing this topic.

scandore8472

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Embed CPMFetch into Coppermine Template?
« on: December 28, 2007, 02:59:17 am »

I hope this is the right forum. Is there a way to do this? I've been searching for a while and can't seem to find a solution.

I'm trying to create a random picture module using CPMFetch to display on the intermediate picture page. The code works outside of coppermine, but as soon as I try putting it into the theme.php file, it fails. I have to admit, I am a PHP noob so I may be trying to integrate the code incorrectly. I'm just copy and pasting it into the theme file.

I'm using CPMFetch 2.0 and coppermine 1.4.13
« Last Edit: December 28, 2007, 10:35:44 am by GauGau »
Logged

scandore8472

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Embed CPMFetch into Coppermine Template?
« Reply #1 on: December 28, 2007, 07:28:41 am »

Nevermind, I figured it out. I modified the instructions for inserting the code into phpbb template.

Here is the code for future reference.

Copy the function theme_html_picture() from the sample theme file to your theme.php



Once you have the function copied over, find

Code: [Select]
$params = array('{CELL_HEIGHT}' => '100',


Add Before

Code: [Select]
include_once "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_setReturnType('html');

Then find

Code: [Select]
'{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
Add After:

Code: [Select]
'{FETCHRANDOM}' => $objCpm->cpm_viewRandomMedia(2, 3),
Then find

Code: [Select]
);
This should be directly below the code you just added, if not it is the end of the array

After Add
Code: [Select]
$objCpm->cpm_close();
To add it to the intermediate picture copy the template for intermediate image display from the sample template to your theme.php

Then use {FETCHRANDOM} to position the cpmfetch module on the page
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.