 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
brandy
Joined: 11 Dec 2003 Posts: 8 Location: MI
|
Posted: Tue Jan 11, 2005 3:37 am Post subject: blank comments page |
|
|
I setup my friend's blog a couple of weeks ago, copy and pasting the coding I use for the index.php and b2comments.php templates, which works fine on my blog. On hers, however, the comments page is blank. The CSS works fine, but there's no comments form or text at all. I adjusted the <php include> to her section of my site, which gave me text on the comments page, but it's the post, then an error.
I don't want to post the codes, since I'm not sure what all is needed, so I'll just link: http://caomh.net/tashab2/index.php _________________ & brandy
[caomh] |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 906 Location: Oslo, Norway
|
|
Back to top |
|
 |
brandy
Joined: 11 Dec 2003 Posts: 8 Location: MI
|
Posted: Wed Jan 12, 2005 4:37 am Post subject: |
|
|
Sigg3 wrote: | Quote: | Warning: main(/b2comments.php): failed to open stream: No such file or directory in /home/brandy/public_html/tashab2/index.php on line 57 |
What's on line 57?
Doesn't look like you've uploaded b2comments.
Loved your 404, btw:D |
I *think* line 57 is:
<a href="<?php comments_link() ?>"><?php comments_number('x','x','x') ?></a>
I've never uploaded any of the b2 files; I do everything through the b2 files on my domain.
Thanks.  _________________ & brandy
[caomh] |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 906 Location: Oslo, Norway
|
|
Back to top |
|
 |
brandy
Joined: 11 Dec 2003 Posts: 8 Location: MI
|
Posted: Wed Jan 12, 2005 8:16 pm Post subject: |
|
|
No, b2comments is in the folder, and it's not renamed (I've had problems before with renaming b2 files). I have three different b2 folders on my domain (one for my domain, and one for each of the add-on domains I host), and this is the only one with problems (I did all three the same way, and copied the templates from my personal blog).  _________________ & brandy
[caomh] |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 906 Location: Oslo, Norway
|
|
Back to top |
|
 |
brandy
Joined: 11 Dec 2003 Posts: 8 Location: MI
|
Posted: Fri Jan 14, 2005 5:13 am Post subject: |
|
|
index.php
Code: | <html>
<head>
<style type="text/css">
<!--
body, table, tr, td {
font: 7pt Verdana;
color: #484848;
letter-spacing: 0px}
body {
background-color: #FFDBE7;
}
a:link {color: #FF5D5A; text-decoration: none; font-weight: bold}, a:active {color:#FF5D5A; text-decoration: none; font-weight: bold}, a:visited {color:#FF5D5A; text-decoration: none; font-weight: bold}
a:hover {color: #FF496B; text-decoration: none; font-weight: bold}
input, textarea, option, select {
background-color: #FFDBE7;
font: 7pt Verdana;
color: #FFFFFF;
letter-spacing: 1px;
border: 1px solid #FFDBE7;
padding:2px; }
body { scrollbar-face-color: #FFDBE7; scrollbar-shadow-color: #FFDBE7;
scrollbar-highlight-color: #FFDBE7; scrollbar-3dlight-color: #FFDBE7;
scrollbar-darkshadow-color: #FFDBE7; scrollbar-track-color: #737573;
scrollbar-arrow-color: #FFDBE7}
input, textarea, option, select {
background-color: #FFDBE7;
font-family: Verdana;
font-size: 7pt;
color: #484848;
border-top: 1pt solid #484848;
border-bottom: 1pt solid #484848;
border-left: 1pt solid #484848;
border-right: 1pt solid #484848;
}
</style>
</head>
<body>
<div class="datetime">
<img src="http://www.tantalyze.net/bullet1.png"> <b>January 04 2005 @ 7:15PM</div></b><br />
Hey jellybeans. Just saying I'm still alive and... stuff. <br />
<br />
Winter quarter started yesterday but I haven't gone to any of my classes yet. Go me, right? I was wandering through the parking lot when my ex ran up to me out of nowhere and so we wandered together. I never did find my class, though, which was in an off-campus building. So fuck it. I'm dropping it.<br />
<br />
I bought a turquoise Marilyn Monroe top at Hot Topic but had to return it because my boobs couldn't breathe even though I bought the shirt a size larger than I normally wear. So I got a Draco Malfoy shirt instead. Which is equally hot, in my personal opinion.<br />
<br />
Mrah. My stomach hurts, I'm thirsty, my hands are so numb and stiff I can barely type, and I really need to clean up some more around my bedroom and take care of my laundry.<br />
<br />
A nap would be very nice right about now. <br /><br />
<img src="http://www.tantalyze.net/heart.gif"> <b>Tasha</b>
<a href="index.php?p=7&c=1#comments">1</a>
CMNT <b>;</b>
<a href="index.php?p=7&c=1#comments">x</a>
<br><br>
<div class="datetime">
<img src="http://www.tantalyze.net/bullet1.png"> <b>December 31 2004 @ 7:32PM</div></b><br />
Just a superquick blog before I head out for my New Year's Eve festivities. I am currently feeling better but much worse at the same time, but I think (or at least, hope) everything will be alright in the end. Things are certainly different though. <br />
<br />
Tonight's plans include dinner at the Olive Garden if the wait isn't too bad, a party (either at my cousin's new place or at another friend's), and lots and lots of alcohol. First, though, I need to get out of this chair and into some clothes before Richard complains about me taking too long to get ready. -_-<br />
<br />
I wish all of you a wonderful New Year's- have fun and stay safe. :)<br />
<br />
P.S. Thanks to <a href="http://www.caomh.net" target=_blank>Brandy</a> for setting me up with b2. Loves. ;)<br /><br />
<img src="http://www.tantalyze.net/heart.gif"> <b>Tasha</b>
<a href="index.php?p=5&c=1#comments">1</a>
CMNT <b>;</b>
<a href="index.php?p=5&c=1#comments">x</a>
<br><br>
<div class="datetime">
<img src="http://www.tantalyze.net/bullet1.png"> <b>December 31 2004 @ 3:32AM</div></b><br />
Welcome back to tantalyze.net, jellybeans.<br />
<br />
I wasn't planning on putting the site back up until mid-January or so, but, well, here you go.<br />
<br />
<s>I keep intending to install a blogging system, but I never get around to it. I think the last time I tried, I fucked up the scripts and created a bunch of errors and pretty much gave myself a headache, so I'll probably have to beg Sheri or Brandy to help me out with that.</s> <br />
<br />
Don't have much else to say for now. I'm still feeling kind of shitty about everything, I keep thinking I'll snap out of it soon but it's been a week now and I still feel unhappy as ever. I thought the holidays were all about cheer and that good stuff.<br />
<br />
Later days.<br /><br />
<img src="http://www.tantalyze.net/heart.gif"> <b>Tasha</b>
<a href="index.php?p=4&c=1#comments">2</a>
CMNTS <b>;</b>
<a href="index.php?p=4&c=1#comments">x</a>
<br><br>
</body>
</html> |
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'
}
setcookie("comment_author",$author, time()+30000000);
setcookie("comment_author_email",$email, time()+30000000);
setcookie("comment_author_url",$url, time()+30000000);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$location = (!empty($HTTP_POST_VARS['redirect_to'])) ? $HTTP_POST_VARS['redirect_to'] : $HTTP_SERVER_VARS["HTTP_REFERER"];
header("Location: $location");
} else {
die("Sorry, you can only post a new comment every 30 seconds");
}
?> |
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><b>comments</b></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><b>leave a comment</b></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><a href="javascript:history.go(-1)">blog</a></div>
<?php // if you delete this the sky will fall on your head
}
} else {
return false;
}
?> |
_________________ & brandy
[caomh] |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 906 Location: Oslo, Norway
|
|
Back to top |
|
 |
brandy
Joined: 11 Dec 2003 Posts: 8 Location: MI
|
Posted: Fri Jan 14, 2005 8:58 pm Post subject: |
|
|
That's how I got those codes (with the exception of index.php). Here's the unparsed code for index.php:
Code: | <?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<html>
<head>
<style type="text/css">
<!--
body, table, tr, td {
font: 7pt Verdana;
color: #484848;
letter-spacing: 0px}
body {
background-color: #FFDBE7;
}
a:link {color: #FF5D5A; text-decoration: none; font-weight: bold}, a:active {color:#FF5D5A; text-decoration: none; font-weight: bold}, a:visited {color:#FF5D5A; text-decoration: none; font-weight: bold}
a:hover {color: #FF496B; text-decoration: none; font-weight: bold}
input, textarea, option, select {
background-color: #FFDBE7;
font: 7pt Verdana;
color: #FFFFFF;
letter-spacing: 1px;
border: 1px solid #FFDBE7;
padding:2px; }
body { scrollbar-face-color: #FFDBE7; scrollbar-shadow-color: #FFDBE7;
scrollbar-highlight-color: #FFDBE7; scrollbar-3dlight-color: #FFDBE7;
scrollbar-darkshadow-color: #FFDBE7; scrollbar-track-color: #737573;
scrollbar-arrow-color: #FFDBE7}
input, textarea, option, select {
background-color: #FFDBE7;
font-family: Verdana;
font-size: 7pt;
color: #484848;
border-top: 1pt solid #484848;
border-bottom: 1pt solid #484848;
border-left: 1pt solid #484848;
border-right: 1pt solid #484848;
}
</style>
</head>
<body>
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<div class="datetime">
<img src="http://www.tantalyze.net/bullet1.png"> <b><?php the_time("F d Y"); ?> @ <?php the_time("g:iA"); ?></div></b><br />
<?php the_content(); ?><br /><br />
<img src="http://www.tantalyze.net/heart.gif"> <b>Tasha</b>
<a href="<?php comments_link() ?>"><?php comments_number('0','1','%') ?></a>
<?php comments_number('CMNTS','CMNT','CMNTS') ?> <b>;</b>
<a href="<?php comments_link() ?>"><?php comments_number('x','x','x') ?></a>
<br><br>
<?php include ("/b2comments.php"); ?>
<?php } ?>
</body>
</html> |
I don't have any idea if that path is correct; I really don't know a whole lot about php. If b2comments is automatically in b2loop, then yes, it's there. If not, I suppose it's not there, and I don't know how to put it there. Sorry, I suppose I'm a bit useless. _________________ & brandy
[caomh] |
|
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
|