• HEXUS
  • HEXUS.tv
  • channel
  • gaming
  • lifestyle
  • trust
  • community
  • ESReality
  • HEXUS.community discussion forumsVisit Corsair.com

    Welcome to the HEXUS.community discussion forums forums.

    You are currently viewing our boards as a guest which gives you limited access to view most discussions and other features. By joining our free community you will have access to post topics, respond to polls and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

    Go Back   HEXUS.community discussion forums > HEXUS.channels > HEXUS.opinions > HEXUS.suggestions

    HEXUS.suggestions got any kind words to say, issues to raise, or constructive suggestions to make about HEXUS.net

    Reply
     
    LinkBack Thread Tools
    Old 02-05-2004, 02:24 PM   #1 (permalink)
    I live in a giant bucket.
     
    eldren's Avatar
     
    Join Date: Jul 2003
    Location: South Africa
    Posts: 617
    Thanks: 0
    Thanked 0 Times in 0 Posts
    Smiley Parsing

    To insert smilies into our posts, we use specific phrases between colons (eek, mad, etc.) to denote the various images. However, when you use these within parenthesis, you may wind up with an unexpected result (This is an example. ). Of course, this can be worked around be putting a space between the end of the smilie and the closing parenthesis, but I'm sure I'm not the first to be tripped up.

    What I suggest is that, instead of first replacing the short colon-parenthesis, et al, smilie strings, the parsing engine be changed to first look for the colon-word-colon smilie types, and then the remaining short ones.

    Thanks for your time. semicolon-parenthesis

    eldren is offline   Reply With Quote
    Old 02-05-2004, 02:35 PM   #2 (permalink)
    Furry
     
    Shorty's Avatar
     
    Join Date: Jul 2003
    Location: Manchester, UK
    Posts: 1,237
    Thanks: 1
    Thanked 2 Times in 2 Posts
    Negative. The smilie parse doesn't work like that. Unless you fancy rewriting the way PHP uses perl regular expressions

    "In a world without walls and fences, who needs Windows and Gates?"
    Shorty is offline   Reply With Quote
    Old 02-05-2004, 02:37 PM   #3 (permalink)
    I live in a giant bucket.
     
    eldren's Avatar
     
    Join Date: Jul 2003
    Location: South Africa
    Posts: 617
    Thanks: 0
    Thanked 0 Times in 0 Posts
    Ahh. More's the pity, though. Thanks anyway. :>

    eldren is offline   Reply With Quote
    Old 02-05-2004, 03:14 PM   #4 (permalink)
    Crazy HEXUS.net
     
    Stoo's Avatar
     
    Join Date: Jul 2003
    Location: The Void.. Floating
    Posts: 10,416
    Thanks: 27
    Thanked 60 Times in 48 Posts
    Stoo's system
    We managed to get around it on Tangent21, but we have custom built our forums from the ground up..

    Not sure how much you'd want to hack about with the vBulletin guts, but I could ask our developer guy for the code if you wanted..

    Originally Posted by silent ben
    Nanotechnology is going to be huge.
    Stoo is offline   Reply With Quote
    Old 02-05-2004, 03:21 PM   #5 (permalink)
    Furry
     
    Shorty's Avatar
     
    Join Date: Jul 2003
    Location: Manchester, UK
    Posts: 1,237
    Thanks: 1
    Thanked 2 Times in 2 Posts
    Originally Posted by Stoo
    We managed to get around it on Tangent21, but we have custom built our forums from the ground up..

    Not sure how much you'd want to hack about with the vBulletin guts, but I could ask our developer guy for the code if you wanted..
    Im more than happy to .. it's just the way it's coded (efficently I might add), it's a total hackjob to bascially redo their parse engine and undo some very smart, clean work.

    "In a world without walls and fences, who needs Windows and Gates?"
    Shorty is offline   Reply With Quote
    Old 02-05-2004, 03:36 PM   #6 (permalink)
    HEXUS.net Webmaster
     
    Iain's Avatar
     
    Join Date: Jul 2003
    Location: UK
    Posts: 3,113
    Thanks: 1
    Thanked 0 Times in 0 Posts
    Are the smilies parsed using regular expressions on vBulletin ? Seems like overkill as str_replace is a lot faster and you always know what the full string to replace is going to be. In that instance then it would be relatively easy to do as you would change the order of the parsing so that all smilies with words between the colons are replace first and then the rest would be done.

    The same would be true for regular expressions if there was any way to influence the sequence in which the smilies were added to the patterns which are being replaced. If the smilies are in the databse then a sequence column could be added and the SQL which reads them modified to order by sequence

    Shorty is the expert on vBulletin though

    Iain is offline   Reply With Quote
    Old 02-05-2004, 03:53 PM   #7 (permalink)
    Furry
     
    Shorty's Avatar
     
    Join Date: Jul 2003
    Location: Manchester, UK
    Posts: 1,237
    Thanks: 1
    Thanked 2 Times in 2 Posts
    In VB2.x.x, they were parsed using str_replace.. my own smilies engine in my own code uses the same.

    With VB3.x.x, it's been changed. It's now using preg_replace() and preg_quote() to parse, to stop them being parsed in URL's and the such. (according to the comments in the parse functions).

    Right now, there is no order set for how they are pulled from the db. They are just built into arrays and then parsed in a loop.

    Thoughts?

    "In a world without walls and fences, who needs Windows and Gates?"
    Shorty is offline   Reply With Quote
    Old 02-05-2004, 08:38 PM   #8 (permalink)
    HEXUS.net Webmaster
     
    Iain's Avatar
     
    Join Date: Jul 2003
    Location: UK
    Posts: 3,113
    Thanks: 1
    Thanked 0 Times in 0 Posts
    ah, I see the need for preg_replace now. If there's no set order (and realistically vBulletin probably didn't see a need for it) then you'd need to do what I mentioned and add a sequence column.

    It's probably not worth the effort though but if you have access to the bug/feature request people for vBulletin it might be worth suggesting it for the next version.

    Also, looks like I may need to rewrite the Hexus smilie parser now as well

    Iain is offline   Reply With Quote
    Reply

    Breadcrumb
    Go Back   HEXUS.community discussion forums > HEXUS.channels > HEXUS.opinions > HEXUS.suggestions


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools

    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
    Trackbacks are On
    Pingbacks are On
    Refbacks are On
    Forum Jump



    All times are GMT. The time now is 07:16 AM.

    Any representations/statements made on the HEXUS.community discussion forums are the representations/statements of the author i.e. the person/organisation making them. If any such representations/statements are disputed they are a matter between the parties concerned. HEXUS Limited accepts no responsibility for any misrepresentations, inaccurate or false statements made by any person/organisation other than HEXUS Limited employees.
    Powered by vBulletin® Version 3.7.4
    Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
    Content Relevant URLs by vBSEO 3.2.0
    © Copyright 2008 HEXUS® Limited. All rights reserved. Unauthorised reproduction strictly prohibited.