 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
Krae
Joined: 12 Jan 2004 Posts: 10 Location: Texas
|
Posted: Fri Jun 11, 2004 10:22 am Post subject: comments = blank |
|
|
Whnen you click to add a comment it just takes you to a blank page. Everything else is working fine though.
Code: |
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<h3><strong><?php the_date("d.m.y"); ?>:<?php the_title(); ?></strong></h3>
<?php permalink_anchor(); ?>
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<br />
<em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a></em>
<br />
<a href="<?php comments_link() ?>"><?php comments_number("no comments", "1 comment", "% comments") ?></a>
</p>
<?php include ("b2/b2comments.php"); ?>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?>
|
_________________ -krae
silently-screaming.org
moxie-networks.com |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 616 Location: Oslo, Norway
|
|
Back to top |
|
 |
Krae
Joined: 12 Jan 2004 Posts: 10 Location: Texas
|
Posted: Sat Jun 12, 2004 3:03 am Post subject: |
|
|
Ok, I changed it so where its not /b2/ anymore. But its still not working.
Heres the site:
http://silently-screaming.org/b2/neww.php
Heres the code:
Code: |
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<h3><strong><?php the_date("d.m.y"); ?>:<?php the_title(); ?></strong></h3>
<?php permalink_anchor(); ?>
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<br />
<em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a></em>
<br />
<a href="<?php comments_link() ?>"><?php comments_number("no comments", "1 comment", "% comments") ?></a>
</p>
<?php include ("b2comments.php"); ?>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?>
|
_________________ -krae
silently-screaming.org
moxie-networks.com |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 616 Location: Oslo, Norway
|
|
Back to top |
|
 |
Laur
Joined: 29 Aug 2004 Posts: 1 Location: NJ
|
Posted: Sun Aug 29, 2004 1:11 pm Post subject: |
|
|
I get this too. The comment is added, but it doesn't redirect back to the blog, it just goes to a blank page.
This is b2comments.post.php:
Code: | <?php
# if you want to change the paths here, remember to put your new path BEFORE $b2inc,
# like this: "b2/$b2inc/b2functions.php"
require("b2config.php");
require("$b2inc/b2template.functions.php");
include("$b2inc/b2vars.php");
include("$b2inc/b2functions.php");
dbconnect();
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} else {
$array[$k] = addslashes($v);
}
}
return $array;
}
if (!get_magic_quotes_gpc()) {
$HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);
$HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
}
$author = trim($HTTP_POST_VARS["author"]);
$email = trim($HTTP_POST_VARS["email"]);
$url = trim($HTTP_POST_VARS["url"]);
$comment = trim($HTTP_POST_VARS["comment"]);
$original_comment = $comment;
$comment_autobr = $HTTP_POST_VARS["comment_autobr"];
$comment_post_ID = $HTTP_POST_VARS["comment_post_ID"];
if ($require_name_email && ($email == "" || $email == "@" || $author == "" || $author == "name")) { //original fix by Dodo, and then Drinyth
echo "Error: please fill the required fields (name, email)";
exit;
}
if ($comment == "comment" || $comment == "") {
echo "Error: please type a comment";
exit;
}
$user_ip = $REMOTE_ADDR;
$user_domain = gethostbyaddr($user_ip);
$time_difference = get_settings("time_difference");
$now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));
$author = strip_tags($author);
$email = strip_tags($email);
if (strlen($email) < 6) {
$email = '';
}
$url = trim(strip_tags($url));
$url = ((!stristr($url, '://')) && ($url != '')) ? 'http://'.$url : $url;
if (strlen($url) < 7) {
$url = '';
}
$comment = strip_tags($comment, $comment_allowed_tags);
$comment = balanceTags($comment, 1);
$comment = convert_chars($comment);
$comment = format_to_post($comment);
$comment_author = $author;
$comment_author_email = $email;
$comment_author_url = $url;
$author = addslashes($author);
$email = addslashes($email);
$url = addslashes($url);
/* flood-protection */
$query = "SELECT * FROM $tablecomments WHERE comment_author_IP='$user_ip' ORDER BY comment_date DESC LIMIT 1";
$result = mysql_query($query);
$ok=1;
if (!empty($result)) {
while($row = mysql_fetch_object($result)) {
$then=$row->comment_date;
}
$time_lastcomment=mysql2date("U","$then");
$time_newcomment=mysql2date("U","$now");
if (($time_newcomment - $time_lastcomment) < 30)
$ok=0;
}
/* end flood-protection */
if ($ok) {
$query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now','$comment','0')";
$result = mysql_query($query);
if (!$result)
die ("There is an error with the database, it can't store your comment...<br>Contact the <a href=\"mailto:$admin_email\">webmaster</a>");
if ($comments_notify) {
$notify_message = "New comment on your post #$comment_post_ID.\r\n\r\n";
$notify_message .= "author : $comment_author (IP: $user_ip , $user_domain)\r\n";
$notify_message .= "e-mail : $comment_author_email\r\n";
$notify_message .= "url : $comment_author_url\r\n";
$notify_message .= "comment: \n".stripslashes($original_comment)."\r\n\r\n";
$notify_message .= "You can see all comments on this post there: \r\n";
$notify_message .= $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal.$comment_post_ID.$querystring_separator.'c'.$querystring_equal.'1'."\r\n\r\n";
$postdata = get_postdata($comment_post_ID);
$authordata = get_userdata($postdata["Author_ID"]);
$recipient = $authordata["user_email"];
$subject = "comment on post #$comment_post_ID \"".$postdata["Title"]."\"";
@mail($recipient, $subject, $notify_message, "From: b2@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: b2 $b2_version - PHP/" . phpversion());
}
if ($email == "") {
$email = " "; // this to make sure a cookie is set for 'no email'
}
if ($url == "") {
$url = " "; // this to make sure a cookie is set for 'no url'
}
} else {
die("Sorry, you can only post a new comment every 30 seconds");
}
?>
|
And this is 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 -->
<a name="comments"></a>
<p> </p>
<div><strong><span style="color: #0099CC">::</span> comments</strong></div>
<p> </p>
<?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>
<b><?php comment_author() ?> <?php comment_author_email_link("email", " - ", "") ?><?php comment_author_url_link("url", " - ", "") ?></b>
<br />
<?php comment_text() ?>
<br />
<?php comment_date() ?> @ <?php comment_time() ?>
</p>
<p> </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 */ } ?>
<div><strong><span style="color: #0099CC">::</span> leave a comment</strong></div>
<p> </p>
<!-- 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">
url<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="40" 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 -->
<p> </p>
<div><b><span style="color: #0099CC">::</span> <a href="javascript:history.go(-1)">return to the blog</a></b></div>
<?php // if you delete this the sky will fall on your head
}
} else {
return false;
}
?> |
If it's another page, please let me know and I'll post that code... Eh IDK what could be wrong. Please help! _________________ xoxo Laur |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|