i dont understand lines, so here's what I have:
<?php
/* Don't remove these lines. */
$blog = 1;
require ('wp-blog-header.php');
add_filter('comment_text', 'popuplinks');
foreach ($posts as $post) { start_wp();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $blogname ?> - Comments on "<?php the_title() ?>"</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen">
@import url( wp-layout.css );
body { margin: 3px; }
</style>
</head>
<body id="commentspopup">
<h1 id="header">"><?php echo $blogname ?></h1>
<h2 id="comments">Comments</h2>
/wp-commentsrss2.php?p=<?php echo $post->ID; ?>">RSS feed for comments on this post.
<?php if ('open' == $post->ping_status) { ?>
The URI to TrackBack this entry is: <?php trackback_url() ?>
<?php } ?>
<?php
// this line is WordPress' motor, do not delete it.
$comment_author = (isset($HTTP_COOKIE_VARS['comment_author_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_'.$cookiehash]) : '';
$comment_author_email = (isset($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash]) : '';
$comment_author_url = (isset($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash]) : '';
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id");
if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $commentstatus->post_password) { // and it doesn't match the cookie
echo(get_the_password_form());
} else { ?>
<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
<li id="comment-<?php comment_ID() ?>">
<?php comment_text() ?>
<cite><?php comment_type(); ?> by <?php comment_author_link() ?> — <?php comment_date() ?> @ "><?php comment_time() ?></cite>
<?php } // end for each comment ?>
<?php } else { // this is displayed if there are no comments so far ?>
No comments yet.
<?php } ?>
<?php if ('open' == $commentstatus->comment_status) { ?>
<h2>Leave a Comment</h2>
Line and paragraph breaks automatic, website trumps email, HTML allowed: <?php echo allowed_tags(); ?>
<form name="commentform" action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform">
<label for="author">Your name:</label>
<input type="text" name="author" id="author"
class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" />
<label for="email">Your email:</label>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
<label for="url">Your URL:</label>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
Click on a smilie to add it to your comment!
<script language="JavaScript" type="text/javascript">
function bbinsert(formObj, strIns, strInsClose )
{ theSelection = false;
if (document.selection)
{
formObj.comment.focus();
theSelection = document.selection.createRange().text;
document.selection.createRange().text = strIns + theSelection+strInsClose;
formObj.comment.focus();
theSelection = false;
return;
}
formObj.comment.value += strIns + strInsClose;
formObj.comment.focus();
return;
}
</script>
<?php
foreach($wpsmiliestrans as $smiley => $img)
{
print '<img src="'.$smilies_directory.'/'.$img.'" alt="'.$smiley.'"
class="middle" onClick="bbinsert(document.commentform,\'\', \''.str_replace("'","\'",$smiley).'\')" /> ';
}
?>
<label for="comment">Your Comment:</label>
<textarea name="comment" id="comment" cols="40" rows="10" tabindex="4"></textarea>
<input class="button" type="submit" value="Say it!" />
</form>
<?php } else { // comments are closed ?>
Sorry, comments are closed at this time.
<?php } ?>
<div>Go back.</div>
<?php // if you delete this the sky will fall on your head
}
?>
I added the clickable smilies hack today.