Image captions shown in slideshow mode - Page 2 Image captions shown in slideshow mode - Page 2
 

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

Main Menu

Image captions shown in slideshow mode

Started by martinha, September 24, 2004, 03:36:02 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Rallemann

it works fine, thanks

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

pwiedower

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.

pwiedower

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

BrianD

Using this mod on 1.3.5.  Love it!   

Only problem, & is being printed as &amp;

How do I fix?

Thanks.

Brian

BrianD

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

Thanks!
Brian D

BrianD

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:
    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:

    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

RatKing

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:
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords';
to
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title';

then in slideshow.inc.php below:
var Pic = new Array() // don't touch this
add
var Title = new Array() // don't touch this

change:
    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:
    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:
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
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:
    $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100,
        '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" /><br />',
        '{ADMIN_MENU}' => '',
        );

add
    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.... :)

mingmann

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.


mingmann

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.

Joachim Müller

Quote from: mingmann on November 16, 2007, 12:09:38 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).

ThaiJan

Quote from: Joachim Müller on November 16, 2007, 09:07:54 AM
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?

ThaiJan

Quote from: ThaiJan on October 18, 2009, 07:44:40 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.

Joachim Müller

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.

ThaiJan

Quote from: Joachim Müller 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.
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".