Location: PHPKode > projects > Free Simple Shop > themes_menu_right.inc
<?php

// =======================================================================
// Module name: Themes Menu Right
// File name: themes_menu_right.inc
// Version: 1.0
// Description: This script contains php code that controls the menu
// layout for the right side of the pages.
// 
// Comments are included within this script to document changes made to
// the code with each new version of the script. Each comment also lists
// the author's initials to document who made the changes to the code.
//
// Copyright (C) 2006-2010 Dustin Cowell Enterprises
//
// License: GNU General Public License, Version 2
//
// Link: http://www.gnu.org/licenses/gpl-2.0.txt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to:
//
// Free Software Foundation, Inc.
// 51 Franklin Street, Fifth Floor
// Boston, MA  02110-1301 USA
// =======================================================================

// =======================================================================
// Comment - DC - Version 1.0
// =======================================================================

if (!$install_type and $admin_id) {

}

// =======================================================================
// Comment - Version 1.0 - DC
// =======================================================================

if (!$install_type and $members_id) {

}

// =======================================================================
// Comment - Version 1.0 - DC
// =======================================================================

if (!$install_type and !$admin_id and !$members_id) {

	$db_lookup_menu_categories = @mysql_query("SELECT id FROM menu_categories WHERE left_right='Right'");
	$db_menu_categories = @mysql_fetch_array($db_lookup_menu_categories);
	$db_menu_categories_id = $db_menu_categories['id'];

	if ($db_menu_categories_id) {

		// echo("<td valign='top' align='left' width='15%' bgcolor='$db_themes_background_color_menu'>");

		$db_lookup_menu_categories = @mysql_query("SELECT id, name FROM menu_categories WHERE name != 'Links' and left_right='Right' ORDER BY id ASC");

		while ($db_menu_categories = @mysql_fetch_array($db_lookup_menu_categories)) {

			$db_menu_categories_id = $db_menu_categories['id'];
			$db_menu_categories_name = $db_menu_categories['name'];

			$db_lookup_menu = @mysql_query("SELECT id, name, page FROM menu WHERE menu_categories_id='$db_menu_categories_id' and page != 'view_detail'");
			$db_menu = @mysql_fetch_array($db_lookup_menu);

			if ($db_menu) {

				echo("<table border='0' cellpadding='5' cellspacing='0' width='100%'>");
				echo("<tr>");
				echo("<td>" . $font_menu . "<b>$db_menu_categories_name</b></td>");
				echo("</tr>");
				echo("<tr>");
				echo("<td>");

				if ($db_menu_categories_name == "Shop") {

					$db_lookup_menu = @mysql_query("SELECT name, page, request FROM menu WHERE menu_categories_id='$db_menu_categories_id' and page != 'checkout' and page != 'view_cart' ORDER BY name ASC");
						
					while ($db_menu = @mysql_fetch_array($db_lookup_menu)) {
						
						$db_menu_name = $db_menu['name'];
						$db_menu_page = $db_menu['page'];
						$db_menu_request = $db_menu['request'];

						if ($db_menu_request) {
							echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page&request=$db_menu_request'>" . $link_color . $db_menu_name . "</font></a><br>");
						} else {
							echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page'>" . $link_color . $db_menu_name . "</font></a><br>");
						}
					}

					$db_lookup_menu = @mysql_query("SELECT name, page, request FROM menu WHERE menu_categories_id='$db_menu_categories_id' and page != 'checkout' and page != 'view_cart' ORDER BY name ASC");
					$db_menu = @mysql_fetch_array($db_lookup_menu);

					$db_menu_name = $db_menu['name'];

					if ($db_menu_name) {
						echo("<br>");
					}

					$db_lookup_menu = @mysql_query("SELECT name, page, request FROM menu WHERE menu_categories_id='$db_menu_categories_id' and page='checkout' or page='view_cart' ORDER BY name DESC");
						
					while ($db_menu = @mysql_fetch_array($db_lookup_menu)) {
						
						$db_menu_name = $db_menu['name'];
						$db_menu_page = $db_menu['page'];
						$db_menu_request = $db_menu['request'];

						if ($db_menu_request) {
							echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page&request=$db_menu_request'>" . $link_color . $db_menu_name . "</font></a><br>");
						} else {
							echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page'>" . $link_color . $db_menu_name . "</font></a><br>");
						}
					}

				} else {

					if ($db_menu_categories_name == "Blog") {

						echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=entries'>" . $link_color . "All Entries</font></a><br>");

						$db_lookup_menu = @mysql_query("SELECT name, page, request FROM menu WHERE menu_categories_id='$db_menu_categories_id' and name != 'All Entries' ORDER BY name ASC");
							
						while ($db_menu = @mysql_fetch_array($db_lookup_menu)) {
							
							$db_menu_name = $db_menu['name'];
							$db_menu_page = $db_menu['page'];
							$db_menu_request = $db_menu['request'];

							if ($db_menu_request) {
								echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page&request=$db_menu_request'>" . $link_color . $db_menu_name . "</font></a><br>");
							} else {
								echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page'>" . $link_color . $db_menu_name . "</font></a><br>");
							}
						}
					} else {

						$db_lookup_menu = @mysql_query("SELECT name, page, request FROM menu WHERE menu_categories_id='$db_menu_categories_id' and page != 'home' ORDER BY name ASC");
							
						while ($db_menu = @mysql_fetch_array($db_lookup_menu)) {
							
							$db_menu_name = $db_menu['name'];
							$db_menu_page = $db_menu['page'];
							$db_menu_request = $db_menu['request'];

							if ($db_menu_request) {
								echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page&request=$db_menu_request'>" . $link_color . $db_menu_name . "</font></a><br>");
							} else {
								echo($font_menu . "<a href='" . $_SERVER['PHP_SELF'] . "?page=$db_menu_page'>" . $link_color . $db_menu_name . "</font></a><br>");
							}
						}
					}
				}

				echo("</td>");
				echo("</tr>");
				echo("</table>");
			}
		}

		$db_lookup_menu_categories = @mysql_query("SELECT left_right FROM menu_categories WHERE name='Links'");
		$db_menu_categories = @mysql_fetch_array($db_lookup_menu_categories);

		$db_menu_categories_left_right = $db_menu_categories['left_right'];

		if ($db_menu_categories_left_right == "Right") {

			$db_lookup_links_categories = @mysql_query("SELECT id, name FROM links_categories ORDER BY name ASC");

			while ($db_links_categories = @mysql_fetch_array($db_lookup_links_categories)) {

				$db_links_categories_id = $db_links_categories['id'];
				$db_links_categories_name = $db_links_categories['name'];

				$db_lookup_links = @mysql_query("SELECT name FROM links WHERE links_categories_id='$db_links_categories_id'");
				$db_links = @mysql_fetch_array($db_lookup_links);

				if ($db_links) {

					echo("<table border='0' cellpadding='5' cellspacing='0' width='100%'>");
					echo("<tr>");
					echo("<td>" . $font_menu . "<b>$db_links_categories_name</b></td>");
					echo("</tr>");
					echo("<tr>");
					echo("<td>");
			
					$db_lookup_links = @mysql_query("SELECT name, url FROM links WHERE links_categories_id='$db_links_categories_id' ORDER BY name ASC");
						
					while ($db_links = @mysql_fetch_array($db_lookup_links)) {
						
						$db_links_name = $db_links['name'];
						$db_links_url = $db_links['url'];

						echo($font_menu . "<a href='$db_links_url'>" . $link_color . $db_links_name . "</font></a><br>");
					}

					echo("</td>");
					echo("</tr>");
					echo("</table>");
				}
			}
		}
		// echo ("</td>");
	}
}

?>
Return current item: Free Simple Shop