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 

Smilies in comments hack?

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



Joined: 22 Aug 2003
Posts: 9

PostPosted: Sat Sep 13, 2003 8:53 pm    Post subject: Smilies in comments hack? Reply with quote

Can somebody point me to this hack, where the smilies are in the comments pop-up page... a'la http://www.local-girl.org? I followed the link in her blog... but only got to dodo's threaded comments hack. Thank you in advance Smile
Back to top
View user's profile Send private message Visit poster's website
epolady



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Sat Sep 13, 2003 11:35 pm    Post subject: Reply with quote

Paste this where you want the smilies to go.

Code:
<script language="JavaScript" type="text/javascript">
function emoticon(theSmilie) {
   theSmilie = ' ' + theSmilie + ' ';
   if (document.form.comment.createTextRange && document.form.comment.caretPos) {
      var caretPos = document.form.comment.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie;
   } else {
      document.form.comment.value  += theSmilie;
   }
   document.form.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 == 8) { //new row after specified number of smilies
                                    echo '<br />';
                                    $newrow = 0;
                        }
            }
            $prev_val = $val;
}
?>


And change your Form Action for b2comments.php (and b2commentspopup.php) to
Code:
<form action="b2comments.post.php" method="post" name="form">


Make sure smilies are enabled in b2config.php with the correct URL.
_________________
No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there.
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1274
Location: Oregon

PostPosted: Sun Sep 14, 2003 5:31 pm    Post subject: Reply with quote

Hey, that's my revision... heh.
_________________
Michael P.

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



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Mon Sep 15, 2003 1:25 am    Post subject: Reply with quote

Cyberian75 wrote:
Hey, that's my revision... heh.
LOL, yes it is. I've been using it for a while.
_________________
No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there.
Back to top
View user's profile Send private message
Jules



Joined: 22 Aug 2003
Posts: 9

PostPosted: Mon Oct 13, 2003 12:26 am    Post subject: Reply with quote

where do I put the stuff above? I'm really clueless at this stuff, lol!
Back to top
View user's profile Send private message Visit poster's website
epolady



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Mon Oct 13, 2003 12:51 am    Post subject: Reply with quote

In b2comments.php (or b2comments.popup.php).
_________________
No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there.
Back to top
View user's profile Send private message
Elladora



Joined: 20 Jul 2003
Posts: 5
Location: Malaysia, South-East Asia

PostPosted: Sun Feb 01, 2004 10:36 am    Post subject: Reply with quote

How about a hack which list the smilies on your b2 login page? Then, all you have to do is click on the smilie and it will be on your entry box. So you don't have to type out the emoticon strokes yourself or memorize them.

Btw, is there a way for me to change the date of post to suit my time zone?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Miyu



Joined: 05 Nov 2002
Posts: 37

PostPosted: Sun Feb 01, 2004 10:37 pm    Post subject: Reply with quote

There is a hack for that, because I got it off this board. You'll have to dig around one of the older threads about smile hacks Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hazel



Joined: 20 Jan 2004
Posts: 38
Location: Philippines

PostPosted: Thu Feb 19, 2004 12:42 pm    Post subject: Reply with quote

the installation of the smilies are okay.. but it wouldn't show up in the comments.. click here: http://www.strawberryshake.net/sweet/b2.php?p=16&c=1#comments

HELP!!!!

Also, i see in some blog, if they are going to comment the "name", "email" and "url" disappear.. how is that?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Spack



Joined: 03 Mar 2004
Posts: 9
Location: Guadeloupe

PostPosted: Fri Mar 05, 2004 11:50 pm    Post subject: Reply with quote

Try this...Create a new file in b2-include/ ...I named it "b2quicktags.comments.php"

Code:
<script language="JavaScript" type="text/javascript">
function bbinsert(formObj, strIns, strInsClose ) {
      theSelection = false;
               
      if (document.selection)
      {
         formObj.content.focus();
         theSelection = document.selection.createRange().text; // Get text selection
         // Add tags around selection:
         document.selection.createRange().text = strIns + theSelection + strInsClose;
         formObj.comment.focus();
         theSelection = false;
         return;
      }
   
      formObj.comment.value += strIns + strInsClose;
      formObj.comment.focus();
      return;
   
}
</script>

<table border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="middle">
<td>
<img src="b2-img/smilies/icon_arrow.gif" title=":arrow:" class="middle"  onClick="bbinsert(document.post,'', ' :arrow: ')" />
</td>
<td> </td>
<td>
<img src="b2-img/smilies/icon_biggrin.gif" title=":D" class="middle"  onClick="bbinsert(document.post, '', ' :D ')" />
</td>
</tr>
<!-- put here your smiles picture as the example -->
<!-- open a new <tr> tag to create a new line of smilies -->
</table>


In "b2comments.php" or "b2commentspopup.php", name the form "post" :
Code:
<form name="post" action="<?php echo $siteurl; ?>/b2comments.post.php" method="post">


and modify the textaera part as it :
Code:

<p class="commentfield">
   comment<br />
        <?php if ($use_quicktags) include($b2inc.'/b2quicktags.comments.php'); ?>
   <textarea cols="40" rows="4" name="comment" tabindex="4" wrap="virtual" id="comment"></textarea>
</p>


If you have an error who says that you don't have enter your comment...Modify "b2comments.post.php"
Code:
if ($comment == "") {
   echo "Error: You don't have enter your comment";
   exit;
}


Sorry for my english ...But I hope you understand...
Back to top
View user's profile Send private message
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