Change slideshow defaults

bensiebro
bensiebro's picture

Joined: 2003-05-16
Posts: 70
Posted: Sun, 2005-09-11 17:10

As of right now, the defaults for slideshows are rather strange. The default size is the thumbnail and the default time to display is 15 seconds.

How can I change the default size to 640x480 and the time to 3 seconds?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-11 17:21

change modules/slideshow/template/SlideShow.tpl

in html, "selected" determines which option in a drop down list is selected by default.
change:

    <select onchange="new_delay(this.value)">
      <option value="1">{g->text text="1 seconds"}</option>
      <option value="3">{g->text text="3 seconds"}</option>
      <option value="5">{g->text text="5 seconds"}</option>
      <option value="10">{g->text text="10 seconds"}</option>
      <option selected="selected" value="15">{g->text text="15 seconds"}</option>
      <option value="20">{g->text text="20 seconds"}</option>
    </select>

to:

    <select onchange="new_delay(this.value)">
      <option value="1">{g->text text="1 seconds"}</option>
      <option selected="selected" value="3">{g->text text="3 seconds"}</option>
      <option value="5">{g->text text="5 seconds"}</option>
      <option value="10">{g->text text="10 seconds"}</option>
      <option value="15">{g->text text="15 seconds"}</option>
      <option value="20">{g->text text="20 seconds"}</option>
    </select>

and change:

    <select onchange="new_size(this.value)">
      <option value="0">{g->text text="320x320"}</option>
      <option value="1">{g->text text="640x640"}</option>
      <option value="2">{g->text text="800x800"}</option>
      <option value="3">{g->text text="1024x1024"}</option>
      <option value="4">{g->text text="1280x1280"}</option>
      <option value="5">{g->text text="no limit"}</option>
    </select>

to:

    <select onchange="new_size(this.value)">
      <option value="0">{g->text text="320x320"}</option>
      <option selected="selected" value="1">{g->text text="640x640"}</option>
      <option value="2">{g->text text="800x800"}</option>
      <option value="3">{g->text text="1024x1024"}</option>
      <option value="4">{g->text text="1280x1280"}</option>
      <option value="5">{g->text text="no limit"}</option>
    </select>
 
bensiebro
bensiebro's picture

Joined: 2003-05-16
Posts: 70
Posted: Sun, 2005-09-11 17:37

Those changes make the select boxes reflect the desired defaults, but we're not quite there yet. It appears there is Javascript? that needs to be changed as well .. as the pictures are still the same size (thumbs) and the timing is still 15 seconds.

 
bensiebro
bensiebro's picture

Joined: 2003-05-16
Posts: 70
Posted: Sun, 2005-09-11 17:49

Found it:

In Slideshow.tpl Line 41
var image = new Image(), timer, iDelay = 15000, iDir = 1, iSize = 0;

Change to:

var image = new Image(), timer, iDelay = 3000, iDir = 1, iSize = 1;

 
BrockVond

Joined: 2005-09-17
Posts: 1
Posted: Sat, 2005-09-17 17:57

thanks for this. Saved me quite a bit of time with same problem.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2005-10-02 10:49

Have been trying to get the 'text' default to show under the image in slideshows.

[Slideshow.tpl] changing...
var bPause = 0, bShowText = 0, bShowTools = 1;
...into...
var bPause = 0, bShowText = 1, bShowTools = 1;
...doesn't do it.
Haven't yet worked out whether it's the stuff in the area...
<a href="#" onclick="text_onoff();return false">
<span id="moreInfo">{g->text text="Show More Info"}</span>
</a>
...that might achieve the desired effect (text showing by default).

best wishes, Robert

 
Pinguin

Joined: 2005-09-27
Posts: 210
Posted: Sun, 2005-10-02 13:18

I agree that the default values are very strange. Nobody wants to wait 15sec. for the next picture and visitors get confused while nothing happens.

Also I think, that the minimum resolution today is 1024x768. Why not define this as default value?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2005-10-02 13:50

I didn't say they were strange, the choice of timings depends on many criteria. For people with hosted bandwidth limits then 15sec seems friendly, particularly when you consider that you may not actually have a human viewer present! However, yes, I agree that some visitors appear to get confused if nothing happens within a few seconds. On my sites I am prepared to show (aka give away) no more than 640pix and have disabled all other sizes larger or smaller so the choice isn't even onscreen.

I'd still like to find out how to default (on) the descriptive text.

 
tmaes2

Joined: 2005-10-10
Posts: 1
Posted: Mon, 2005-10-10 18:10

to Robert:
I've been trying the same thing and I've found a ploblem...

if you put bShowText to 1, it will work on firefox only if you make also this change:

Quote:
line 227 <div id="textBanner" class="gbBlock gcBackground1" style="visibility:hidden">
to
line 227 <div id="textBanner" class="gbBlock gcBackground1" style="visibility:visible">

but I saw that the first change makes that IE always pauses the slide because of the line 83...
everithing happens like if it doesn't understand this line and stops there witout reading lines 84 and 85...
the following code will make IE pass trough the bug and continue the slideshow but it will not show the text...

Quote:
change:
function slide_view_start() {
if (bShowText) show_text();
preload(move_index(1));
if (!bPause) timer = setTimeout('goto_next_photo()', iDelay);
}
to:
function slide_view_start() {
preload(move_index(1));
if (!bPause) timer = setTimeout('goto_next_photo()', iDelay);
if (bShowText) show_text();
}

For now I stop here, for the next times I will try to find why ie bugs with this line 83...
hope it can help...
tmaes

 
lixuefeng

Joined: 2005-10-31
Posts: 1
Posted: Mon, 2005-10-31 07:58

Just change

Quote:
<script type="text/JavaScript">
// <![CDATA[
linkStop = document.getElementById('stop');
spanPause = document.getElementById('pause');
spanText = document.getElementById('moreInfo');
toolText = document.getElementById('tools');
toolBar = document.getElementById('toolbar');
textBanner = document.getElementById('textBanner');
spanTitle = document.getElementById('title');
spanSummary = document.getElementById('summary');
spanDate = document.getElementById('date');
spanDescription = document.getElementById('description');
document.images.slide.onload = slide_view_start;
document.images.slide.onerror = goto_next_photo;
document.images.slide.src =
document.getElementById('item_{$SlideShow.start}_'+item_map[{$SlideShow.start}][iSize]).href;
// ]]>
</script>

To

Quote:
<script type="text/JavaScript">
// <![CDATA[
linkStop = document.getElementById('stop');
spanPause = document.getElementById('pause');
spanText = document.getElementById('moreInfo');
toolText = document.getElementById('tools');
toolBar = document.getElementById('toolbar');
textBanner = document.getElementById('textBanner');
spanTitle = document.getElementById('title');
spanSummary = document.getElementById('summary');
spanDate = document.getElementById('date');
spanDescription = document.getElementById('description');
document.images.slide.onload = slide_view_start;
document.images.slide.onerror = goto_next_photo;
document.images.slide.src =
document.getElementById('item_{$SlideShow.start}_'+item_map[{$SlideShow.start}][iSize]).href;
text_onoff();
// ]]>
</script>

It will show descriptive text by default.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-31 10:18

lixuefeng----
YES, cheers;~)
----best wishes, Robert

 
agilos

Joined: 2003-10-11
Posts: 9
Posted: Mon, 2005-11-21 07:08

Great that worked perfectly....thanks

 
Edward Andrews

Joined: 2005-12-06
Posts: 4
Posted: Tue, 2005-12-06 18:23

It says at the top of the file that you should customise a version of this file in a directory called local, so it doesn't get overwritten.

Should I make this directory inside the slideshow directory, or in the modules directory or...

I'm asking because I'm back doing this for a second time after upgrading!

Thanks
Edward

 
Edward Andrews

Joined: 2005-12-06
Posts: 4
Posted: Tue, 2005-12-06 19:07

To answer my own question for anyone else that's wondering

Put the folder inside templates that is:

copy orignal file to modules/slideshow/template/local/SlideShow.tpl and change that version.

 
hkkk

Joined: 2005-10-25
Posts: 43
Posted: Sat, 2005-12-10 09:09
Edward Andrews wrote:
To answer my own question for anyone else that's wondering

Put the folder inside templates that is:

copy orignal file to modules/slideshow/template/local/SlideShow.tpl and change that version.

thank your tip, it is useful for me too

 
sircuss
sircuss's picture

Joined: 2005-04-19
Posts: 46
Posted: Sat, 2006-01-14 17:15

I changed the selected size to value 1 at 640x640 and time delay to 3 seconds. I also adjusted the javascript on line 41 to those values and deleted the template cache in site admin-->maintainance. When I go to my slideshow it just seems to hang up in a loop.

I noticed this also happens on another g2 installation I tried it on.
Any suggestions?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2006-01-15 01:30

<Any suggestions?>
Might be clearer for you work on a much
smaller album slideview - say 4 images max!

 
sircuss
sircuss's picture

Joined: 2005-04-19
Posts: 46
Posted: Sun, 2006-01-15 17:17

I'm not sure what you mean by that. Can you be more specific? Where/what do I change to have a smaller album slideview?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2006-01-15 17:30

Make a separate (test) album consisting of just 4 images...
Then you or others might be able to see the wood for the trees:~)
At the moment it seems like the image compiling is taking time.
Whether it's a code problem or your host is too slow is not clear.

 
sircuss
sircuss's picture

Joined: 2005-04-19
Posts: 46
Posted: Mon, 2006-01-16 17:24

I created a test album here with 4 images and it's still not working. Could it be anything else?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2006-01-16 23:47

You could try checking out why you're seemingly
downloading and not slideviewing the images.
Also check the url_rewrite stuff too? I can't
make head nor tail out of what your embedded
URL calls are doing;~/ No wonder nothing works.

Just do a source view (Firefox), it looks weird.

Or using M$IE... well that 'stuff' down in the little
status bar is certainly wrong. Perhaps you should
look at whatever it is you've done with some Smarty
commands. Smarty should be rendered/compiled and
not appear in the status line! You've messed up
the code somewhere - need more care I expect;~)

 
sircuss
sircuss's picture

Joined: 2005-04-19
Posts: 46
Posted: Fri, 2006-01-20 18:49

All I ever changed was the above mentioned changes. When I view source I see the error message and don't see anylinks. What do you mean?
Also, I just reverted the file to its former state, deleted the local folder, deleted template cache, deleted my browsers cache and yet I'm still getting an error for the link to the slideshow. Is this a bug?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-01-20 18:55

What I mean is that you shouldn't see Smarty stuff appearing
in the Status Bar, the obvious inference from this is that
you've messed up the code in your edits/amendments. Probably
a missing } or something. Hence the 'more care'... ;~)

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-01-20 18:59

I don't get it. Your test album...
http://www.foodneed.org/pics/v/test/slideshow.html
...seems to be working as a slideview?

 
sircuss
sircuss's picture

Joined: 2005-04-19
Posts: 46
Posted: Fri, 2006-01-20 19:57

My apologies - I had the wrong url from my home page and forgot to change it. The slideshow does work when I revert it back to 320px and 15 sec. So I tried to change it to 3 seconds and 640px one more time from the beginning with the same bad results. Since I didn't change any smarty tags other than the above (the 2nd and 4th posts) and those don't seem to have any missing "}" or anything else, I can only assume that my host (a cheap one) just can't handle it for some reason, it's a bug, or I'm not catching the error. So I reverted it to 320px, 15 secs default (ugghh). I'm attaching my adjusted Slideshow.tpl file in the hope that I'm just missing something and it actually will work. Thanks for looking.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-01-20 20:15

I'm still confused as to your requests.
Even before your posting I had already tried your
test album's settings for 3s and 640pix. Both worked.
Do you 'actually' mean that you want the DEFAULTS
amended to 3s and 640pix?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-01-20 20:30

If you do want to default to 3s and 640pix make the changes as below...

old
  var image = new Image(), timer, iDelay = 15000, iDir = 1, iSize = 0;
new
  var image = new Image(), timer, iDelay = 3000, iDir = 1, iSize = 1;
old
      <option value="1">{g->text text="1 seconds"}</option>
      <option value="3">{g->text text="3 seconds"}</option>
      <option value="5">{g->text text="5 seconds"}</option>
      <option value="10">{g->text text="10 seconds"}</option>
      <option selected="selected" value="15">{g->text text="15 seconds"}</option>
      <option value="20">{g->text text="20 seconds"}</option>
new 
      <option value="1">{g->text text="1 seconds"}</option>
      <option selected="selected" value="3">{g->text text="3 seconds"}</option>
      <option value="5">{g->text text="5 seconds"}</option>
      <option value="10">{g->text text="10 seconds"}</option>
      <option value="15">{g->text text="15 seconds"}</option>
      <option value="20">{g->text text="20 seconds"}</option>
old
      <option value="0">{g->text text="320x320"}</option>
      <option value="1">{g->text text="640x640"}</option>
      <option value="2">{g->text text="800x800"}</option>
      <option value="3">{g->text text="1024x1024"}</option>
      <option value="4">{g->text text="1280x1280"}</option>
      <option value="5">{g->text text="no limit"}</option>
new
      <option value="0">{g->text text="320x320"}</option>
      <option selected="selected" value="1">{g->text text="640x640"}</option>
      <option value="2">{g->text text="800x800"}</option>
      <option value="3">{g->text text="1024x1024"}</option>
      <option value="4">{g->text text="1280x1280"}</option>
      <option value="5">{g->text text="no limit"}</option>

...though not sure about that size change in the very
last bit as I don't give my viewers a choice in size;~)

 
tholio

Joined: 2006-05-05
Posts: 1
Posted: Fri, 2006-05-05 11:00

Hello, I couldn't find answer before questionning!
I would like to change position of the default slideshow. I would prefer to get it in the middle of the page?

 
randomly

Joined: 2006-07-06
Posts: 13
Posted: Wed, 2006-07-19 10:12

I start using Gallery 2 nowadays and find it great. However, I want to modify the NavBar for the photo page such that it has the form

<left>First Previous</left> <middle>Slideshow</middle> <right>Next Last</right>

and I need help on that. I am not sure if this is the correct forum to ask, but could anybody help me to make such a modification? Thank you.

Currently, I am using the matrix theme, but I believe that the modification can be done similarly for other themes as well.

Also I want to prevent slideshow to start a new window/tab.

Thanks

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Wed, 2006-07-19 14:23

tholio----

Your theme's files do that sort of stuff.
(nothing to do with the slideshow module)
This is how I changed mine... (YMMV)

[theme.css]
.gallery-photo {
	width: 800px; 
	text-align: center; 
}

----best wishes, Robert

 
SYNTAX

Joined: 2006-12-21
Posts: 3
Posted: Tue, 2007-07-10 07:50

So.. anyway, back to the Default Slideshow Question... is there a more elegant way of defaulting to 'RANDOM' other than changing the header.tpl?

Quote:
filterNames[0] = '{g->text text="RANDOM" forJavascript="1"}';
filters[0] = 'RANDOM';
filterNames[15] = '{g->text text="Blend" forJavascript="1"}';
filters[15] = 'progid:DXImageTransform.Microsoft.Fade(duration=1)';

eg. A simple php Code that I don't know that will "Select Option 15" of id='filter' from the start of the Slideshow.

PS> Thanx for the above suggestions, It's so much nicer having the Images Centered, Larger, 5sec delay with Random Transitions, and More Info displayed.

 
unrevealable

Joined: 2007-12-05
Posts: 1
Posted: Wed, 2007-12-05 21:56

I'm having a problem after changing the defaults. I copied everything exactly as written. Now, when I go into the slideshow view the slideshow does not work. If I click on one of the links at the top ("Pause", "Back One Image") it will start scrolling. I have cleared the template cache in the admin panel.

What am I missing?

 
jivyb

Joined: 2005-11-10
Posts: 31
Posted: Thu, 2008-04-24 21:03

@unrevealable: You're probably beyond this now, but I had this problem before changing the var line above. Once I did that it functioned as expected.

 
jkuruppu

Joined: 2008-01-22
Posts: 43
Posted: Thu, 2008-06-05 17:52
lixuefeng wrote:
Just change

Quote:
<script type="text/JavaScript">
// <![CDATA[
linkStop = document.getElementById('stop');
spanPause = document.getElementById('pause');
spanText = document.getElementById('moreInfo');
.
.
.
document.images.slide.onerror = goto_next_photo;
document.images.slide.src =
document.getElementById('item_{$SlideShow.start}_'+item_map[{$SlideShow.start}][iSize]).href;
// ]]>
</script>

To

Quote:
<script type="text/JavaScript">
// <![CDATA[
linkStop = document.getElementById('stop');
spanPause = document.getElementById('pause');
spanText = document.getElementById('moreInfo');
.
.
.
document.images.slide.onerror = goto_next_photo;
document.images.slide.src =
document.getElementById('item_{$SlideShow.start}_'+item_map[{$SlideShow.start}][iSize]).href;
text_onoff();
// ]]>
</script>

It will show descriptive text by default.

just for anyone else who wants to default their Text Descriptions below the photos to "on", the above probably worked for the code in 2003-5, but in 2008, it's actually even easier!!

Just change:

<script type="text/JavaScript">
  // <![CDATA[
  var image = new Image(), timer, iDelay = 5000, iDir = 1, iSize = 3;
  var bPause = 0, bShowText = 0, bShowTools = 1;

to

<script type="text/JavaScript">
  // <![CDATA[
  var image = new Image(), timer, iDelay = 5000, iDir = 1, iSize = 3;
  var bPause = 0, bShowText = 1, bShowTools = 1;

and, you'll also want to change:

    <a href="#" onclick="text_onoff();return false">
      <span id="moreInfo">{g->text text="Show More Info"}</span>
    </a>

to

    <a href="#" onclick="text_onoff();return false">
      <span id="moreInfo">{g->text text="Hide More Info"}</span>
    </a>
 
PaulineK

Joined: 2008-05-04
Posts: 1
Posted: Sat, 2008-06-14 20:44

That last change posted by jkuruppu did not work for me (gallery 2.2.4), but the original version of the change and all the other changes worked. Thanks!

 
wrecsamtri

Joined: 2007-09-29
Posts: 7
Posted: Sat, 2008-08-09 17:48

I also made all the above changes and they worked apart from the show comment

The slideshow starts correctly with the correct display.

The header is changed to show hide comments - but there are non there.

If I click on hide comments then back on show comments they appear

Any ideas>

 
mejon2

Joined: 2008-11-18
Posts: 2
Posted: Tue, 2008-11-18 18:02

Hello,

I've Gallery2 2.3 full, all work, but i don't know how can I change the default time between 2 pictures in the slideshow.
Defaut settings :10sec, and i need 3sec.
I use PicLens Diaporama Version 1.3.1.14221.
gallery2\modules\slideshow\

You can see my work : http://www.johnnyhapache.com/gallery2/main.php?g2_itemId=14

Thanks for your help.

 
neca

Joined: 2006-05-23
Posts: 18
Posted: Sat, 2008-11-22 18:41
 
mejon2

Joined: 2008-11-18
Posts: 2
Posted: Mon, 2008-11-24 22:26

Thanks !

neca wrote:
Replying to myself (don't bother, I'm paranoid...)

Solved it (for the delay issue) :
In modules/slideshow/module.inc line 168 :
Change :
. 'p.start({feedUrl:\'%s\', guid:%d, pid:\'2PWfB4lurT4g\', delay:10})',
to :
. 'p.start({feedUrl:\'%s\', guid:%d, pid:\'2PWfB4lurT4g\', delay:3})',

Flush every cache that may be hidden in your computer or around your house, come back to you slideshow and enjoy its new speed!

About the default fullscreen, I'm still searching, but not sure there's a way (though there's a will...)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2008-11-24 23:57