Forums
Welcome to the home of BaD_DuD :: Forums :: General :: General
 
<< Previous thread | Next thread >>
[moved] Suggestion
Moderators: bad_dud
Author Post
deltree
Thu Aug 06 2009, 06:28AM
Registered Member #439
Joined: Tue Apr 03 2007, 02:39AM
Location: Spain
Posts: 1
Hi BaD_DuD!

I have made some changes to the clan_info_menu plugin, because I had some few problems before with the size of my clan, and then my site begin don't showing the "\admin\admin_member.php" page; for this reason, I made a pagination routine to solve this problem!

Change the lines between (143-160) on the file " \107_plugins\clan_info_menu\ad min\admin_member.php" to the code bellow.


// first we need to decide how mu ch to display per page
$limit = 10;

if(!isset($_GET['page']))
{
  $page = 1;
}else
{
  $page = $_GET['page'];
}

//start and end records
$start = ($page - 1) * $limit;
// $sql -> db_Select(" clan_roster", "*", " clan_roster_id>=0 ORDER BY cla n_roster_tag ASC");
$trows = $sql -> db_Count(" clan_roster", "(*)", " WHERE clan_roster_id>=0 ORDER  BY clan_roster_tag ASC");

$maxPage = ceil($trows/$limit) ;

$self = $_SERVER['PHP_SELF'];
$pg ="<span class='class1'>";

if ($page > 1)
{
   $page1  = $page - 1;
   $prev  = " <a href='" .$self."?page=".$page1."'  title='Preview Page'>[Prev]</ a> ";
   $first = " <a href='" .$self."?page=1' title=' First Page'>[First]</a> ";
}
else
{
   $prev  = '&nbsp;'; // we' re on page one, don' t print previous link
   $first = '&nbsp;'; //  nor the first page link
}

for ($x = 1; $x <= $maxPage;  $x++) {
   if ($x!=$page) {
   $pg .= "<a href='".$self."? page=".$x."' title='Goto Page:  ".$x."'>".$x."</a> ";}
   else{
   $pg .= "<b><font style=' font-size: 12pt'>".$x."</ font></b> ";
   }
}

$pg.= "</span>";

if ($page < $maxPage)
{
   $page1 = $page + 1;
   $next = " <a href='" .$self."?page=".$page1."'  title='Next Page'>[Next]</ a> ";
   $last = " <a href='" .$self."?page=".$maxPage."'  title='Last Page'>[Last]</ a> ";
}
else
{
   $next = '&nbsp;'; // we' re on the last page, don' t print next link
   $last = '&nbsp;'; //  nor the last page link
}

// echo $first . $prev . "  Showing page $page of $maxPag e pages " . $next . $last;

//  ====== Clan Member ========== ===========
$text = "
<style type='text/css'>
.class1 A:link {background:  #FFCC00; text-decoration:  none; font-size: 12pt}
.class1 A:visited {background:  #FFCC00; text-decoration:  none; font-size: 12pt}
.class1 A:active {background:  #FFCC00; text-decoration:  none; font-size: 12pt}
.class1 A:hover {background:  #FFCC00; font-weight:bold;  color: red; font-size: 12pt;}
}
</style>

<div style='text-align:center' >".$rs -> form_open("post" , e_SELF, "clanmember")."
<br>Register: ".$start."-" .$limit." of ".$trows." | Goto Page: " .$first . $prev . " ".$pg." " . $next . $last."

 <table class='cimfborder'  style='width:95%'>
   <tr>
     <td colspan='2' class=' cimforumheader'>".CI_19."</ td>
   </tr>
   <tr>
     <td colspan='2' class=' cimforumheader2' style='text- align:center'><span class=' smalltext'>".CI_20."</span></ td>
   </tr>\n";


if(!$sql -> db_Select(" clan_roster", "*", " clan_roster_id>=0 ORDER BY cla n_roster_tag ASC LIMIT $start, $limit")){
   $text .= "<tr><td colspan=' 2' class='cimforumheader3'  style='text-align:center' ><i>".CI_21."</i></td></tr>";

I Hopefully that it comes to help many others too!

Best Regards for ALL,
DelTree

[ Edited Thu Aug 06 2009, 06:30AM ]
Back to top
Website
bad_dud
Thu Aug 06 2009, 07:49AM


Registered Member #1
Joined: Sat Sep 11 2004, 12:33PM
Location: Stockholm
Posts: 236
thx for yor tip but this will not work in the Clan Manager. (Rewriten)

Clan Info Menu is dead and i will not make any change on it but it's nice that you make a notis to all other.

============================== ======
May the beer force be with you
Back to top
Website
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
 
 
 
Render time: 0.3958 sec, 0.0418 of that for queries.