コード例 #1
0
ファイル: view.php プロジェクト: nhodges/neighbr
<?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'];
		}
	}
コード例 #2
0
ファイル: settings.php プロジェクト: nhodges/neighbr
<?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>