Thanks that seems to work,
with this
// links display
$gal = $HTTP_GET_VARS["gal"];
$pic = $HTTP_GET_VARS["pic"];
$n = 1;
$links = array();
$fp = fopen("links.txt", "r");
while (!feof($fp)) {
$link = fgets($fp, 500);
if($link) {
$links[$n] = rtrim($link);
$n++; } }
fclose($fp);
for ($i=sizeof($links); $i>=1; $i--) {
echo "<a href=?gal=".$i.">".$links[$i]."</a>";
if ( $i<=(sizeof($links)-1)) { echo " <br> "; } }
There is one problem though the gallery links input is:
Gallery4Gallery3
Gallery 2
Gallery 1
after gallery 4 should be a <br>
Also, one other thing..
If you go to the index.php for the gallery.. It always start with the earliest gallery, which is Gallery 1, instead of 4.. meaning that gallery's 1 1st photo shows instead of the newest gallery which is 4 or if I add a 5th gall, that photo should show..
SHould anything with this code below be changed to get that effect
// photo display
if (!$gal) { $gal = 1; }
if (!$pic) { $pic = 1; }
$dir= "gallery".$gal;
@$d = dir($dir);
if ($d) {
while($entry=$d->read()) {
$entry = preg_replace("/ /","%20",$entry);
$pos = strpos (strtolower($entry), ".jpg");
if (!($pos === false)) {
$arr_pic[] = $dir."/".$entry; } }
$d->close(); }
@sort ($arr_pic);
$total = sizeof($arr_pic);
echo "<img src=".$arr_pic[$pic-1]." border=1 width=350 height=263>";