All pastes #589649 Raw Edit

Miscellany

public text v1 · immutable
#589649 ·published 2007-06-26 03:18 UTC
rendered paste body
<?php

	/**
	* Directory Level
	*/
	$DirPath = "1";

	/**
	* Include Config
	*/
	require_once("../config.php");

	/**
	* Set Page Name
	*/
	$Page = "Tutorial";

	/**
	* Set Current Tab
	*/
	$Tab = "Tutorials";

	/**
	* Validate Variables
	*/
	$Category = PostClean(trim($_GET['c']));
	$CheckCategory = $DB->Query("SELECT id, icon_alt, icon_src FROM tutorial_categories WHERE title = '$Category' LIMIT 1");
	$NumRows = $DB->NumRows($CheckCategory);
	if ($NumRows < 1) {
		header("Location: index.php");
	}
	$C = $DB->FetchArray($CheckCategory);
	$CategoryID = $C['id'];
	$CategoryIconAlt = $C['icon_alt'];
	$CategoryIconSRC = $C['icon_src'];
	$TutorialID = PostClean(trim($_GET['t']));
	if (ctype_digit($TutorialID)) {
		$CheckTutorial = $DB->Query("SELECT clicks, title, description, content, author, author_url, icon_alt, icon_src, date FROM tutorials WHERE id = '$TutorialID' LIMIT 1");
		$NumRows = $DB->NumRows($CheckTutorial);
		if ($NumRows < 1) {
			header("Location: index.php");
		}
		$T = $DB->FetchArray($CheckTutorial);
		$Clicks = $T['clicks'];
		$Title = $T['title'];
		$Description = $T['description'];
		$Content = $T['content'];
		$Author = $T['author'];
		$AuthorSRC = $T['author_src'];
		$IconAlt = $T['icon_alt'];
		$IconSRC = $T['icon_src'];
		$Date = $T['date'];
	}
	else {
		header("Location: index.php");
	}

	/**
	* Get Page Settings
	*/
	$PageSettingsQuery = $DB->Query("SELECT description, keywords, title FROM page_settings WHERE page = 'Tutorials$Page'");
	while($PS = $DB->FetchArray($PageSettingsQuery)) {
		if (!empty($PS['description'])) {
			$Settings['Description'] = $PS['description'];
		}
		if (!empty($PS['keywords'])) {
			$Settings['Keywords'] = $PS['keywords'];
		}
		if (!empty($PS['title'])) {
			$Settings['Title'] = $PS['title'];
		}
	}

	/**
	* Include Theme
	*/
	require_once($Dir . "Themes/" . $Theme . "/Tutorials/" . strtolower($Page) . ".php");

?>