<?php require_once "./include/config.php"; require_once "./include/inursql.php"; $db = new inursql(); $c = $db->connect($hostname, $username, $password, $database); $id = sanitize($_GET['id']); $sql = "SELECT neighbr, type, source, title, note, timestamp FROM posts WHERE id = $id"; $result = $db->query($sql); while($post = $db->grab($result)) { $timestamp = "<div style=\"float: right;\">" . date("M d Y", strtotime($post['timestamp'])) . "</div>"; $pagetitle = $post['title'] . " / " . $post['neighbr'] . " / neighbr.net"; $posttitle = $post['title']; if(!isset($_GET['title'])) { header('Location: /view/' . $id . '/' . str_replace(' ', '-', trim($post['title']))); exit; } $neighbr = $post['neighbr']; if($post['type'] != 'text') { $type = $post['type']; $link = $post['source']; $note = $post['note']; } else { $type = $post['type']; $note = $post['note']; } }
<?php require_once "./include/config.php"; require_once "./include/inursql.php"; $db = new inursql(); $c = $db->connect($hostname, $username, $password, $database); include "./templates/header.php"; $sql = "SELECT title,note FROM posts WHERE neighbr = 'neighbrhood' ORDER BY timestamp DESC LIMIT 0,1"; $result = $db->query($sql); echo "\t\t<div id=\"bulletin\"><div style=\"padding: 10px;\">\r\n"; while($bulletin = $db->grab($result)) { echo "\t\t\t<div style=\"font-weight: bold; margin-bottom: 5px;\"><a href=\"/neighbrhood/\">$bulletin[title]</a></div>\r\n"; echo "\t\t\t<div style=\"color: #979797;\">$bulletin[note]</div>\r\n"; } echo "\t\t</div></div>\r\n"; // mysql_free_result($result); if(isset($_SESSION['username'])) { $sql = "SELECT * FROM users WHERE username = '******'username'] . "'"; $result = $db->query($sql); while($neighbr = $db->grab($result)) { $permissions = $neighbr['permissions']; } } else { $permissions = "guest"; }
<?php session_start(); if(isset($_GET['id']) && is_numeric($_GET['id'])) { if(isset($_SESSION['username']) && $_SESSION['username'] == 'darthnuri') { require_once "./include/config.php"; require_once "./include/inursql.php"; $db = new inursql(); $c = $db->connect($hostname, $username, $password, $database); $sql = "DELETE FROM posts WHERE id = " . $_GET['id']; $result = $db->query($sql); if($result) { header("Location: " . $_SERVER['HTTP_REFERER']); } } else { header("Location: " . $_SERVER['HTTP_REFERER']); } } else {
<?php session_start(); require_once "./include/config.php"; require_once "./include/inursql.php"; require_once "./include/inurweb.php"; $db = new inursql(); $c = $db->connect($hostname, $username, $password, $database); // start collect connected website streams $sql = "SELECT * FROM connections WHERE neighbr = '" . $_SESSION['username'] . "'"; $result = $db->query($sql); if(mysql_num_rows($result) > 0) { while($connection = $db->grab($result)) { if($connection['name'] == 'twitpic') { $twitpic = 'http://twitpic.com/photos/' . $connection['token'] . '/feed.rss'; } } } // end collect connected website streams include "./templates/header.php"; ?> <div style="padding: 10px;"> <div style="float: left; width: 50px;"><a href="./arguments.callee/"><img src="./img/avatars/arguments.callee.jpg" alt="neighbr: arguments.callee" style="width: 50px; height: 50px; border: 0px;" /></a></div>