Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Remove Page Grouping of Thumbs

  1. #11
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Dear John: I wrote you yesterday but fell asleep on the sofa before I posted it, I guess. Wanted to tell you that I finally was able to get back to the gallery site and did exactly what you said and it worked perfectly! I LOVE it!!! I love how you matched the background color too. So I'm working on applying it to my other gallery site. I'll show you when I'm done. Thanks a million!!!

    Aloha, kuau

  2. #12
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    For my other gallery site, I use a custom template & variables to create the page with the slideshow and the thumbnails. I was planning to add a field to the database to hold the number of rows in the thumbs array because it varies from one artist to the next. It suddenly occurred to me that perhaps the getpics.php script may already calculate how many files are in the folder in order to do the paging and, if so, could I use that total to calculate the number of rows on the fly, ie. 5 x $rows? Is it possible to pass a variable value from javascript to php? Just wondering. Thanks, kuau

  3. #13
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I suppose that it might be possible. But there is the issue of PHP (the server actually) generally needing to know what the values are when the page is served. I think getpics could be modified to make a server variable that could then be used here like:

    PHP Code:
    var dimension="5x<?php=$_rows?>"
    Not sure If I have my PHP syntax right. The bigger issue is whether the $_rows would be ready in time or not. Since this is already a javascript though, I'd try passing the value directly (worked here in local testing):

    Code:
    var dimension="5x"+Math.ceil(galleryarray.length/5);
    Also (unrelated to this particular question), if you are going to use this for various galleries where the path might be different than:

    Code:
    /img/lrg/
    and on pages that might have other scripts than we've already covered, this (be sure to use the added semicolon on the targetlinkdr line):

    Code:
    	 . . . iptionprefix=[0, ""]
    	var gsortorder=""
    	var targetlinkdir="http://www.billmyrickartist.com/img/lg/";  //large gallery
    	(function(){	
    	for (var i = galleryarray.length-1, j ; i > -1 ; --i)
    	for (j = slides.length-1 ; j > -1 ; --j)
    	if(slides[j][0].replace(/^.*\//,'') == galleryarray[i][0])
    	galleryarray[i][1]=slides[j][1];	
    	})();
    </script>
    would be better than:

    Code:
    	 . . . iptionprefix=[0, ""]
    	var gsortorder=""
    	var targetlinkdir="http://www.billmyrickartist.com/img/lg/"  //large gallery
    	for (var i = galleryarray.length-1, j ; i > -1 ; --i)
    	for (j = slides.length-1 ; j > -1 ; --j)
    	if(slides[j][0].replace(/\/img\/lg\//,'') == galleryarray[i][0])
    	galleryarray[i][1]=slides[j][1];
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #14
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    PHP Code:
    ...
    var dimension="5x<?php=$_rows?>"
    ...
    I'd use:
    PHP Code:
    var dimension="5x<?php echo $_rows?>"
    Just in case people don't have the short_tags enabled on their server.
    Last edited by tech_support; 11-22-2007 at 11:19 PM.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #15
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Superb Solution

    Dear John: I didn't get an email alert so didn't find your response until today... Happy Thanksgiving by the way!

    I love to do things in the most efficient way possible and you have certainly accomplished that for me in only 34 characters!! I would have had to manually count all the files for 53 artists, divide by 5 and store the values in a database table to be retrieved using php, and update the values every time I added files. This is a fabulous solution that solves my 3" gap problem in an elegant way. Thank you so much!!! Here is one of the pages so you can see how much you have contributed to my design...

    http://www.sargentsfineart.com/artist/auction.php

    Mahalo plenty!!! kuau

  6. #16
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    On second thought, forget that page -- it won't work properly until I get all the images uploaded. This is one of the pages that works perfectly already...

    http://www.sargentsfineart.com/artist/wishard.php

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •