Search the web
Sign In
New User? Sign Up
dotcomments-support · dotcomments
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Comments page not loading...   Message List  
Reply | Forward Message #695 of 928 |
Hi, all.  :)
 
I've searched the message archives and couldn't find a solution to this problem, so I'm hoping someone who's figured it out can give me a hand.
 
First, I'm not an HTML newbie, but I'm fairly new to PHP and am still feeling my way around it, for the most part.  That being said, sometimes I can't see the forest for the trees, and it's often stupid little mistakes (like forgetting a quotation mark or semicolon) that kill me.  :p  I'm hoping another set of eyes might spot what I can't see...  I usually use 1st Page as an editor, but I downloaded tsWebEditor for its error-finding tool...nothing turned up when I used it.
 
My blog site is set up at http://blog.lunaclick.net (it's a work in progress, and the category archives aren't templated yet).  I'm using Blog (http://www.farook.org) to publish, and as it's a Blogger emulator, a lot of the <insert content here> tags are the same or similar.
 
The count seems to be ok so far (being that I have no comments on anything, and every comments link shows "No Comments," just like I want it to, LOL).  When I click on the link, though, the comments window pops up, but it takes FOREVER to load, and when it loads, I get a "cannot find server/page cannot be displayed" error.
 
I've tried different configurations -- even using the original "straight-out-of-the-box" versions, changing only my URLs and paths -- but no changes I make seem to be in a positive direction.  :-/  I'm going to keep playing around with it, but here is the code that I'm using right now:
 
Before headers in template_journal.php (/www/x/xxxxx/ replaces my actual path):
<?
function commentCount($n)
{
$comments_path =
"http://blog.lunaclick.net/comments/";
$filesystem_path =
"/www/x/xxxx/blog/htdocs/comments/";

if (file_exists($filesystem_path .
"$n.comment"))
{
$file = @fopen($comments_path .
"$n.comment", 'r');
$thisFile = fread($file, '
1000000');
$thisFile = explode(
"\n", trim($thisFile));
fclose($file);
$comments = sizeof($thisFile);
if($comments ==
1)
{
$comments .=
" Comment";
}
else
{
$comments .=
" Comments";
}
}
else
{
$comments =
"No Comments";
}
return $comments;
}
?>
In <head> tags in template_journal.php (within <script> tags, of course):
function viewComments(n)
{
window
.open('/comments.php?' + n, 'Comments' + n, 'directories=0,height=480,location=0,resizable=1,scrollbars=1,toolbar=0,width=515');
}
Comments link in template_journal.php:
<a href="javascript:viewComments('<$BlogID>');"><? echo commentCount('<$BlogID>'); ?></a>
And finally, my comments.php file:

<?
// User-defined Variables (FEEL FREE TO EDIT THESE)
$table_bgcolor = array(
"#808088", "#707078");
$order =
"1";
$timeAdjustment =
"3";
$comments_path =
"http://blog.lunaclick.net/";
$email =
"angela@...";
$showip =
"0";

// Begin Comment Parsing (DON'T EDIT THIS)
error_reporting(
7);

$commentID = ereg_replace('[^
0-9]', '', getenv('QUERY_STRING'));
$commentText = preg_replace('/<((?!\/?(b|i|u|a|ol|ul|li)\b)[^>]*)>/xis', '', ' ' . stripslashes(trim($commentText)));
$commentText = trim(eregi_replace("[^\"]((http|mailto|ftp):\/\/[^[:space:]<>]{1,})", "
<a href=\"\\1\">\\1</a>", $commentText));
$commentText = str_replace("\n", '<br>', $commentText);

if($commentText) {
if(!isset($commentName)
&& isset($submit)) $commentName = 'Anonymous'; else $commentName = strip_tags(trim($commentName));
if(!isset($commentMail)) $commentMail = ''; else $commentMail = strip_tags(trim($commentMail));
if(!isset($commentSite)) $commentSite = ''; else $commentSite = strip_tags(trim($commentSite));
if(strlen($commentSite)
&& !stristr($commentSite, 'http://')) $commentSite = 'http://' . $commentSite;

$commentDate = time() + ($timeAdjustment * 3600);
$thisComment = $commentDate . '[+]' . $commentName . '[+]' . $commentMail . '[+]' . $commentText . '[+]' . $commentSite . '[+]' . getenv('REMOTE_ADDR') . "\n";

$file = @fopen("comments/$commentID.comment", 'a');
fwrite($file, $thisComment);
fclose($file);

$cookie = $commentName . '[+]' . $commentMail . '[+]' . $commentSite;
setcookie('comments', $cookie, time() + 31536000);

if($email) {
mail($email, "New Comment [$commentID]", stripslashes($commentText) . "\n\n--\nTo view this comment, visit " . $comments_path . "comments.php?" . $commentID, "From: $commentName <$commentMail>");
}
} elseif($HTTP_COOKIE_VARS['comments']){
list($commentName, $commentMail, $commentSite) = explode('[+]', $HTTP_COOKIE_VARS['comments']);
}

if($file = @fopen($comments_path . "comments/$commentID.comment", 'r')) {
$comments = fread($file, '1000000');
$comments = explode("\n", trim($comments));
fclose($file);

for($i = 0; $i < sizeof($comments); $i++) {
$thisComment = explode('[+]', stripslashes($comments[$i]));
$thisComment[
0] = ' &#0149; ' . date("m/d/y h:ia", $thisComment[0]);
if($thisComment[
2]) $thisComment[2] = ' [<a href="mailto:' . $thisComment[2] . '">' . $thisComment[2] . '</a>] ';
if($thisComment[4]) $thisComment[1] = '
<a href="' . $thisComment[4] . '">' . $thisComment[1] . '</a>';
if($thisComment[5]
&& $showip) $thisComment[5] = ' &#0149; ' . $thisComment[5]; else $thisComment[5] = '';
$comment[$i] = $thisComment[3] . "<br>\n<div class=\
"date\">" . $thisComment[1] . $thisComment[2] . $thisComment[5] . $thisComment[0] . "</div>\n";
}
} else {
$comment[0] = "<p align=\
"center\">No comments found.</p>\n";
}

if($order) {
$countStart = 0;
$countEnd = sizeof($comment);
$countInc = 1;
} else {
$countStart = sizeof($comment) - 1;
$countEnd = -1;
$countInc = -1;
}

// End Comment Parsing
?>

<html>
<head>
<title>BlogSpace - Comments</title>
<META NAME=
"robots" CONTENT="noindex, nofollow">
<LINK REL=StyleSheet HREF=
"/blog.css" TYPE="text/css" MEDIA=screen>
<base target=
"_blank">
</head>

<body>

<form method=
"post" name="frmPost" target="_top">
<table border="0" cellpadding="10" cellspacing="1" width="100%">
<? for($i = $countStart; $i != $countEnd; $i += $countInc) { ?>
<tr>
<td bgcolor="<? echo $table_bgcolor[$i % 2]; ?>" class="comment">
<? echo $comment[$i]; ?>
</td>
</tr>
<? } ?>
<tr>
<td>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td align="left" class="form" colspan="2" valign="middle" width="100%"><b>Add your comment:</b> (Auto-line breaks enabled.)</td>
</tr>
<tr>
<td align="left" class="form" valign="middle" width="1%">Name:</td>
<td align="left" valign="middle" width="99%"><input maxlength="50" name="commentName" size="40" type="text" value="<? echo $commentName; ?>"></td>
</tr>
<tr>
<td align="left" class="form" valign="middle">Email:</td>
<td align="left" valign="middle"><input maxlength="75" name="commentMail" size="40" type="text" value="<? echo $commentMail; ?>"></td>
</tr>
<tr>
<td align="left" class="form" valign="middle">Website:</td>
<td align="left" valign="middle"><input maxlength="100" name="commentSite" size="40" type="text" value="<? echo $commentSite; ?>"></td>
</tr>
<tr>
<td align="left" class="form" valign="top">Comment:</td>
<td align="left" valign="top"><textarea cols="38" name="commentText" rows="5" wrap="virtual"></textarea></td>
</tr>
<tr>
<td><br></td>
<td><input name="Cancel" onclick="javascript:window.close();" type="button" value="Cancel" class="button"> &nbsp; &nbsp; <input name="Submit" type="submit" value="Submit" class="button"></td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</body>
</html>

Thanks in advance for any help you can give me!  :)


~ Angela ~
Proud wife of USAF SSgt Kerry Allen ~ 11 October 1999
Proud big sister of USAF SrA "Dewey" Taylor

LunaClick.net  ~  About Me  ~  Albums  ~  BlogSpace
ECHS Alumni  ~  Forum  ~  LunaShoppe  ~  PSP Goodies
RAF Mildenhall Spouses | Goodfellow AFB Spouses
Pagan Military Spouses | PCS PSP | Mad About Tags



Wed Feb 23, 2005 2:03 pm

usaf_angela
Offline Offline
Send Email Send Email

Forward
Message #695 of 928 |
Expand Messages Author Sort by Date

Hi, all. :) I've searched the message archives and couldn't find a solution to this problem, so I'm hoping someone who's figured it out can give me a hand. ...
Angela Allen
usaf_angela
Offline Send Email
Feb 23, 2005
2:04 pm

Hey Angela, I recently started using dotcomments and I found I got some sort of error when everything should have been working right. What I was not doing was...
jonz0r@...
jonzario
Offline Send Email
Feb 23, 2005
7:14 pm

Hi, John! Thanks for the quick response! Yep, I use WS_FTP and am very familiar with CHMOD settings. ;) I'll give your suggestion a shot and let you know...
Angela Allen
usaf_angela
Offline Send Email
Feb 23, 2005
9:23 pm

oi! he forgives me but.... I do not know of whom that you I stops. I am of Brazil, florianópolis and not entendu what you write much less why that you order...
Thaiana Lopes
thaianalopes
Offline Send Email
Feb 23, 2005
10:12 pm

I think you're asking why you're receiving email from me... Well, we're both a member of a mailing list on Yahoo Groups, and you're receiving emails from...
Angela Allen
usaf_angela
Offline Send Email
Feb 23, 2005
10:19 pm

John, I tried setting the permissions on comments.php to both 777 and 755, but no change. :( Any other ideas? I've been banging my head against this thing for...
Angela Allen
usaf_angela
Offline Send Email
Feb 24, 2005
2:01 am

Alrighty, I tried Phil Ringalda's "Remote dotcomments" script (*waves to Phil*), and it works. :) I'm not sure why one would work and not the other, but hey,...
Angela Allen
usaf_angela
Offline Send Email
Feb 24, 2005
5:04 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help