Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2

Thread: a few questions

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    1
    Member #
    20877
    hi i was wondering if anyone could tell me where to find a script that is free if possible. that would allow me to post a image link. And allows me to set how many per row and how many per page. then when that number is reached puts them on page 2 and 3 and so on. i dont need alot of features like coments or anything. i would like it to be like this one on this site www.nekkidtees.com

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Do you have any PHP experience?
    You could make a script yourself.

    Below is an example ... (I didn't actually test it).

    Create a plain text file, call it "catalog.txt" and fill it with one line for each photo.
    And the three fields separated by pipes |

    http://www.site1.com|myphoto1.jpg|caption
    http://www.site2.net|myphoto342.jpg|caption
    http://www.site3.net|myphoto46342.jpg|caption
    http://www.site4.net|myphoto345742.jpg|caption

    etc.

    Now, you have a PHP script that opens that file and displays your images.
    Like this ... call it "links.php" ...
    PHP Code:
    <?php

    // open the file, put into an array.
    $file file("catalog.txt");

    // how many across?
    $across=4;

    // how many per page?
    $qty=16;

    // which one to start at.
    $start=1//default to the first photo if not specified
    if($_GET['s']){
    $start=$_GET['s'];
    }
    $prev=$start-$qty;
    // check the limits for previous
    if($prev<1){
    $prev=1;
    }

    $next=$start+$qty;
    // check the limits for next
    if($next count($file)){
    $next=count($file);
    }

    // start the display
    echo"<div>";
    $x=0;

    //loop through your file and display them.
    //use the correct path to your photos
    // (in my example, your pix are all stored in 'photos/'

    for($i=($start-1);$i<=($next-1);$i++){
       
    $field=explode('|',$file[$i]);

       
    //display photo
       
    echo"
       <a href='
    $field[0]'><img src='photos/$field[1]' alt='$field[2]' title='$field[2]' style='padding:5px; float:left;' /></a>
       "
    ;
          
    // do a line feed when the number across is met.
          
    $x++;
          if(
    $x==$across){
          
    $x=0;
          echo
    "<div style='clear:both;'></div>\n";
          }
    }

    // display prev or next page ...
    echo"<div style='clear:both;'></div>\n";
    echo
    "<a href='links.php?s=$prev'>Previous</a> &nbsp;&nbsp; <a href='links.php?s=$next'>Next</a>\n";

    echo 
    "</div>";
    ?>
    That's a stand-alone script ... to put this script into your main page, you can use PHP include,
    and move the "prev" "next" thing to the main page, or use an <iframe>....
    Or put the whole script into your main page ... so many ways to do it.
    I of course have no way of knowing anything about your existing site.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:14 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com