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: Check for keyword in $template_display_media?  (Read 2527 times)

0 Members and 1 Guest are viewing this topic.

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Check for keyword in $template_display_media?
« on: February 20, 2011, 10:08:29 am »

I've inserted some html on the sides of the intermedia picture - excellent documentation by the way. I want to check for some keywords and then customize the html when a keyword is found. Is it possible to add php-code to $template_display_media that checks for a specific keyword?
Thanks,
http://uppsalafoto.se/galleri/
Logged
Human

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Check for keyword in $template_display_media?
« Reply #1 on: February 22, 2011, 06:12:53 am »

Ah, $template_display_media is not for php. I am guessing I have to do some reading up on where I can put php that checks keywords (than use that info in $template_display_media?). Any pointers?
Thanks
Logged
Human

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Check for keyword in $template_display_media?
« Reply #2 on: February 23, 2011, 10:57:06 am »

I suggest to just add placeholders in $template_display_media and replace them with your actual content in the function theme_html_picture like it's done for the other placeholders:
Code: [Select]
    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );
Logged

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Check for keyword in $template_display_media?
« Reply #3 on: February 24, 2011, 10:56:20 pm »

Thanks! got it finally
So what I did was to put a token
Code: [Select]
{SOMETHING} in $template_display_media. Then in theme_html_picture I put something in it:
Code: [Select]
'{SOMETHING}' => "SOMETHING",
Logged
Human
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.