Location: PHPKode > projects > SiteX > admin/links_edit.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['EditorRightsLinksEdit']))  loginError($sxLang['LoginRequired']);

if($Submit)
{
	$query = "UPDATE $DB_Links SET name='$name', url='$link_url', groupid='$category' WHERE id='$linkid'";
	$result = mysql_query($query, $Link) or queryError("23", mysql_error());
	header("Location:links.php?sxViewCat=$category&message=".str_replace(" ","_",$sxLang['MessageLinkEdited']));
	die();
}

$query = "SELECT * FROM $DB_Links WHERE id='$linkid'";
$result = mysql_query($query, $Link) or queryError("23", mysql_error());
$ROW = mysql_fetch_object($result);

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>    
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['GeneralHeadingEdit'].' '.getComponentName("5"); ?></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> > <a href="links.php"><?PHP echo getComponentName("5").' '.$sxLang['GeneralHeadingManager']; ?></a> > <?PHP echo $sxLang['GeneralHeadingEdit'].' '.getComponentName("5"); ?></div>   
   <?PHP echoMessage($message); ?>
	<form name="sxFormLinksEdit" method="post" action="<?PHP echo $PHP_SELF; ?>">
	  <table border="0" cellspacing="2" cellpadding="5">
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemName']; ?></td>
		  <td><input name="name" type="text" style="width:300px;" value="<?PHP echo  htmlspecialchars($ROW->name); ?>" maxlength="255" /></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemURL']; ?></td>
		  <td><input name="link_url" type="text" style="width:300px;" value="<?PHP echo $ROW->url; ?>" maxlength="255" /></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemCategory']; ?></td>
		  <td><select name="category"><?PHP
			$query2 = "SELECT * FROM $DB_Links_Groups ORDER BY name ASC";
			$result2 = mysql_query($query2, $Link) or queryError("23", mysql_error());
			while($ROW2 = mysql_fetch_object($result2)){
				if($ROW2->id == $ROW->groupid) $selected = " selected";
				else $selected = "";
				echo '<option value="' . $ROW2->id . '"' . $selected . '>' . $ROW2->name . '</option>';
			}
		   ?></select></td>
		</tr>
		<tr> 
		  <td>&nbsp;</td>
		  <td>
		  <input name="linkid" type="hidden" value="<?PHP echo $linkid; ?>" />
		  <input name="Submit" type="submit" id="Submit" value="<?PHP echo $sxLang['LinksButtonEdit']; ?>" class="sxButton" /></td>
		</tr>
	  </table>
	  </form>
  </div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX