Location: PHPKode > projects > SiteX > admin/editor_index.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");

clearCache();

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

if($sxPageEdit)
{
	header("Location: page_edit.php?pageid=".$sxPageEditID);
	die();
}

if($deletePage)
{
	$query = "SELECT * FROM $DB_Pages WHERE id='$deletePage'";
	$result = mysql_query($query, $Link) or queryError("25", mysql_error());
	$ROW = mysql_fetch_object($result);
	$page_name = $ROW->name;
	
	$query = "SELECT * FROM $DB_Navigation";
	$result = mysql_query($query, $Link) or queryError("25", mysql_error());
	while($ROW = mysql_fetch_object($result))
	{
		if($ROW->url == ('page.php?page='.str_replace(' ', '_', $page_name)))
		{
			$this_id = $ROW->id;
			$this_position = $ROW->position;
		}
	}
	
	$query = "SELECT * FROM $DB_Navigation WHERE position>'$this_position'";
	$result = mysql_query($query, $Link) or queryError("26", mysql_error());
	while($ROW = mysql_fetch_object($result))
	{
		if($ROW->position > 1)
			$new_position = $ROW->position-1;
		else
			$new_position = $ROW->position;
		$query2 = "UPDATE $DB_Navigation SET position='$new_position' WHERE id='$ROW->id'";
		$result2 = mysql_query($query2, $Link);
	}
	
	$query = "DELETE FROM $DB_Pages WHERE id='$deletePage'";
	$result = mysql_query($query, $Link) or queryError("51", mysql_error());
	
	$query = "DELETE FROM $DB_Pages_Private WHERE pageid='$deletePage'";
	$result = mysql_query($query, $Link) or queryError("51", mysql_error());
	
	$query = "DELETE FROM $DB_Navigation WHERE id='$this_id'";
	$result = mysql_query($query, $Link);
	
	// Refresh in case user clicks back after going forward
	header("Location: $PHP_SELF?message=".str_replace(" ","_",$sxLang['MessagePageDeleted']));
	die();
}

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function deletePage(){
	if(confirm("<?PHP echo $sxLang['AdminJSDeletePage']; ?>")){
		window.location='<?PHP print $PHP_SELF."?deletePage="; ?>'+document.sxFormPages.sxPageEditID.value;
	}
}
//-->
</script>
<div class="bodyWrapper">
<h1 class="sxAdminHeading sxAdminHome"><?PHP echo $sxLang['AdminHeading']; ?></h1><?PHP echoMessage($message); ?><br>
<?PHP sxEchoWarning(sxFetchPanelWarnings()); ?>
<noscript ><div class="noscript"><?PHP echo $sxLang['JavascriptDisabled']; ?></div></noscript>
<table width="<?PHP echo $sxThemeConfig['ContentWidth']-30; ?>" border="0" cellpadding="0" cellspacing="0">
  <tr> 
	<td width="60%" valign="top" class="td_background"> 
	  <div style="padding-left:25px;"> 
		<p><strong><?PHP echo $sxLang['AdminSectionGeneral']; ?></strong><br />
		 <?PHP if($sxSetup['EditorRightsHomepageOptions']) { ?>&nbsp;&nbsp;&nbsp;- <a href="home_manager.php"><?PHP echo $sxLang['AdminLinkHomeManager']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsNavigation']) { ?>&nbsp;&nbsp;&nbsp;- <a href="navigation.php"><?PHP echo $sxLang['AdminLinkNavigation']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsVisitorStats']) { ?>&nbsp;&nbsp;&nbsp;- <a href="hits.php"><?PHP echo $sxLang['AdminLinkStatistics']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsCommentsManager']) { ?>&nbsp;&nbsp;&nbsp;- <a href="comments_manager.php"><?PHP echo $sxLang['AdminLinkCommments']; ?></a></p><?PHP } ?>
		<p><strong><?PHP echo $sxLang['AdminSectionUser']; ?></strong><br />
		 <?PHP if($sxSetup['EditorRightsUserOptions']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_options.php"><?PHP echo $sxLang['AdminLinkUserOptions']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsUsersEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_manager.php"><?PHP echo $sxLang['AdminLinkUserManage']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsUserTypes']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_types.php"><?PHP echo $sxLang['AdminLinkUserTypes']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsUsersAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_add.php"><?PHP echo $sxLang['AdminLinkUserAdd']; ?></a> <br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsOnline']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_online.php"><?PHP echo $sxLang['AdminLinkOnline']; ?></a><br /><?PHP } ?>
		 <?PHP if($sxSetup['EditorRightsUsersEmail']) { ?>&nbsp;&nbsp;&nbsp;- <a href="user_mail.php"><?PHP echo $sxLang['AdminLinkUserMail']; ?></a><br /><br /><?PHP } ?>
		<form name="sxFormPages" method="post" action="<?PHP echo $PHP_SELF; ?>">
		<strong><?PHP echo $sxLang['AdminSectionPages']; ?></strong><br /><br />
		<select name="sxPageEditID" style="width:225px;">
		<?PHP
		$query = "SELECT * FROM $DB_Pages ORDER BY name ASC";
		$result = mysql_query($query, $Link) or queryError("25", mysql_error());
		while($ROW = mysql_fetch_object($result)){
			echo '  <option value="' . $ROW->id .'">' . $ROW->name .'</option>'."\n";
		}
		?>
		</select><br />
		<?PHP if($sxSetup['EditorRightsPagesEdit']) { ?><input style=" " type="submit" name="sxPageEdit" value="<?PHP echo $sxLang['ButtonEdit']; ?>" class="sxButton" /><?PHP } ?>
		<?PHP if($sxSetup['EditorRightsPagesDelete']) { ?><input style=" " type="button" name="sxPageDelete" value="<?PHP echo $sxLang['ButtonDelete']; ?>" onclick="deletePage()" /><?PHP } ?>
		<?PHP if($sxSetup['EditorRightsPagesAdd']) { ?><input style=" " type="button" name="sxPageAdd" value="<?PHP echo $sxLang['ButtonAdd']; ?>" onclick="window.location='page_add.php'" /><?PHP } ?>
		</form><br />
		<?PHP if($sxThemeConfig['AdminShowHelp']){ ?>
		<p><strong><?PHP echo $sxLang['AdminSectionHelp']; ?></strong><br />
		  &nbsp;&nbsp;&nbsp;- <a href="http://sitex.wiki.sourceforge.net" target="_blank"><?PHP echo $sxLang['AdminLinkURLWiki']; ?></a><br />
		  &nbsp;&nbsp;&nbsp;- <a href="http://sourceforge.net/export/rss2_projdocs.php?group_id=121558&rss_alllanguages=1" target="_blank"><?PHP echo $sxLang['AdminLinkRSSTips']; ?></a><br />
		  &nbsp;&nbsp;&nbsp;- <a href="http://sitex.bjsintay.com/page.php?pageid=4" target="_blank"><?PHP echo $sxLang['AdminLinkURLFAQ']; ?></a><br />
		  &nbsp;&nbsp;&nbsp;- <a href="http://sitex.bjsintay.com/forums.php" target="_blank"><?PHP echo $sxLang['AdminLinkURLForum']; ?></a><br />
		<?PHP }?></div></td>
	<td valign="top" class="td_background">
	  <div style="padding-top: 0px; padding-left:25px;">
		<?PHP if(componentActive(1)){ ?><p><strong><?PHP echo getComponentName("1"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsJournalAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="journal_add.php"><?PHP echo $sxLang['AdminLinkJournalAdd']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsJournalEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="journal_manager.php"><?PHP echo $sxLang['AdminLinkJournalManage']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsJournalManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="journal_options.php"><?PHP echo $sxLang['AdminLinkJournalPreferences']; ?></a></p><?PHP } ?><?PHP } ?>
		<?PHP if(componentActive(2)){ ?><p><strong><?PHP echo getComponentName("2"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsPhotoAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="photo_add.php"><?PHP echo $sxLang['AdminLinkPhotoAdd']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsPhotoEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="photos.php"><?PHP echo $sxLang['AdminLinkPhotoManage']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsAlbumsAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="photo_album_add.php"><?PHP echo $sxLang['AdminLinkAlbumAdd']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsAlbumsManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="photo_albums.php"><?PHP echo $sxLang['AdminLinkAlbumManage']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsPhotoBatchAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="photo_batch_up.php"><?PHP echo $sxLang['AdminLinkPhotoBatch']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(3)){ ?> <p><strong><?PHP echo getComponentName("3"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsGuestbookEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="guestbook_manager.php"><?PHP echo $sxLang['AdminLinkGuestbookManage']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(4)){ ?> <p><strong><?PHP echo getComponentName("4"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsPollsEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="polls.php"><?PHP echo $sxLang['AdminLinkPollsManage']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(5)){ ?><p><strong><?PHP echo getComponentName("5"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsLinksAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="links_add.php"><?PHP echo $sxLang['AdminLinkLinkAdd']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsLinksEdit']) { ?>&nbsp;&nbsp;&nbsp;- <a href="links.php"><?PHP echo $sxLang['AdminLinkLinkManage']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(6)){ ?><p><strong><?PHP echo getComponentName("6"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsForumsOptions']) { ?>&nbsp;&nbsp;&nbsp;- <a href="forums_options.php"><?PHP echo $sxLang['AdminLinkForumOptions']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsForumsManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="forums_manager.php"><?PHP echo $sxLang['AdminLinkForumManage']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsForumsAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="forums_add.php"><?PHP echo $sxLang['AdminLinkForumAdd']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(7)){ ?><p><strong><?PHP echo getComponentName("7"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsContactManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="contact_config.php"><?PHP echo $sxLang['AdminLinkFormConfig']; ?></a></p><?PHP } ?><?PHP } ?>
	   <?PHP if(componentActive(8)){ ?><p><strong><?PHP echo getComponentName("8"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsEventsAdd']) { ?>&nbsp;&nbsp;&nbsp;- <a href="event_add.php"><?PHP echo $sxLang['AdminLinkEventAdd']; ?></a><br /><?PHP } ?>
		  <?PHP if($sxSetup['EditorRightsEventsManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="event_manager.php"><?PHP echo $sxLang['AdminLinkEventManage']; ?></a></p><?PHP } ?><?PHP } ?>
	   <p><strong><?PHP echo getComponentName("9"); ?></strong><br />
		  <?PHP if($sxSetup['EditorRightsFilesManage']) { ?>&nbsp;&nbsp;&nbsp;- <a href="file_manager.php"><?PHP echo $sxLang['AdminLinkFiles']; ?></a><br />	<?PHP } ?>	  
	  </div>
	</td>
  </tr>
</table>
</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX