Location: PHPKode > projects > Kwalbum > kwalbum/pages/FavoritesPage.php
<?php
/**
 * @version 2.1.1
 * @since 2.0 2008-09-09
 * @package kwalbum
 */
require_once 'include/IPage.php';
require_once 'include/FavoriteURLParser.php';
require_once 'include/funcGetImageCode.php';
$FURLP = new FavoriteURLParser();

class FavoritesPage implements IPage
{
	function GetHead(&$title)
	{
		global $FURLP;
		if ($FURLP->GetId())
		{
			require 'include/ItemPageInfo.php';
			if (!$this->IPI = new ItemPageInfo($title, $FURLP))
				return null;
			return $this->IPI->GetHeader().
			("FavoriteUserIdFk='".USER_ID."'" == $FURLP->GetUserQuery() ?
				'<script type="text/javascript" language="javascript" SRC="ajax/delFavorite.js"></script>' : null);
		}
		$title = $FURLP->GetTitle();
		return '';
	}

	function ShowBody()
	{
		global $DB, $FURLP;

		$extendedURL = $FURLP->GetExtendedURL();

		if ($FURLP->GetId())
		{
			$IPI = $this->IPI;
			$id = $IPI->id;
			$currentURL = $FURLP->GetExtendedURL();
			$DB->Close();
			if ("FavoriteUserIdFk='".USER_ID."'" == $FURLP->GetUserQuery())
				$favSpan = "<span id='delFavorite'><a href='' onClick='return DelFavorite($id);'?>Delete from Favorites</a></span>";
			else
				$favSpan = "<span id='addFavorite'><a href='' onClick='return AddFavorite($id);'?>Add to Favorites</a></span>";
			require 'ItemPage.html.php';
		} else
		{
			$title = $FURLP->GetTitle();
			$query = $FURLP->GetThumbnailQuery();
			$result = $DB->query($query);

			$prevLinks = $FURLP->GetPrevPageLink();
			$pageNumber = $FURLP->GetPageNumber();
			$pageNumberLinks = $FURLP->GetPageNumberLinks();
			$nextPageLinks = $FURLP->GetNextPageLink();
			$DB->Close();

			$numRows = $FURLP->numRows;
			$numColumns = $FURLP->numColumns;

			require 'ThumbnailsPage.html.php';
		}
	}
}
?>
Return current item: Kwalbum