Advanced search  

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

Pages: [1]   Go Down

Author Topic: Embed CPMFetch into Coppermine Template?  (Read 4387 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 15 queries.