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.
166
Features / Re: Culmination of Permissions Ruminations
« on June 4th, 2013, 02:43 AM »tl:dr; do we actually *need* or *want* post count permissions? It seems like it has served to confuse people more than it has helped them.
tl:dr; The idea of primary/secondary groups is obsolete, I want to move them to a separate table, and I have funky ideas about changing post count groups including their permissions if we still want them.
Also tl:dr; I would explicitly add *everyone* to 'Regular Members' if they are logged in. This seems more logical to me that the current situation which is a by-product of the primary/secondary group antics.
tl:dr; I want to move away from this groups->permissions setup to groups->roles->permissions. Other forum systems use it and it works for them. I see no reason it shouldn't work for us and should be more sensible for most users.
tl:dr; We could reformulate admin powers to be less overarching and more granular. This has consequences for management too.
167
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:48 PM »I can't remember :/
168
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:35 PM »One takes into account server time, the other does not...
169
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:30 PM »
strtotime gives me 03 Jun 2013, 18:52. DateTime gives me 03 Jun 2013, 16:52 (2 hours difference).
One takes server time, the other not?
I came back to home page after posting and the NEW icon showed up for this topic..
One takes server time, the other not?
Posted: June 3rd, 2013, 09:28 PM
I came back to home page after posting and the NEW icon showed up for this topic..
170
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:23 PM »Either a regex to scrape the content or something like http://uk3.php.net/manual/en/datetime.createfromformat.php to process it.
Because this works :)
$date = $run['at'];
$time = strtotime($date);
echo date("d M Y, H:i", $time)171
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:09 PM »
I have $date = $run['at'];, which gives me 2013-06-03T16:52:24Z. How can I manipolate it to get for example "d M Y, H:i" ?
172
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 08:56 PM »
You're right as always. I gave proper permissions to the dir and now the file is created.
I still get this though:
Code: [Select]
Solved. It was foreach ($data_dailymile as $run), not foreach ($data_dailymile['entries'] as $run)
I still get this though:
2013/06/03 20:53:23 [error] 6003#0: *56208 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: entries in /BLAHBLAH/runs.php on line 16
PHP message: PHP Warning: Invalid argument supplied for foreach() in /BLAHBLAH/runs.php on line 16" while reading response header from upstream, client: XXXXX, server: BLAHBLAH request: "GET /BLAHBLAH/runs.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "BLAHBLAH"Posted: June 3rd, 2013, 08:55 PM
Solved. It was foreach ($data_dailymile as $run), not foreach ($data_dailymile['entries'] as $run)
173
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 08:32 PM »I don't know, what is wrong with it?
2013/06/03 20:29:40 [error] 6002#0: *55092 FastCGI sent in stderr: "PHP message: PHP Warning: file_put_contents(/BLAHBLAH/dailymile_json/7c51bf1c050135a03bde30dda21a977a2e0ed5c8.json): failed to open stream: Permission denied in /BLAHBLAH/test.php on line 11
PHP message: PHP Notice: Undefined index: entries in /BLAHBLAH/test.php on line 16
PHP message: PHP Warning: Invalid argument supplied for foreach() in /BLAHBLAH/test.php on line 16" while reading response header from upstream, client: XXXXX, server: XXXXX, request: "GET /BLAHBLAH/test.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "BLAHBLAH"Posted: June 3rd, 2013, 08:29 PM
Oh, I probably need OAuth :(
It's strange though.. I can access the url properly via browser. They blocked GET requests..?
http://api.dailymile.com/people/multiforme/entries.json
Posted: June 3rd, 2013, 08:30 PM
I'm getting a weird bug editing this post. Strange
[error][/error]174
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 08:25 PM »
What's wrong with this foreach now? :(
Code: [Select]
<ul>
<?php
$json_dailymile = "http://api.dailymile.com/people/multiforme/entries.json";
$cache_dailymile = '/var/www/multiformeingegno.it/htdocs/wp-content/themes/multiformeingegno/dailymile_json/'.sha1($json_dailymile).'.json';
if(file_exists($cache_dailymile) && filemtime($cache_dailymile) > time() - 1000){
// if a cache file newer than 1000 seconds exist, use it
$data_dailymile = json_decode(file_get_contents($cache_dailymile), true);
} else {
$data_dailymile = json_decode(file_get_contents($json_dailymile), true);
file_put_contents($cache_dailymile,json_encode($data_dailymile));
}
$data_dailymile = $data_dailymile['entries'];
foreach ($data_dailymile['entries'] as $run) {
$distance = $run['workout']['distance']['value'];
$units = $run['workout']['distance']['units'];
$duration = $run['workout']['duration'];
$url = $run['url'];
echo '<li><a href="', $url, '">', $distance, ' ', $units, ' in ', $duration, '</li></a>'; }
?>
</ul>
175
Off-topic / Re: Scary Times Helping Other Admins
« on June 1st, 2013, 12:28 PM »He doing backups of the database from within the Admin panel, as there's a thread about the 504 gateway errors and he mentioned doing it that way, and I think it's causing problems for him. I need to tell him to not do it that way and do it from Cpanel. :)
176
Off-topic / Re: System Visitation: IPB 3.4.5
« on May 31st, 2013, 11:25 AM »I still have one of the early lifetime licenses.
Does it offer the same of actual subscriptions?
177
Off-topic / Re: Next System Visitation
« on May 31st, 2013, 03:49 AM »The problem is I gotta run it somehow - ASP is not an environment I'm equipped for.
Here's IIS http://www.microsoft.com/web/downloads/platform.aspx
178
Off-topic / Re: Next System Visitation
« on May 31st, 2013, 03:44 AM »
I'm reading now. Allow 1 day to reply to those 2 really interesting posts. :)
What about the old Snitz Forum 2000 ? It's in ASP and Access DB though :P
http://forum.snitz.com/
Posted: May 31st, 2013, 03:42 AM
What about the old Snitz Forum 2000 ? It's in ASP and Access DB though :P
http://forum.snitz.com/
179
Off-topic / Re: json_decode and arrays
« on May 31st, 2013, 03:34 AM » $data = $data['recenttracks'];
$tracks=$data['track'];
foreach ($tracks as $index=>$track) {
if (isset($track['@attr'])) {
unset($tracks[$index]);
}
}
foreach ($tracks as $track) {
$artist = $track['artist']['#text'];
$title = $track['name'];
$url = $track['url'];
echo '<li><a href="', $url, '" title="', $title, '">', $artist, ' - ', $title, '</li></a>'; }
This did the trick :)
180
Off-topic / Re: json_decode and arrays
« on May 31st, 2013, 03:11 AM »If it's an array, unset it like you would any other item. In theory the same should be true for using it as an object but I don't do the whole iterated objects thing if I can help it. The memory use is significantly higher.
removeAttr($data);
function removeAttr(&$array) {
if (isset($array['@attr']['nowplaying']))
unset($array['WHAT']);
foreach ($array as &$value) {
if (is_array($value)) {
removeAttr($value);
}
}
}
What should I type instead of 'WHAT'?