View previous topic :: View next topic |
Author |
Message |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Thu Jan 01, 2004 11:22 pm Post subject: Comments page, displaying comments for the past 2 days |
|
|
Hi.
Im having problems with the comments page. When i changed the option of my b2 blog to display 3 posts per page, my comments page also displays the comments for the past 2 days. I only want to display the comment for my most recent blog. How can i do this?
Thanks. |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 12:56 am Post subject: |
|
|
What comments page? Got a URL? _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 2:59 am Post subject: |
|
|
epolady wrote: | What comments page? Got a URL? |
Hello. the url is http://personalversion5.bubufet.biz/index2.php the page loads a bit slow because the site is heavy on graphics. pls bear with my site. thanks so much!
Last edited by sharmaine on Fri Jan 02, 2004 3:02 am; edited 1 time in total |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 3:00 am Post subject: |
|
|
You will notice that in the comments window, all comments since the last 2 days were displayed. i want only the comments for my most recent blog. thanks in advance! |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 4:41 am Post subject: |
|
|
Ah, it looks like you have some weird looping problem, can you post b2comments.php here please? Thanks. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 5:05 am Post subject: |
|
|
I noticed that when i changed the options to 1 post per page, it displays the comments for the most recent post; if i changed it to 2, it displays comments for 2 days; 3 posts per page and it displays comments for 3 days..
this is the source code for my b2commentspopup:
before head tag:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?><?php /* Don't remove this line, it calls the b2 function files ! */
$blog=1; include ("blog.header.php"); while($row = mysql_fetch_object($result)) { start_b2();
?><!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">
after body tag:
...
<?php
$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"])) ? "http://url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_content NOT LIKE '%<trackback />%' ORDER BY comment_date";
$resultc = mysql_query($queryc);
if ($resultc) {
?>
<!-- you can start editing here -->
<a name="comments"></a> <br />
<strong><span style="color: #0099CC">::</span> <font color="#66FF00">comments
on my blog</font><br />
</strong>
<?php // these lines are b2's motor, do not delete
while($rowc = mysql_fetch_object($resultc)) {
$commentdata = get_commentdata($rowc->comment_ID);
?>
<a name="c<?php comment_ID() ?>"></a>
<!-- comment -->
<br>
<br>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center"><strong><span class="verdana75norm">
<?php comment_author() ?>
<?php comment_author_email_link("email", " - ", "") ?>
<?php comment_author_url_link("url", " - ", "") ?>
</span></strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFF00">
<tr>
<td><div align="center">
<span class="verdana75norm">
<?php comment_text() ?>
</span>
</div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center" class="verdana75norm">
<?php comment_date() ?>
@
<?php comment_time() ?>
</div></td>
</tr>
</table></td>
</tr>
</table>
<!-- /comment -->
<?php //end of the loop, don't delete
}
?>
thanks in advance. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 5:10 am Post subject: |
|
|
Also, i want "descending" as the order of my comments, meaning the most recent comment on top. how do i do that? thanks again. |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 5:16 am Post subject: |
|
|
Do you have this at the end of b2commentspopup.php?
Quote: | <!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?> |
_________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 5:21 am Post subject: |
|
|
Opps I'm sorry. please allow me to repost my source:
Quote: |
<?php
$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"])) ? "http://url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_content NOT LIKE '%<trackback />%' ORDER BY comment_date";
$resultc = mysql_query($queryc);
if ($resultc) {
?>
<!-- you can start editing here -->
<a name="comments"></a> <br />
<strong><span style="color: #0099CC">::</span> <font color="#66FF00">comments
on my blog</font><br />
</strong>
<?php // these lines are b2's motor, do not delete
while($rowc = mysql_fetch_object($resultc)) {
$commentdata = get_commentdata($rowc->comment_ID);
?>
<a name="c<?php comment_ID() ?>"></a>
<!-- comment -->
<br>
<br>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center"><strong><span class="verdana75norm">
<?php comment_author() ?>
<?php comment_author_email_link("email", " - ", "") ?>
<?php comment_author_url_link("url", " - ", "") ?>
</span></strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFF00">
<tr>
<td><div align="center">
<span class="verdana75norm">
<?php comment_text() ?>
</span>
</div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center" class="verdana75norm">
<?php comment_date() ?>
@
<?php comment_time() ?>
</div></td>
</tr>
</table></td>
</tr>
</table>
<!-- /comment -->
<?php //end of the loop, don't delete
}
?>
<p align="center"><span class="verdana75norm"><strong>Please wait until
the comments page<br />
is loaded properly. Thanks.</strong></span></p>
<div><strong><span style="color: #0099CC">::</span> <font color="#66FF00">leave
a comment</font></strong></div>
<div align="left"><br>
<!-- form to add a comment -->
</div>
<form action="b2comments.post.php" method="post">
<div align="left">
<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"]); ?>" />
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="TableFont">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="TableFont" align="center">
<tr>
<td width="10%">Name:</td>
<td width="90%"><input type="text" name="author" class="myinputbg" value="<?php echo $comment_author ?>" size="20" tabindex="1"
onfocus="this.value=(this.value=='name') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'name' : this.value;" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" class="myinputbg" value="<?php echo $comment_author_email ?>" size="20" tabindex="2"
onfocus="this.value=(this.value=='email') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'email' : this.value;" /></td>
</tr>
<tr>
<td>Homepage </td>
<td><input type="text" name="url" class="myinputbg" value="<?php echo $comment_author_url ?>" size="20" tabindex="3"
onfocus="this.value=(this.value=='http://url') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'http://url' : this.value;" /></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="TableFont">
<tr>
<td width="50%" valign="top">Your comment<br />
<textarea cols="30" rows="4" name="comment" tabindex="4" class="mytextareabg"
onfocus="this.value=(this.value=='comment') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'comment' : this.value;" >comment</textarea>
<br /> <br />
</td>
<td align="right" valign="top">
<script language="JavaScript" type="text/javascript">
function emoticon(theSmilie) {
theSmilie = ' ' + theSmilie + ' ';
if (document.form.comment.createTextRange && document.form.comment.caretPos) {
var caretPos = document.form.comment.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie;
} else {
document.form.comment.value += theSmilie;
}
document.form.comment.focus();
theSmilie = '';
}
</script>
<?php
$newrow = 0;
$prev_val="";
asort($b2smiliestrans);
while (list ($key, $val) = each ($b2smiliestrans)) {
if($prev_val and $val==$prev_val) { }
else if(!$prev_val or ($prev_val and $val!=$prev_val)){
?>
<img src="<?php echo "$smilies_directory/$val"; ?>" alt="<?php echo $key; ?>" border="0" onclick="emoticon('<?php echo $key; ?>')" onmouseover="style.cursor='hand'" />
<?php
$newrow++;
if($newrow == 6) { //new row after specified number of smilies
echo '<br />';
$newrow = 0;
}
}
$prev_val = $val;
}
?>
</td>
</tr>
</table> </td>
</tr>
</table> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="TableFont">
<tr>
<td><div align="center">
<input type="checkbox" name="comment_autobr" value="1" <?php
if ($autobr)
echo " checked=\"checked\"" ?> tabindex="6" />
Auto-BR (line-breaks become <br> tags)<br />
<br />
<input type="submit" name="submit" class="myinputbg" value="Mwah! Mwah!" tabindex="5" />
</div></td>
</tr>
</table>
</div>
</form>
<!-- /form -->
<br>
<div><b><span style="color: #0099CC">::</span> <a href="javascript:window.close()">close this window</a></b></div>
<?php // if you delete this the sky will fall on your head
}
?>
</div>
<!-- // this is just the end of the motor - don't touch that line either -->
<?php } ?>
|
|
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 5:43 am Post subject: |
|
|
Okay, try this, but don't forget to put in your own CSS, etc.
PLEASE make a backup of your current b2commentspopup.php before using this code!
Code: | <?php /* Don't remove this line, it calls the b2 function files ! */
$blog=1; include ("blog.header.php"); while($row = mysql_fetch_object($result)) { start_b2();
?><!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" />
<meta http-equiv="reply-to" content="[email protected]" />
<meta http-equiv="imagetoolbar" content="no" />
<meta content="TRUE" name="MSSmartTagsPreventParsing" />
</head>
<body>
<?php
$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"])) ? "http://url" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_content NOT LIKE '%<trackback />%' ORDER BY comment_date";
$resultc = mysql_query($queryc);
if ($resultc) {
?>
<!-- you can start editing here -->
<a name="comments"></a> <br />
<strong><span style="color: #0099CC">::</span> <font color="#66FF00">comments
on my blog</font><br />
</strong>
<?php // these lines are b2's motor, do not delete
while($rowc = mysql_fetch_object($resultc)) {
$commentdata = get_commentdata($rowc->comment_ID);
?>
<a name="c<?php comment_ID() ?>"></a>
<!-- comment -->
<br>
<br>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center"><strong><span class="verdana75norm">
<?php comment_author() ?>
<?php comment_author_email_link("email", " - ", "") ?>
<?php comment_author_url_link("url", " - ", "") ?>
</span></strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFF00">
<tr>
<td><div align="center">
<span class="verdana75norm">
<?php comment_text() ?>
</span>
</div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="b2-img/spacer.gif"></div></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFCC66">
<tr>
<td><div align="center" class="verdana75norm">
<?php comment_date() ?>
@
<?php comment_time() ?>
</div></td>
</tr>
</table></td>
</tr>
</table>
<!-- /comment -->
<?php //end of the loop, don't delete
}
?>
<p align="center"><span class="verdana75norm"><strong>Please wait until
the comments page<br />
is loaded properly. Thanks.</strong></span></p>
<div><strong><span style="color: #0099CC">::</span> <font color="#66FF00">leave
a comment</font></strong></div>
<div align="left"><br>
<!-- form to add a comment -->
</div>
<form action="b2comments.post.php" method="post">
<div align="left">
<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"]); ?>" />
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="TableFont">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="TableFont" align="center">
<tr>
<td width="10%">Name:</td>
<td width="90%"><input type="text" name="author" class="myinputbg" value="<?php echo $comment_author ?>" size="20" tabindex="1"
onfocus="this.value=(this.value=='name') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'name' : this.value;" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" class="myinputbg" value="<?php echo $comment_author_email ?>" size="20" tabindex="2"
onfocus="this.value=(this.value=='email') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'email' : this.value;" /></td>
</tr>
<tr>
<td>Homepage </td>
<td><input type="text" name="url" class="myinputbg" value="<?php echo $comment_author_url ?>" size="20" tabindex="3"
onfocus="this.value=(this.value=='http://url') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'http://url' : this.value;" /></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="TableFont">
<tr>
<td width="50%" valign="top">Your comment<br />
<textarea cols="30" rows="4" name="comment" tabindex="4" class="mytextareabg"
onfocus="this.value=(this.value=='comment') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'comment' : this.value;" >comment</textarea>
<br /> <br />
</td>
<td align="right" valign="top">
<script language="JavaScript" type="text/javascript">
function emoticon(theSmilie) {
theSmilie = ' ' + theSmilie + ' ';
if (document.form.comment.createTextRange && document.form.comment.caretPos) {
var caretPos = document.form.comment.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie;
} else {
document.form.comment.value += theSmilie;
}
document.form.comment.focus();
theSmilie = '';
}
</script>
<?php
$newrow = 0;
$prev_val="";
asort($b2smiliestrans);
while (list ($key, $val) = each ($b2smiliestrans)) {
if($prev_val and $val==$prev_val) { }
else if(!$prev_val or ($prev_val and $val!=$prev_val)){
?>
<img src="<?php echo "$smilies_directory/$val"; ?>" alt="<?php echo $key; ?>" border="0" onclick="emoticon('<?php echo $key; ?>')" onmouseover="style.cursor='hand'" />
<?php
$newrow++;
if($newrow == 6) { //new row after specified number of smilies
echo '<br />';
$newrow = 0;
}
}
$prev_val = $val;
}
?>
</td>
</tr>
</table> </td>
</tr>
</table> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="TableFont">
<tr>
<td><div align="center">
<input type="checkbox" name="comment_autobr" value="1" <?php
if ($autobr)
echo " checked=\"checked\"" ?> tabindex="6" />
Auto-BR (line-breaks become <br> tags)<br />
<br />
<input type="submit" name="submit" class="myinputbg" value="Mwah! Mwah!" tabindex="5" />
</div></td>
</tr>
</table>
</div>
</form>
<!-- /form -->
<br>
<div><b><span style="color: #0099CC">::</span> <a href="javascript:window.close()">close this window</a></b></div>
<?php // if you delete this the sky will fall on your head
}
?>
</div>
</div>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?>
</body>
</html> |
_________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 6:49 am Post subject: |
|
|
okay ill try to use that code. ill post it whaever will happen. thanks. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 6:59 am Post subject: |
|
|
it's the same thing.
I'm thinking if you can post here the original, unedited code of b2template.functions.php
thanks. |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 7:42 am Post subject: |
|
|
I'm not sure what b2template.functions.php has to do with this problem, but to be honest, if I were you, I would re-download a fresh copy of b2, and edit & re-upload b2commentspopup.php. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
sharmaine
Joined: 27 Oct 2003 Posts: 23
|
Posted: Fri Jan 02, 2004 7:51 am Post subject: |
|
|
Oh my gosh! So is that the only solution left for me? |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Jan 02, 2004 8:32 am Post subject: |
|
|
Well, it's not that bad of a solution, you're just using a fresh b2commentspopup.php and adding in your codes.
Or if you want, you can compare a unedited b2commentspopup.php with your current b2commentspopup.php and edit the differences.
It's up to you. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
|