Show Posts

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.

Messages - MultiformeIngegno
166
Features / Re: Culmination of Permissions Ruminations
« on June 4th, 2013, 02:43 AM »
Quote from Arantor on June 2nd, 2013, 06:02 PM
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.
I'm ok for not having physical groups.. but I think it's needed the ability to have some badges or specific permissions when users reach X posts (was thinking about stackoverflow).
Quote from Arantor on June 2nd, 2013, 06:02 PM
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.
Absolutely fine with ditching primary/secondary groups. Always confused me
Quote from Arantor on June 2nd, 2013, 06:02 PM
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.
Don't know on this. I leave comments to others on this :)
Quote from Arantor on June 2nd, 2013, 06:02 PM
tl:dr; We could reformulate admin powers to be less overarching and more granular. This has consequences for management too.
I think the solution that makes more sense is: when creating other admins, the first admin has a screen with deny permissions. By default they have all permissions, but before creating them the "first" admin removes specific permissions.
167
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:48 PM »
Quote from Arantor on June 3rd, 2013, 09:36 PM
I can't remember :/
I think DateTime does. Because it displayed correct time and strtotime not. Then I added set_locale and strtotime displayed correct time too.
168
Off-topic / Re: json_decode and arrays
« on June 3rd, 2013, 09:35 PM »
Quote from Arantor on June 3rd, 2013, 09:33 PM
One takes into account server time, the other does not...
Which one takes server time?
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?
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 »
Quote from Arantor on June 3rd, 2013, 09:16 PM
Either a regex to scrape the content or something like http://uk3.php.net/manual/en/datetime.createfromformat.php to process it.
Is DateTime better than strtotime?

Because this works :)

Code: [Select]
$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]
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 »
Quote from Arantor on June 3rd, 2013, 08:27 PM
I don't know, what is wrong with it?
Code: [Select]
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
Code: [Select]
[error][/error]
tags appear.
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 »
Quote from xrunner on June 1st, 2013, 02:19 AM
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. :)
Tar cronjob!
176
Off-topic / Re: System Visitation: IPB 3.4.5
« on May 31st, 2013, 11:25 AM »
Quote from Powerbob on May 31st, 2013, 05:22 AM
I still have one of the early lifetime licenses.
Wow, really lucky!! :D
Does it offer the same of actual subscriptions?
177
Off-topic / Re: Next System Visitation
« on May 31st, 2013, 03:49 AM »
Quote from Arantor on May 31st, 2013, 03:45 AM
The problem is I gotta run it somehow - ASP is not an environment I'm equipped for.
Yeah it's a bit inconvenient to test.. but IMO could be interesting to see how they structured the forum with a completely different architecture. And it seem really fast and solid.. Ok the look ruins all, I know :P

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. :)
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 »
Code: [Select]
$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 »
Quote from Arantor on May 31st, 2013, 03:08 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.
Code: [Select]
    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'?