Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/delete-unused-tags.php
<%
	include_once( "modules/utils.inc.php" );
	include( "$modules/header.insecure.inc.php" );

	$tok =  $_COOKIE["c_pass_token"];
	$u   =  $_COOKIE["c_uid"];
	$sessionUserId = $u;

	if( $tok && $tok == md5( getPasswdForUser( $u ))) {
%>

<title> Delete your old tags? </title>
<% include( "$modules/header.inc.php" ); %>

<%
	$con_pageName = mysql_connect();
	mysql_selectdb( getDBName() );
	$qs = getQuery( "unused_tags", $u );
	$q = mysql_query( $qs );
	if( $numRows = $q ? mysql_num_rows($q) : 0 ) {
%>

<h2>You have <%= $numRows %> unused tags.</h2>
These are tags not used on any of your links:
<p />

<form action="/action" method="post" name="delete_unused_tags_form">
<input type="hidden" name="op" value="delete_unused_tags" />
<big>
<%
		for( $i = 0; $i < $numRows; $i++ ) {
			$id = mysql_result($q,$i,"id");
			$name = mysql_result($q,$i,"name");
			echo makePrettyFolderName( urldecode($name) ) ;
			if( $i +1 != $numRows )
				echo ", ";
%>

<input type="hidden" name="ut<%= $id %>" value="1" />
<%
		}
%>

</big>
<p />
<input class="default button" type="submit" value="Delete all unused tags" />
<input class="button" type="button" value="Never mind" onClick="history.go( -1 );" />
</form>

<%
	} else {
%>
<h2>You have no unused tags. Good for you!</h2>

<a href="javascript:history.go( -1 );">Back to it, then.</a>
<%
	}
%>


<%
	conClose( $con_pageName );
%>


<% } %>

<%
	include( "$modules/footer.inc.php" );
%>

Return current item: FeedMeLinks, Social BookmarkingSince2002