ars aranea. the web, the way we make it. | |
Post discussion# Smiley JS ButtonsPosted: Jun 9, 2005, under WordPress, DHTML. Add a comment!This WordPress plugin allows you to display all the smilies in the default WP set as images next to your comment field. When you click on one of them it appends the code needed to produce that smiley to the comment field.
You can add a comment:
87 comments
| Important
Categories
Authoring
(1)Books (2)Cross platforms (2)DHTML (12)Graphical design (3)IT today (12)Morals&Politics (10)ODP (1)Random stuff (3)Romania (16)Security (7)SEO (2)Software (9)SQL (1)Standards (7)Technology (4)WordPress (4)[În română] (5)[This website] (2)Time-jump Syndication Need hosting?I've been a happy user of LunarPages since 2005. |
Copyright ©2005–2010 Zuavra | |
Hi, I used your clickable smileys plugin on my site, but instead of displaying the smiley images it displays the text.. like : lol : instead of :lol:. Do you know how I can fix this? Thank you!
germaine: It must not pick up the correct path to the images. Look at the source of the page and see what URL it uses for the images. Then try to obtain that image via the browser location bar. See how the two differ, that may give you a clue.
Use the latest version (1.1), 1.0 had a typo that may affect this.
It's possible you have installed WP in a subdir and the plugin doesn't pick things up correctly. If all else fails, edit the plugin file and set
$smilies_blog_urlby hand to a proper path.Thanks for that, version 1.1 fixed the problem :)
Hi,
i want to implement the smilie tollbar into my guestbook form, but when I use the function, the smilies won't be insert into the textarea.
What do I wrong?
Greetings
LeonDerProfi: See the instructions, under "Using the plugin". By default, the function expects the textarea to be called "comment". Make sure the textarea tag has a name attribute and pass the right name to the function (don't forget to use quotes).
Hi,
i tried it before like in your example above, but it doesn't works.
Here is my code:
<?php if (function_exists('SJB_outputSmilies')) {SJB_outputSmilies('comment');} ?><br /> <p><textarea name="comment" id="comment" cols="80" rows="10" tabindex="4"></textarea></p>What could be the problem?
LeonDerProfi: add an
alert()next to the call to the function and see if it pops up. Try loading your page in Mozilla or Firefox and look at the JS console debugger for clues. Check again if you really activated the plugin, sometimes I copy a plugin but forget to activate it.Yes, it is activated, because i already use this script for the comments in the blog. I don't know what you mean with the alert() function, because I habe no experience with PHP. But I tested the site with the js debugger an got many errors like that:
SJB_appendSmiley is not defined or some syntax errors. Maybe you can test the site by yourself and see what kinds of error there are:
http://www.arkadius-tencar.com/?page_id=22
I also looked up the comments template, but there's the code the same like in the guestbook and I have no problems with the comments…
LeonDerProfi: For some reason you seem to have
<br>tags inside the JavaScript code. This blows up the definition of the function so when smilies are clicked they have nothing to trigger. I'm guessing something is applyingnl2br()over the output of the PHP functionSJB_outputSmilies().ok, and what could I do now to solve that problem? :?
LeonDerProfi: I'm afraid I don't know what is producing that effect. It has never happened to me. Search the files in your template for "nl2br", perhaps you'll find a clue. Maybe it's an editor or authoring tool you're using. Maybe it's another plugin's fault.
Here's a workaround. Edit the SJB plugin file. Take everything inside the
<script></script>tags (without the tags!) and put them in another text file somewhere on your website, such as/sjb.txt. Then in their former place put the following:<script type="text/JavaScript" src="/sjb.txt"></script>Hopefully, this will cause the JavaScript code to escape the evil nl2br().
hm, i found no "nl2br" in the script and the external java file didn't work too. I think it's ok, the main thing is, that it works with the comments textarea in the blog.
Thanks for your help and for the plugin! I like that smilies! :)
Hi
the smilies works only when i'm logged in, how come? whats wrong?
Nevermind. when i put the function under the textbox it worked.
Great Plugin, I love and it was so easy to install. Thank you
:mrgreen:
I'll be more than grateful if you show me a way to active this plug with the ver. 1.5.2 of wordpress ..
doctoorh: Why, doesn't it work? Does it appear in the plugin list? What happens when you activate it?
I dunno, it appears in the plug list, and I active it correctly .. but when I go to comment I can't see the Smileys .. what shall I do ?! :(
hey, never mind
..
..
the problem was that I got the code from other blog, and it was wrong, I used yours now ..
and it worked so beautiful .. thank you very much
does this plugin make any request to the Database?
CoffeeMan: None whatsoever. It picks up the already available global array containing smiley-to-image pairs, flips it to obtain the reversed image-to-smiley pairs, and generates some JavaScript which runs on the client side.
Great plugin ! :)
You can add the following tips :
1- Edit files in "/wp-admin" directory "edit-form-advanced.php"/"edit-form.php"/"edit-form-comment.php"
2- Search the "textarea" just below the word "the_quicktags" and insert the line for the smileys. :)
You have the smyleys in the admin editor. :D
Last thing to say : I find a good fonction in the plugin "iimage-browser" to insert in your plugin : "InsertAtCursor". I can send you your plugin with this function inside. It works very well. :)
Leguims: Thanks, we'll talk via email shortly.
hello,i finished one of your "to do list":Detect cursor position and insert smilies accordingly instead of appending them.But sorry for support IE only now,You can download and test it.Thanks for your nice plugin.
Download Here
OMG!I read Leguims's comment,and wrote it again,now support all Popular browser like IE,FIREFOX
:lol:
download link same.
Sorry For Spam….And New Download Link is: Here
Plugin work just like origina one,but If you dont want to kiss good-bye to IE User,you must add some code to "textarea" tag:
onkeyup="storeCaret(this);" onclick="storeCaret(this);" onselect="storeCaret(this);"For Detail please go to: http://www.quakemachine.com/blog/php/wordpress/575/ ,sorry no english now,maybe later i will add it;But i think it's easy to anyone to add these code.
AvP: thanks a lot, I will start looking at it. It was file ID 20, BTW, not 19. :)
I'm still not very sure about basing the detection on browser name, I'd like to do it by examining if certain DOM elements exist.
Also cool would be a way to reuse the same JS functions that WP uses for the admin area.
But one way or another we'll do this. :)
rewrite again,no need add code to "textarea",install just like your plugin.
Download Here
Thanks, that's better. I'll incorporate it one of these days, as soon as I get some time.
I love the plugin and was wondering if there was any way to use different smileys, like those designed for the yahoo/msn smiley plugin?
Thanks!
Scott
Scott: this plugin only uses whatever smilies you already have. If you want to change your smilies you have to change your smiley set by hand. Check out this tutorial.
Hello, I just upgraded to Worpress 2.0, the plugin works fine in the comment area, but it does not work in the admin area because it is now using the ajax/wysiwig editor.
Am I the only one with this problem ?
xaqc: It's probably the same for everybody, but I heard lots of people consider the new WYSIWYG editor in WP2 slow and annoying and they turn it off. Perhaps it works with the old-style editor.
Maybe I missed reading about it but version 1.2 doesn't work correctly in WordPress version 2. The smileys' images don't show up.
The reason is because the default location for the smileys in WP 2 is in /wp-includes/images/smilies/
To fix that, open up "smileys_js_buttons.php" in your text editor and look for "/wp-images/smilies/" (without quotes) and replace it with "/wp-includes/images/smilies/" (without quotes). Save. That's it. Now it works in WP 2.
Keep up the good work!
If you have WP2.0 you can turn of the rich text editor in your "USERS" tab under your individual profile.
However I have changed all the directories for the comment smilies and I still do not have the images, only the text and Red X (only on IE).
Hello World!!!
:shock:
Cooooool!!! I must have one of this!!!
I installed the plugin and it works fine. The only problem is the thick nasty border around the images. It's in the default link colors (purple and blue) and I can't figure out how to get rid of it.
What should I do?
Alyssa: One simple solution is to edit your
style.cssand add this somewhere, preferably at the end:a img { border: 0 }It means that
imgtags insideatags should not have borders.Thank you so much!
I knew there must be a simple solution.. I feel so blonde now.
When I added the: it moved my sidebar down below the comments.
Robin, added the what? :)
after i installed the smileys the pictire error and the :name: of the smiles shows and i cant click on them but if i write in :name: they work…help please!?
shortii, so you're saying that they show up in posts and comments but not in the bar? Or just in posts, or just in comments? It would really help if you'd give me a live WordPress where I can see this happening. Until then, see my replies to germaine (top of the comment list on this page).
heres my wordpress url http://www.love-fiend.com/wp
ok scratch everything i asked…i figured most of it out…..now the only problem im having is clicking on the smilies to put into form???
I think I know what's wrong. You called
SJB_outputSmilies('')that is with a blank string as parameter. You shouldn't do that, either pass something in the string or just use(). If you look at your comment page source as compared to mine (this one), you'll notice that my JavaScript definition forfunction SJB_appendSmiley(text)tries to grab the comment field using the "comment" id, whereas yours just uses an empty string and ends up grabbing who knows what page element (I think it grabsdocumentor something :)).yup that was the problem thanks!
I'm having a problem. The images are not working in the actual comments. The row shows up below the text box though. Any ideas? This is happening in WP2.
Laura, in WP2 the smilies were moved. You will have to modify the plugin before you put it on your site. First, get at least version 1.3. Then look for a line like this:
And change it to:
Ok. I did that. They are still not working. The regular ones such as :) and ;) work but any others- like
don't work.
I believe it has to do with another plugin that I have installed- custom smilies. I'm working on a fix now. Thanks!
I love this plugin
I was wondering, how to add the smilies of my choice.
Maggie, please read the presentation article. It has a section explaining how you can use your own smilies.
i used the latest version you have and i got the same problem as your first poster(germaine)…
Jameson, you must be using WP 2. The plugin still uses the old 1.5 path to the smilies, which was
/wp-images/smilies/. You need to edit the plugin and change line 43 to/wp-includes/images/smilies/.Later: Fixed, please download version 1.4 and let me know how it works. It should be able to detect the proper smiley dir on its own.
Alright, 1.4 worked perfect, the smiles look sweet ! Thanks Skippy !!!
Alright then, glad to hear it's working, and glad that your comment prompted me fixing some long-standing issues with this plugin. :)
Good evening,
I recently upgraded to version 2.0.6 and although I have my own smilies in the smilie folder, they seem to have been overridden by the default smilies which I have removed from the smilie folder. I've also checked the vars.php file and it seems to be fine. Was hoping you might be able to help.
Maggie, unfortunately I got burned myself by this one. It probably has nothing to do with the plugin. The upgrade procedure from WP 2.0.5 to 2.0.6 recommends to completely delete and re-upload the
wp-includes/directory, and that's where your custom smilies (and mine) were being kept.So they're gone right now and I for one will restore them from backup when I get home. Hope you got a backup as well.
doesn't work on Firefox
sandynata, the JavaScript used is very basic, it should work in pretty much all versions of Firefox. What version are you using? Please check that you're not blocking JavaScript somehow. Also make sure you're using the latest version of this plugin. The latest versions will let you know if JavaScript is not activated.
Hi, thanks for the plugin. Works fine, is simple and light, I like it :)
For adding the smileys to the admin pages without editing the admin php files, I did the following modifications to smiley_js_buttons.php (just after the "SJB_getSmilies();" call) :
add_action("dbx_post_sidebar", SJB_add_box, 1);
add_action("dbx_page_sidebar", SJB_add_box, 1);
function SJB_add_box() {
?>
Custom Smileys
Hi, me again.
I managed to insert a function in the "the_editor" action hook, and now the smileys are found above all 'content' text edit boxes (write, edit and edit comments), without modifying the wordpress source code.
I mailed you the file, but if you did not get it mail me if you want and I'll send them to you.
Regards,
LaTomate.
HI, yes my me its the same problem it only appears the text
not the smilie in the comment. Plsease help me, thx
Hello,
its me again, sorry for my bad english but i try to explain my problem again for better understanding :
Well, rather i have exact the same problem like youre first poster (germaine), but i have installed the newest version (1.4) and followed youre Installation tutorial
but it doesnt works correctly, hmm would be nice when you help me
, thanks !
peter
Sorry for taking longer to respond lately. LaTomate, thanks for the idea, I'll definitely look into it. Peter, it's pretty hard to debug WP remotely. :) Follow the advice I gave germaine about how to tell what's going wrong and get back to me with more info about how it went.
Okay, Since Wordpress have been upgrade to version 2.2, that means Smiley JS Button plugin is now broken and show some errors like this:
Warning: array_flip() [function.array-flip]: The argument should be an array in wp-content/plugins/smiley_js_buttons.php on line 59
Warning: array_map() [function.array-map]: Argument #2 should be an array in wp-content/plugins/smiley_js_buttons.php on line 59
Just thought let you know about that.
Thanks, Levi. I plan to upgrade to 2.2 as soon as I get my hands on some spare time, at which point I'll update the plugin as appropriate.
Hope you will update the plugin as soon as possible. It was useful and I liked it so much.
Thanks for your share :)
I can't wait for the newest version of this plugin, which is compatible with WP 2.2!
do u have a smiley buttons for ragnarok online emoticons?
although i'm still waiting for your updates. i'm also using WP2.2
Will you update the code soon?
I can't wait anymore…
No sooner than about 2 weeks, I'm afraid.
Your plugin stops working on WP v2.2
But there is a simple fix: move call to SJB_getSmilies() on line #33 to line #64.
It's better this way, since smilies array are not initialized if not required (that is, only when displaying the comment form).
Another solution is to call smilies_init() within the function SJB_getSmilies()
Thanks a lot, Boriel. :)
I am curious to know how to fix the line 59 problem with wordpress 2.2?
Still waiting anxiously waiting for a fix for the array_flip()
I'm dying to give this a try.
Thanks!
Strangely enough, it's been working perfectly for me, even though I've updated this site to WP 2.2.x at some point.
Nevertheless, the suggested fix is sensible no matter the WP version. Bottom line is, version 1.5 should work with WP 2.2 now. Please download it and report if there are problems.
ok?
look nice though…
testing
Hello, for some reason the smileys are not loading at all in my comments. I am not receiving any errors or anything, and I've copied the correct code. For some reason, the bar is just absent. Help? Oh yes, I am using the latest version of WP.
Ah, it's upgrade time again. :) I'll look into it, but I don't know when. Upgrading to WP 2.3 is a bit low on my priorities right now.
just checking out the images
Hi there. I have a problem with the plugin. When I activate it and write the code line in the comment.php, I get this sense in the pages:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/vhosts/xxxxx.com/httpdocs/blog/wp-content/themes/mainfield/comments.php on line 100
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/xxxxx.com/httpdocs/blog/wp-content/themes/mainfield/comments.php on line 105
Can you tell me which is the matter? I like your plugin, but can't use it
I like this
Thank you!