![]() | ![]() |
|
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! |
|
|||||||
| HEXUS.suggestions got any kind words to say, issues to raise, or constructive suggestions to make about HEXUS.net |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
I live in a giant bucket.
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
|
|
|
|
|
|
#2 (permalink) |
|
Furry
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?"
|
|
|
|
|
|
#4 (permalink) |
|
Crazy HEXUS.net
Join Date: Jul 2003
Location: The Void.. Floating
Posts: 10,416
Thanks: 27
Thanked 60 Times in 48 Posts
|
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
|
|
|
|
|
|
#5 (permalink) |
|
Furry
Join Date: Jul 2003
Location: Manchester, UK
Posts: 1,237
Thanks: 1
Thanked 2 Times in 2 Posts
|
Originally Posted by Stoo
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?"
|
|
|
|
|
|
#6 (permalink) |
|
HEXUS.net Webmaster
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 |
|
|
|
|
|
#7 (permalink) |
|
Furry
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?"
|
|
|
|
|
|
#8 (permalink) |
|
HEXUS.net Webmaster
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
|
|
|
|
![]() |
| Breadcrumb | ||||||
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|