News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Quote tags not recognized

Started by Burpee, July 05, 2004, 09:39:00 AM

Previous topic - Next topic

packman

#20
Quote from: [Unknown] on August 18, 2004, 02:32:01 AM
Can you try this query in phpMyAdmin?

SELECT post_text, REPLACE(post_text, CONCAT(':', bbcode_uid), '')
FROM phpbb_posts_text
WHERE post_id = 32540
LIMIT 1;

-[Unknown]

Before:

[quote:6932865ed6="Vergil83"][quote:6932865ed6="windy"]
but chris is away again for a week (he is a very busy guy!)[/quote:6932865ed6]
i found chris  :lol:  http://news.bbc.co.uk/1/hi/england/3545218.stm[/quote:6932865ed6]
I told the BBC that I didn't want any publicity so they put someone else's picture on the web site. This is me....

[img:6932865ed6]http://www.weather-watch.com/chris.jpg[/img:6932865ed6]


After:

[quote="Vergil83"][quote="windy"]
but chris is away again for a week (he is a very busy guy!)[/quote]
i found chris  :lol:  http://news.bbc.co.uk/1/hi/england/3545218.stm[/quote]
I told the BBC that I didn't want any publicity so they put someone else's picture on the web site. This is me....

[img]http://www.weather-watch.com/chris.jpg[/img]

Chris

packman

I've just taken a look at some records migrated to SMF that have quotes in them. If I look at a migrated record in SMF that has a quote in it, I get the [ quote="metoo"] at the start of the quoted string but not the [ /quote] at the end of the string.

However, if I modify a message that contains a quote, the editable message text shows the [ /quote] in the correct place. When I save the unedited message back, the quoting is miraculously fixed. Looking at examples of the SMF message record before and after modifying/saving shows...

Before

[quote="windy"]i am willing to change the way these numbers are calculated, instead of being :
the coldest or warmest temperature[/quote]


After

[quote=&quot;windy;&quot;]i am willing to change the way these numbers are calculated, instead of being :<br />the coldest or warmest temperature[/quote]

So there seem to be two things going on...

1) The double quotes are being translated into &quot's. I've manually modified a record to include &quot and it then seems to display correctly in SMF.

2) End of lines are being translated into <br /> tags.

The first of these appears to fix the quoting problem, but I'm wondering if the second translation will have some currently unidentified impact?
Chris

[Unknown]

Wait, the converter doesn't change \n to <br />??  It should always do that.

It should also have the &quot;'s in the message - these are expected, and should be parsed fine:

Quote from: meSomething...
(in the database, that will show as [ quote=&quot;me&quot; ]Something...[/ quote ])

It looks like it should be converted properly, I'm not sure why it would ever remove the [ /quote ].  The "after" is what *should* be used in the "body" column on the messages table... it should not at all be stripping anything...

As for the fixing, SMF automatically does that when you post/edit...

-[Unknown]

packman

The converter code doesn't appear to do very much to the body text of each message. It seems to simply transfer the content of the phpBB message body straight into the SMF body text field after removing the bbcode_uid values. So no &quot or <br /> conversions are carried out.
Chris

[Unknown]

Quote from: packman on August 20, 2004, 07:59:27 AM
The converter code doesn't appear to do very much to the body text of each message. It seems to simply transfer the content of the phpBB message body straight into the SMF body text field after removing the bbcode_uid values. So no &quot or <br /> conversions are carried out.

Right, and I just fixed that... however, if it's not doing any of that, it's surely not removing the
Quote
's!

-[Unknown]

packman

Quote from: [Unknown] on August 20, 2004, 07:50:09 PM
however, if it's not doing any of that, it's surely not removing the
Quote
's!

The converted data in the smf_messages file contains both the incorrectly formatted start tag and the correctly formatted end of quote tag.

It's when the messages are displayed by SMF that the code formatting the message for display isn't recognising the incorrectly formatted start of quote tag and therefore displays it as if it were normal message text. The message formatting code does recognise the end of quote tag and presumably doesn't display it. So you see the start of quote tag, but not the end of quote tag.
Chris

[Unknown]

Ah, I undertstand.  So the [ /quote ] was there, it's just that it's not parsing it.  Okay, that makes sense....

In the converter, find:
'body' => "REPLACE(pt.post_text, CONCAT(':', pt.bbcode_uid), '')",

Which should be:
'body' => "REPLACE(REPLACE(REPLACE(pt.post_text, CONCAT(':', pt.bbcode_uid), ''), '\\n', '<br />'), '\"', '&quot;')",

Not to mention:
'signature' => "REPLACE(user_sig, CONCAT(':', user_sig_bbcode_uid), '')",

Which might also better be:
'signature' => "REPLACE(REPLACE(REPLACE(user_sig, CONCAT(':', user_sig_bbcode_uid), ''), '\\n', '<br />'), '\"', '&quot;')",

Does that resolve it?  By the by, how fluent are you in PHP?

-[Unknown]

packman

Quote from: [Unknown] on August 21, 2004, 03:07:17 PM
Does that resolve it?  By the by, how fluent are you in PHP?

You're a star...it does solve it  :D :D :D

I've not coded much PHP, but I know the language well enough to act as a debugger for other people's code. I can often identify which bit of code is causing a problem and sometimes suggest a fix. I usually come unstuck with writing fixes because I don't know how the whole system works, e.g. exactly what database fields are used for or exactly how system/API calls function.

I'm from the old school of programming...I've used dozens of languages since I first entered my first bits of binary machine code onto a 256 byte Intel 4004 system way back in 1976. Once you've seen a few languages you can usually make sense of new languages fairly quickly!
Chris

[Unknown]

I've never done machine code, but I did do a fair amount of assembly... wrote a PCX loader completely in it which I was quite proud of ;).

-[Unknown]

packman

Seriously off topic...

I wrote a RTTY (Radio Telex using Baudot code) terminal program in assembler way back in the early 80's. The machine I was using didn't have timers available so I had to count machine cycles in a timing loop for code to detect and create the two frequencies that were used. I had no way to test it, so once it was written I put it out on air. I was stunned that I could decode other signals and they could decode mine. The only mistake I made was to transpose a couple of letters in my code lookup table.

Real time programming without interrupts was tricky, but fun. For example, I had to use the machine cycles avilable whilst the stop bits were being sent to do all the display/keyboard handling! Luckily RTTY only ran at 45.45baud, so I had around 30mS to do all the user interaction ;)

PHP is easy by comparison  :P
Chris

[Unknown]

How would you like to take a whack at some of the other problems in the phpBB converter if I give you where and a basic gist of how to fix them?

It would save me a lot of time, make them get done faster, and if you have the time to do it you seem to be more than knowledgable enough (about phpBB and about PHP) to do so.

-[Unknown]

packman

I've started to mod the converter to try to add in the bits that I requested. I've got the code in to migrate the phpBB ranks and just need to add a check to make sure there are some ranks in phpBB before I wipe out the default SMF post based groups.

I'll try adding the other stuff I requested and if I can do that I'll hopefully learn enough about the converter to have a go at tackling any other problems that are awaiting fixes.

I'll get back in touch when I've made some more progress.

Just one question...which I should have asked before I started modding...has any code in the converter been changed since RC1 was released, i.e. am I working from a valid version? I've got the quote tags fix as described in this thread in my version.
Chris

[Unknown]

You're working on an older version, but I can use the repository to merge in the changes made since...

-[Unknown]

packman

At what point is it worth trying the merge?

So far I've added extra steps to migrate phpBB post based ranks and groups (but not added users to groups or set up board permissions using the groups yet). Are the mods in the repository applicable to RC2 (or whatever comes next), or would the converter still work with RC1? I'm just conscious that the work I've done so far is essentially adding new code, but I think I will have to start modding more existing code to add users to groups. Is it worth me working on the latest code from the repository or carrying on with what I'm doing?
Chris

[Unknown]

All of the changes made since RC1 should be fine to convert even to RC1; so yes, I can merge changes in and it won't conflict with RC2/1.1.

Some of the major changes were described here.  If you want, I can give you a diff file. (or the latest code, although it'd be easier for me to merge your changes in with cvs than otherwise, I'd guess.)

-[Unknown]

packman

I made some more mods last night that aren't fully finished/tested yet. When I get to my next stable version perhaps you could do the merge and then let me have a copy of the latest code to continue the mods?

I'm part way through doing the groups/permissions migration. After that I'm going to look at migrating all of the installed phpBB smileys. Hopefully, I'll have enough experience of the code by then to tackle any outstanding bugs.
Chris

packman

It's probably time for a merge with the repository...and some pointers at known problems to take a look at. So far I've added the following new features...

- Migration of phpBB2 Ranks as SMF Post Based MemberGroups. These are migrated before members are imported so that people end up in the correct groups. The first 5 new groups get 1 to 5 stars and then every other group just gets 5 stars (otherwise things get silly!) Post Based Groups are not given any board access/permissions when the boards are migrated.

- Migrate phpBB2 Groups as non-Post Based SMF MemberGroups. To avoid name clashes the AdditionalGroups are prefixed with 'phpbb2_'. The prefix can be removed manually (if required) after migration.

- Migrate SMF Members into the correct phpBB2 Groups. Note that you'll still need to set up the permissions for the new groups. I've had a brief look at mapping permissions from phpBB2 to SMF and it's quite tricky!

- Migrate phpBB2 avatars as SMF avatars. The SMF Member record is given the correct avatar and all the avatar files are copied from the phpBB2 directories to an appropriate SMF directory. phpBB2 gallery avatars are placed in a directory of the same name under '...smf/avatars'. phpBB2 uploaded avatars are placed in a directory called '.../smf/avatars/phpBB2/'

- Migrated the phpBB user setting that hides the email address from public view

- Migrated the phpBB user setting that allows the user to hide their online status

- Migrated the phpBB user timezone setting

- Inactive phpBB users are now marked as inactive SMF users. The registration processes are different between the two systems, so inactive users will have to be manually activated in SMF if required.
Chris

[Unknown]

Quote from: packman on August 30, 2004, 05:06:52 AM
- Migrate phpBB2 Groups as non-Post Based SMF MemberGroups. To avoid name clashes the AdditionalGroups are prefixed with 'phpbb2_'. The prefix can be removed manually (if required) after migration.

I'm not sure I understand; is this only to prevent converting an "Administrator" group?  Unless I'm mistaken, it's perfectly valid to have two groups with the same name.

Quote- Migrate SMF Members into the correct phpBB2 Groups. Note that you'll still need to set up the permissions for the new groups. I've had a brief look at mapping permissions from phpBB2 to SMF and it's quite tricky!

Certainly so... but maybe we/you/us can come up with something ;).

Quote- Migrated the phpBB user timezone setting

How correctly is this migrated ^_^?  SMF stores it as a time offset, instead of a GMT offset....

Sounds good, though.... you can send it to me at [email protected] (I'd prefer attachments by email) and I'll look at it..

-[Unknown]

packman

Whilst phpBB can have a Rank and a Group with the same name, SMF doesn't appear to allow this, i.e. I can't persuade Admin Centre to create a Regular Group and a Post Based Group with the same name. I guess I could probably create two SMF groups with the same name by direct database inserts in the convertor. However, phpBB ranks are purely descriptive, i.e. they can't grant permissions like in SMF, and I've assumed that the additionalGroups will be used for setting permissions, so I thought it safest to avoid any confusion between groups of the same name.

Being a GMT based being, I tend to forget that people do different things with timezones and time offsets :( I've removed that for now.

Permissions...I gave up on this until I got a better feel for how SMF permissions work. SMF permissions are a lot more flexible than phpBB permissions, but also spread across a number of tables. I tried working out what went into which table, but got more than a little confused :(

An email will be on it's way after I post this.
Chris

Burpee

I'm guessing the following is related to this topic:

http://forum.vuurwerklook.com/index.php/topic,344.0.html
Quote[size=14]Tijdszones[/size]

I'm thinking it doesn't recognize the tags because it doesn't specify px or pt.
So there's two things:
1. What do I do to fix this for my forum?
2. Does the phpBB2 to SMF convertor change this correctly? The size in phpBB is in px by default (I checked)

Advertisement: