Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Move picture title and description  (Read 2843 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Move picture title and description
« on: March 03, 2014, 07:49:04 am »

How can I move rating starts and navmeu between picture title and picture on displayimage.php like this:

picture title
picture description
navmenu
rating stars
image
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15415
Re: Move picture title and description
« Reply #1 on: March 04, 2014, 09:46:23 am »

Copy the function theme_display_image from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.

Find
Code: [Select]
echo $votes;and move it above
Code: [Select]
    starttable();
    echo $picture;
    endtable();

find
Code: [Select]
    starttable();
    echo $nav_menu;
    endtable();
and above, add
Code: [Select]
    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Re: Move picture title and description
« Reply #2 on: March 05, 2014, 09:52:59 pm »


Code: [Select]
    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();

That's what I need it and did not know how to do.

Thanks it worked.
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Move picture title and description
« Reply #3 on: March 22, 2014, 08:44:11 am »

Very often:

Template error
Failed to find block 'caption' (#<!-- BEGIN caption -->(.*?)<!-- END caption -->#s) in :

             
and no image.

If I remove the code the page shows the right way.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15415
Re: Move picture title and description
« Reply #4 on: March 27, 2014, 01:30:37 pm »

Please try what happens if you comment out the following code block in theme_html_picture:
Code: (include/themes.inc.php or themes/yourtheme/theme.php) [Select]
    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Move picture title and description
« Reply #5 on: March 27, 2014, 02:05:49 pm »

It worked.Thanks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15415
Re: Move picture title and description
« Reply #6 on: March 27, 2014, 02:17:09 pm »

Instead of modifying two functions, I suggest to undo the mod in theme_html_picture. Instead replace the mod
Code: [Select]
    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();
with
Code: [Select]
    global $CURRENT_PIC_DATA;
    starttable();
    if ($CURRENT_PIC_DATA['title']) {
        echo template_extract_block($picture, 'title');
    }
    if ($CURRENT_PIC_DATA['caption']) {
        echo template_extract_block($picture, 'caption');
    }
    endtable();
in theme_display_image.
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Re: Move picture title and description
« Reply #7 on: March 27, 2014, 02:22:33 pm »

Instead of modifying two functions

Thanks a lot.I disliked the ideea to add another function.Plus theme_html_picture is a big function.

It worked.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 21 queries.