vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Smilie Code Not Functioning Properly (https://vborg.vbsupport.ru/showthread.php?t=50636)

Sunshine 03-22-2003 01:56 PM

Smilie Code Not Functioning Properly
 
I've looked high and low here and no one seems to have posted about this problem before.

On my site, the smilie code is not functioning properly.

For example -
;p is a tongue face and...
;puke is of course a puking face

The problem is, the puke face never comes up. Instead what we get is the tongue face. It's not reading past the p for some reason.

The same thing is true with codes that are similar but differentiated by a 2 or 3 at the end. For example -
;welcome would be the first welcome smilie
;welcome2 would be the second welcome smilie

When you type the code for the second welcome smilie, you get the first welcome smilie with a 2 next to the image.

Any insights or suggestions would be much appreciated. We were using version 2.2.9 but upgraded to 2.3.0 last night and that did not fix the problem.

amykhar 03-22-2003 02:04 PM

That happens at my board too. My workaround would be to name ;puke ;vomit instead. The smilie replacement code seems to work like a bad naughty word filter that would bleep out a word like assess.

Amy

Xenon 03-22-2003 02:17 PM

i haven't tested it, because i don't have this problem (not using that much smilies ^^)

but i think this would work:

open admin/functions.php

find:
PHP Code:

  if($dosmilies) {
    
$bbcode=str_replace(">)""> )"$bbcode);
    
$bbcode=str_replace("<)""< )"$bbcode);
    if(!isset(
$smilies)) {
      
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
    } else {
      
$DB_site->data_seek(0,$smilies);
    }

    while (
$smilie=$DB_site->fetch_array($smilies)) {
      if(
trim($smilie[smilietext])!="") {
        
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode);
      }
    }
  } 

and change it to:
PHP Code:

  if($dosmilies) {
    
$bbcode=str_replace("&gt;)""&gt; )"$bbcode);
    
$bbcode=str_replace("&lt;)""&lt; )"$bbcode);
    if(!isset(
$smilies)) {
      
$smilies=$DB_site->query("SELECT smilietext,smiliepath,LENGTH(smilietext) AS lgt FROM smilie ORDER BY lgt DESC");
    } else {
      
$DB_site->data_seek(0,$smilies);
    }

    while (
$smilie=$DB_site->fetch_array($smilies)) {
      if(
trim($smilie[smilietext])!="") {
        
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode);
      }
    }
  } 


Sunshine 03-22-2003 03:52 PM

Thank you very much! That did the trick! :cool:

amykhar 03-22-2003 04:00 PM

Xenon, you should release this as a bug fix over at the .com site and here. Everybody's board has this problem.

amykhar 03-22-2003 04:04 PM

Woah! Big bug. Installing this hack removes MANY of my smilies.

Some that were missing started with ! Not sure if that is the only problem though.

Xenon 03-23-2003 04:24 PM

huh?

normally no smilies should disappaer, because the fix just changes the order smilies are get out of the db...

amykhar 03-23-2003 04:31 PM

Not sure what it is doing, but with the code in, I have 2 pages of smilies in the control panel. With it out, I have about 10 pages.

Amy

Xenon 03-23-2003 04:36 PM

it is just that line:
PHP Code:

      $smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie"); 

which was changed, and as you can see, the new code:
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smiliepath,LENGTH(smilietext) AS lgt FROM smilie ORDER BY lgt DESC"); 

couldn't change the ammount of smilies.

but as said, it's just a quickfix of the bug above, i don't know if the smilies are preloaded somewhere which could produce the bug at your board.....

i've posted it over at vb.com for the developers to look into it.


All times are GMT. The time now is 09:20 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.01062 seconds
  • Memory Usage 1,740KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete