Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/modules/folder-menu.inc.php
<%	
	# $Id: folder-menu.inc.php,v 1.5 2004/04/09 17:57:50 hirokai Exp $
	$tok =  $authenticated = $_COOKIE["c_pass_token"];
	$u   =  $sessionUserId = $_COOKIE["c_uid"];
	if( $tok && $tok == md5( getPasswdForUser( $u )) ) {

	$qs = "SELECT * from linksGroups where userid = '$sessionUserId' ORDER BY name";
	$folderMenuCon = mysql_connect();
	mysql_selectdb( getDBName() );

	$q = mysql_query( $qs );
	$numRows = mysql_num_rows($q);
	if( $numRows ) {
%>

      <option value=""> - </option>
      <option value="unfiled"> &lt;unfiled&gt; </option>
<%
		$i = 0;
		while ($i < $numRows) {
			$id = mysql_result($q,$i,"ID");
			$folderName = makeSafeName( mysql_result($q,$i,"name"));

      # we use our own hashtables instead of the raw DB, 
			# so that we can re-sort without the leading "p-slash" fucking us up....
      if( isPublic( $folderName )) {
        $folderName = makePrettyFolderName( $folderName );
				$folderName = $folderName . " (pub)";
			}
			$groups[$id] =  $folderName;
			$i++;
		}
		mysql_close( $folderMenuCon );
		natcasesort( $groups );
		$i = 0;
		while (list ($key, $val) = each ($groups)) {
			$i++;
%>
			<option value="<%= $key %>" <%= $groupid == $key ? "selected" : "" %>><%= $val %></option>
<%
		}
	}
%>
	</select>

<% } # end auth %>
Return current item: FeedMeLinks, Social BookmarkingSince2002