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.
3676
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:56 PM »
Only for readability later on. Using 3600 will be faster than using 60*60, but 60*60 is more readable. Unless we're talking an insanely busy site it doesn't matter (and if we are, there are bigger things to worry about than that anyway)
3677
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:41 PM »
Yes, time() and filemtime() work on seconds.
3678
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 06:27 PM »
I do get so confused in trying to decipher the mindfuck that is time and date in PHP.
I'm confused why you're putting in time() + 3600. gmstrftime as PHP's manual says wants two parameters - the format you want to display and the time you want to display in that format, putting in time() + 3600 is just going to confuse it (and it complains)
The description seems to indicate that it would actually deal with the offset itself (since setlocale should be providing it), which would suggest simply:
Code: [Select]
Failing that, the more naive but workable solution (though won't take into account DST)
Code: [Select]
I'm confused why you're putting in time() + 3600. gmstrftime as PHP's manual says wants two parameters - the format you want to display and the time you want to display in that format, putting in time() + 3600 is just going to confuse it (and it complains)
The description seems to indicate that it would actually deal with the offset itself (since setlocale should be providing it), which would suggest simply:
'.htmlentities(gmstrftime('%e %B %Y alle %R', $value->caption->created_time)).'Failing that, the more naive but workable solution (though won't take into account DST)
'.htmlentities(strftime('%e %B %Y alle %R', $value->caption->created_time + 3600)).'3679
Features / Re: Things to do before the Mayan apocalypse: membergroups
« on April 20th, 2012, 05:52 PM »
:lol: Heh, something like that.
It isn't so much that I have concerns about the master plan, more that I have concerns about the way people want to go about things, and taking comments out of context. 3NF is not inherently bad, neither is combining values into text and running them inline, just like everything else these things have to be used properly.
It isn't so much that I have concerns about the master plan, more that I have concerns about the way people want to go about things, and taking comments out of context. 3NF is not inherently bad, neither is combining values into text and running them inline, just like everything else these things have to be used properly.
3680
Off-topic / Re: QapTcha
« on April 20th, 2012, 05:51 PM »
Well, this is the thing, it's security by obscurity, and a measure I'm prepared to accept because it isn't a measure that is secure all on its own - but as a facet of a more complex system.
3681
Features / Re: New revs
« on April 20th, 2012, 04:35 PM »
(5 files, 6KB)
Revision: 1554
Author: arantor
Date: 20 April 2012 15:34:33
Message:
! When viewing a category on its own, don't collapse it if it would be collapsed on the board index. (Subs-BoardIndex.php)
! Add 'the number of links in a post' as a moderation filters criteria, meaning you can moderate or refuse a post based on links in it (e.g. moderate if links is 1 or more and user has under 10 posts) (ManageModeration.php, Subs-Moderation.php, ManageModeration.template.php, ManageSettings language file)
----
Modified : /trunk/Sources/ManageModeration.php
Modified : /trunk/Sources/Subs-BoardIndex.php
Modified : /trunk/Sources/Subs-Moderation.php
Modified : /trunk/Themes/default/ManageModeration.template.php
Modified : /trunk/Themes/default/languages/ManageSettings.english.php
Revision: 1554
Author: arantor
Date: 20 April 2012 15:34:33
Message:
! When viewing a category on its own, don't collapse it if it would be collapsed on the board index. (Subs-BoardIndex.php)
! Add 'the number of links in a post' as a moderation filters criteria, meaning you can moderate or refuse a post based on links in it (e.g. moderate if links is 1 or more and user has under 10 posts) (ManageModeration.php, Subs-Moderation.php, ManageModeration.template.php, ManageSettings language file)
----
Modified : /trunk/Sources/ManageModeration.php
Modified : /trunk/Sources/Subs-BoardIndex.php
Modified : /trunk/Sources/Subs-Moderation.php
Modified : /trunk/Themes/default/ManageModeration.template.php
Modified : /trunk/Themes/default/languages/ManageSettings.english.php
3682
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:35 PM »
If it works, it's probably correct... ;)
3683
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:22 PM »
The incoming data isn't UTF-8, it's probably likely ISO-8859-1.
3684
Features / Re: Things to do before the Mayan apocalypse: membergroups
« on April 20th, 2012, 01:57 PM »
I'm not going to get into the meat of things here, because there's a lot of things that this impacts on, but I will take care of the issue relating to 3NF.
There are times and places that normalised data can have performance concerns. (And really, 3NF is tame. Wait until you start dealing with 5NF. :niark:) Like everything else, that is.
Now, a lot of my concern about normalising everything is that you end up generating far more rows in a resultset than you need or you start getting more queries, and for information you're loading at certain times, it's going to get hideous.
I actually have an example in SMF for this: board level moderators. They're stored in their own table, and during the board index gathering query, they're actually pulled via join into the main query. Now, on a forum without any board level moderators, it's not a problem. But if you have one board with 3 moderators, that board is returned three times, once for each moderator, which has to be cleaned up in PHP, and that accounts for some of the overhead attached to the board index stuff (which is, indirectly, one of the reasons the sub-board-of-a-sub-board problem occurs).
In that particular case, I'd almost argue that having board moderators would almost be better handled as a comma-separated value stored inline in the board table, precisely because there aren't many of them in most cases.
Getting back to the concern here, separating out friends to another table will give you the proper asynchronous structure you want. But it means that loading the list of friends up front is not cheap, because it means either overloading the first query where mem.* is loaded (which for any number of friends is non trivial), or we add a new query at that point, or we push it into a cache.
That said, we can consider a few alternatives... where exactly do we need to know and care about whether a given user is a friend of ours? Well, for the users online area in the footer, certainly, but with an asynch table we can actually do a join from *that* query and figure it out that way. For the PM area we can do a query as needed there, and so on.
Like everything else, it's a change, but it can bring other changes to balance it out.
There are times and places that normalised data can have performance concerns. (And really, 3NF is tame. Wait until you start dealing with 5NF. :niark:) Like everything else, that is.
Now, a lot of my concern about normalising everything is that you end up generating far more rows in a resultset than you need or you start getting more queries, and for information you're loading at certain times, it's going to get hideous.
I actually have an example in SMF for this: board level moderators. They're stored in their own table, and during the board index gathering query, they're actually pulled via join into the main query. Now, on a forum without any board level moderators, it's not a problem. But if you have one board with 3 moderators, that board is returned three times, once for each moderator, which has to be cleaned up in PHP, and that accounts for some of the overhead attached to the board index stuff (which is, indirectly, one of the reasons the sub-board-of-a-sub-board problem occurs).
In that particular case, I'd almost argue that having board moderators would almost be better handled as a comma-separated value stored inline in the board table, precisely because there aren't many of them in most cases.
Getting back to the concern here, separating out friends to another table will give you the proper asynchronous structure you want. But it means that loading the list of friends up front is not cheap, because it means either overloading the first query where mem.* is loaded (which for any number of friends is non trivial), or we add a new query at that point, or we push it into a cache.
That said, we can consider a few alternatives... where exactly do we need to know and care about whether a given user is a friend of ours? Well, for the users online area in the footer, certainly, but with an asynch table we can actually do a join from *that* query and figure it out that way. For the PM area we can do a query as needed there, and so on.
Like everything else, it's a change, but it can bring other changes to balance it out.
3685
Off-topic / Re: QapTcha
« on April 20th, 2012, 01:45 PM »Basically a bot could even implement it's own pseudo code to emulate whatever js does.
This should be moved to a private place as it mentions Wedge specific security.
3686
The Pub / Re: The Cookie Law (in the UK at least)
« on April 20th, 2012, 01:42 PM »I agree entirely with your comments. But many Forum sites hold other personal information that has been voluntarily supplied by its members - such as their location, user names on social network sites and instant messengers, perhaps even their exact geographic location (for Google Map pins).
Exact location is a bit different, because it could be a matter of public record. For example, if I were to put my location in, it could be claimed that my name and address are matters of public record (voter's roll, domain name WHOIS), so it's not even that simple.
Well almost: if that member receives a ban, he is no longer able to remove his personal details and whilst the site needs to retain that member's email address, user name and IP Address in order to enforce the ban, it does not - and should not (in my view) - retain any of the additional information that user supplied during his membership. That retention might fall foul of the DPA.
It gets more complicated, though... what happens if a ban is enacted accidentally against a user who wishes to update or remove their information? Say there's a ban on host which locks out so many more users? Yes, I'd argue there's a problem there, but I don't see how, viably, it's possible to solve them at this time.
If my suspicions have any legs, then wouldn't it be wise for the site to automatically remove all additional informations - including all PMs sent/received - when a member is banned?
What happens if the ban is later removed? Or was put in place by accident?
To the best of my knowledge - and according to some basic research carried-out by my lawyer - no UK-based Forum site has been found in violation of the DPA but there remains the risk that should the ICO be asked to investigate a site under the "cookie law", it might also check for other violations.
And that's the thing, ultimately, I have no idea whether the ICO would check for violations or not. But while I as a site owner may take one stance, I have to consider the implications for Wedge as a platform too.
Last night, just out of curiosity, I went looking for it on phpBB, because phpBB has at least one UK developer (and their primarily language is 'British English'), and I will also look at what XenForo is doing, though I haven't yet. What intrigued me is that there's a distinct 'we don't think the ICO will pursue it' attitude, it's almost like SMF's stance - 'we don't think anything will be done so we don't have to worry about it', as such they're not planning on doing anything about it.
Now, I personally do not believe we're going to see a rash of complaints or enforcement actions, but that's my personal opinion, not with my 'platform steward' hat on. And I have to consider it a viable threat until I see some evidence to the contrary with that in mind.
]
On a side-note - cookie lifetimes. For logged on folks ("paid up" members), it's easy in most cases because you ask them how long they want to be logged in for; just be explicit that a cookie is used to store that information and I would hope that the ICO view that as a "good faith" attempt at compliance. For "anonymous" guests, I'd like to see any cookies lasting for as short a time as can be managed - to the extent of potentially having cookies expire while anonymous users are still browsing.
For guests who do not register and have never registered nor never logged in, they get a session cookie, which is a true session cookie - it expires when they close their browser. This is the infamous PHPSESSID cookie, of course.
Logging in, you do get to specify how long you're logged in for. 'Forever' is not really forever, either, it's actually 3 years. But the problem attached is that the PHPSESSID cookie is also held for the same time, but as far as I'm concerned this is actually a bug, because there is no need to keep the session cookie when a proper cookie is established.
With more and more people leaving their browser running 24x7, you can't really rely on "End of session" cookies any more (this is a browser issue in my book - but I can't think of an easy fix...)
3687
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:58 AM »
Considering that I have no idea what wp_remote_get does (and note that file_get_contents with the URL wrapper does also use the HTTP GET method), I cannot answer that question, and no, I'm not about to trawl through the shit-heap that is WP's source to find out.
What I can tell you is that if file_get_contents works, it's certainly workable. But it has limitations, namely that it's not particularly flexible across servers since it's easy to disable it at the config level, and it isn't robust in terms of handling time-outs. If WP's function handles *any* of that (and even my lack of faith in WP's code suggests that it would handle *some* of it), run with it.
If this were file_get_contents vs Wedge's equivalent (the weget class), I'd have no hesitation in recommending Wedge's own much lengthier and likely slower - but far far more robust solution. I would likely argue the same for WP's case.
What I can tell you is that if file_get_contents works, it's certainly workable. But it has limitations, namely that it's not particularly flexible across servers since it's easy to disable it at the config level, and it isn't robust in terms of handling time-outs. If WP's function handles *any* of that (and even my lack of faith in WP's code suggests that it would handle *some* of it), run with it.
If this were file_get_contents vs Wedge's equivalent (the weget class), I'd have no hesitation in recommending Wedge's own much lengthier and likely slower - but far far more robust solution. I would likely argue the same for WP's case.
3688
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:49 AM »
Yup, it is useless, unless you want to directly use $date itself into the echo statement.
3689
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:42 AM »
Yes, you're doing it wrong. Don't use date, as I said, it doesn't do what you want. And plugging in strftime has broken it because date wants a number, not a string, hence the error.
Code: [Select]
It won't work on Windows, though as %e isn't supported.
strftime('%e %B',strtotime($decode[$i]['created_at']))It won't work on Windows, though as %e isn't supported.
3690
Off-topic / Re: Extract images with a certain tag from Instagram
« on April 20th, 2012, 02:27 AM »
http://php.net/manual/en/function.date.php:Quote
To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().