Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/modules/get-option.inc.php
<%
	# $Id: get-option.inc.php,v 1.1 2004/01/27 19:03:17 hirokai Exp $

	include_once( "utils.inc.php" );

	# this should be a hashtable
	$masterOptionsTable = "";

	# convenience constants:
	define( "opt_show_urls_in_index", 				0 );
	define( "opt_display_long_urls", 				1 );
	define( "opt_delete_without_confirm", 		2 );
	define( "opt_unused_3", 	3 );
	define( "opt_unused_4", 4 );
	define( "opt_unused_5", 5 );
	define( "opt_unused_6", 6 );
	define( "opt_unused_7", 7 );
	define( "opt_unused_8", 8 );
	define( "opt_unused_9", 9 );

	function getUserOptions( $userId ) {
    mysql_connect();
    mysql_selectdb( getDBName() );
    $qs = "SELECT * from linksUsers WHERE userid = '$userId'";
		#echo $qs;
    $q = mysql_query( $qs );
    if( mysql_num_rows($q) ) {
      $i = 0;
			$id = mysql_result($q,$i,"id");
			$savedOptions = mysql_result($q,$i,"options");
		}
		return $savedOptions;
	}

	function userHasOptShowUrlsInIndex($userId) {
		$options = getUserOptions($userId);
		return $options{opt_show_urls_in_index};
	}

	function userHasOptDisplayLongUrls($userId) {
		$options = getUserOptions($userId);
		return $options{opt_display_long_urls};
	}

	function userHasOptDeleteWithoutConfirm($userId) {
		$options = getUserOptions($userId);
		return $options{opt_delete_without_confirm};
	}

	function userHasOptMakeThisFolderPublic($userId) {
		$options = getUserOptions($userId);
		return $options{opt_unused_3};
	}

	# return the name of an option
	function getOption( $optNum ) {
		if( $optNum == -1 )
			return "0000000000";
		else if( $optNum == opt_show_urls_in_index )
			return "show urls in index (not yet implemented)";
		else if( $optNum == opt_display_long_urls )
			return "display full urls in index (not yet implemented)";
		else if( $optNum == opt_delete_without_confirm )
			return "delete without confirm (not yet implemented)";
		else if( $optNum == 3 )
			return "NULL";
		else if( $optNum == 4 )
			return "NULL";
		else if( $optNum == 5 )
			return "NULL";
		else if( $optNum == 6 )
			return "NULL";
		else if( $optNum == 7 )
			return "NULL";
		else if( $optNum == 8 )
			return "NULL";
		else if( $optNum == 9 )
			return "NULL";
	}

%>
Return current item: FeedMeLinks, Social BookmarkingSince2002