Location: PHPKode > scripts > SelectaPix Image Gallery > admin/includes/inc_output_fns.php
<?php
/* +----------------------------------------------------------------------+
   |SelectaPix Open Source Gallery	                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 2004 OutOfTheTrees			                          |
   |                                                                      |
   | http://www.outofthetrees.co.uk/index.php                             |
   | 												                      |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.0 of the GPL license,       |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.outofthetrees.co.uk/license/2_0.txt.                      |
   | If you did not receive a copy of the SelectaPix license and are 	  |
   | unable to obtain it through the world-wide-web, please send a note   |
   | to hide@address.com so we can mail you a copy immediately.|
   +----------------------------------------------------------------------+ */
if (!defined("ACCESS")) {
    die ("Direct request denied");
}

function do_html_header($title) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="assets/admin.js"></script>
<style type="text/css" media="screen">@import url(assets/admin.css);</style>
</head>
<body<?php if(strstr($_SERVER['PHP_SELF'], 'login')) echo ' onload="document.forms[0].username.focus()"'; ?>>
<div id="header">
<?php
}

function do_html_heading($title)
{
	echo "<h1>".$title."</h1>\n</div>\n";
}

function do_html_footer($helpsection = "contents", $showkwikenav = "showkwikenav") {
	global $abm;
	if ($showkwikenav == "showkwikenav") {
		$temp = $abm->get_temp_albumID();
?>
<div id="kwikenav">
<a href="member.php" title="Main admin area"><img src="images/home_small.gif" width="24" height="24" alt="Main admin area" /></a>
<a href="gallery.php" title="View albums"><img src="images/view_albums_small.gif" width="24" height="24" alt="View albums" /></a>
<a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=single" title="Upload a single image"><img src="images/upload_single_image_small.gif" width="24" height="24" alt="Upload a single image" /></a>
<a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=multiple" title="Upload multiple images"><img src="images/upload_multiple_images_small.gif" width="24" height="24" alt="Upload multiple images" /></a>
<a href="register_form.php" title="Add a new admin user"><img src="images/add_admin_user_small.gif" width="24" height="24" alt="Add a new admin user" /></a>
<a href="user.php" title="Manage existing admin users"><img src="images/manage_admin_users_small.gif" width="24" height="24" alt="Manage existing admin users" /></a>
</div>
<?php
	}
?>
</body>
</html>
<?php
}

function do_html_URL($url, $name) {
	echo "<p><a href=\"".$url."\">".$name."</a></p>\n";
}

function display_user_menu() {
	global $abm;
	$temp = $abm->get_temp_albumID();
?>
<div id="mainmenu">
<ul>
<li><a href="gallery.php" title="View albums" class="mainmenu"><img src="images/view_albums_big.gif" class="picture" width="48" height="48" alt="View albums" /></a> <a href="gallery.php">View albums</a></li>
<li><a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=multiple" title="Upload multiple images" class="mainmenu"><img src="images/upload_multiple_images_big.gif" class="picture" width="48" height="48" alt="Upload multiple images" /></a> <a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=multiple">Upload multiple images</a></li>
<li><a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=single" title="Upload a single image" class="mainmenu"><img src="images/upload_single_image_big.gif" class="picture" width="48" height="48" alt="Upload a single image" /></a> <a href="upload.php?albumID=<?php echo $temp; ?>&amp;parentID=0&amp;request=single">Upload a single image</a></li>
<li><a href="change_passwd_form.php" title="Change password" class="mainmenu"><img src="images/change_pass_big.gif" class="picture" width="48" height="48" alt="Change password" /></a> <a href="change_passwd_form.php">Change password</a></li>
<li><a href="register_form.php" title="Add a new admin user" class="mainmenu"><img src="images/add_admin_user_big.gif" class="picture" width="48" height="48" alt="Add a new admin user" /></a> <a href="register_form.php">Add a new admin user</a></li>
<li><a href="user.php" title="Manage existing admin users" class="mainmenu"><img src="images/manage_admin_users_big.gif" class="picture" width="48" height="48" alt="Manage existing admin users" /></a> <a href="user.php">Manage existing admin users</a></li>
<li><a href="logout.php" title="Logout" class="mainmenu"><img src="images/logout_big.gif" class="picture" width="48" height="48" alt="Logout" /></a> <a href="logout.php">Logout</a></li>
</ul>
<p class="credit">Powered by <a href="http://www.outofthetrees.co.uk/">SelectaPix</a></p>
</div>
<?php
}

function display_site_info()
{
  // display some marketing info
?>
<div class="siteinfo">
<h2 style="text-transform: none; color: #ccc;">Powered by <a style="background-color: transparent; color: #ccc;" href="http://www.outofthetrees.co.uk/" title="Powered by SelectaPix">SelectaPix</a></h2>
<h2>Features include:</h2>
<ul>
<li>Upload images to your web site</li>
<li>Arrange images into albums</li>
<li>Choose which images to display or hide</li>
<li>Delete albums or images</li>
<li>Add, Remove and Restrict other users access to your site</li>
</ul>
<p>All via a simple to use web interface!</p>
</div>
<?php
}

function display_login_form() {
	?>
<div class="iecentrehack">
<div id="loginmenu">
<form action="member.php" method=post>
<h2>Log in to the admin area</h2>
<div class="formrow"><label for="username">Username:</label></div>
<div class="formrow"><input type="text" name="username" id="username" size="16" onmouseover="return showStatus('Enter your Username')" onmouseout="return clearStatus()" /></div>
<div class="formrow"><label for="passwd">Password:</label></div>
<div class="formrow"><input type="password" name="passwd" id="passwd" size="16" onmouseover="return showStatus('Enter your password')" onmouseout="return clearStatus()" /></div>
<div class="formrow"><input type="submit" class="button" value="Log in" onmouseover="return showStatus('Log in to the admin area')" onmouseout="return clearStatus()" /></div>
</form>
<p><a href="forgot_form.php" onmouseover="return showStatus('Click here to request a new password')" onmouseout="return clearStatus()">Forgotten your password?</a></p>
</div>
<?php
}

function display_registration_form() {
	global $user;
?>
<form method="post" action="register_new.php" class="swanky" style="width: 495px;">
<h2>Add A New Admin User</h2>
<div class="swankyform" style="margin-bottom: 20px;">
<label for="email">Email address:</label>
<input type="text" name="email" id="email" size="30" maxlength="100" /><br />
<label for="username">Preferred username:<br />(max 16 chars)</label>
<input type="text" name="username" id="username" size="16" maxlength="16" /><br />
<label for="passwd">Password:<br />(6 to 16 chars)</label>
<input type="password" name="passwd" size="16" id="passwd" maxlength="16" /><br />
<label for="passwd2">Confirm password:</label>
<input type="password" name="passwd2" id="passwd2" size="16" maxlength="16" /><br />
<label for="roleID">Select Access Level:</label>
<?php $user->list_role_levels(); ?></select>
</div>
<input type="submit" class="button" value="Create User">
</form>
<?php
}

function display_new_album_form() {
?>

<form action="gallery.php" method="post" class="swanky" style="width: 395px;">
<h2>Create New Album</h2>
<div class="swankyform">
<label for="album_name">Album Name:</label>
<input type="text" name="album_name" id="album_name" size="40" title="Maximum 64 characters" /><br />
<label for="album_descr">Album Description:</label>
<textarea name="album_descr" id="album_descr" rows="5" cols="33"></textarea><br />
<input type="hidden" name="add_album" value="true" />
</div>
<input type="submit" class="button" name="add" value="Create Album" />
</form>

<?php
}

function display_new_sub_album_form($albumID) {
?>
<form action="edit_album.php?albumID=<?php echo $albumID; ?>&amp;parentID=0" method="post" class="swanky" style="width: 395px;">
<h2>Create New Sub Album</h2>
<div class="swankyform">
<label for="album_name">Album Name:</label>
<input type="text" name="album_name" id="album_name" size="40" title="Maximum 64 characters" /><br />
<label for="album_descr">Album Description:</label>
<textarea name="album_descr" id="album_descr" rows="3" cols="33"></textarea><br />
<input type="hidden" name="add_sub_album" value="true" />
<input type="hidden" name="parent_albumID" value="<?php echo $albumID; ?>" />
</div>
<input type="submit" class="button" name="add" value="Create Album" />
</form>
<?php
}

function display_update_album_form($albumID, $parentID, $album_name, $album_descr) {
?>
<form action="<?php echo $_SERVER['PHP_SELF'].'?albumID='.$albumID.'&amp;parentID='.$parentID; ?>" method="post" class="swanky" style="width: 395px;">
<h2>Change the name or description of this album</h2>
<div class="swankyform">
<label for="album_name">Album Name:</label>
<input type="hidden" name="albumID" value="<?php echo $albumID; ?>" />
<input type="hidden" name="update_album" value="true" />
<input type="text" name="album_name" id="album_name" size="40" title="Maximum 64 characters" value="<?php echo $album_name; ?>" /><br />
<label for="album_descr">Album Description:</label>
<textarea name="album_descr" id="album_descr" rows="5" cols="33"><?php echo $album_descr; ?></textarea><br />
</div>
<input type="submit" class="button" name="save" value="Save Changes" />
</form>
<?php
}

function display_password_form() {
// display html change password form
?>
<form action="change_passwd.php" method="post" class="swanky" style="width: 395px;">
<h2>Change Your Password</h2>
<div class="swankyform">
<label for="old_passwd">Enter old password:</label>
<input type="password" name="old_passwd" id="old_passwd" maxlength="16" /><br />
<label for="new_passwd">Enter new password:</label>
<input type="password" name="new_passwd" id="new_passwd" maxlength="16" /><br />
<label for="new_passwd2">Repeat new password:</label>
<input type="password" name="new_passwd2" id="new_passwd2" maxlength="16" /><br />
</div>
<input type="submit" class="button" value="Update Password" />
</form>
<?php
}

function display_forgot_form() {
// display HTML form to reset and email password
?>
<div class="iecentrehack">
<form action="forgot_passwd.php" method="post" class="centreform">
<h2>Forgotten your password?</h2>
<div class="formrow"><label for="username">Enter your username:</label></div>
<div class="formrow"><input type="text" name="username" id="username" size="16" maxlength="16" /></div>
<div class="formrow"><input type="submit" class="button" value="Change password" /></div>
<div class="formrow">A new password will be sent to your email address.</div>
</form>
</div>
<?php
}

function display_text_button($target, $text, $title) {
	echo '<a href="'.$target.'" class="textbutton" title="'.$title.'">'.$text.'</a>';
}
?>
Return current item: SelectaPix Image Gallery