<?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"; }
if(isset($_GET['do']) && $_GET['do'] == 'login') { if(empty($_POST['username']) OR empty($_POST['password'])) { header("Location: http://neighbr.net/"); } else { $username = $_POST['username']; $pass = md5($_POST['password']); $sql = "SELECT password FROM users WHERE username = '******'"; $result = $db->query($sql); if(mysql_result($result, 0) != $pass) { header("Location: http://neighbr.net/"); } else { $sql = "SELECT * FROM users WHERE username = '******'"; $result = $db->query($sql); while($user = $db->grab($result)) { $_SESSION['loggedin'] = TRUE; $_SESSION['username'] = $user['username']; $_SESSION['useridno'] = $user['id']; } header("Location: http://neighbr.net/"); } } } if(isset($_GET['do']) && $_GET['do'] == 'logout') { unset($_SESSION['loggedin']); unset($_SESSION['username']); header("Location: http://neighbr.net/"); }
} $result = $db->query($sql); if(mysql_num_rows($result) == 0) { die("There seems to be some sort of force field."); } header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n"; echo "<rss version=\"2.0\">\r\n"; echo "<channel>\r\n"; echo "<title>$title</title>\r\n"; echo "<description>What have your neighbrs been up to?</description>\r\n"; echo "<link>$url</link>\r\n"; echo "<language>en-us</language>\r\n"; while($post = $db->grab($result)) { $pubDate = date("D, d M Y H:i:s O", strtotime($post['timestamp'])); echo "\t<item>\r\n"; echo "\t\t<neighbr>$post[neighbr]</neighbr>\r\n"; if(file_exists("./img/avatars/$post[neighbr].jpg")) { $avatar = "http://neighbr.net/img/avatars/$post[neighbr].jpg"; } else { $avatar = "http://neighbr.net/img/avatars/neighbrhood.jpg"; } echo "\t\t<avatar>$avatar</avatar>\r\n"; echo "\t\t<title>" . str_replace("&", "&", $post[title]) . "</title>\r\n"; echo "\t\t<description>" . str_replace("&", "&", $post[note]) . "</description>\r\n"; switch($post['type']) { case "text"; case "code"; echo "";
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> <div style="float: right; width: 500px;"> <div>