Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/edit.php
<%
	# $Id: edit.php,v 1.16 2005/01/02 21:07:03 hirokai Exp $
	$page = "edit";
	include_once( "modules/utils.inc.php" );
	$site = getSiteUrl();

	$tok =  $authenticated = $_COOKIE["c_pass_token"];
	$u   =  $sessionUserId = $_COOKIE["c_uid"];
	$noBody = 1;
	include_once( "$modules/header.insecure.inc.php" );
%>
<title> Feed Me Edits : Change a Link <%= $id %> </title>
<base href="<%= $site %>/edit" />
<%
	if( $tok && $tok == md5( getPasswdForUser( $u ))) {

	$MAX_LINKS = 100;
	$MAX_NAME_LENGTH = 35;
%>
<script language="javascript">

	if( window.focus() )
		window.focus();

</script>

<% include_once( "$modules/header.insecure.inc.php" ); %>
<%
	if( $id ) {
		$con_edit = mysql_connect();
		mysql_selectdb( getDBName() );

		$shouldDump = 0;
		$qs = "SELECT * from links where ID=$id AND submitter='$sessionUserId'";
		$q = mysql_query( $qs );
		$numRows = mysql_num_rows($q);
		$numGroups = 0;
		if( $numRows ) {
			$name =  urldecode( mysql_result($q,0,"name")) ;
			$url = $link =  urldecode( mysql_result($q,0,"url")) ;
			$private = mysql_result($q,0,"isPrivate");

			$groupid = mysql_result($q,$i,"groupid");

			if( $groupid ) {
				$qs2 = "SELECT * from linksGroups WHERE ID = $groupid";
				$q2 = mysql_query( $qs2 );
				$numRows2 = mysql_num_rows($q2);
				if( $numRows2 ) {
					$folder   = urldecode( mysql_result($q2,0,"name"));
					$folderID = urldecode( mysql_result($q2,0,"ID"));
				}
			} else
				$folder = "unnamed";
			$public = 0;
			if( isPublic( $folder )) {
				$folder = makePrettyFolderName( $folder );
				++$public;
			}

			if( strlen( $link ) > 40 )
				$displayLink = substr( $link, 0, 40 ) . "...";
			else
				$displayLink = $link;
			$user =  urldecode( mysql_result($q,0,"submitter")) ;
			$createDate = mysql_result($q,0,"createDate");
			conClose( $con_edit );
			$niceCreateDate = formatTS( $createDate ) ;
%>

<body>

<form action="index">
<input type="hidden" name="folder" value="<%= $folderID %>" />
<input type="hidden" name="from" value="popup" />
<div class="attention">
editing <%= $id %>, '<b><%= $name %></b>', added <%= $niceCreateDate != "today" && $niceCreateDate != "yesterday" ? " on" : "" %> <%= $niceCreateDate %>:<br />
  <input class="light" name="op" value="commitEdit" type="hidden" />
	<% include( "$modules/addLinkForm.inc.php" ); %>
	</div>
	</form>
</span>

<%
	} else {
%>
<div class="attention">
	<b>link not found!</b>
	<br />
	<br />
	<input type="button" class="button" value="close" onClick="window.close();" />
</div>
<%

	}
  } else {

%>
<div class="attention">
	<b>no link to edit!</b>
	<br />
	<br />
	<input type="button" class="button" value="close" onClick="window.close();" />
</div>
<%

  }
	} else {
%>
	Edit this link:
	<% include( "$modules/popup-login.inc.php" ); %>
<% } %>

Return current item: FeedMeLinks, Social BookmarkingSince2002