Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Joshua

    (@joshuapalinggmailcom)

    Another example fix:

    On line 279 of adrotate.php, change this:

    if ($disabledbanners) {
    to this:
    if (!empty($disabledbanners)) {

    Last example fix:

    change this:

    if($stats_today->impressions == 0) {
    to this:
    if(empty($stats_today->impressions) or $stats_today->impressions == 0) {

    By using !empty, you’re checking that the variable is a) instantiated, and b) holding a value that does not evaluate to false. There’s more info on it in that article I linked to in my previous post.

    Joshua

    (@joshuapalinggmailcom)

    Won’t doing it that way mean that a 150px image is stretched, making it look bad quality? Or is there a way to pull in an image that’s bigger than 150px?

    Thread Starter Joshua

    (@joshuapalinggmailcom)

    (just marking this topic as resolved)

    Thread Starter Joshua

    (@joshuapalinggmailcom)

    OK so it turns out the issue is in CurlHttpClient.php, inside Instagram-PHP-API. Because open_basedir is false, the ‘getResponse’ method calls “curl_redir_exec”, which sets CURLOPT_HEADER to true, so headers are included in the response.

    The ‘curl_redir_exec’ method has a line:
    list( $header, $data ) = explode( "\r\n", $data, 2 );
    which attempts to strip out the headers before finally returning $data, but it doesn’t always work. Sometimes there’s more than one “\r\n” within the header part of the response.

    Anyway, basically, it’s the same problem as what’s described here: https://stackoverflow.com/questions/11359276/php-curl-exec-returns-both-http-1-1-100-continue-and-http-1-1-200-ok-separated-b so that’s what I’m using as a solution. Hope that helps if someone else has the same issue.

    Thread Starter Joshua

    (@joshuapalinggmailcom)

    By the way, it’s working on my localhost – just not on the staging server.

    Doing some debugging and print_r’s, it turns out the difference between the staging site and the local site is this:

    On the staging site, $this->_oauthToken contains:
    “HTTP/1.1 200 OK Content-Language: en Content-Type: application/json Date: Tue, 04 Dec 2012 04:14:39 GMT Server: nginx Vary: Accept-Language, Cookie, Accept-Encoding Content-Length: 367 Connection: keep-alive {“access_token”:”104849973.098c54f.73df46f417e643239e6e79b4ca5916b8″,”user”:{“username”:”flamingopinkau”,”bio”:”Welcome to our Instagram page. Put the kettle on, settle in and stay a while xox”,”website”:”http:\/\/flamingopink.com.au”,”profile_picture”:”http:\/\/images.instagram.com\/profiles\/profile_104849973_75sq_1339942957.jpg”,”full_name”:””,”id”:”104849973″}}”

    And on the local site, it contains pretty much the same thing – but only the json array. No “HTTP/1.1 200 OK Content-Language: en Content-Type: application/json Date: Tue, 04 Dec 2012 04:14:39 GMT Server: nginx Vary: Accept-Language, Cookie, Accept-Encoding Content-Length: 367 Connection: keep-alive” at the start of it. Now to figure out why the staging site is getting that additional stuff… any ideas?

    Thread Starter Joshua

    (@joshuapalinggmailcom)

    OK thanks. I had to enter first and last name in order for other display names to show in the drop down list. Done.

    Joshua

    (@joshuapalinggmailcom)

    So, if this is resolved, how did you resolve it? I’m wanting to limit it to one photo, too. Thanks

Viewing 7 replies - 1 through 7 (of 7 total)