Skip to content
WJunction - Webmaster Forum

My first WCDDL modification - Better pagination

Status
Not open for further replies.
This is my first modification, so far it works perfect.
I've been learning some PHP lately, and I'm still getting used to how WCDDL works.

Just go to your index.

FIND FOR:
Code:
$paginator_type = in_array(strtolower($type),$allowed_types) ? $type : false;
echo paginator("index.php?page=#i#",$page,$max_pages,10,array("q" => urlencode(strip_tags($q)), "type" => $paginator_type));


REPLACE WITH
Code:
$paginator_type = in_array(strtolower($type),$allowed_types) ? $type : false;
    if ($page > "11") {
    echo '<a href="index.php?page=1';
    if(isset($type)){ echo "&type=".$paginator_type; }
    if(isset($q)){ echo "&q=".urlencode(strip_tags($q)); }
    echo '"><small>[ <strong>«</strong> First ]</small></a>';
    }
    echo paginator("index.php?page=#i#",$page,$max_pages,10,array("q" => urlencode(strip_tags($q)), "type" => $paginator_type));
    if ($page < $max_pages-10) {
    echo '<a href="index.php?page='.$max_pages;
    if(isset($type)){ echo "&type=".$paginator_type; }
    if(isset($q)){ echo "&q=".urlencode(strip_tags($q)); }
    echo '"><small>[ Last <strong>»</strong> ]</small></a>';
    }
 
Status
Not open for further replies.

About the author

C
Active Member · Joined
1,493
Messages
2
Reactions
38
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom