/** * Inlude a view path **/ function errorview($view, $variables = array()) { // var_dump($variables); //Import variables into the current page extract($variables); include_once views('errors/' . $view); }
<?php include_once 'includes/header.php'; if ($_GET['get'] == '') { include_once 'index.php'; } else { if (short_url_exist($_GET['get']) == FALSE) { echo 'The short URL you entered doesn\'t exist.'; } else { $page = short_to_long_url($_GET['get']); views($_GET['get'], $update = TRUE); header("Location: {$page}"); } } include_once 'includes/footer.php';
SelectItem(); break; case "add_repair": Repair(); break; case "submit_repair": SubmitRepair(); Repair(); break; case "edit_item": EditItem($_POST['item']); break; case "submit_e_item": SubmitItemEdit(); if (isset($_POST['view'])) { views(); break; } SelectItem(); break; case "give_item": GiveItemtoItem(); break; case "give": GivingItem(); GiveItemtoItem(); break; default: index(); break; }
<?php include_once 'includes/header.php'; $user_name = mysql_real_escape_string($_GET['user']); $user_id = name_to_id($user_name); $photo_result = mysql_query("SELECT * FROM photos WHERE user_id='{$user_id}' ORDER BY photo_views DESC LIMIT 0, 100"); $photo_count = mysql_num_rows($photo_result); if ($photo_count == 0) { echo 'No images have been uploaded by this user.'; } else { while ($photo_row = mysql_fetch_assoc($photo_result)) { $date = date("Y\\-m\\-d H:i:s"); echo '<b><h1>' . $photo_row['photo_title'] . '</h1></b>' . resize_img($photo_row['photo_name'], $photo_row['user_id']) . '<br />' . views($photo_row['photo_name'], $date) . '<br />'; } } include_once 'includes/footer.php';
<?php include_once 'includes/header.php'; $photo_name = mysql_real_escape_string($_GET['photo_name']); $photo_result = mysql_query("SELECT * FROM photos WHERE photo_name='{$photo_name}'"); $photo_count = mysql_num_rows($photo_result); if ($photo_count == 0) { echo 'That image doesn\'t exist.'; } else { $photo_row = mysql_fetch_assoc($photo_result); $date = date("Y\\-m\\-d H:i:s"); echo '<b><h1>' . htmlspecialchars($photo_row['photo_title']) . '</h1></b>' . resize_img($photo_row['photo_name'], $photo_row['user_id']) . '<br />' . views($photo_row['photo_name'], $date, TRUE) . '<br />'; if ($photo_row['anon'] == 0) { echo 'Posted by <a href="user.php?user='******'user_id']) . '">' . id_to_name($photo_row['user_id']) . '</a>.'; } elseif ($photo_row['anon'] == 1) { echo 'Posted by ' . id_to_name(2) . '.'; } } include_once 'includes/footer.php';