View Full Version : Need space before smiley
kjell
07-02-2004, 04:48 PM
Hi all !
I don't want smilies in posts unless there is a space in front of the smiley code. I first tried to add the space in the ACP to every smiley but it seems like it's ignored so I guess it's removed by default.
Then I had a look in functions_bbcodeparse.php under the PARSE SMILIES section and tried to add a space in the replace function but neither did that help.
Can someone guide me where to change so only smilies with space in front will actually parse and shows up as icons in the posts.
Thanks in advance for any input.
Karthick
07-02-2004, 06:12 PM
Hi all !
I don't want smilies in posts unless there is a space in front of the smiley code. I first tried to add the space in the ACP to every smiley but it seems like it's ignored so I guess it's removed by default.
Then I had a look in functions_bbcodeparse.php under the PARSE SMILIES section and tried to add a space in the replace function but neither did that help.
Can someone guide me where to change so only smilies with space in front will actually parse and shows up as icons in the posts.
Thanks in advance for any input.
Try and add the space from the ACP. Maybe instead of a space, you could try (non breaking space).
Karthick
07-02-2004, 06:15 PM
By the way, if you are posting some sort of table or code data and you don't want smilies to appear you can deselect "show smilies" in your post and smilies will not show at all for that post.
Andreas
07-02-2004, 06:25 PM
Adding a space from ACP won't help as the parse function will remove it.
Try this instead:
In functions_bbcodeparse FIND
if (!$dohtml)
{
$smilie_find[] = htmlspecialchars_uni(trim($smilie['smilietext']));
}
else
{
$smilie_find[] = trim($smilie['smilietext']);
}
// if you change this HTML tag, make sure you change the smilie remover in code/php/html tag handlers!
if ($iswysiwyg)
{
$smilie_replace[] = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"$smilie[title]\" smilieid=\"$smilie[smilieid]\" />";
}
else
{
$smilie_replace[] = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"$smilie[title]\" />";
}
REPLACE that with
if (!$dohtml)
{
$smilie_find[] = htmlspecialchars_uni(' ' . trim($smilie['smilietext']));
}
else
{
$smilie_find[] = ' ' . trim($smilie['smilietext']);
}
// if you change this HTML tag, make sure you change the smilie remover in code/php/html tag handlers!
if ($iswysiwyg)
{
$smilie_replace[] = " <img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"$smilie[title]\" smilieid=\"$smilie[smilieid]\" />";
}
else
{
$smilie_replace[] = " <img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"$smilie[title]\" />";
}
Please note that this code-block appears twice. Both instances must be changed.
kjell
07-02-2004, 06:40 PM
Karthick, I know I can disable smilies in posts but all users do not think of this and it looks funny when there's smilies in the middle of some words.
KirbyDE, that's simular to what I did in functions_bbcodeparse but never got it to work and it seems like it's not working with the above code either.
I actually removed the entier *** PARSE SMILIES *** section out and it still parses smilies in posts so I'm not sure I'm at the right place.
Andreas
07-02-2004, 06:47 PM
Umm ... does work on my local testboard.
If you removed the whole section then there shouldn't be smilies at all, so I can only guess you did smth. wrong, maybe uploaded the file to a wrong directory?
kjell
07-02-2004, 06:51 PM
I'll do a better check and see...
kjell
07-02-2004, 07:05 PM
Well, sometimes DWMX don't upload files if thinks there's no difference, so I tried another FTP client but the smilies are still there.
However, I went back to the ACP and removed my spaces in front of the smilies and now your code works fine KirbyDE.
I should have checked that before I tried to customize the code.
Many thanks for the help :D
Bellinis
11-01-2005, 07:57 AM
In 3.5 we are facing the same problem now.
Can anybody tell me how I could add a space before a smiley?
Bellinis
11-12-2005, 09:16 AM
Anyone pleaaaase :(
BucShot
04-18-2010, 03:41 PM
You need to edit vbulletin_textedit.js in the clientscript directory as outlined in this thread.
https://vborg.vbsupport.ru/showthread.php?t=178145&highlight=smiley+space
You'll probably also want to download the uncompressed version of vbulletin_textedit.js by going to http://members.vbulletin.com --> Download vBulletin and click More Download Options and look for the option to include the uncompressed javascript towards the bottom of the page.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.