Quantcast
Channel: Topic Tag: bug | WordPress.org
Viewing all articles
Browse latest Browse all 23376

Dartanjan on "[Plugin: Instapress] Pagination broken, trying to fix it."

$
0
0

After hitting Next» link, nothing happens except two other links are inserted, and so on for every click. (though, in DOM, another set of instagrams are inserted, only, it's the same photos as the first page)

I did some digging through the code, with no luck, though at some times it seemed like I fixed it. Here are a couple of points:

instagram.php, line 255:

if(is_numeric($value)) {
	$values[$key] = intval($value);
}

is_numeric() check isn't really needed, and I think it breaks things, since 'nextMaxId' contains an underscore, if I'm not wrong. If true, then intval() might be messing things up too.

instagram.php, line 352:

if($nextMaxId)
	$lastShownId = $obj->id;
else
	$lastShownId = '';

What's interesting is that this $lastShownId is never being used, ever. This must be a bug. First, I don't think the check is needed, so we can just say $lastShownId = $obj->id, as we will always the last Instagram ID. Second, I think $lastShownId should be used on line 365, where <input hidden> is created, like so:

$result .= '<input type="hidden" id="instapress-'.$values['instanceid'].'-next-max-id-'.(intval($values['paging'])+1).'" value="'.$lastShownId.'" />';
instead of $nextMaxId, which never gets updated.
This hidden input value is later used to get the next batch of instagrams. Without it, I don't see how Instagram API knows where we want to continue.

This is how far I got into solving the pagination problem, but I still haven't really figured it out. Anyone else working on this?

http://wordpress.org/extend/plugins/instapress/


Viewing all articles
Browse latest Browse all 23376

Trending Articles