Text formatter differences
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Re: Text formatter differences
I think we're just using a different terminology. You start with the original text, then it is parsed and serialized into another format (kind-of HTML in 3.1, XML in 3.2), then it's stored in the database for a while before it is rendered into HTML whenever it's displayed.
It doesn't matter whether you modify the data before or after it's saved to the database, what's important is that once the original text has been parsed you need to be careful not to break the format it's been serialized to. In the snippet you posted I can see there's some HTML in the middle of the XML, which would prevent it from being read. That's why it's best to stick to modifying either the original text or the rendered HTML.
It doesn't matter whether you modify the data before or after it's saved to the database, what's important is that once the original text has been parsed you need to be careful not to break the format it's been serialized to. In the snippet you posted I can see there's some HTML in the middle of the XML, which would prevent it from being read. That's why it's best to stick to modifying either the original text or the rendered HTML.
Re: Text formatter differences
Well I know this change will effect quite a few extensions. Chat extensions, a few of mine and apparently one of David's.
For others that care, using this
it then gets displayed correctly but, naturally, fails for 3.1.9. ***sigh***
Thanks for the clue JoshyPHP
For others that care, using this
Code: Select all
$url = $this->root_path . 'memberlist.' . $this->php_ext . '?mode=viewprofile&u=' . $this->user->data['user_id'];
$color = $this->user->data['user_colour'];
$user_name = $this->user->data['is_registered'] ? '[url=' . $url . '][color=#' . $color . ']' . $this->user->data['username'] . '[/color][/url]' : $data['username'];
Thanks for the clue JoshyPHP
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: Text formatter differences
So just include then full url?
- 3Di
- Registered User
- Posts: 951
- Joined: Tue Nov 01, 2005 9:50 pm
- Location: Milano 🇮🇹 Frankfurt 🇩🇪
- Contact:
Re: Text formatter differences
Yup, do you mean it could be better to..
Code: Select all
/**
* Use this event to change the output of get_username_string()
*
* @event core.modify_username_string
* @var string mode profile|username|colour|full|no_profile
Free support for our extensions also provided here: phpBB Studio
Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Re: Text formatter differences
https://github.com/rmcgirr83/contactadm ... #L267-L276
Code: Select all
if (phpbb_version_compare($this->config['version'], '3.2.0-b2', '>='))
{
$url = $this->root_path . 'memberlist.' . $this->php_ext . '?mode=viewprofile&u=' . $this->user->data['user_id'];
$color = $this->user->data['user_colour'];
$user_name = $this->user->data['is_registered'] ? '[url=' . $url . '][color=#' . $color . ']' . $this->user->data['username'] . '[/color][/url]' : $data['username'];
}
else
{
$user_name = $this->user->data['is_registered'] ? get_username_string('full', $this->user->data['user_id'], $this->user->data['username'], $this->user->data['user_colour']) : $data['username'];
}
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: Text formatter differences
Code: Select all
$url = generat_board_url() . 'memberlist.' . $this->php_ext . '?mode=viewprofile&u=' . $this->user->data['user_id'];
$color = $this->user->data['user_colour'];
$user_name = $this->user->data['is_registered'] ? '[url=' . $url . '][color=#' . $color . ']' . $this->user->data['username'] . '[/color][/url]' : $data['username'];
- 3Di
- Registered User
- Posts: 951
- Joined: Tue Nov 01, 2005 9:50 pm
- Location: Milano 🇮🇹 Frankfurt 🇩🇪
- Contact:
Re: Text formatter differences
Perhaps Paul refers to the cases: profile and no_profile.
That usually are managed by auths
That usually are managed by auths
Code: Select all
($this->auth->acl_get('u_viewprofile'))
Free support for our extensions also provided here: phpBB Studio
Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Re: Text formatter differences
Yep, tried that but IIRC the url link wasn't displayed correctly probably due to me usingpaulus wrote: ↑Mon May 23, 2016 2:32 pmShould work on both .Code: Select all
$url = generat_board_url() . 'memberlist.' . $this->php_ext . '?mode=viewprofile&u=' . $this->user->data['user_id']; $color = $this->user->data['user_colour']; $user_name = $this->user->data['is_registered'] ? '[url=' . $url . '][color=#' . $color . ']' . $this->user->data['username'] . '[/color][/url]' : $data['username'];
$this->root_path
instead of generate_board_url but that then brings up the problem of nubs changing their domain name (could happen if moving from freeforum host to paid I think) in which case the generate_board_url thing would break (lead to a can't find domain or whatever).@ 3Di, I'm not concerned with auths as the only ones that should have access to view these types of posts (and PMs for that matter) are admins, or at least those in the admin group, and/or founders and the link to the user name is only created if the user is registered on the forum.
I suppose I have to choose the lesser of two evils. Either way no problem with validation as it relates to this part of the code @paulus?
Do not hire Christian Bullock he won't finish the job and will keep your money
Re: Text formatter differences
The URL problem will apply for a lot of posts, so adding a bunch more is not that much of an issue in my opinion. You can always try to do something with a custom BBCode which you replace somewhere in a event, but I don't think you can really do that (Without much hacking) in 3.1.
For validating I see no issue with using BBCode. I have some problems with using HTML as thats really not how it should be used. (And is really hacky)
For validating I see no issue with using BBCode. I have some problems with using HTML as thats really not how it should be used. (And is really hacky)
Re: Text formatter differences
Good point, guess I'll use the @paulus nubland method.
Grats!
PS I now owe you three beers
Grats!
PS I now owe you three beers
Do not hire Christian Bullock he won't finish the job and will keep your money