Location: PHPKode > projects > SiteX > admin/photo_albums.php
<?PHP
ob_start();
session_start();
include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");

if((!userEditor())AND(!userAdmin()))  loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsAlbumsManage']))  loginError($sxLang['LoginRequired']);

if($upid)
	moveAlbumUp($upid);
if($downid)
	moveAlbumDown($downid);
if($delete)
	deleteAlbum($delete, $allpics);

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function confirmDelete(theID,theName){
	if(confirm("<?PHP echo $sxLang['PhotoAlbumJSDeleteAlbum1']; ?> '"+theName+"' <?PHP echo $sxLang['GeneralJSDeleteEntry2']; ?>")){
		if(confirm("<?PHP echo $sxLang['PhotoAlbumJSDeletePhotos']; ?>")){
			window.location='<?PHP print $PHP_SELF."?allpics=1&delete="; ?>'+theID;
		}else{
			window.location='<?PHP print $PHP_SELF."?allpics=0&delete="; ?>'+theID;
		}
	}
}
//-->
</script>     
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['PhotoAlbumHeadingManager']; ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <?PHP echo $sxLang['PhotoAlbumHeadingManager']; ?></div>   
   <?PHP echoMessage($message); ?>
	<table border="0" cellspacing="2" cellpadding="5">
	  <tr>
		<td align="right" colspan="3">
		<input type="button" name="add_photo" value="<?PHP echo $sxLang['PhotoHeadingAdd']; ?>" onclick="window.location='photo_add.php'" /> 
		<input type="button" name="add_album" value="<?PHP echo $sxLang['PhotoAlbumHeadingAdd']; ?>" onclick="window.location='photo_album_add.php'" /></td>
	  </tr>
	  <tr>
		<td class="tableColumn"><?PHP echo $sxLang['GeneralItemNum']; ?></td>
		<td class="tableColumn"><?PHP echo $sxLang['GeneralItemName']; ?></td>
		<td class="tableColumn"><?PHP echo $sxLang['GeneralItemOptions']; ?></td>
	  </tr>
		<?PHP
		$query = "SELECT * FROM $DB_Photos_Albums ORDER BY position ASC";
		$result = mysql_query($query, $Link) or queryError("27", mysql_error());
		while($ROW = mysql_fetch_object($result))
		{
			echo '  <tr bgcolor="' . $sxTheme['ColorTableRow'] . '">';
			echo '     <td>' . $ROW->position . '</td>';
			echo '     <td>' . htmlspecialchars($ROW->name) . '</td>';
			echo '     <td>';
			echo '     <a href="photo_album_edit.php?editid=' . $ROW->id . '" title="' . $sxLang['ButtonEdit'] . '"><img src="../images/admin_edit.gif" style="border: 0;" alt="' . $sxLang['ButtonEdit'] . '" /></a> ';
			echo '     <a href="#" onclick="confirmDelete(' . $ROW->id . ',\'' . addslashes(htmlspecialchars($ROW->name)) . '\')" title="' . $sxLang['ButtonDelete'] . '"><img src="../images/admin_delete.gif" style="border: 0;" alt="' . $sxLang['ButtonDelete'] . '" /></a> ';
			echo '     <a href="' . $PHP_SELF . '?upid=' . $ROW->id . '" title="' . $sxLang['ButtonUp'] . '"><img src="../images/admin_up.gif" style="border: 0;" alt="' . $sxLang['ButtonUp'] . '" /></a> ';
			echo '     <a href="' . $PHP_SELF . '?downid=' . $ROW->id . '" title="' . $sxLang['ButtonDown'] . '"><img src="../images/admin_down.gif" style="border: 0;" alt="' . $sxLang['ButtonDown'] . '" /></a> ';
			echo '     </td>';
			echo '  </tr>';
		}
		if(mysql_num_rows($result) == 0)
			echo '<tr bgcolor="' . $sxTheme['ColorTableRow'] . '"><td colspan="3"><div style="width:300px;"><em>' . $sxLang['NoAlbums'] . '</em></div></td></tr>';
		?></table>
	</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX