Jump to content

[Solved btw there is the source for all the noobs] image slideshow type thing


BillyBoB

Recommended Posts

Sure there's at least one way to do it. They all begin with you posting a reasonable amount of useful information along with the code you have already written ... or post your request in freelancing and offer something in return for a solution.
Link to comment
Share on other sites

sorry for not posting all of the above i figured it out and here is the finished code incase u want to ever do it:

[code]
<?php
if($_GET['pic'])
{
$pic = $_GET['pic'];
echo(" <a href=\"viewpic.php?pic=$pic&full=y\" border = \"0\"><img src=\"halopics/$pic.jpg\" height=\"300\" width=\"490\" border = \"0\" /></a><br /><center>Click the Pic to Enlarge.</center><br />");
echo("<center><form method=\"POST\"><input type=\"submit\" name=\"back\" value=\"Back\" />\____/<input type=\"submit\" name=\"next\" value=\"Next\" /></form></center><br />");

$dir = './halopics/';
$handle = opendir($dir);
while (($file = readdir($handle)) !== false)
{
if ( !in_array($file, array('.', '..') ) )
{
$file_list[] = basename($file, '.jpg');
}
}

closedir($handle);

asort($file_list);
if($_POST['next'])
{
$currentfile = current($file_list);
while($currentfile!=$pic)
{
$currentfile=next($file_list);
}
if(current($file_list)==$pic)
{
$nextfile = next($file_list);
$pic = $nextfile;
if(!$nextfile)
{
$pic = end($file_list);
}
}
echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\" />");

}
if($_POST['back'])
{
$currentfile = current($file_list);
while($currentfile!=$pic)
{
$currentfile=next($file_list);
}
if(current($file_list)==$pic)
{
$nextfile = prev($file_list);
$pic = $nextfile;
if(!$nextfile)
{
$pic = reset($file_list);
}
}
echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\" />");

}
echo ("
<center><form method=\"POST\">Select:<select name=\"pic\">
");
foreach($file_list as $key => $value){
echo ("
<option>$value</option>
");
}
echo("
</select>
<input type=\"submit\" name=\"submit\" value=\"View Pic\" />
</form></center>
");
if($_POST['submit'])
{
$pic = $_POST['pic'];
echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\"/>");
}
}else{
$dir = './halopics/';
$handle = opendir($dir);

while (($file = readdir($handle)) !== false)
{
if ( !in_array($file, array('.', '..') ) )
{
$file_list[] = basename($file, '.jpg');
}
}

closedir($handle);

asort($file_list);
echo ("
<center><form method=\"POST\">Select:<select name=\"pic\">
");
foreach($file_list as $key => $value){
echo ("
<option>$value</option>
");
}
echo("
</select>
<input type=\"submit\" name=\"submit\" value=\"View Pic\" />
</form></center>
");
if($_POST['submit'])
{
$pic = $_POST['pic'];
echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\"/>");
}
}
?>
[/code]

this code is copyrighted but you can use the basic design of it :)  ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.