vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=200413

[How To] Paginate Admin CP Results
by Iain M
02 Jan 2009 13:20

Had just finished developing a hack, and realized over time that the pages in the admin cp would become quite long if they weren't paginated, so I ventured into the modcp/banning.php file to help me out...

This article is for hack authors, and presumes you are familiar with vBulletin and PHP in general.

First block of code...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Things to change are the $perpage variable, the table_name.

Then the output of the pagination...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Here you have to change incent_admin.php to your filename and the do=, and the 4 in the print_description_row.

Then there's your query:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

All you just need to add to your query is the LIMIT $start, $perpage.

If you've done it correctly you should have page navigation on your admin cp page.


Here's the code in full from one of my pages, if you don't understand anything above:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(Phrases are hard coded coz the hack is just for my own use, for now:))


Also, thanks to Revan for his [How-To] Paginate your results for user pages.

Vaupell 07 Feb 2009 23:56

Awsome TX....

5x stars


EDIT :
Im haveing problems with linking to pages..

The problem is, linking from pagenavs
and the one that lists my query is DO Find
and when i change the pagenav to fit the links to the other pages fail


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



and find is the one printing results, and works fine, only shows the ammount i
set it for, howewer when clicking additional pages, it goes blank just as if it cant
located the requested destination..

any suggestions ? Im confused where the link goes, i can see it goes to do=find but the rest page=X
heh nope.

Iain M 24 Feb 2009 17:41

Sorry for the late reply... don't come on here often.

Would you mind PM'ing me your file, and I'll take a look at it?


All times are GMT. The time now is 19:16.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.