Page 2 of 3

Re: BBcode oddity

Posted: Fri Aug 16, 2019 2:15 am
by 3Di
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

Re: BBcode oddity

Posted: Fri Aug 16, 2019 2:33 am
by John connor
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.

Re: BBcode oddity

Posted: Fri Aug 16, 2019 2:43 am
by John connor
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.

Re: BBcode oddity

Posted: Fri Aug 16, 2019 3:16 am
by EA117
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.

Re: BBcode oddity

Posted: Fri Aug 16, 2019 4:46 am
by John connor
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.

Re: BBcode oddity

Posted: Fri Aug 16, 2019 6:00 am
by John connor
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.

Re: BBcode oddity

Posted: Fri Aug 16, 2019 8:10 pm
by 3Di
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.

Re: BBcode oddity

Posted: Sat Aug 17, 2019 5:39 am
by John connor
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.

Re: BBcode oddity

Posted: Sun Aug 25, 2019 12:17 am
by VSE
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).

Re: BBcode oddity

Posted: Sun Aug 25, 2019 1:35 am
by 3Di
Interesting,
I am a bit busy in this period but I will for sure give it a shot asap, thanks. :)

Re: BBcode oddity

Posted: Sun Aug 25, 2019 9:38 am
by John connor
Look for to the update. Thanks!

Re: BBcode oddity

Posted: Mon Aug 26, 2019 1:32 am
by 3Di
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.

Re: BBcode oddity

Posted: Mon Aug 26, 2019 11:36 am
by John connor
Then I'll pay someone to do it I guess when I get paid. Kinda want this fixed.

Re: BBcode oddity

Posted: Mon Aug 26, 2019 3:35 pm
by VSE
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.

Re: BBcode oddity

Posted: Mon Aug 26, 2019 6:40 pm
by VSE
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.