Location: PHPKode > projects > Nitrotech > nitrotech/includes/data.php
<?php


$query1 = "SELECT * FROM " . $table['data'];
$result1 = mysql_query($query1);
if (!$result1)
{
	message("Could not successfully run query ($query1) from DB: " . mysql_error(), 'die');
}

while ( $row = mysql_fetch_assoc($result1) )
{
	$site_data[$row['data_name']] = $row['data_values'];
}

unset($query1);
unset($result1);

$terms_and_conditions = "By registering for this site you must agree to these terms<br />
Blah Blah Blah";

//menu
function create_menu($dot)
{
	global $table, $root;
	$query1 = "SELECT * FROM " . $table['pages'] . " ORDER BY sort_id ASC";
	$result1 = mysql_query($query1);
	if (!$result1)
	{
	        message("Could not successfully run query ($query1) from DB: " . mysql_error(), 'die');
	}

	$loggedin = loggedin();

	while ( $page = mysql_fetch_assoc($result1) )
	{
	    if(($page['auth'] - 1) < get_userinfo('level'))
	    {
	        if($page['special'] == '1')
	        {
	            if($page['logged_in'] == '0')
	            {
	                echo($dot . " <a href=\"" . get_sid($root.$page['page_file']."?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	            else if($page['logged_in'] == '1' && $loggedin == '1')
	            {
	                echo($dot . " <a href=\"" . get_sid($root.$page['page_file']."?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	            else if($page['logged_in'] == '2' && $loggedin == '0')
	            {
	                echo($dot . " <a href=\"" . get_sid($root.$page['page_file']."?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	        }
	        else
	        {
	            if($page['logged_in'] == '0')
	            {
	                echo($dot . " <a href=\"" . get_sid($root."pages.php?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	            else if($page['logged_in'] == '1' && loggedin() == '1')
	            {
	                echo($dot . " <a href=\"" . get_sid($root."pages.php?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	            else if($page['logged_in'] == '1' && loggedin() == '0')
	            {
	                echo($dot . " <a href=\"" . get_sid($root."pages.php?page_id=".$page['id'].$page['extra_vars']) . "\">" . $page['page_name'] . "</a> ");
	            }
	        }
	    }
	}
	unset($query1);
	unset($result1);
}

//style time ;)
$style = $site_data['defalt_style'];
if(loggedin())
{
	//users logged in... lets use their style

	$query1 = "SELECT * FROM " . $table['styles'];
	$result1 = mysql_query($query1);
    if (!$result1)
	{
		message("Could not successfully run query ($query1) from DB: " . mysql_error(), 'die');
	}

    while($style1 = mysql_fetch_assoc($result1))
    {
	    if(get_userinfo('style') == $style1['folder'])
        {
        	//this is their style
            if(!$style1['active'])
            {
            	//wooowa their style isnt allowed
                $style = $site_data['defalt_style'];
            }
            else
            {
            	//everything is fine ;) lets continue
                $style = get_userinfo('style');
            }
        }
    }
    unset($query1);
    unset($result1);
}

?>
Return current item: Nitrotech