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

	$tok =  $authenticated = $_COOKIE["c_pass_token"];
	$u   =  $sessionUserId = $_COOKIE["c_uid"];
	include( "$modules/header.insecure.inc.php" );
%>
<title> Feed Me Links : Delete 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>

<%
	$con_delete = 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");
    $niceCreateDate = formatTS( $createDate ) ;
		conClose( $con_delete );
%>
<form action="index">
<input type="hidden" name="folder" value="<%= $folderID %>" />
<input type="hidden" name="from" value="popup" />
<div class="attention">
are you sure you want to delete '<%= makeExtLinkOut( $id ) %>',<br />
&nbsp; added on <%= $niceCreateDate %>?<br />

<p>
<input type="button" value="Delete" class="default button" onClick="location.replace( '/index?op=delete&id=<%= $id %>&folder=<%= urlencode( $folder ) %>');" />
<input type="button" value="Cancel" class="default button" onClick="javascript:window.close();" />

</p>
	</div>
	</form>

<%
  } else {
%>

<div class="attention">
<b>no link to delete!</b>
<br />
<br />

<input type="button" class="button" value="close" onClick="window.close();" />
</div>
<%
  } 
	} else {
%>
	Delete this link -- 
	<% include( "$modules/popup-login.inc.php" ); %>
<%
	}
%>
</span>

<% include( "$modules/footer.inc.php" ); %>
Return current item: FeedMeLinks, Social BookmarkingSince2002