Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[How To] Paginate Admin CP Results
Iain M
Join Date: Jul 2005
Posts: 256

Glasgow, Scotland
by Iain M Iain M is offline 02 Jan 2009

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.
Views: 4377
Reply With Quote
Comments
  #2  
Old 08 Feb 2009, 00:56
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Real name: Martin
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.
__________________
My website Evisystems
- - - Stuff - - -
follow the white rabbit, feed! your head

Last edited by Vaupell; 08 Feb 2009 at 23:54.
Reply With Quote
  #3  
Old 24 Feb 2009, 18:41
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Real name: Iain
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?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:53.

Layout Options | Width: Wide Color: