File:  [mozdev] / cdn / www / b2-include / b2comments.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Thu Mar 13 12:51:40 2003 UTC (16 years, 5 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
rearrange

    1: <?php // Do not delete these lines
    2: if (basename($HTTP_SERVER_VARS["SCRIPT_FILENAME"]) == "b2comments.php")
    3:   die ("please, do not load this page directly");
    4: 
    5: if (($withcomments) or ($c)) {
    6: 
    7:   $comment_author = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "name" : $HTTP_COOKIE_VARS["comment_author"];
    8:   $comment_author_email = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "email" : trim($HTTP_COOKIE_VARS["comment_author_email"]);
    9:   $comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
   10: 
   11:   $queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND " .
   12:             "comment_content NOT LIKE '%<trackback />%' AND comment_content NOT LIKE '%<pingback />%' ORDER BY comment_date";
   13:   $resultc = mysql_query($queryc);
   14:   
   15:   if ($resultc) {
   16:     ?>
   17: 
   18: <!-- you can start editing here -->
   19: 
   20: <a name="comments"></a>
   21: <p>&nbsp;</p>
   22: <div><strong><span style="color: #0099CC">::</span> comments</strong></div>
   23: <p>&nbsp;</p>
   24: 
   25: <?php /* this line is b2's motor, do not delete it */ $wxcvbn_c=0; while($rowc = mysql_fetch_object($resultc)) { $wxcvbn_c++; $commentdata = get_commentdata($rowc->comment_ID); ?>
   26: 
   27: <a name="c<?php comment_ID() ?>"></a>
   28: 
   29: <!-- comment -->
   30: <p>
   31: <b><?php comment_author() ?> <?php comment_author_email_link("email", " - ", "") ?><?php comment_author_url_link("url", " - ", "") ?></b>
   32: <br />
   33: <?php comment_text() ?>
   34: <br />
   35: <?php comment_date() ?> @ <?php comment_time() ?>
   36: </p>
   37: <p>&nbsp;</p>
   38: <!-- /comment -->
   39: 
   40: 
   41: <?php /* end of the loop, don't delete */ } if (!$wxcvbn_c) { ?>
   42: 
   43: <!-- this is displayed if there are no pingbacks so far -->
   44: <p>No Comment on this post so far.</p>
   45: 
   46: <?php /* if you delete this the sky will fall on your head */ } ?>
   47: 
   48: <div><strong><span style="color: #0099CC">::</span> leave a comment</strong></div>
   49: <p>&nbsp;</p>
   50: 
   51: 
   52: <!-- form to add a comment -->
   53: 
   54: <form action="<?php echo $siteurl; ?>/b2comments.post.php" method="post">
   55: 	<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
   56: 	<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($HTTP_SERVER_VARS["REQUEST_URI"]); ?>" />
   57: 
   58: 	<p class="commentfield">
   59: 	name<br />
   60: 	<input type="text" name="author" class="textarea" value="<?php echo $comment_author ?>" size="20" tabindex="1" />
   61: 	</p>
   62: 
   63: 	<p class="commentfield">
   64: 	email<br />
   65: 	<input type="text" name="email" class="textarea" value="<?php echo $comment_author_email ?>" size="20" tabindex="2" />
   66: 	</p>
   67: 
   68: 	<p class="commentfield">
   69: 	url<br />
   70: 	<input type="text" name="url" class="textarea" value="<?php echo $comment_author_url ?>" size="20" tabindex="3" />
   71: 	</p>
   72: 
   73: 	<p class="commentfield">
   74: 	your comment<br />
   75: 	<textarea cols="40" rows="4" name="comment" tabindex="4" class="textarea">comment</textarea>
   76: 	</p>
   77: 
   78: 	<p class="commentfield">
   79: 	<input type="checkbox" name="comment_autobr" value="1" <?php
   80: 	if ($autobr)
   81: 	echo " checked=\"checked\"" ?> tabindex="6" /> Auto-BR (line-breaks become &lt;br> tags)<br />
   82: 	<input type="submit" name="submit" class="buttonarea" value="ok" tabindex="5" />
   83: 	</p>
   84: 
   85: </form>
   86: 
   87: <!-- /form -->
   88: 
   89: <p>&nbsp;</p>
   90: <div><b><span style="color: #0099CC">::</span> <a href="javascript:history.go(-1)">return to the blog</a></b></div>
   91: 
   92: <?php // if you delete this the sky will fall on your head
   93: }
   94: } else {
   95: 	return false;
   96: }
   97: ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>