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 [2]   Go Down

Author Topic: Image captions shown in slideshow mode  (Read 42047 times)

0 Members and 1 Guest are viewing this topic.

Rallemann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: Image captions shown in slideshow mode
« Reply #20 on: February 28, 2006, 06:51:42 pm »

it works fine, thanks

mod can be marked as "working with 1.44" :)  :-*
Logged

pwiedower

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Image captions shown in slideshow mode
« Reply #21 on: April 18, 2006, 12:34:12 am »

Ok, so maybe I am slow.  I have tried this twice with the same result.  I the following at the top of the screen when I begin a slideshow, EOT; endtable(); starttable(); echo template_eval( , Array); endtable(); starttable(); echo <<.  I even upgraded last night thinking I was doing something wrong.  My site is www.wiedowerfamily.com.  Any help would be appricated.
Logged

pwiedower

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Image captions shown in slideshow mode
« Reply #22 on: April 18, 2006, 12:57:48 am »

I am not sure exactly what I did, but I got it to work.  Thanks
Logged

BrianD

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Image captions shown in slideshow mode
« Reply #23 on: June 05, 2006, 06:09:11 pm »

Using this mod on 1.3.5.  Love it!   

Only problem, & is being printed as &amp;

How do I fix?

Thanks.

Brian
Logged

BrianD

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Image captions shown in slideshow mode
« Reply #24 on: July 18, 2006, 07:21:23 pm »

I know 1.3 really isn't supported anymore but does anyone have a recomendation for me?

Thanks!
Brian D
Logged

BrianD

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Image captions shown in slideshow mode
« Reply #25 on: July 19, 2006, 06:08:32 pm »

For those using this mod, I figured out why all my & were converting to &amp;  It turns out the function htmlspecialchars was the culprit.  After doing some digging and learning what that function actually did  :) ,  I decided to use addslashes instead. So to expand on RatKings reply (http://forum.coppermine-gallery.net/index.php?topic=10265.msg48034#msg48034),

Use:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . htmlspecialchars($picture_url, ENT_QUOTES) . "'\n";
        echo "Title[$i] = '" . addslashes($Title) . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

instead of:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . $picture_url . "'\n";
        echo "Title[$i] = '" . $Title . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

For those interested:
htmlspecialchars => http://www.zend.com/manual/function.htmlspecialchars.php
addslashes => http://www.zend.com/manual/function.addslashes.php

Brian
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Image captions shown in slideshow mode
« Reply #26 on: October 01, 2006, 10:15:12 am »

After a way to long abcense I have some time and tried my hand add making a mess of 1.4.9  ;D

So here is, for those of you that didn't get it working them selfs, the version that will work for 1.4.9


In functions.inc.php change this line:
Code: [Select]
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords';to
Code: [Select]
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title';
then in slideshow.inc.php below:
Code: [Select]
var Pic = new Array() // don't touch thisadd
Code: [Select]
var Title = new Array() // don't touch this
change:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        echo "Pic[$i] = '" . $picture_url . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}
to:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . htmlspecialchars($picture_url, ENT_QUOTES) . "'\n";
        echo "Title[$i] = '" . addslashes($Title) . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

change:
Code: [Select]
function runSlideShow(){
   if (xIE4Up){
     document.images.SlideShow.style.filter="blendTrans(duration=2)"
     document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
     document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (xIE4Up){
     document.images.SlideShow.filters.blendTrans.Play()
   }

   pos = j

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
   preLoadPic(j)
}
to
Code: [Select]
function runSlideShow(){
   if (xIE4Up){
     document.images.SlideShow.style.filter="blendTrans(duration=2)"
     document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
     document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.getElementById('Title').innerHTML = Title[j];
   document.images.SlideShow.src = preLoad[j].src;
   if (xIE4Up){
     document.images.SlideShow.filters.blendTrans.Play()
   }

   pos = j

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
   preLoadPic(j)
}

And in themes.inc.php, below:
Code: [Select]
    $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100,
        '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" /><br />',
        '{ADMIN_MENU}' => '',
        );
add
Code: [Select]
    starttable();
    echo <<<EOT
        <tr><td align="center" class="navmenu" style="white-space: nowrap;"><div id=Title></div></td></tr>

EOT;
    endtable();

That will do the trick and will work in every single theme.... :)
Logged

mingmann

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Image captions shown in slideshow mode
« Reply #27 on: November 14, 2007, 11:13:29 pm »

I've used the above code but instead of
        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];

I substituted picture title with picture caption so my description would show up.
        if ( $picture['caption'] ) $Title = $picture['caption']; else $Title = $picture['filename'];

This does seem to do what I want to do, which is to have the caption with each picture during slideshow. The problem I am having is that for those pictures with long caption, the caption would just show up in one long row all the way across the page.  This stretches the width of the page.  How can I get it so the caption wraps around so it is roughly the width of the picture?

You can see examples here:  http://mingywu.com/copper/thumbnails.php?album=44.  Click on slideshow.

Logged

mingmann

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Image captions shown in slideshow mode
« Reply #28 on: November 16, 2007, 12:09:38 am »

Hmmm. Solved my own question.

Use "wrap" instead of "nowrap" in themes.inc.php.

        <tr><td align="center" class="navmenu" style="white-space: wrap;"><div id=Title></div></td></tr>

Seems to work.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Image captions shown in slideshow mode
« Reply #29 on: November 16, 2007, 09:07:54 am »

Use "wrap" instead of "nowrap" in themes.inc.php.
Don't edit themes.inc.php - under no circumstances. That's why the dev team doesn't recommed to use this mod at all (since RatKing's original instructions say to modify that file). Modify themes/yourtheme/theme.php instead (whenever RatKing instructs you to use include/themes.inc.php).
Logged

ThaiJan

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Image captions shown in slideshow mode
« Reply #30 on: October 18, 2009, 07:44:40 pm »

Don't edit themes.inc.php - under no circumstances. That's why the dev team doesn't recommed to use this mod at all (since RatKing's original instructions say to modify that file). Modify themes/yourtheme/theme.php instead (whenever RatKing instructs you to use include/themes.inc.php).
Know this is very old, but I risk getting my head ripped of by bringing it up having spend many hours searching and reading posts, since I really would like to have the picture Title to show up in slideshow mode.

I want to follow Joachim's advice not to edit themes.inc.php, but being an almost complete blank novice in PHP I simply can't manage to figure out where or how to place the code in the themes/classic/theme.php instead. Have studied the themes/sample/theme.php carefully, but still blank.

Anybody who can help a beginner?
Logged

ThaiJan

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Image captions shown in slideshow mode
« Reply #31 on: October 18, 2009, 08:23:48 pm »

Know this is very old, but I risk getting my head ripped of by bringing it up having spend many hours searching and reading posts, since I really would like to have the picture Title to show up in slideshow mode.

I want to follow Joachim's advice not to edit themes.inc.php, but being an almost complete blank novice in PHP I simply can't manage to figure out where or how to place the code in the themes/classic/theme.php instead. Have studied the themes/sample/theme.php carefully, but still blank.

Anybody who can help a beginner?
I'm deeply sorry, I realize I posted this in a wrong place. Can't delete, edit, or report it to Moderator though.

Moderator, please just delete these two posts of mine while receiving my excuse for my mistake.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Image captions shown in slideshow mode
« Reply #32 on: October 19, 2009, 08:44:11 am »

We never delete threads nor postings because they were solved. Instead of asking your posting to be removed, why don't you resolve your posting by saying what you did to figure out your issues. We only delete spam and other abusive postings.
Logged

ThaiJan

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Image captions shown in slideshow mode
« Reply #33 on: October 19, 2009, 09:28:02 am »

We never delete threads nor postings because they were solved. Instead of asking your posting to be removed, why don't you resolve your posting by saying what you did to figure out your issues. We only delete spam and other abusive postings.
Joachim, I haven't resolved it yet, but since I by mistake posted here I won't post it in the support forum also. That would be double posting.

It wasn't untill I had clicked submit that I realized where my searches had taken me and I was posting where there is no support and requests for such aren't allowed. That's why I requested this posting to be deleted first not to mess things up.

I feel real sorry about this mistake and the inconvinience it is for you and others on this board.

If I can find a solution I will of course share it on the board as I did on another topic I marked "Solved".
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.025 seconds with 20 queries.