Files
2017-03-02 20:30:40 -06:00

221 lines
5.7 KiB
PHP
Executable File

<?php
$page = $_GET['page'];
$team = $_GET['team'];
$event = $_GET['event'];
$picture = $_GET['picture'];
include "header.php";
if( ($page == "" or $page == 'home') and ($team == '') )
{ PrintHome(); }
else if( $page == 'about' and $team == '' )
{ PrintAbout(); }
if( $team != '' and $event == '' )
{ DisplayTeam($team); }
if( $event != '' and $picture =="" )
{ DisplayTeamEvent($team,$event); }
if( $picture != '' )
{ DisplayTeamEventPicture($team,$event,$picture); }
?>
</div>
<div id="teamindexheader">Teams List
<div id="teamindex">
<?php
$teams_folder = scandir('./pictures');
if( $teams_folder )
{
print "
<table cellpadding='0' cellspacing='20' border='0'>
<tr>
";
foreach($teams_folder as $file)
{
if( $file != '.' and $file != '..' )
{
print "
<td align='center'>
<a href='index.php?team=$file'><img src='graphics/folder.gif' border='0' /></a>
<br />
<a href='index.php?team=$file'>$file</a>
</td>";
}
}
print "
</tr>
</table>
";
}
?>
</div>
</div>
</div>
</body>
</html>
<?php
//=================================================
// PAGE FUNCTIONS
//=================================================
//=======================================
// Displays the home page
//=======================================
function PrintHome()
{
?>
<strong>Welcome to John Nielsen's Bobsled Photos Home page!</strong>
<br /> <br />
The pictures here are organized according to team. Once you click on a team, you can
see pictures of that team organized according to event.
<br /> <br />
All pictures are for sale through PayPal. Please e-mail me at
<a href="mailto:bobsledphotos@friendshiptours.org">bobsledphotos@friendshiptours.org</a>
if you have any questions.
<?php
}
//=======================================
// Displays the about page
//=======================================
function PrintAbout()
{
?>
<strong>About John Nielsen</strong>
<br /> <br />
Stuff about John Nielsen.
<br /> <br />
More stuff about John Nielsen.
<?php
}
//=======================================
// Displays all events of a
// specific team
//=======================================
function DisplayTeam($team)
{
print "
<strong class='team'>$team</strong>
<br /> <br />";
$team_folder = scandir("./pictures/$team");
if( $team_folder )
{
$event_counter = 0;
print "
<table cellpadding='0' cellspacing='20' border='0'>
<tr>
";
foreach($team_folder as $file)
{
if( $file == '.' or $file == '..' )
{ continue; }
print "
<td align='center'>
<a href='index.php?team=$team&event=$file'><img src='graphics/folder.gif' border='0' /></a>
<br />
<a href='index.php?team=$team&event=$file'>$file</a>
</td>";
$event_counter++;
if( $event_counter == 4 )
{ print "</tr><tr>\n"; $event_counter = 0; }
}
print "
</tr>
</table>
";
}
}
//=======================================
// Displays a specific event of a
// specific team
//=======================================
function DisplayTeamEvent($team,$event)
{
print "
<strong class='team'><a href='index.php?team=$team'>$team</a> :: $event</strong>
<br /> <br />";
$event_folder = scandir("./pictures/$team/$event");
if( $event_folder )
{
$picture_counter = 0;
print "
<table cellpadding='0' cellspacing='20' border='0'>
<tr>
";
foreach($event_folder as $file)
{
if( $file == '.' or $file == '..' or (true == strpos($file,".txt")) )
{ continue; }
print "
<td align='center'>
<a href='index.php?team=$team&event=$event&picture=$file'><img src='./pictures/$team/$event/$file' border='0' width='80' /></a>
<br />
$file
</td>";
$picture_counter++;
if( $picture_counter == 5 )
{ print "</tr><tr>\n"; $picture_counter = 0; }
}
print "
</tr>
</table>
";
}
}
//=======================================
// Displays a specific picture of a
// specific event of a specific team
//=======================================
function DisplayTeamEventPicture($team,$event,$picture)
{
$picture_details = file_get_contents("./pictures/$team/$event/$picture.txt");
$details = explode("\n",$picture_details);
$details[1] = stripslashes($details[1]);
print "
<strong class='team'><a href='index.php?team=$team'>$team</a> ::
<a href='index.php?team=$team&event=$event'>$event</a> ::
$picture</strong>
<br /> <br />
<div align='center'>
<div id='picture' align='center'>
<img src='./pictures/$team/$event/$picture' width='550' />
<br />
<div align='left' class='description'>
<strong>Description:</strong> {$details[1]}
<br /> <br />
<form name='_xclick' action='https://www.paypal.com/cgi-bin/webscr' method='post'>
<strong>Price:</strong> \${$details[0]}
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='business' value='ebay@rameydesign.net'>
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='item_name' value='$team/$event/$picture'>
<input type='hidden' name='amount' value='{$details[0]}'>
<input type='image' src='http://www.paypal.com/en_US/i/btn/x-click-but23.gif' border='0' name='submit' align='middle' alt='Make payments with PayPal - it's fast, free and secure!'>
</form>
</div>
</div>
</div>
";
}
?>