BBcode oddity

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
User avatar
3Di
Former Team Member
Posts: 14061
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: BBcode oddity

Post by 3Di » Fri Aug 16, 2019 2:15 am

3Di wrote: ↑
Thu Aug 15, 2019 9:16 pm
Used a 3.2.7 fresh board with my latest validated version of '3Di - BBCode Enabled Profile Fields'.
No ABBC3 extension FWIW. In localhost btw.

And I am using now https://upload-3456.s3-us-west-2.amazonaws.com/goldeneye.mp3 as the file to play, it works. :)
UCP-audio-bbcode-CPF.png
Screenshot_2.png
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
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Fri Aug 16, 2019 2:33 am

EA117 wrote: ↑
Fri Aug 16, 2019 1:53 am
VSE wrote: ↑
Thu Aug 15, 2019 11:31 pm
Also the OP is talking not about their BBCode appearing or not, but instead whether or not audio will play or not - so the BBcode is rendering, but for some reason, unrelated to ABBC3, Amazon is not streaming audio to their audio player.
For what it's worth, that's more information that I could surmise from looking at the site. Since he hasn't even shown us his site with the "Guest" access removed from the BBCode, I couldn't say whether the BBCode is actually rendering in that case or not.

(Mr. Conner, maybe you need to turn off Guest access for the BBCode and break the playback for a bit, so that we can see the difference. What I get right now when viewing the profile is <audio autoplay=""><source src="https://upload-3456.s3-us-west-2.amazonaws.com/goldeneye.mp3"></audio><br>, rendered right before the "matix" smilely of a guy sitting in front of multiple computer screens.)

Image

The other evidence which seems antithetical to this explanation is that all Mr. Conner has to do in order to "make Amazon suddenly be willing to stream audio" is change the "Guest" access for the BBCode. It's not obvious for me anyway how the BBCode permission setting creates a problem for the Amazon streaming. What would make sense for getting that result is the BBCode not being rendered; but that's certainly not the only possible explanation.

But should certainly be able to rule that out by viewing the site's generated HTML while the problem is occurring.
Correct. I don't want to sound like nothing is happening here, and I'm not trying to be rude. There is in fact some form of oddity here and if I knew PHP and the ins and outs of the phpBB framework I might be able to pin it down. I will disable the guest group from using the BBcode and I'll let you know when that happens shortly.

I'm open to to voice chat via Wire and a Team Viewer season as well if one needs to see just what is going on here. I can even grant someone a temp user account on my testing forum to test this.

BTW- The image you shared from my site won't parse here because I have hotlink protection on.

Addendum- I mentioned that this issue happens whether it's an external link or a internal link. i.e, an Amazon S3 link or a link from the images folder where I like to host internal content. Yeah, I guess I should uses the files folder instead.

Let me turn off the guest permission now.

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Fri Aug 16, 2019 2:43 am

Guest permission now turnned off and as you will see (or in this case hear) no audio is rendered automatically to play like before. Here's the link to my profile.


Now go here and you can hear audio in a post. Just not in a profile field with the guest permission off for the BBcode that is being used now.

Check out my Sig as well.

Edit-

And something I never noticed before. The BBcode in the profile shows up when guests can't use it.

User avatar
EA117
Registered User
Posts: 830
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: BBcode oddity

Post by EA117 » Fri Aug 16, 2019 3:16 am

John connor wrote: ↑
Fri Aug 16, 2019 2:43 am
Guest permission now turnned off and as you will see (or in this case hear) no audio is rendered automatically to play like before.
...
And something I never noticed before. The BBcode in the profile shows up when guests can't use it.
You mean you can literally "see the BBCode when viewing the profile", right? That's what I notice too.

Because with Guest permission turned off, what gets rendered into the HTML document is the literal BBCode reference:

<br>
[audioauto]https://upload-3456.s3-us-west-2.amazonaws.com/goldeneye.mp3[/audioauto]<br>


So we can definitely say the BBCode is not "missing", nor was "the HTML replacement botched." But at minimum the issue is "the BBCode will no longer be parsed." Such that the BBCode ends up literally in the HTML output.

But since that's not the behavior 3DI gets in what intended to be the same scenario, it's not clear what the additional factor is which makes it happen in your board and not in 3DI's test.

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Fri Aug 16, 2019 4:46 am

Well, I added the other BBcode to have a player display like 3DI's and it too doesn't parse. You can see its BBcode as well.

I went into my test site and disabled all extensions except the 3DI an ABBC3 extension, pulled the htaccess and bypassed CloudFlare with my hosts file and still the BBcode doesn't parse for a guest with the guest permissions turned off.

I'm at a total lose here other than my host. I don't know. Kinda wanna now check out XAMPP.

In the custom profile field options I do have parse links off. Only BBcode and smiles can parse. I did turn on parsing links but no change.

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Fri Aug 16, 2019 6:00 am

BINGO!

Found the problem. I disabled the ABBC3 extension and just used the BBcode to play audio without that extension and the permissions it has and it worked! So it's the permission system withen the ABBC3 extension that is causing this not to work in profile fields.



Without the ABBC3 extension shown here, the BBcode works in profile fields.

1.jpg



With the ABBC3 extension, the BBcode doesn't work unless you allow those groups.



2.jpg

The ABBC3 extension works with the audio code in posts regardless of what group a user is in. But in profile fields the group plays a bearing on whether the BBcode for the audio plays or not.

@VSE, can you have a look at your extension concerning this issue please? I'd really like to use your extension and have the audio parse in profile fields.

User avatar
3Di
Former Team Member
Posts: 14061
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: BBcode oddity

Post by 3Di » Fri Aug 16, 2019 8:10 pm

John connor wrote: ↑
Fri Aug 16, 2019 6:00 am
BINGO!

Found the problem. I disabled the ABBC3 extension and just used the BBcode to play audio without that extension and the permissions it has and it worked! So it's the permission system withen the ABBC3 extension that is causing this not to work in profile fields.
3Di wrote: ↑
Fri Aug 16, 2019 2:15 am
3Di wrote: ↑
Thu Aug 15, 2019 9:16 pm
Used a 3.2.7 fresh board with my latest validated version of '3Di - BBCode Enabled Profile Fields'.
No ABBC3 extension FWIW .....
3Di wrote: ↑
Thu Aug 15, 2019 8:44 pm
Try to not use ABCC3 for this bbcode, remove it completely from there...
and use instead the native phpBB's ACP facility in the posting's tab to add it.

Or use a fresh test board with only my extension.
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
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Sat Aug 17, 2019 5:39 am

Sorry about that. When you mentioned not to use the ABBC3 extension it didn't occur to me that was the issue because I don't want to get rid of that extension. Had you said that the ABBC3 extension was the problem, my dumb head would have then known what the issue was withen the context you specified and I would have tested that out from the get go.

Again, thanks for your profile extension to allow BBcode. Now I'm hoping VSE will look into this permission thing as it relates to audio being played in profile fields. It works in posts when you deny groups from using it, just not in profile fields.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4897
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: BBcode oddity

Post by VSE » Sun Aug 25, 2019 12:17 am

I see what the problem is now, and the problem is in fact with the BBCode Enabled Profile Fields extension.

Simply: it's storing BBCodes incorrectly in the database (they need to be generated for storage before being saved).

In all posts (PMs, posts, and third party stuff like board rules, announcements and so on) BBCodes are stored after they are prepared for storage. In the database this looks something like:

Code: Select all

<r><MOD mod="admin"><s>[mod=admin]</s>A message from the admin<e>[/mod]</e></MOD></r>
However the BBCode Enabled Profile Fields extension is storing them un-prepared for storage, so they're stored almost like raw posts text, and it looks like this in the db:

Code: Select all

[mod=&quot;admin&quot;]A message from the admin[/mod]
This is wrong. It means the Parser has to be summoned every time there are profile fields to be viewed (which actually places an extreme burden on boards if a lot of users are using this because it gets called for every single post where a user is using bbcodes in their profile fields...as opposed to never needing the parser to be called under normal conditions). It also means these CPF BBcodes are being treated as though they are like something being written in a new post, rather than something that has already been parsed and stored, which is why they don't pass ABBC3's restrictions on users who are blocked from being able to post/use a BBCode.

Bottom line, 3Di's extension should use generate_text_for_storage before storing these BBCodes...and only once - when they are stored to the user's profile, as opposed to using it to display them which winds up calling it on every single rendering of a user's custom profile fields when viewing topics.

I did a test to measure the strain BBCode Enabled Profile Fields places on a board because of how it's not storing the BBCode's already parsed... In a single topic on my local test board it adds 2.24MiB of overhead to RAM:
Without BBCode Enabled Profile Fields installed: 16.92 MiB
With BBCode Enabled Profile Fields installed: 19.16 MiB

If 3Di can update his extension to store BBCodes prepared for storage, this overhead will disappear, and BBCodes will work as expected (and ABBC3 won't have any influence on them).
Dictated but not read.
Official phpBB Extensions β˜… My Extensions & MODs
Please do not PM me for support.

User avatar
3Di
Former Team Member
Posts: 14061
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: BBcode oddity

Post by 3Di » Sun Aug 25, 2019 1:35 am

Interesting,
I am a bit busy in this period but I will for sure give it a shot asap, thanks. :)
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
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Sun Aug 25, 2019 9:38 am

Look for to the update. Thanks!

User avatar
3Di
Former Team Member
Posts: 14061
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: BBcode oddity

Post by 3Di » Mon Aug 26, 2019 1:32 am

VSE wrote: ↑
Sun Aug 25, 2019 12:17 am
Bottom line, 3Di's extension should use generate_text_for_storage before storing these BBCodes...and only once - when they are stored to the user's profile, as opposed to using it to display them which winds up calling it on every single rendering of a user's custom profile fields when viewing topics.
No way I can do it without pushing at least a new event in the core, specifically against the function update_profile_field_data().
I studied the whole CPFs core code today, got what you said modifying it and commenting out 1 one line of mines.

Here the stored data as an example
profile-pfbbcode-data.png
And here the result
profile-pfbbcode-parsed.png
John connor wrote: ↑
Sun Aug 25, 2019 9:38 am
Look for to the update. Thanks!
No time for now.
Compatibility with other extensions is not a priority, actually.
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
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
John connor
Registered User
Posts: 2200
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: BBcode oddity

Post by John connor » Mon Aug 26, 2019 11:36 am

Then I'll pay someone to do it I guess when I get paid. Kinda want this fixed.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4897
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: BBcode oddity

Post by VSE » Mon Aug 26, 2019 3:35 pm

3Di wrote: ↑
Mon Aug 26, 2019 1:32 am
VSE wrote: ↑
Sun Aug 25, 2019 12:17 am
Bottom line, 3Di's extension should use generate_text_for_storage before storing these BBCodes...and only once - when they are stored to the user's profile, as opposed to using it to display them which winds up calling it on every single rendering of a user's custom profile fields when viewing topics.
No way I can do it without pushing at least a new event in the core, specifically against the function update_profile_field_data().
I studied the whole CPFs core code today, got what you said modifying it and commenting out 1 one line of mines.

Here the stored data as an example
profile-pfbbcode-data.png

And here the result
profile-pfbbcode-parsed.png
John connor wrote: ↑
Sun Aug 25, 2019 9:38 am
Look for to the update. Thanks!
No time for now.
Compatibility with other extensions is not a priority, actually.
I don't think you need new events at all.

Your pf_validate function seems to be halfway there. I'm not sure what it's actually doing, because you call it before storing variables, and you run the one's with BBCodes there through generate for storage... but you never pass the results back. You just need to get that sorted out and should be able to use that.
Dictated but not read.
Official phpBB Extensions β˜… My Extensions & MODs
Please do not PM me for support.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4897
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: BBcode oddity

Post by VSE » Mon Aug 26, 2019 6:40 pm

You can also use the event ucp_profile_info_modify_sql_ary to update the profile field data with generate_text_for_storage too if that is needed instead.
Dictated but not read.
Official phpBB Extensions β˜… My Extensions & MODs
Please do not PM me for support.

Post Reply

Return to β€œphpBB Custom Coding”