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 

[Help] Quoting Comments

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Wed Jan 29, 2003 2:13 pm    Post subject: [Help] Quoting Comments Reply with quote

Anyone would like to co-develop a comments quoting feature in b2? I got the so called base code, but it is so buggy, need lots of help from you all to make it bug free.
Here is the "base" code:

Open b2vars.php, find
Code:
$b2_bbcode['in'] = array(

add in below it
Code:
'#\[quote](.+?)\[/quote]#is'


find
Code:
$b2_bbcode['out'] = array(

add in below it
Code:
 '<blockquote>$1</blockquote>',

_________________

++ GamerZ.Per.Sg - Complex Simplicity


Last edited by GamerZ on Wed Jan 29, 2003 2:24 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Wed Jan 29, 2003 2:19 pm    Post subject: Reply with quote

Add in this javascript anywhere in your page
Code:

<script language="Javascript">
function QuoteComment(cid){

var Comment_Author = document.getElementById("Comment_Author_" + cid).innerText;
var Comment_Text = document.getElementById("Comment_Text_" + cid).innerText;
commentsform.comment.value = commentsform.comment.value + "[quote][b]" + Comment_Author + " said...[/b]\n" + Comment_Text + "[/quote]";
}
</script>


next open b2comments.php
find
Code:
<?php comment_author() ?>

replace
Code:
<span id="Comment_Author_<?php comment_ID() ?>"><?php comment_author() ?></span>


find
Code:
<?php comment_text() ?>

replace
Code:
<span id="Comment_Text_<?php comment_ID() ?>"><?php comment_text() ?></span>


Next add in a "Quote" anywhere within the b2 loop. Here is the code
Code:

<a href="#Quote_This_Comment" onClick="QuoteComment(<?php comment_ID() ?>);">Quote</a>

_________________

++ 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
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Wed Jan 29, 2003 2:20 pm    Post subject: Reply with quote

this code is definately not complete, don't use it unless you want to help out in the coding of it.

This code works only with 1 quote, and it cannot work with "a quote in a quote".

Thanks, any help is appreciated Smile
_________________

++ 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
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Wed Jan 29, 2003 5:54 pm    Post subject: Reply with quote

I believe my "latest n comments" does something very similar to what you are trying to do. Yeah?
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Thu Jan 30, 2003 6:42 am    Post subject: Reply with quote

hmm, but mine is trying to quote a comments w/o the implementation of my sql queries.
_________________

++ 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
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
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