vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need space before smiley (https://vborg.vbsupport.ru/showthread.php?t=66790)

kjell 07-02-2004 04:48 PM

Need space before smiley
 
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

Quote:

Originally Posted by kjell
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
PHP Code:

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
PHP Code:

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 :(


All times are GMT. The time now is 05:53 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01043 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete