boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dodo's threaded comments hack (BETA)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Thu Jun 05, 2003 6:47 pm    Post subject: dodo's threaded comments hack (BETA) Reply with quote

Hi, I need some beta testers for my threaded comments hack like here:
http://pure-essence.net/index.php?p=598&c=1#comments

No one seems have tried it yet so I don't know how well it will work for you. Of course it worked for me.

i'm also trying to improve the script. threaded comments will not place your newest comment on top so it's kinda hard to find which comments are the newest.. if you have any suggestion how to handle that problem, let me know.

download here
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
blog17



Joined: 28 Jan 2003
Posts: 144
Location: London, UK

PostPosted: Thu Jun 05, 2003 8:31 pm    Post subject: Reply with quote

OMG! THREADED COMMENTS! ok paul, beathe, breathe... IM GONNA TEST IT NOW!
_________________
Check this out! The ULTIMATE site!
Back to top
View user's profile Send private message Visit poster's website
blog17



Joined: 28 Jan 2003
Posts: 144
Location: London, UK

PostPosted: Thu Jun 05, 2003 8:43 pm    Post subject: Reply with quote

In the readme:
Code:
==find:==
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date DESC";

It doesnt exist in my b2comments.php
_________________
Check this out! The ULTIMATE site!
Back to top
View user's profile Send private message Visit poster's website
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Thu Jun 05, 2003 11:52 pm    Post subject: Reply with quote

i fogot, i edited that before, it should not have DESC for you. try

Code:

==find:==
$queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date";


or does someone remember the default, give me a hint.
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
blog17



Joined: 28 Jan 2003
Posts: 144
Location: London, UK

PostPosted: Fri Jun 06, 2003 7:42 am    Post subject: Reply with quote

I searched for the first half of that line and this is the only thing that exists in the code:
Quote:
$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";

Is this it?
_________________
Check this out! The ULTIMATE site!
Back to top
View user's profile Send private message Visit poster's website
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Fri Jun 06, 2003 11:21 am    Post subject: Reply with quote

erm, I think it will generate lots of mysql queries if there are alot of comments? Same problem as the sub categories.
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
daynah



Joined: 25 Jan 2002
Posts: 8

PostPosted: Fri Jun 06, 2003 5:23 pm    Post subject: small bug Reply with quote

There's a bug in the comment script, nothing major though.

In dodo's blog, she logs the user's theme, so there's an extra field in her comments table that we do not have.

On line 91 of b2comments.post.phps:
Code:
    $query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now',[b]'$used_theme',[/b]'$comment','0', '$comment_reply_ID')";


Replace it with:
Code:
    $query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now','$comment','0', '$comment_reply_ID')";


Save it, upload. And it should be fixed. Smile
_________________
PHP Princess.net | Daynah.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Fri Jun 06, 2003 7:17 pm    Post subject: Reply with quote

i edited my file. fixed some of the bugs and added a few new functions

thank you to lele http://drollery.com/index.php?p=1803&c=1 who tried it for me Smile

http://pure-essence.net/b2/hacks/b2_threaded_comments_hack.zip
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
wteening



Joined: 12 Jul 2002
Posts: 71

PostPosted: Sat Jun 07, 2003 9:36 am    Post subject: Reply with quote

Does it work alongside the http://tidakada.com/board/viewtopic.php?t=2042 notification hack ?
That, or a different colour for 'new' replies would work well to spot the new entries?
Back to top
View user's profile Send private message Visit poster's website
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Sun Jun 08, 2003 1:48 am    Post subject: Reply with quote

actually i have notification for my site.. it's a hassle to add in. it notifies the commenter of the original comment if you are replying to it. but it's a lot of hassle to add and it seems not many people are interested in this hack so *shurg*
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
phona



Joined: 07 Feb 2002
Posts: 35
Location: Australia

PostPosted: Sun Jun 08, 2003 3:28 am    Post subject: Reply with quote

the comments that are posted after the original; one (that aren't meant to be threaded) are threading under the original comment...

http://littlelioness.net/blog.php?p=68&c=1


I don't know what I've done, though I'll prbably figure it out as soon as I post this lol!

some of the comments.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_reply_ID = '0' ORDER BY comment_date";
   $resultc = mysql_query($queryc);
   if ($resultc) {
   ?>

<!-- you can start editing here -->
<script language=JavaScript>
<!--
function reply_to(ID)
{
document.post.comment_reply_ID.value = "" + ID + "";
}
-->
</script>
<p><?php previous_post() ?> |
<A href="blog.php">main</a> |
<?php next_post() ?> </p>
<a name="comments"></a>
<p> </p>
<div><strong><P><span style="color: #0099CC">::</span> comments</p></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); 
   $comment_ID = $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() ?>
<BR>
<a href="#post_a_comment" onclick="javascript:reply_to('<?php comment_ID() ?>')" title="reply to this comment" target="_self">reply to this comment</a>
</p>
<p> </p>
<P>
<? dodos_thread($comment_ID); ?>
</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><P><span style="color: #0099CC">::</span> leave a comment</p></strong></div>
<p> </p>
<a name="post_a_comment"></a>

<!-- form to add a comment -->

<form name="post" 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"]); ?>" />
   <input type="hidden" name="comment_reply_ID" value="0" />

   <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>
   <BR>
   <script language="JavaScript" type="text/javascript">
function emoticon(theSmilie) {
   theSmilie = ' ' + theSmilie + ' ';
   if (document.post.comment.createTextRange && document.post.comment.caretPos) {
      var caretPos = document.post.comment.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie;
   } else {
      document.post.comment.value  += theSmilie;
   }
   document.post.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 == 11) { //new row after specified number of smilies
                                    echo '<br />';
                                    $newrow = 0;
                        }
            }
            $prev_val = $val;
}
?>
   </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><p><span style="color: #0099CC">::</span> <a href="javascript:history.go(-1)">return to the blog</a></p></b></div>

<?php // if you delete this the sky will fall on your head
}
} else {
   return false;
}
?>


*edited cos I pasted the wrong stuff*

I don't know if that'll help anyway...


I and I removed all the DESC from the $query sections, because it's more natural to me to have them with the older comments first.. .which i see Dodo has anyway :p

*goes back to fiddling*
_________________
Just a sweet lil Aussie chick (yeah, whatever)
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
phona



Joined: 07 Feb 2002
Posts: 35
Location: Australia

PostPosted: Sun Jun 08, 2003 6:15 am    Post subject: Reply with quote

Okay.. just me hvaing issues with where to put div tags and where not to...

moving right along

your hack rules dodo Smile
_________________
Just a sweet lil Aussie chick (yeah, whatever)
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
neotrace



Joined: 08 Jun 2003
Posts: 4

PostPosted: Sun Jun 08, 2003 10:58 pm    Post subject: issue Reply with quote

I'm unable to get the changes to work, though there are no problem which seems slightly odd.

The page I current have the main posts displayed upon is http://www.neocipher.net/ and the blog is located at http://www.neocipher.net/blog/

I would like that main page to simpliy display post, comments, and a reply to comments button like the example site does....
Back to top
View user's profile Send private message Visit poster's website AIM Address
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Tue Jun 10, 2003 11:45 pm    Post subject: Re: issue Reply with quote

neotrace wrote:
I'm unable to get the changes to work, though there are no problem which seems slightly odd.

The page I current have the main posts displayed upon is http://www.neocipher.net/ and the blog is located at http://www.neocipher.net/blog/

I would like that main page to simpliy display post, comments, and a reply to comments button like the example site does....


hmm are you using b2?? it seems you are using bblog? i don't know about that script.. is that another form of b2 or something.
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Tue Jun 10, 2003 11:47 pm    Post subject: Reply with quote

plug another pretty user of mine Smile

http://girl.daynah.net/index.php?p=724&c=1#comments
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
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