首页 > 网站 > 建站经验 > 正文

Speedphp分页标签代码

2024-04-25 20:31:56
字体:
来源:转载
供稿:网友

{if $pager}

共有记录{$pager.total_count}条,共有{$pager.total_page}页(每页{$pager.page_size}条):

{$max_page=10}

{if $pager.current_page%$max_page ==0}

{$start_page=floor($pager.current_page/$max_page)*$max_page+1-$max_page}

{else}

{$start_page=floor($pager.current_page/$max_page)*$max_page+1}

{/if}

{if ($start_page+$max_page)<=$pager.total_page}

{$end_page=$start_page+$max_page-1}

{else}

{$end_page=$pager.total_page}

{/if}

{if $start_page <= 1 and $pager.current_page <= 1 }

首 |

« |

{elseif $pager.current_page > 1 and $pager.total_page <= $max_page}

首 |

« |

{elseif $pager.current_page > 1 and $pager.current_page<=$max_page}

首 |

« |

{else}

首 |

« |

-{$max_page} |

{/if}

{foreach from = $pager.all_pages item = thepage}

{if $thepage <= $end_page and $thepage >= $start_page}

{if $thepage == $pager.current_page}

{$thepage} |

{else}

{$thepage} |

{/if}

{/if}

{/foreach}

{if $end_page == $pager.total_page }

{if $pager.current_page == $pager.last_page}

» |

尾 |

{else}

» |

尾 |

{/if}

{else}

+{$max_page} |

» |

尾 |

{/if}

{/if}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表