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 [3] 4 5   Go Down

Author Topic: Wind buttons for film_strip in displayimage.php  (Read 75588 times)

0 Members and 1 Guest are viewing this topic.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #40 on: February 21, 2005, 09:30:57 pm »

nol33t, are you coding this for 1.3 or 1.4? Or would it work with both?

edit: Your gallery is 1.4 so it looks like that's what it will work with. cool. :) And that's neat that it does a countdown of the number of pics remaining in the album.
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #41 on: February 21, 2005, 10:08:27 pm »

nol33t, are you coding this for 1.3 or 1.4? Or would it work with both?

1.4, but a downgrade wouldn't be too difficult imo (could work without other changes on 1.3, i'll try).

and actually..here's the mod attached ;)

I added as you suggested:
- on the tooltip the number of pictures left
- arrows disappearing when you're at the start or the end of the filmstrip
- internationalization ( english.php, a new array $lang_film_strip )

last demo still here

I tried a lot of different implementations ( cause there was many different solutions to do this ), and the one i'm submitting does work with IE/Mozilla browsers, and is the most comprehensive i manage to found out ( at least for me ;) )

Basically, here is how it works:
 - when the template for the filmstrip is generated, it adds in the html a comment tag <!--STARTPOSX#X'#X''#X'''ENDPOS--> where X, X', X'' and X''' will be the new "positions" if you click on one of the buttons:
  - X for fast rewind ( pos - number of thumbs set up for the filmstrip in the config )
  - X' for rewind ( pos -1 )
  - X'' for forward ( pos +1 )
  - X'' for fast forward ( pos + number of thumbs set up for the filmstrip in the config )

when you click on one of the buttons, it will call a javascript script which will parse this comment tag, and depending one which button you clicked on, send the new position to display, with the album infos, to filmstrip.php, which returns the new filmstrip. Since i use the display_film_strip() function to do that, the new filmstrip will contain the new <!--STARTPOS ENDPOS-->  comment, but with the new positions ( so it loops which i kinda like :) )

the only probs i found are:
- the html code i added in $template_film_strip does not validate as XHTML 1.0, but i'm not that sure displayimage.php was before, and those are minor things to fix, and i'm must admit i'm not good at that ( which does not mean the html is real messy )
- one glitch when you're at the beginning of the filmstrip, arrow takes two clicks to dissapear, if a math geek looks at my code i'm sure he'll find the prob in 2 sec ;) )
- last but not least: you all work too fast on the devel 1.4 release, i had to merge my mod!  :P ;)

If you want more explanations on my choices for this mod and its implementation, just ask

Hope you'll like it,

-matt-

« Last Edit: February 21, 2005, 10:16:37 pm by nol33t »
Logged

jaysonyates

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Sons website
Re: Wind buttons for film_strip in displayimage.php
« Reply #42 on: February 21, 2005, 10:51:35 pm »

now this will not over write my custom theme will it, nol33t?

Thanks can not wait to try it out.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #43 on: February 21, 2005, 11:05:17 pm »

Great job, nol33t! :) Thank you.

A couple of things ;D

- With the files from the archive, the buttons didn't work in FF, but they worked in IE. After I merged your file with my themes.inc.php, it worked. So I guess there was something missing. I diffed the two files to see what it could be but couldn't figure it out.
- I can't replicate it, but I saw this in both of our galleries. Sometimes at the end of the gallery, the message would be displayed that there was no picture to show. Sometimes that message shows and sometimes not. I would have to refresh the page to make the filmstrip return.

Thanks so much for helping out with this. (http://tu2.net/emoticons/icon_clap.gif)(http://tu2.net/emoticons/icon_thumbs_up.gif)
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #44 on: February 21, 2005, 11:28:10 pm »

Sorry, I hate to ask too much since you've done so much already...

Is it possible to make it so that the script can detect that the browser has javascript enabled? And if it is not, have the tooltip say that js is required? I can see some people clicking madly away at those arrows. :D

Maybe someone else can jump in on this. :)
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #45 on: February 22, 2005, 12:04:18 am »

in themes.inc.php, after
Code: [Select]
      {PREV_BUTTONS}
      {NEXT_BUTTONS}
      </td>
      </tr>

you could add
Code: [Select]
<NOSCRIPT><td colspan={COLS} align="center"> Your browser doesn't support JavaScript, navigation has been disabled. </td></NOSCRIPT>

but with an internationalized error message of course ;)

--edit: a better one could be to use javascript for "printing" the buttons (with document.write() )..no javascript, no buttons..

-matt-
« Last Edit: February 22, 2005, 01:21:36 am by nol33t »
Logged

jaysonyates

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Sons website
Re: Wind buttons for film_strip in displayimage.php
« Reply #46 on: February 22, 2005, 12:35:37 am »

Where do all the files go? Sorry if this sounds like a stupid question, but I would hate to add the files to the wrong area, and then corrupt Coppermine.

Thanks
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #47 on: February 22, 2005, 12:58:08 am »

Sorry but the zip i provided is meant for 1.4, i didn't test it yet with 1.3, and in any cases if you use a custom theme you will have to manually modify the theme.php file in the folder of the theme you use.
Patience is a virtue..;)

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #48 on: February 22, 2005, 01:26:30 am »

--edit: a better one could be to use javascript for "printing" the buttons (with document.write() )..no javascript, no buttons..

-matt-
That would be cool indeed. :)

@jaysonyates, do you think you could wait til 1.4 comes out with this included? You would still have to manually update your custom theme, but there would be instructions to upgrade custom themes from 1.3 to 1.4.
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #49 on: February 22, 2005, 02:48:54 am »

That would be cool indeed. :)

ok here it is then ;)

- in theme.php replace
Code: [Select]
      {PREV_BUTTONS}
      {NEXT_BUTTONS}

with
Code: [Select]
      <span style="visibility:hidden" id="buttons">
      {PREV_BUTTONS}
      {NEXT_BUTTONS}
      </span>
     <script language="JavaScript" type="text/javascript">
     <!--
      var buttons = document.getElementById("buttons");
                buttons.style.visibility="visible";
     //-->
     </script>

and in script.js, find
Code: [Select]
filmstrip.innerHTML=xmlhttp.responseText;

and add right after
Code: [Select]
      var buttons = document.getElementById("buttons");
        buttons.style.visibility="visible";

I'm really no DOM expert, so chances are that there's better solutions, but it works with IE/and Mozilla browsers :)

-matt-

jaysonyates

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • My Sons website
Re: Wind buttons for film_strip in displayimage.php
« Reply #50 on: February 22, 2005, 05:51:22 am »

Man! That is like asking a little kid not to open his gifts before X-Mas, "sigh" oh, I can wait..........................................................................................................................................................................................................Is it here yet? ;D

--edit: a better one could be to use javascript for "printing" the buttons (with document.write() )..no javascript, no buttons..

-matt-
That would be cool indeed. :)

@jaysonyates, do you think you could wait til 1.4 comes out with this included? You would still have to manually update your custom theme, but there would be instructions to upgrade custom themes from 1.3 to 1.4.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #51 on: February 22, 2005, 08:32:35 am »

Great job, nol33t! It worked in IE and FF.

I checked in Opera and the buttons didn't respond. Javascript was enabled. I turned on the setting to have the console show up if there is an error. When I clicked the button, the console showed up, with a long list of stuff so I don't know about posting it here. However, when I disabled js, the buttons didn't show up so that part worked.

Opera has great functions built-in that FF needs extensions for. But it's times like these when it is just a bane on a web dev's existence. :P
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #52 on: February 22, 2005, 08:58:52 am »

About Opera: the actual version ( 7.5x ) actually got problems with xmlhttp, web services like Gmail also don't work with..that's why they are rewritting this part...and i just tried with the Beta 8.0, and the buttons worked ;)

-matt-

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: Wind buttons for film_strip in displayimage.php
« Reply #53 on: February 22, 2005, 01:30:36 pm »

Code: [Select]
      <span style="visibility:hidden" id="buttons">
      {PREV_BUTTONS}
      {NEXT_BUTTONS}
      </span>
     <script language="JavaScript" type="text/javascript">
     <!--
      var buttons = document.getElementById("buttons");
                buttons.style.visibility="visible";
     //-->
     </script>

Always rather display than visibility : visibility "hides" the layer, but it "keeps" the place it takes ..
Display : block / display : none ... the layer disappears totally, even if it takes several pixels

Code: [Select]
      <span style="display : none" id="buttons">
      {PREV_BUTTONS}
      {NEXT_BUTTONS}
      </span>
     <script language="JavaScript" type="text/javascript">
     <!--
      var buttons = document.getElementById("buttons");
                buttons.style.display="block";
     //-->
     </script>


So your code becomes interesting ... but is it possible to do a version like your flash mod but with dhtml ? (you have proved with this mod it's possible)

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #54 on: February 22, 2005, 01:38:29 pm »

thanx for the display / visibility tip :)

Quote
is it possible to do a version like your flash mod but with dhtml ? (you have proved with this mod it's possible)

well everything is possible..but the amount of work would be imo - even though quite fun - quite big..

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #55 on: February 22, 2005, 06:47:59 pm »

Always rather display than visibility : visibility "hides" the layer, but it "keeps" the place it takes .. Display : block / display : none ... the layer disappears totally, even if it takes several pixels
Code: [Select]
<span style="display : none" id="buttons"> {PREV_BUTTONS} {NEXT_BUTTONS} </span> <script language="JavaScript" type="text/javascript"> <!-- var buttons = document.getElementById("buttons"); buttons.style.display="block"; //--> </script>


So your code becomes interesting ... but is it possible to do a version like your flash mod but with dhtml ? (you have proved with this mod it's possible)
Thanks, Rodinou. It's good to make the blank space go away if the arrows are not there. However, the arrows disappear after the first series. Here's an example. It happens in IE and FF.
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #56 on: February 22, 2005, 06:52:47 pm »

it also has to be in script.js, after filmstrip.innerHTML=xmlhttp.responseText; ;)

Code: [Select]
       var buttons = document.getElementById("buttons");
        buttons.style.display="block";

-matt-
« Last Edit: February 22, 2005, 07:01:21 pm by nol33t »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #57 on: February 22, 2005, 07:02:20 pm »

Thanks, that fixed it.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Wind buttons for film_strip in displayimage.php
« Reply #58 on: February 22, 2005, 07:06:48 pm »

So your code becomes interesting ... but is it possible to do a version like your flash mod but with dhtml ? (you have proved with this mod it's possible)
Let's finish this first so that we can release the next cpg version with this. ;)
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Wind buttons for film_strip in displayimage.php
« Reply #59 on: February 22, 2005, 07:10:29 pm »

Thanks, that fixed it.

cool, cause it's look's real nice when javascript isn't enabled now :)

Quote
Let's finish this first so that we can release the next cpg version with this. Wink

you want me to check for the " random bug" ( no image to display ) when at the end of the album?
found another little one too, if nbr of pics of the album <= items in the filmstrip, both right and left arrows have to be disabled
Pages: 1 2 [3] 4 5   Go Up
 

Page created in 0.028 seconds with 20 queries.