View Full Version : PHPBB2 importer issues (smilies)
OmerE
Thu 22nd Jul '04, 1:28pm
Hi,
The phpbb2 importer does not import smilies properly, due to differences
in parsing between the VB smiley and phpBB2 smiley systems.
In phpbb2 the system can differentiate between:
:0: and
:0.
When VB encounters something like
:0: it will just pick
up on the first match, that being
:0.
Any plans to solve this? I guess either by changing the VB matching to look
for a complete match, or have the importer parse every single post body
and fix references so that they do not appear ambiguous to the VB parsing
system?
Thanks.
Scott MacVicar
Thu 22nd Jul '04, 10:47pm
If you change the displayorder so that :0: has a lower number than :0 it will be sorted.
OmerE
Fri 23rd Jul '04, 10:03pm
If you change the displayorder so that :0: has a lower number than :0 it will be sorted.
I just tried it, doesn't work (I fail to see why the the display order should
in any way change the way the post body is parsed). Even if it
did work, this would prevent me from being able to arrange the
smilies display the way I want.
Any other suggestions?
Thanks.
OmerE
Sat 24th Jul '04, 4:39pm
I just tried it, doesn't work (I fail to see why the the display order should
in any way change the way the post body is parsed). Even if it
did work, this would prevent me from being able to arrange the
smilies display the way I want.
Any other suggestions?
Thanks.
Replying to myself here...
Scott, thanks again for the reply. I just noticed that the smilie ordering
in the smiliecache is based on the image category as well - hence why
doing as you suggested did not help until both image categories were
merged, as the smilies from phpBB2 get imported into a new category.
However, is there a reason not to have the smilies sorted within the
smilie cache based on the length, and not the display order?
This would solve the problem of "conflicting" smilies. If I use the display
order, I am unable to choose the order in which I want them to appear, as
it is required for proper parsing.
Thanks,
Omer.
Scott MacVicar
Sat 24th Jul '04, 5:09pm
Read the last entry in this bug report: http://www.vbulletin.com/forum/bugs.php?do=view&bugid=1457
OmerE
Sat 24th Jul '04, 5:19pm
Read the last entry in this bug report: http://www.vbulletin.com/forum/bugs.php?do=view&bugid=1457
Thanks.
I replied there with my solution, I'll paste it here as well:
I'd like to offer what I think is the proper fix for this.
I believe smilies need to be sorted based on display order for the image
categories, not the categoryid - as the categoryid is not something
the user (admin) is able to control.
I modified the code that builds the image cache to take this into account like so (I'm not sure I'm allowed to include the whole "build_image_cache()" function code here, so the bit I'm pasting here replaces the existing "items =" line in that function):
From 'adminfunctions.php': this also needs to be fixed in functions_bbcodeparse.php in case the datastore does not contain the serialized cache.
$query_modifier = ($table == 'smilie') ? "LENGTH(`smilietext`) DESC, " : "";
$items = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "$table i, " . TABLE_PREFIX . "imagecategory c WHERE i.imagecategoryid=c.imagecategoryid ORDER BY c.displayorder, " . $query_modifier . "i.displayorder");
The $query_modified bit also sorts the smilie table so that length takes precedence, to address the specific smilie parsing issue mentioned above (as FASherman suggested).
Works for me.
Thanks again,
Omer.
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights