This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
916
Features / Re: Cookieless domains and other things...
« on April 12th, 2014, 05:04 PM »
Not available on my host... :( :(
917
Archived fixes / Re: Broken Privacy Topic
« on April 12th, 2014, 04:57 PM »
This is getting annoying... I need some opinions here.
Part 1: the problem.
This is how Noisen.com does topic privacy:
- build a query checking the privacy state
- load board, with query above, and also load topic approval
- check topic approval manually. Actually, I didn't really bother with that, because Noisen doesn't use topic approvals much.
This is how Wedge.org does topic privacy:
- build a query checking privacy & approval states
- load board, with query above (if private or not approved, no topic, thus nothing to show)
The problem is with the query building. Privacy is fine, but approval is not, because if you're a moderator, you're exempt from having to check on approval states, since you're the one who's supposed to approve messages...
However, and the trick is here, the query check is built BEFORE the board is loaded, which also means it's built BEFORE permissions are loaded. Thus, allowedTo() will always return FALSE, making it impossible for moderators to see unapproved posts.
Part 2: how I solved it in late March. (And why it fails to work correctly.)
I simply removed the topic privacy/approval check in loadBoard, and figured I'd move it to Display.php (which I forgot to do). I fixed that today (not committed yet). However... It also means that if you have ";topic=..." in your URL, but are NOT viewing a topic page, the topic approval query won't be loaded. Oops!
I went for an alternative solution, which was to move the $topicinfo builder to its own loadTopic() function, and then automatically load it on all pages if the topic itself is shown NOT to have a 'default' privacy or approved setting. Then, I can easily close access to that topic if the user isn't allowed to see it.
Still, that makes it all very complicated, and it loads a lot of data for nothing.
Another (close) way to do it would be to accept that I'm spending an extra query on all pages with ";topic=" in them, but a SUPER FAST query like "SELECT 1 FROM topics AS t WHERE id_topic = $topic AND {query_see_topic}". That would only manipulate a single row in a single table, id_topic has an index so it's all fine, and query_see_topic only manipulates that row as well.
Part 3: what should I do?
Not worry about the extra query? It takes about a millisecond on my local install. (Still, I find it 'too much'.)
Move the $topicinfo builder to loadTopic, and call loadTopic if $topic is set, then not call it again from Display()..? (Problem: although it's a similar query to my simplified one, filling $topicinfo when you don't actually need that info is also overkill. Then again, maybe people would LIKE for $topicinfo to be systematically available when a current topic ID is available.)
Something else..?
Help :sob:
Part 1: the problem.
This is how Noisen.com does topic privacy:
- build a query checking the privacy state
- load board, with query above, and also load topic approval
- check topic approval manually. Actually, I didn't really bother with that, because Noisen doesn't use topic approvals much.
This is how Wedge.org does topic privacy:
- build a query checking privacy & approval states
- load board, with query above (if private or not approved, no topic, thus nothing to show)
The problem is with the query building. Privacy is fine, but approval is not, because if you're a moderator, you're exempt from having to check on approval states, since you're the one who's supposed to approve messages...
However, and the trick is here, the query check is built BEFORE the board is loaded, which also means it's built BEFORE permissions are loaded. Thus, allowedTo() will always return FALSE, making it impossible for moderators to see unapproved posts.
Part 2: how I solved it in late March. (And why it fails to work correctly.)
I simply removed the topic privacy/approval check in loadBoard, and figured I'd move it to Display.php (which I forgot to do). I fixed that today (not committed yet). However... It also means that if you have ";topic=..." in your URL, but are NOT viewing a topic page, the topic approval query won't be loaded. Oops!
I went for an alternative solution, which was to move the $topicinfo builder to its own loadTopic() function, and then automatically load it on all pages if the topic itself is shown NOT to have a 'default' privacy or approved setting. Then, I can easily close access to that topic if the user isn't allowed to see it.
Still, that makes it all very complicated, and it loads a lot of data for nothing.
Another (close) way to do it would be to accept that I'm spending an extra query on all pages with ";topic=" in them, but a SUPER FAST query like "SELECT 1 FROM topics AS t WHERE id_topic = $topic AND {query_see_topic}". That would only manipulate a single row in a single table, id_topic has an index so it's all fine, and query_see_topic only manipulates that row as well.
Part 3: what should I do?
Not worry about the extra query? It takes about a millisecond on my local install. (Still, I find it 'too much'.)
Move the $topicinfo builder to loadTopic, and call loadTopic if $topic is set, then not call it again from Display()..? (Problem: although it's a similar query to my simplified one, filling $topicinfo when you don't actually need that info is also overkill. Then again, maybe people would LIKE for $topicinfo to be systematically available when a current topic ID is available.)
Something else..?
Help :sob:
918
Archived fixes / Re: Broken Privacy Topic
« on April 12th, 2014, 01:14 PM »
Okay, as I expected, this bug was created by the following commit... (Which actually mentions the whole thing; it's just that, for some reason, it "worked" when I committed, but not later.)
https://github.com/Wedge/wedge/commit/6b1a53d4acba4d35f9747409f44d22a1107578d3
I'll have to find another way to make it work, then... Hmm.
https://github.com/Wedge/wedge/commit/6b1a53d4acba4d35f9747409f44d22a1107578d3
I'll have to find another way to make it work, then... Hmm.
919
Importing into Wedge / Re: Importer Problem Attachment not found
« on April 12th, 2014, 12:33 AM »
Hmm, perhaps a problem with how the attachment folder variable is built now that I've hardcoded all paths?
920
Features / Re: Cookieless domains and other things...
« on April 12th, 2014, 12:31 AM »
Dunno, I've never looked into these things. Honestly, I don't see how something with SSL capability could be faster than HTTP 1.x, but what the hell.
Also, dunno how I could implement that in Wedge.
Also, dunno how I could implement that in Wedge.
921
Archived fixes / Re: Broken Privacy Topic
« on April 12th, 2014, 12:25 AM »
Hmm... Confirmed.
It's looking like the $topic 'creation' process never goes through {query_see_topic}, which is odd... I thought it did, really.
I mean, if a board is set to a specific group, attempting to access a topic in it will fail... So, I guess I need to add query_see_topic in the same query.
Can someone else look into it, to save me a few minutes? (or dozen minutes, depending on how it turns out...) I need to find where this one is. Possibly boardsAllowedTo or something. Have to jump to bed now... :-/
It's looking like the $topic 'creation' process never goes through {query_see_topic}, which is odd... I thought it did, really.
I mean, if a board is set to a specific group, attempting to access a topic in it will fail... So, I guess I need to add query_see_topic in the same query.
Can someone else look into it, to save me a few minutes? (or dozen minutes, depending on how it turns out...) I need to find where this one is. Possibly boardsAllowedTo or something. Have to jump to bed now... :-/
922
Features / Re: New revs
« on April 12th, 2014, 12:17 AM »
[Commit revision 9bf4a22]
Author: Nao
Date: Thu, 10 Apr 2014 16:10:53 +0200
Stats: 18 files changed; +40 (insertions), -40 (deletions)
[Commit revision 0b9053c]
Author: Nao
Date: Thu, 10 Apr 2014 19:50:16 +0200
Stats: 3 files changed; +15 (insertions), -16 (deletions)
[Commit revision 51fe74e]
Author: Nao
Date: Sat, 12 Apr 2014 00:15:29 +0200
Stats: 6 files changed; +98 (insertions), -20 (deletions)
Date: Thu, 10 Apr 2014 16:10:53 +0200
Stats: 18 files changed; +40 (insertions), -40 (deletions)
- Spacinazi, more precisely, double spaces before new sentences. There were still a lot of these... (18 files, not listing them, doesn't matter if you don't update them.)
[Commit revision 0b9053c]
Date: Thu, 10 Apr 2014 19:50:16 +0200
Stats: 3 files changed; +15 (insertions), -16 (deletions)
- More spacinazi. (Class-Editor.php, Subs-Post.php)
- Pixelnazi. (sections.css)
[Commit revision 51fe74e]
Date: Sat, 12 Apr 2014 00:15:29 +0200
Stats: 6 files changed; +98 (insertions), -20 (deletions)
- New feature: page replacements. Similar to the <replace> feature in skin definitions, this one is applied after skins are shown, so you can override anything, across any skin, plugin or whatever. (ManageSettings.php, Subs-Template.php, Admin.template.php, Admin.english.php)[1]
- Rewrote relative paths in CSS url() functions. To be specific, I had to ensure that if you wanted to move /gz/css to another domain, absolute URLs were used in CSS files instead of relative ones. (Class-CSS.php, Subs-Cache.php)
| 1. | Accessed from the Pretty URLs settings page. |
923
Features / Re: Language revs
« on April 12th, 2014, 12:16 AM »
[Commit revision e6271d6]
Author: Nao (Signed-off)
Date: Sat, 12 Apr 2014 00:16:34 +0200
Stats: 4 files changed; +14 (insertions), -2 (deletions)
Date: Sat, 12 Apr 2014 00:16:34 +0200
Stats: 4 files changed; +14 (insertions), -2 (deletions)
- Page replacements feature. (Admin)
- Spacinazi. (LICENSE, Media.german.php)
924
Features / Re: Plugin revs
« on April 11th, 2014, 09:51 AM »
These are just basics. If someone wants to install on a non-supported server, they do the conversion themselves.
In this case I did explain it was only to make Google happy...
In this case I did explain it was only to make Google happy...
925
Features / Re: Plugin revs
« on April 10th, 2014, 11:51 PM »
[Commit revision f424b87]
Author: Nao (Signed-off)
Date: Thu, 10 Apr 2014 23:50:19 +0200
Stats: 5 files changed; +7 (insertions), -7 (deletions)
[Commit revision 9251cc8]
Author: Nao (Signed-off)
Date: Thu, 10 Apr 2014 23:51:01 +0200
Stats: 1 file changed; +5 (insertions), -0 (deletion)
Date: Thu, 10 Apr 2014 23:50:19 +0200
Stats: 5 files changed; +7 (insertions), -7 (deletions)
- Spacinazi. (birthday, calendar, facebook)
[Commit revision 9251cc8]
Date: Thu, 10 Apr 2014 23:51:01 +0200
Stats: 1 file changed; +5 (insertions), -0 (deletion)
- Adding an htaccess cache file for the Facebook icon. Might seem a bit overkill, but Google PageSpeed likes this better. (facebook/templates/images/.htaccess)
926
Features / Re: Cookieless domains and other things...
« on April 10th, 2014, 11:48 PM »
Absolute URLs in the main CSS file increase the gzipped size by about 15 bytes.
This was enough to trigger in me the need to turn them back into relative URLs...
Which is completely silly. I've been fighting all night to get it to work. It's not, for now. Well, it is, but I keep finding new weird bugs. It's getting annoying... For instance, doing a Purge Cache will regenerate all flag icons, including the ones for disabled languages. Does that ring a bell to you..? ;)
I guess I need to fix that one.
I'm considering making my relative path code simpler, i.e... If a page_replacement string is found, then use absolute URLs. Right now, I'm doing it that way, except I only use absolute URLs if one of the replacement strings has 'gz/css' in it (implying I'm trying to move my CSS to another domain). It works, but it would need more work, because... What if I keep the CSS in the same domain, but I moved the assets to another? Any attempts to access the assets would fail. Maybe I should simply look for gz/css *and* assets, but what if the skin author wants to access yet another path... Lol.
This was enough to trigger in me the need to turn them back into relative URLs...
Which is completely silly. I've been fighting all night to get it to work. It's not, for now. Well, it is, but I keep finding new weird bugs. It's getting annoying... For instance, doing a Purge Cache will regenerate all flag icons, including the ones for disabled languages. Does that ring a bell to you..? ;)
I guess I need to fix that one.
I'm considering making my relative path code simpler, i.e... If a page_replacement string is found, then use absolute URLs. Right now, I'm doing it that way, except I only use absolute URLs if one of the replacement strings has 'gz/css' in it (implying I'm trying to move my CSS to another domain). It works, but it would need more work, because... What if I keep the CSS in the same domain, but I moved the assets to another? Any attempts to access the assets would fail. Maybe I should simply look for gz/css *and* assets, but what if the skin author wants to access yet another path... Lol.
927
Bug reports / [Posting] Re: Wrong attachment is uploaded
« on April 10th, 2014, 03:10 PM »
Nope, I haven't been working on this... I usually rely on the original authors to fix problems (Dragooon, TE...), but feel free to work on them, just as I fixed the importer bug myself. ;)
928
Archived fixes / Re: HTML5 validation report
« on April 10th, 2014, 02:58 PM »
You no longer need to mention me, I've readded this boars to my list anyway.
As for this, it's normal.
Setting utf in the header saves a few bytes. I'm setting it in the head tag for topics because they're more likely to get saved to your hard drive. And in this case, you need it to be in the HTML.
I think I mentioned this last year or so...
As for this, it's normal.
Setting utf in the header saves a few bytes. I'm setting it in the head tag for topics because they're more likely to get saved to your hard drive. And in this case, you need it to be in the HTML.
I think I mentioned this last year or so...
929
Archived fixes / Re: follow_me() bug, shows up from time to time.
« on April 10th, 2014, 02:55 PM »
I still rarely get the bug where I get a 10000px+ height on every post when loading the tab in the background. So it's not fully fixed.
I dunno if I should wait for Google to enable position sticky outside of the web platform flag. Not sure why they've been waiting so long for that... Something like 2 years! Even Firefox has yet to unprefix it... Why? Works so well for me...
I dunno if I should wait for Google to enable position sticky outside of the web platform flag. Not sure why they've been waiting so long for that... Something like 2 years! Even Firefox has yet to unprefix it... Why? Works so well for me...
930
Features / [Poll] Re: Board status icons: what's the point?
« on April 10th, 2014, 12:20 AM »Not only more readable.
Sub-select was more efficient for this query in my tests.
Forgot to mention: to get this query using the index, you must post something to start the magic :)
ORDER BY / GROUP BY:
I've changed it because we don't aggregating that much data ( sum(), max(), avg() ).
So here's the point:
If we're using this query with "ORDER BY", we get the full benefit from index.
If we're using GROUP BY, the query will start a partial filesort.
You can give it a shot and look how it's performing here on Wedge. The changes can easily be reverted:)