pagination hack

1 view
Skip to first unread message

sfong15

unread,
Apr 8, 2008, 4:49:35 AM4/8/08
to habari-users
I know some of the geeks here have tried and there is a Charcoal theme
that does that, i.e. having newer/older entries link instead of
numbered pagination.

I looked at K2's home.php and found this
echo Utils::page_selector( $page, Utils::archive_pages( $posts-
>count_all() ), null, array( 'leftSide' => 2, 'rightSide' => 2 ) );

and in search.php this
echo Utils::page_selector( ....); idential line.

so I thought if I hacked utils to get 'older/newer' link that it
should work everywhere.

In utils.php line 299 I replaced 'return $out;' with
return $url_lastpage.$text_lastpage.$out.$url_nextpage.$text_nextpage;
of course before this line there are about 20 lines to produce the
url_lastpage and text_lastpage before and after $out. Pretty simple
nothing fancy.

Now I got it working at home.php producing <<last page 1 2 3...next
page>> but under search it doesn't work as the url was still the same
as generated in home.php

I know this must be an issue with url rewrite and am no good at OOP,
what am I missing? Why is the same hack in utils doesn't work in
both places?
Reply all
Reply to author
Forward
0 new messages