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 

B2 Smilies Hack v2.0 (for b2 0.6 pre3)

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



Joined: 25 Jan 2002
Posts: 108
Location: Paris, France

PostPosted: Fri Aug 09, 2002 6:18 pm    Post subject: B2 Smilies Hack v2.0 (for b2 0.6 pre3) Reply with quote

Hi all!

With B2 0.6 pre3 have come BBcode and smilies, so my previous hack, however still useable, seemed to me a little useless...
So I made a v2, which lists each smiley and it's asociated BBcode, under the blog's textarea (I think it has been requested too but I ain't sure).



Now the coding part.
Edit b2edit.form.php and just below
Code:
<textarea rows="9" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual"><?php echo $content ?></textarea><br />
insert
Code:
<br /><b>Smilies :</b><br />
<table bgcolor="#F0F0F0" cellspacing="0" cellpadding="0" border="0" width="99%" align="center" style="border: 1px solid #CCCCCC; padding: 2px; margin: 1px;">
<tr>
<?php
$i=0;
$prev_val="";
asort($b2smiliestrans);
while (list ($key, $val) = each ($b2smiliestrans)) {
  if($val==$prev_val) echo "<br />$key\n";
  else if($prev_val) {
    echo "</font></td>\n";
    $i++;
    if($i==8) {
      echo "</tr><tr>\n";
      $i=0;
    }
?>
<td><img src="<?php echo "$smilies_directory/$val"; ?>" onclick="emoticon('<?php echo $key; ?>')" onmouseover="style.cursor='hand'" /></td><td><font size="1"><?php echo $key; ?>
<?php
  }
  if(!$prev_val) {
?>
<td><img src="<?php echo "$smilies_directory/$val"; ?>" onclick="emoticon('<?php echo $key; ?>')" onmouseover="style.cursor='hand'" /></td><td><font size="1"><?php echo $key; ?>
<?php
  }
  $prev_val = $val;
}
?>
</font></td>
</tr>
</table><br />


Note: clicking on a smiley will add its first BBcode (if there are many ones associated to the same smiley).

Enjoy,
Benjy.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Fallen



Joined: 16 Mar 2002
Posts: 67
Location: Sao Paulo, Brasil

PostPosted: Fri Aug 09, 2002 9:14 pm    Post subject: Reply with quote

Great hack! Smile

Just wondering...: is possible to put this in a popup, and call it from a button like the other bbcode buttons?

Many thanks!

Fallen
_________________
http://crube.net
Back to top
View user's profile Send private message Visit poster's website
Benjy



Joined: 25 Jan 2002
Posts: 108
Location: Paris, France

PostPosted: Fri Aug 09, 2002 9:50 pm    Post subject: Reply with quote

Wait for v2.1

Benjy.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Fri Aug 09, 2002 10:23 pm    Post subject: Reply with quote

Wow great job!
Back to top
View user's profile Send private message Visit poster's website
Mellissa



Joined: 17 Nov 2002
Posts: 29
Location: Malaysia

PostPosted: Sun Nov 17, 2002 7:23 pm    Post subject: Reply with quote

Great script Very Happy I finally realized I was running the wrong version of b2.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Armitage



Joined: 28 Dec 2002
Posts: 14

PostPosted: Thu Jan 02, 2003 3:26 am    Post subject: Reply with quote

Does this hack not work on the newer version? I've tried it a few times and keep getting parse errors on line 123, which is...

if($val==$prev_val) echo "<br />$key\n";

I'm pretty sure its in the first part, but don't know enough about php ytet to fix it.
Back to top
View user's profile Send private message Visit poster's website
Benjy



Joined: 25 Jan 2002
Posts: 108
Location: Paris, France

PostPosted: Thu Jan 02, 2003 12:45 pm    Post subject: Reply with quote

Mmm... at that time it was fully working, and I don't why it wouldn't work any more now... btw, why don't you use a newer release ?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Armitage



Joined: 28 Dec 2002
Posts: 14

PostPosted: Thu Jan 02, 2003 7:41 pm    Post subject: Reply with quote

I'm using b2-0.6.1, only installed it a week or two ago. Is there a newer version of the hack? Has anyone else tried it with b2-0.6.1?
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1113
Location: Oregon

PostPosted: Thu Jan 02, 2003 11:02 pm    Post subject: Reply with quote

What changes did you make in the code? I don't see any significant changes.
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Armitage



Joined: 28 Dec 2002
Posts: 14

PostPosted: Sun Jan 05, 2003 7:12 am    Post subject: Reply with quote

That was the first time I even opened b2edit.form.php

after I got errors, I made that line spread over a few lines and I think something with one of the vars is causeing the error.
Back to top
View user's profile Send private message Visit poster's website
Benjy



Joined: 25 Jan 2002
Posts: 108
Location: Paris, France

PostPosted: Sun Jan 05, 2003 11:49 am    Post subject: Reply with quote

Latest release (2.2) is discussed in this thread: http://tidakada.com/board/viewtopic.php?t=978

Direct download link: http://newcomics.free.fr/b2/b2smilies_22.zip
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
blog17



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

PostPosted: Wed Jan 29, 2003 7:36 pm    Post subject: Reply with quote

Great hack! Works perfectly...

http://www.blog17.vze.com

Thnx
_________________
Check this out! The ULTIMATE site!
Back to top
View user's profile Send private message Visit poster's website
conga



Joined: 14 Feb 2003
Posts: 15
Location: CT

PostPosted: Sun Feb 16, 2003 1:23 pm    Post subject: Reply with quote

sorry to bring this back up, but when i put in the code, i get smilies from other site, where do i put the path to my smilies?
Back to top
View user's profile Send private message Visit poster's website
YankeeGrl



Joined: 10 Sep 2003
Posts: 3

PostPosted: Wed Sep 10, 2003 1:17 am    Post subject: Reply with quote

I really don't get this.. I dont have the b2edit.form.php.. I only have b3edit.php
Back to top
View user's profile Send private message Visit poster's website
epolady



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Wed Sep 10, 2003 1:50 am    Post subject: Reply with quote

YankeeGrl wrote:
I really don't get this.. I dont have the b2edit.form.php.. I only have b3edit.php

You should have a b2edit.form.php in your /b2-include folder.
_________________
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
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