Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2004, 04:48 PM
kjell kjell is offline
 
Join Date: Jun 2004
Location: Sweden
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-02-2004, 06:12 PM
Karthick Karthick is offline
 
Join Date: Mar 2004
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 07-02-2004, 06:15 PM
Karthick Karthick is offline
 
Join Date: Mar 2004
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-02-2004, 06:25 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 07-02-2004, 06:40 PM
kjell kjell is offline
 
Join Date: Jun 2004
Location: Sweden
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 07-02-2004, 06:47 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 07-02-2004, 06:51 PM
kjell kjell is offline
 
Join Date: Jun 2004
Location: Sweden
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll do a better check and see...
Reply With Quote
  #8  
Old 07-02-2004, 07:05 PM
kjell kjell is offline
 
Join Date: Jun 2004
Location: Sweden
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 11-01-2005, 07:57 AM
Bellinis's Avatar
Bellinis Bellinis is offline
 
Join Date: Aug 2005
Location: Amsterdam, the Netherland
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In 3.5 we are facing the same problem now.

Can anybody tell me how I could add a space before a smiley?
Reply With Quote
  #10  
Old 11-12-2005, 09:16 AM
Bellinis's Avatar
Bellinis Bellinis is offline
 
Join Date: Aug 2005
Location: Amsterdam, the Netherland
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone pleaaaase
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:47 PM.


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.04188 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete