Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Cannot find this script...

  1. #1
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cannot find this script...

    Hello guys, new here, I am trying to find a specific script, and it is probably
    so easy to make thats why nobody has it readily available, or I am not looking
    for the right name of it.

    I am working on a site for a friend, a non-nude model site, and was looking
    for a script that could automatically create a 3 column table, and for the
    content of each cell it would be pulled from an xml file.

    Basically so it would be easier to list the most recent set release thumbnails
    first... She likes to have like 60-something up there, so manually shifting
    60 images into new cells 2 times a week would be a lot of work.

    And I can usually install, but I dunno how to program javascript yet.

    Any help, pointing me in the right direction would be greatly appreciated.

    Been trying different scripts the last 2 days and nothing is working how I
    would like yet... Spending to much time on this project for mostly static site.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried those, but I think, in combination with another script I was using, reflex, there were errors displaying the images correctly.

    And I couldn't get the php one to run on a home server... So gave up on that.

  4. #4
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    actually, I dont think I fully thought it through, the non-php one might work for me, I will try it again....

  5. #5
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nope, I remember now....

    Because you define myvacation[0]= and ect through your number of photos,
    you would inevitably have to change 0-60 on every line in order to get said
    newest photo to appear at the top.

  6. #6
    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

    Javascript arrays don't have to be in order, they just (generally, in practical use, such as in this script) cannot have any missing entries.

    So, though I'm not sure exactly what you are objecting to, it makes no difference (other than the order in which the entries will be used, which will always start at 0 and go to the highest number) if you have:

    Code:
    var myvacation=new Array()
    myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"]
    myvacation[1]=["photo2.jpg", "Our car", ""]
    myvacation[2]=["photo3.jpg", "Our dog", "photo3-large.jpg"]
    myvacation[3]=["photo4.jpg", "Our hotel", "http://www.gohawaii.com/"]
    myvacation[4]=["photo5.jpg", "Our Computer", "http://www.google.com", "_new"]
    myvacation[5]=["photo6.jpg", "Our house", "photo6-large.jpg"]
    myvacation[6]=["photo7.jpg", "Our Friends", "http://www.ask.com"]
    or:

    Code:
    var myvacation=new Array()
    myvacation[6]=["../photo1.jpg", "", "photo1-large.jpg"]
    myvacation[5]=["photo2.jpg", "Our car", ""]
    myvacation[4]=["photo3.jpg", "Our dog", "photo3-large.jpg"]
    myvacation[3]=["photo4.jpg", "Our hotel", "http://www.gohawaii.com/"]
    myvacation[2]=["photo5.jpg", "Our Computer", "http://www.google.com", "_new"]
    myvacation[1]=["photo6.jpg", "Our house", "photo6-large.jpg"]
    myvacation[0]=["photo7.jpg", "Our Friends", "http://www.ask.com"]
    or even:

    Code:
    var myvacation=new Array()
    myvacation[6]=["../photo1.jpg", "", "photo1-large.jpg"]
    myvacation[1]=["photo2.jpg", "Our car", ""]
    myvacation[3]=["photo3.jpg", "Our dog", "photo3-large.jpg"]
    myvacation[5]=["photo4.jpg", "Our hotel", "http://www.gohawaii.com/"]
    myvacation[0]=["photo5.jpg", "Our Computer", "http://www.google.com", "_new"]
    myvacation[2]=["photo6.jpg", "Our house", "photo6-large.jpg"]
    myvacation[4]=["photo7.jpg", "Our Friends", "http://www.ask.com"]
    Just as long as the numbers all make up an uninterrupted sequence starting at 0.
    - John
    ________________________

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

  7. #7
    Join Date
    Jun 2008
    Location
    Denham Springs, LA
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    To answer your first post, to my knowledge you cannot read an XML file from javascript.

    Second, I would like to suggest a method for updating photo galleries that has always been very easy to maintain for me. Rather than changing the file or the script, just change the images out.

    Let's say that you have 60 images all named like this:

    image1.jpg
    image2.jpg
    image3.jpg
    ...
    image60.jpg

    When you need to change out the images, all you need to do is rename your images and upload them to the site overwriting the old ones. No need to change the script or an XML file. You have to upload the new images anyway so that step can't be avoided, Why not make it the only step?

    Also, you can rename the image in windows xp very quickly if you put them all into a folder, select them all and click rename. Then type in image.jpg for the first image, they will all be named sequentially.

    Next comment, when you test a script be sure that you only test a small part at a time. This will make it easier to find errors, since there will be less code to dig through that might potentially haver problems. Then once you get a small part working add on the next bit and test again until you finally have added all of the code and it all works.

    "It's broken" is not really a very clever way of describing an error. It's a lot more helpful to say something like, line 68 error outs.

    **Download and install Firebug.

  8. #8
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Just as long as the numbers all make up an uninterrupted sequence starting at 0.
    Hah, shows how much I know about jscript.... I will try that out.

  9. #9
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I got it pretty much working, though it displays myvaction=[0] first no matter what, I thought the way you described it you ment that it would display them in the order I put them, as long as the sequence wasn't broken.

    But I guess you ment if type in the sequence 5, 2, 3, 4, 1, 0 it would still come out 0, 1, 2, 3, 4, 5....

    And also not being able to define the width/height manually is a problem.

    Back to endless googling...

  10. #10
    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

    By being able to number your entries however you like, you control the order, as 0 will always be first, 1 will be second, and so on. This allows you to reorder the entries without actually moving them around, all you need do is to change the numbering.

    This is getting to be a rather long thread, so forgive me if you already mentioned it, what width/height exactly do you want control over?
    - John
    ________________________

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

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
  •