next page, prev page - with iis

Discussion corner for Developers of Serendipity.
Post Reply
reion
Regular
Posts: 34
Joined: Mon Feb 28, 2005 10:51 am
Location: Linz
Contact:

next page, prev page - with iis

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: next page, prev page - with iis

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply