forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started by: martinha on September 24, 2004, 03:36:02 pm
-
For me there are very few new additional features required in future releases of Coppermine. :)
I would like to see the whole thing XHTML-compliant (I think v1.4 will be ;D), and it would be nice to see a caption shown for images shown in slideshow mode. ::)
I know there is a hack for this but it seems a tad clumsy and I can't seem to get it to work with my installation of v.1.3.2 ???
-
A bit demanding, no? ;) This is a volunteer effort and the developers do have other priorities beyond CPG. They still try hard to produce a great application with features that benefit a big enough number of people. Beyond that, there are people who create mods/hacks to build upon CPG's core code. Perhaps you should try to help the developers out so that they can focus on development rather than support. :)
-
A bit demanding, no?
Hardly demanding. :( Just something to make the slidewhow feature more complete. As far as XHTML is concerned I understood that v1.4 when released it is complete will be compliant.
Coppermine is excellent in my view and this addition to the slideshow would (in my mind) make it complete...
-
The "clumsy" caption mod http://forum.coppermine-gallery.net/index.php?topic=9247.0 works fine for 1.3.2, so if you had problems with it then you didn't follow the instructions correctly. I agree that displaying the caption in a text box is not ideal, but I could not find another way that worked. Maybe you can work on and post an improvement?
-Mark
-
FOR 1.4.9 USERS please see my last post about this on page 2 http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257 (http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257)
A neater solution to this issue isn't that hard.....
In functions.inc.php change this line:
$select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid';
to
$select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, 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] = '" . $picture_url . "'\n";
echo "Title[$i] = '" . $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 displayimage.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.... :)
-
If you want to see a working version go to http://www.ratking.net
-
@RatKing - many, many thanks for this hack - it works like a dream ;D
Could this be included in any future releases? :)
-
...although I've just noticed that does not seem to work on all my albums? I can't seem to work out why :\'(
Check out http://cgi.martinhart.force9.co.uk/
-
FOR 1.4.9 USERS please see my last post about this on page 2 http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257 (http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257)
I had a little look and the problem is in the names used for the title's in your: Home > Holidays Abroad > 2002 The Splendours of Venice & Lombardy
There is a title by the name of: Title[13] = 'Gondolas outside St Mark's Square, Venice' that causes an issue because of the Mark's
Now you can solve this in several ways but the best would be to make a change in the PHP (it was my bad not to think of this before)...
This code in slideshow.inc.php should be:
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] = '" . htmlspecialchars($Title, ENT_QUOTES) . "'\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++;
}
}
I have not tested this but I am pretty sure this will do the trick. :-)
-
Gr8 - now works perfectly with all albums (including those containing images with quotes et al.) 8) 8) 8)
-
bonjour,
i test your mod, but it seem not working, the slideshow stay at the first pic and dont run without error, ???
any idea to solve
poubao
-
poubao:
First apply the changes listed by RatKing at the start of this thread and then make the change he suggests further down. Your problme possibly lies in your images having titles with apostrophies ( 's) in their titles?
This solved the problem on mine.... :)
martin
-
Is this supposed to show the caption as well as the title?
Works great for showing the title, but I'm not sure if I missed something.
-
The trick is it shows the caption if available and the file name if there is no caption. That way you will always see something, and the slide show does work have a look at my site (it usses the cade shown above)
-
Thanks Ratking for the mod...works great!
steve
-
Works for me too, this is great. I suggest that this be part of the core application. Thanks a lot.
-
hmm seems to be working for everybody else, i tried two times, and must be doing something wrong.
I'm not getting any errors, just the slidehshow isn't running. Any suggestions?
-
Well
This mod has worked under 1.3x really good. Today I installed 1.43 and I noticed that in displayimage.php is not the code I have to add to:
And in displayimage.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();
I think this code was changed because of any reason, so this mod has to be overworked.
Sorry but I am not able to do this - can you help me?
I suppose that it won't be very difficult
-
http://forum.coppermine-gallery.net/index.php?topic=24540.0
-
Rallemann
You will now find the missing line of code in includes/themes.inc.php and you can add the line in below it as noted in the instructions.
This fix now works for me in v1.4.3
Also the line in functions.inc.php has a couple extra values, just add title to the line inside the quotes as indicated.
-
it works fine, thanks
mod can be marked as "working with 1.44" :) :-*
-
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.
-
I am not sure exactly what I did, but I got it to work. Thanks
-
Using this mod on 1.3.5. Love it!
Only problem, & is being printed as &
How do I fix?
Thanks.
Brian
-
I know 1.3 really isn't supported anymore but does anyone have a recomendation for me?
Thanks!
Brian D
-
For those using this mod, I figured out why all my & were converting to & 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
-
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.... :)
-
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.
-
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.
-
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).
-
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?
-
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.
-
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.
-
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".