Bad username or password (need to register?).

(back)

"); $commenter = mysql_fetch_assoc($query); if($commenter['id'] == "") exit("

Bad username or password (need to register?).

(back)

"); if($_POST['body'] == "") exit("

You didn't enter a comment!

(back)

"); if(!mysql_query("INSERT into comments (post, commenter, body, time) VALUES ('" . $_GET['p'] . "', '" . $commenter['id'] . "', '" . $_POST['body'] . "', '" . time() . "')")) exit("

Bad username or password (need to register?).

(back)

"); } if($_GET['p'] == "") print("

No post specified.

"); $posts = explode(",", $_GET['p']); $query = "SELECT * FROM posts WHERE"; $i = 0; $num_posts = count($posts); while($i < $num_posts) { $query .= " id = '" . $posts[$i] . "'"; if(isset($posts[$i + 1])) $query .= " OR"; $i++; } $query .= " ORDER BY time DESC"; $query = mysql_query($query); while($post = mysql_fetch_assoc($query)) if(!isset($color) || $color == $post['color']) // avoids printing posts on the wrong color page if($num_posts == 1) // don't link to the post if it's the one being displayed print_post($post['title'], $post['body'], $post['time'], $post['color'], $post['id'], true); else print_post($post['title'], $post['body'], $post['time'], $post['color'], $post['id']); } elseif(isset($_GET['user'])) { $query = mysql_query("SELECT * FROM commenters WHERE id = '" . $_GET['user'] . "'"); $commenter = mysql_fetch_assoc($query); print("

Comments by " . $commenter['alias'] . "

"); $query = mysql_query("SELECT * FROM comments WHERE commenter = '" . $_GET['user'] . "'"); while($comment = mysql_fetch_assoc($query)) { $query2 = mysql_query("SELECT * FROM posts WHERE id = '" . $comment['post'] . "'"); $post = mysql_fetch_assoc($query2); print("

on " . $post['title'] . "

\n"); print("
" . $comment['body'] . "
"); } } elseif(isset($_GET['register'])) { if(isset($_POST['submit'])) { $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; $email = $_POST['email']; if($pass1 == $pass2) $password = md5($pass1); else exit("

Passwords didn't match; try again.

"); if($email == "" || $pass1 == "" || $pass2 == "") exit("

You didn't fill out all required fields! Try again.

"); if(strstr($email, "@") == false) // if there is no @ in $email exit("

Invalid email. Try again.

"); $alias = explode("@", $email); if(!mysql_query("INSERT INTO commenters (email, password, alias, time) VALUES ('$email', '$password', '" . $alias[0] . "', '" . time() . "')")) print("

Error inserting data into database, please try again later.

"); else print("

User created.

\nClose this window"); } else { print("
\n"); print("
Email
\n

\n"); print("
Password
\n

\n"); print("
Verify
\n

\n"); print("
"); } } else { if(isset($color)) // if we're on a color's page, only grab that color's posts $query = mysql_query("SELECT * FROM posts WHERE color = '" . $color . "' ORDER BY time DESC"); else // otherwise grab all of them $query = mysql_query("SELECT * FROM posts ORDER BY time DESC"); $n = 9; // num of posts to display while($post = mysql_fetch_assoc($query)) { if($n > 0) { print_post($post['title'], $post['body'], $post['time'], $post['color'], $post['id']); $n--; } else { break; } } } ?>
Blogroll
9 // if it is not, we will not display randoms. if($i >= 9) { print("
Randoms
\n"); print("\n"); } ?>
Search