Page 1 of 1

next page, prev page - with iis

Posted: Wed Mar 02, 2005 2:50 pm
by reion
hey guys!

i just worked a little bit around with serendipity 0.8alpha12, and found a bug (?! ... not sure) with the rewrite-engine ...
i coded a work-around for iis (but i don't know if this works with apache to ...)


so ... first of all ... open your /include/functions_entries.inc.php ...

look for this

Code: Select all

        if ($serendipity['GET']['page'] > 1) {
....
        $serendipity['smarty']->assign('footer_prev_page', serendipity_rewriteURL(implode('/', $uriArguments) .'.html'));
    }
replace it with:

Code: Select all

    if ($serendipity['GET']['page'] > 1) {
        $uriArguments = $serendipity['uriArguments'];
        foreach ($uriArguments as $value) {
        	if ($value != "index" && !in_array($value, $url)) {
        		$url[] = $value;
        	}
        }
        unset($uriArguments);
        $uriArguments=$url;
        $uriArguments[] = 'P'. ($serendipity['GET']['page'] - 1);
        $serendipity['smarty']->assign('footer_prev_page', serendipity_rewriteURL(implode('/', $uriArguments) .'.html'));
    }

and look for

Code: Select all

        if ($serendipity['GET']['page'] < $totalPages) {
....
        $serendipity['smarty']->assign('footer_next_page', serendipity_rewriteURL(implode('/', $uriArguments) .'.html'));
    }
replace it with:

Code: Select all

    if ($serendipity['GET']['page'] < $totalPages) {
        $uriArguments = $serendipity['uriArguments'];
        foreach ($uriArguments as $value) {
        	if ($value != "index" && !in_array($value, $url)) {
        		$url[] = $value;
        	}
        }
        unset($uriArguments);
        $uriArguments=$url;
        $uriArguments[] = 'P'. ($serendipity['GET']['page'] + 1);
        $serendipity['smarty']->assign('footer_next_page', serendipity_rewriteURL(implode('/', $uriArguments) .'.html'));
    }

for me this works perfect ... i hope for you to

Re: next page, prev page - with iis

Posted: Wed Mar 02, 2005 2:55 pm
by garvinhicking
Hi!

Thanks for looking into it, but this was indeed a bug which was fixed earlier today in our Snapshot. :-)

Thanks for sharing,
Garvin