require('../includes/config.php'); buffer(true); require(D_INCLUDES_PATH . 'functions.php'); require(D_INCLUDES_PATH . 'inc_article_functions.php'); require(D_INCLUDES_PATH . 'doctype.php'); ?>
| require_once(D_INCLUDES_PATH.'catalog_menu.php'); ?> |
echo page_title('Current Special'); ?>
// Compose SQL command
$sql = "
SELECT s.id, s.title, s.link_title, s.text, s.approved, i.description AS image_description, i.image_name, i.linked, i.hash, i.file_size AS image_size
FROM specials s LEFT JOIN images i ON s.id = i.special_id
ORDER BY s.posted DESC
LIMIT 0,1
";
db_connect();
// Query the database
$result = @mysql_query($sql) or die('special: ' . mysql_error());
$special_rows = @mysql_num_rows($result);
db_close();
if ($special_rows > 0)
{
while($row = @mysql_fetch_array($result))
{
define('SPECIAL_ID', $row['id']);
$id = $row['id'];
$posted = $row['posted'];
$title = $row['title'];
define('LINK_TITLE', $row['link_title']);
$link_title = $row['link_title'];
$text = $row['text'];
$approved = $row['approved'];
$image_description = $row['image_description'];
$image_name = $row['image_name'];
$image_size = $row['image_size'];
$image_linked = $row['linked'];
$image_hash = $row['hash'];
if (!$approved && $_SESSION['admin_access_level'] == 1)
{
echo ' This special is not currently approved. ';
}
echo '' . $title . ''; if ($approved) { if ($_SESSION['admin_access_level'] == 1) { echo ''; } } if ($image_name) { if ($image_linked) { echo '
' . nl2br(str_replace('{D_WEB_ROOT}', D_WEB_ROOT, clean_bbcode($text))) . ' ';
}
}
else
{
echo 'Currently, there are no special values at ' . D_SITE_NAME . '.'; } ?> |