[RFC] user signature modifications for posts

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] user signature modifications for posts

Post by brunoais »

DavidIQ wrote:
brunoais wrote: That's set using the ACP, right?
How about if only a small significant subset of the users don't like that kind of signatures but other like 'em? Doesn't it sound a better use case for this kind of thing?
No, those settings are in the ACP. The forum admin is who decides what he wants to allow for signatures and what he doesn't. The user obviously shouldn't be in control of that.
Yes, yes... That's what I meant. I should have written that in a better way ;).
DavidIQ wrote:
brunoais wrote:No... I meant a js only approach. This is not required to use the forums. It's just a fancy thing, so js alone is perfectly ok, IMO.
Just use the storage interface or cookies to store... Simple as that.
Not sure how I feel about that. There are so many people that have issues with cookie and a certain EU cookie law that comes to mind...
What's the specific problem you have in mind?
Ger wrote: However: I can imagine a big slowdown when a frequent user keeps adding more and more user_id's to that list. With only a handful it wouldn't matter, but with hundreds or maybe even thousands user_id's to search through with JS I think some browsers will have a hard time. That could potentially result in bad user experience.
If you keep using jQuery for those stuff, yeah. That will happen too much.
I think you forgot that there's something called stylesheets... Ya know... Those things where you write CSS rules you want the browser to follow... (just messin' with ya).
Anyway, using a simple querySelectorAll() we can deal with that easily.
(tested only on ff)
  • Used 1223 comma separated elements in the selector (in 6152 characters for the whole selector).
  • All selectors were made for a class attribute.
  • I tested in the last page of this topic by copying what's in the @id attribute into the @class attribute.
  • The selectors that would match were randomly inserted in the comma separated list.
  • Got 5 Nodes as the result, which is the result expected.
  • Time required: 50ms
Note: I didn't do the code that hides the sigs, only the 1 liner that finds the nodes. I don't believe that it would return a massive amount of results.
Then I tested using jQuery.
I got bored after 30s waiting and so I killed the browser instance (yeah... the browser locked up). I think it wasn't using the querySelectorAll() and was searching in the DOM itself.
Don't forget that querySelectorAll() is supported by all of the most used browsers, firefox, opera, chrome, IE9, IE8(css2 selectors).
So... still got problems with slowness in finding the tags to hide, Ger?

User avatar
Ger
Registered User
Posts: 293
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: [RFC] user signature modifications for posts

Post by Ger »

I'm no front-ender, so I don't really know how jQuery handles this, nor am I familiar with querySelectorAll(). However: I was talking about exploring the cookie for given values. Further processing won't be a problem anyway.
When exploring the cookie goes well for > 1000 stored values, it's OK by me.
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] user signature modifications for posts

Post by brunoais »

Cookies only store strings ;).
Anyway it's guaranteed that a cookie can store upto 4KB of information. If the storage interface is used instead, then this is increased to, at least, 2MB. That's enough to store many more users, maybe half, if not all, the ones this forum has.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1836
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] user signature modifications for posts

Post by DavidIQ »

brunoais wrote:
DavidIQ wrote:
brunoais wrote:No... I meant a js only approach. This is not required to use the forums. It's just a fancy thing, so js alone is perfectly ok, IMO.
Just use the storage interface or cookies to store... Simple as that.
Not sure how I feel about that. There are so many people that have issues with cookie and a certain EU cookie law that comes to mind...
What's the specific problem you have in mind?
I don't mean technical issues. I mean more like moral/ethical/personal/big-brother-is-watching issues with cookies. :P
Image

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] user signature modifications for posts

Post by brunoais »

And that's what I asked, DavidIQ (he clarified it in the IRC).

On idea we could go forward is to use a .php file that outputs CSS with the purpose just to output the CSS that takes care of hiding the signatures that the user does want to hide.
It may use the browser's cache to prevent overload and also use the if-modified-since to return that nothing has changed (if nothing indeed has changed).
When a signature is hidden, just send a POST to that same file to update both the browser's cache and the server data.

What do you think of this idea?
The DB only needs to be a key-value. The key is the userid, the value is the selector used to hide the signatures that are meant to be hidden. It can be a serialized array, for example.

User avatar
VSE
Extension Customisations
Extension Customisations
Posts: 673
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] user signature modifications for posts

Post by VSE »

Although I think this attack on signatures is unnecessary ;) for those who have conspiracy issues with cookies, you could simply just use the HTML5 localStorage api. It is supported by all browsers, even IE8+ (older browser support can be added via polyfill), and it holds up to 5MB data.
Has an irascible disposition.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] user signature modifications for posts

Post by brunoais »

no need for older browser support. phpBB only supports IE8+ and other modern browsers

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] user signature modifications for posts

Post by EXreaction »

The EU cookie law does not apply. This does not track the user in any way and is required for a feature the user wishes to use (if the user would use it).

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] user signature modifications for posts

Post by keith10456 »

bantu wrote:
DavidIQ wrote:Sorry but I completely disagree with the idea as signatures will then become that much less useful. If you don't like long signatures then don't allow them. If you don't like big pictures in signatures then don't allow those.
I agree.
Ditto.

drathbun
Registered User
Posts: 72
Joined: Wed Feb 15, 2006 6:40 pm
Location: Texas
Contact:

Re: [RFC] user signature modifications for posts

Post by drathbun »

User preferences should not - in my opinion - ever be stored in a cookie. For example, I use at least three different computers to access various sites. I don't want to have to reset my "ignore this signature" preference on every device. Why not use this as a modification of the friend/foe feature? It's already being stored in the database, right? I have not looked at the feature (code) in a very long time, but could you have various levels of foes, meaning the highest level of exclusion is to hide everything, but a lower level of exclusion just hides the semi-foe signature?
Sometimes you're the windshield, sometimes you're the bug.

Post Reply