Announcement

Collapse
No announcement yet.

smilies replacements bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • smilies replacements bug

    SMILIES

    Problem: If you have a longer smiliestext contain a shorter one, the longer one will not be displayed correctly

    Example: if you have 2 smiles: :) and :)) => your smilies will be displayed as and )
    see attachment for more examples

    Suggest solution:
    replace smilies text from the longest ones (order by LENGTH DESC)

    ORDER BY LENGTH( `smilietext` ) DESC in bbcodes_parse

    Related topic:
    http://www.vbulletin.com/forum/showthread.php?t=78303
    Attached Files
    Last edited by mtha; Wed 6 Aug '03, 3:00am.

  • #2
    replacement is based on display order rather than length.
    Scott MacVicar

    My Blog | Twitter

    Comment


    • #3
      because it's based on display order, so that you cant display :)) as another smilies. That's why I suggest to order by length.

      Originally posted by Scott MacVicar
      replacements are based on displayorder.

      If you want smilieX to be replaced before smilieY give it a lower displayorder.
      and replacement should not based on display order either.

      Display order is "Eyes catching order", depends on which one is better, more important, or used more frequently, then you want to display them first.

      Now, if you add, says 100 smilies, should you have to "reorder" the display order, everytime adding? and all the "strainge smilies" with longer smiliestext will be on top, too. That doesnt look nice, in my oppinion.

      Make it ordered by length pleassssssseeee , the replacement part is processed "underground", no one care if which one was replaced first, as long as all of them are displayed correctly.
      Last edited by mtha; Wed 6 Aug '03, 3:21am.

      Comment


      • #4
        what if you had say
        (this was good )

        you wouldn't want the longer ) smilie but a regular smilie and a closing bracket.

        if you use the way we have its impossible to use )

        both ways have there flaws and there is really no solution. Each way will accomodate different people.
        Scott MacVicar

        My Blog | Twitter

        Comment


        • #5
          Originally posted by Scott MacVicar
          what if you had say
          (this was good )

          you wouldn't want the longer ) smilie but a regular smilie and a closing bracket.

          if you use the way we have its impossible to use )

          both ways have there flaws and there is really no solution. Each way will accomodate different people.
          says if you have ) "before" in display order, you would still not be able to display the closing bracket (unless you add space in the between - says like you click on the smilies, there's space before and after the smilietext)

          It's just one example. If I have something like :)~ for example, or :oops: (same way as you use :cool: ) it would be replaces by ops:
          Some other examples showing that your mentioned problem is not eliminated if your replacements based on display:
          Examples: Hello <== I need Hello;) (or any text ending with ;)
          He saysont do it for He says:Dont do it

          so, replacement based on LEGNTH still has LESS trouble than by "display order", and more reasonable (as mentioned above). It does NOT add any problem if you have the same set of smilies, it just make the smilies work better.

          Also, as a function of vB, you are able to have many Smilie Categories, which mean you allow us to have the ablility to add a lot of smilies, right? should you ask us to re order eveytime we add a new smilie set? I bet it would happen the same, if you have smilie in category 1 that is substrings of some smiles in category 2


          Suggestion to completely solve the problem: suggest members to add spaces arount the smilies or click on smilies list table OR make it required for replacement (only replace smilietext that has spaces around)
          Last edited by mtha; Wed 6 Aug '03, 9:51am.

          Comment


          • #6
            Well, I just did it myself, if vB team thinks it'd help in smilies, please use it.

            in adminfunctions.php


            line 2087
            PHP Code:
             [indent]DEVDEBUG("Updating $table cache template..."); 

            $itemid $table.'id';
            $items $DB_site->query("SELECT * FROM " TABLE_PREFIX "$table ORDER BY imagecategoryid, [b][color=red]LENGTH( `smilietext` ) DESC[/color][/b], displayorder"); 
            [/
            indent
            and in functions_bbcodeparse.php


            line 350
            PHP Code:

                
            // we have to get the smilies from the database
                
            DEVDEBUG('querying smilies for parse_bbcode2();');
                
            $smilies $DB_site->query("
                 ### SMILIES BBCODEPARSE ###
                 SELECT smilietext, smiliepath, smilieid FROM " 
            TABLE_PREFIX "smilie
                 ORDER BY LENGTH( `smilietext` ) DESC
                "
            ); 

            Comment


            • #7
              Does this work in 3.01? Because I'm desperate for this hack. The smilies are messing up at my VB.

              Comment


              • #8
                Since this is 8 months old and from a beta version of vcB3 I'm siure the code has changed since then. For help with hacks and custom coding, please ask over at vbulletin.org.
                Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                Change CKEditor Colors to Match Style (for 4.1.4 and above)

                Steve Machol Photography


                Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                Comment

                Loading...
                Working...
                X