Joined: Feb 26, 2006 Posts: 337 Location: Jackson, Mississippi
Posted:
Tue Jun 09, 2009 2:08 am
So I am using a pagination class from
Only registered users can see links on this board! Get registered or login to the forums!
and it works fine. However, I believe because the urls are formed in the class it will not let me tap it.
Examples
Only registered users can see links on this board! Get registered or login to the forums!
Only registered users can see links on this board! Get registered or login to the forums!
Any thoughts on how I could make this work? Here is the class, slightly modified to accept css styles for the links.
Code:
<?php
class PaginateIt {
/*
PaginateIt - A PHP Pagination Class
===================================
Author: Brady Vercher
Version: 1.1.1
URL: http://www.bradyvercher.com/
Copyright And License Information
=================================
Copyright (c) 2005 Brady Vercher
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var $currentPage, $itemCount, $itemsPerPage, $linksHref, $linksToDisplay;
var $pageJumpBack, $pageJumpNext, $pageSeparator;
var $queryString, $queryStringVar, $setclass, $setactiveclass;
function SetCurrentPage($reqCurrentPage){
$this->currentPage = (integer) abs($reqCurrentPage);
}
function SetItemCount($reqItemCount){
$this->itemCount = (integer) abs($reqItemCount);
}
function SetItemsPerPage($reqItemsPerPage){
$this->itemsPerPage = (integer) abs($reqItemsPerPage);
}
function SetLinksHref($reqLinksHref){
$this->linksHref = $reqLinksHref;
}
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Wed Jun 10, 2009 6:26 pm
ShortLinks shortens the links AFTER the page is completely built, so I don't understand why they would not be tapped. How is this class included/instantiated? Also, are all your other links still tapped?
Where are you placing the taps? Can you give us an example of one?
Joined: Feb 26, 2006 Posts: 337 Location: Jackson, Mississippi
Posted:
Wed Jun 10, 2009 6:31 pm
montego wrote:
ShortLinks shortens the links AFTER the page is completely built, so I don't understand why they would not be tapped. How is this class included/instantiated? Also, are all your other links still tapped?
Where are you placing the taps? Can you give us an example of one?
Yes, many questions.
First yes, all other links tapped. I did manage to get it to work, but only by editing the class. Rigged so to speak.
Code:
$PaginateIt = new PaginateIt();
$PaginateIt->SetItemCount($numfiles);
$PaginateIt->SetItemsPerPage(6);
Code:
$content .= $PaginateIt->GetPageLinks();
If you notice in the class it builds the links, then displays them with the above.
Congratulations for the nice mod u made on Club Membership module. Can u share that module to use it on RavenNuke or u have it on the limit download? I dont know but I guess u use part of NSN Download modules. I like the module.
Joined: Feb 26, 2006 Posts: 337 Location: Jackson, Mississippi
Posted:
Wed Jun 10, 2009 7:32 pm
sexycoder wrote:
Hi floppydrivez
Congratulations for the nice mod u made on Club Membership module. Can u share that module to use it on RavenNuke or u have it on the limit download? I dont know but I guess u use part of NSN Download modules. I like the module.
Its a very custom copy of
Only registered users can see links on this board! Get registered or login to the forums!
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Sat Jun 13, 2009 8:40 am
floppydrivez, I see. That is explains it then as it is included prior to header.php. There must still be more code somewhere to make this all work, but since you have it working for you now with your "tweaks", I guess enough said. Well done.
Joined: Feb 26, 2006 Posts: 337 Location: Jackson, Mississippi
Posted:
Thu Jun 18, 2009 9:29 pm
montego wrote:
floppydrivez, I see. That is explains it then as it is included prior to header.php. There must still be more code somewhere to make this all work, but since you have it working for you now with your "tweaks", I guess enough said. Well done.
Sigh, I am such a noob. I will fix it. Thank you sir.
Joined: Feb 26, 2006 Posts: 337 Location: Jackson, Mississippi
Posted:
Thu Jun 18, 2009 10:27 pm
Wow, we were both making this harder than it had to be. So I suggest you guys look into using this paging class for raven nuke. I am very impressed. It has tons of options I haven't needed yet.
The problem I believe was this default value.
Code:
$this->SetLinksHref($_SERVER['PHP_SELF']);
Which returned /modules.php. So integration like this
$PaginateIt = new PaginateIt();
$PaginateIt->SetLinksHref('modules.php');//We changed this to make it work
$PaginateIt->SetItemCount($numfiles);//This is the total # of items we want to paginate
$PaginateIt->SetItemsPerPage(6);//Per page
Code:
//Have to tag the end of the query for per page
$result = $db->sql_query("SELECT fid, title, fileimage, md5, description, hits, size, cpoints FROM ".$prefix."_club_files WHERE cid='$cid' ORDER BY title ASC ".$PaginateIt->GetSqlLimit()."");
Code:
//This displays the page numbers and urls
echo $PaginateIt->GetPageLinks();
This is good cause we can use it in some other places on the site now. Thanks for your help montego.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum