Ding Wen
Joined: 05 Aug 2004 Posts: 1 Location: Shanghai, China
|
Posted: Thu Aug 05, 2004 4:26 pm Post subject: Something gets weird.. both in comment and index page. |
|
|
My blog in right in my index page.[url] http://sored.org [/url] for some reason(unknown) I can't view the comments, but when i login to the b2 edit/post, there are comments. so i just got confused, why it doesnt show? and I need to go to IE options to delete something in order to see the page changed. what's wrong?
and the codes I use are:
index.php
Code: |
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<?include('http://sored.org/header.inc'); ?>
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<p class="title" align="right"><?php the_date("","",""); ?></p>
<?php the_content(); ?>
<p align="right"><?php the_author() ?> <a href="<?php permalink_link() ?>">@</a> <?php the_time() ?>
<?php link_pages("<br />Pages: ","<br />","number") ?>
<br><a href="http://sored.org/qa/index.php">q&a</a> | <?php comments_popup_link("0", "1", "%") ?> </p>
<?php trackback_rdf() ?>
<!-- this includes the comments and a form to add a new comment -->
<?php include ("b2comments.php"); ?>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?>
<p align="center"><?php timer_stop(1); ?> powered by <a href="http://cafelog.com" target="_blank"><b>b2</b></a>
</p>
<?include('http://sored.org/footer.inc'); ?>
|
b2comments.php
Code: |
<?php // Do not delete these lines
if (basename($HTTP_SERVER_VARS["SCRIPT_FILENAME"]) == "b2comments.php")
die ("please, do not load this page directly");
if (($withcomments) or ($c)) {
$comment_author = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "name" : $HTTP_COOKIE_VARS["comment_author"];
$comment_author_email = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "email" : trim($HTTP_COOKIE_VARS["comment_author_email"]);
$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_content NOT LIKE '%<trackback />%' AND comment_content NOT LIKE '%<pingback />%' ORDER BY comment_date";
$resultc = mysql_query($queryc);
if ($resultc) {
?>
<!-- you can start editing here -->
<div class="top">Add a new comment</div><br>
<!-- form to add a comment -->
<form action="<?php echo $siteurl; ?>/b2comments.post.php" method="post">
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($HTTP_SERVER_VARS["REQUEST_URI"]); ?>" />
<p class="commentfield">
name<br />
<input type="text" name="author" class="textarea" value="<?php echo $comment_author ?>" size="20" tabindex="1" />
</p>
<p class="commentfield">
email<br />
<input type="text" name="email" class="textarea" value="<?php echo $comment_author_email ?>" size="20" tabindex="2" />
</p>
<p class="commentfield">
website<br />
<input type="text" name="url" class="textarea" value="<?php echo $comment_author_url ?>" size="20" tabindex="3" />
</p>
<p class="commentfield">
your comment<br />
<textarea cols="25" rows="4" name="comment" tabindex="4" class="textarea">comment</textarea>
</p>
<p class="commentfield">
<input type="checkbox" name="comment_autobr" value="1" <?php
if ($autobr)
echo " checked=\"checked\"" ?> tabindex="6" /> Auto-BR (line-breaks become <br> tags)<br />
<input type="submit" name="submit" class="buttonarea" value="ok" tabindex="5" />
</p>
</form>
<!-- /form -->
<?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); ?>
<a name="c<?php comment_ID() ?>"></a>
<!-- comment -->
<p>
<div class="top"><a href="<?php comment_author_url() ?> " target="_blank"><?php comment_author() ?></a> @ <?php comment_time() ?>, <?php comment_date() ?></div>
<br><?php comment_text() ?>
</p>
<!-- /comment -->
<?php /* end of the loop, don't delete */ } if (!$wxcvbn_c) { ?>
<!-- this is displayed if there are no pingbacks so far -->
<p>No Comment on this post so far.</p>
<?php /* if you delete this the sky will fall on your head */ } ?>
<?php // if you delete this the sky will fall on your head
}
} else {
return false;
}
?>
|
|
|