Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
pagination for Manage users and Manage banned IPs in admin

 
Reply to topic    Forum Index » Help View previous topic
View next topic
pagination for Manage users and Manage banned IPs in admin
Author Message
pollawat88



Joined: 29 Mar 2007
Posts: 10

Post pagination for Manage users and Manage banned IPs in admin Reply with quote
I tried to search for longtime but nobody asked this question

1. How to make the pagination for manage uers for edit user mod because when u have too many users who registed they will take too longtime when loading for editing and i also like to have ASC or DESC option

2. the same question for manage banned IPs and manage last comment

thank you for kindly reply

Razz Razz Razz
Thu May 22, 2008 8:30 am View user's profile Send private message
Guest








Please login to hide the ads.

pollawat88



Joined: 29 Mar 2007
Posts: 10

Post Reply with quote
pls help me FIDO
Sat May 24, 2008 1:34 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
That would be neat. I'm sure it can be done. I wish I knew the answer for you. FI-DD just hasn't seen your thread yet, be patient and hopefully he will find the answer you desire. He doesn't miss anything around here.

p.s. FI-DD is not FIDO. Fido is a dogs name Razz

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Sun May 25, 2008 5:10 pm View user's profile Send private message Visit poster's website AIM Address
pollawat88



Joined: 29 Mar 2007
Posts: 10

Post Reply with quote
Razz Razz Razz i'm sorry to changed FI-DO name

i really need u help for my question ,pls.
Mon May 26, 2008 12:43 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
In inc/mod/editusers.mdu change this:
Code:
   foreach($sql->select(array('table' => 'users')) as $row){
?>

  <tr <?=cute_that(); ?>>
   <td width="125" align="center">&nbsp;<?=($row['name'] ? $row['name'] : $row['username']); ?>
   <td width="150" align="center"><?=langdate('j M Y', $row['date']); ?>
   <td width="210" align="center"><?=($row['last_visit'] ? langdate('j M Y', $row['last_visit']) : ''); ?>
   <td width="75" align="center"><?=$row['publications']; ?>
   <td width="100" align="center">&nbsp;<?=$echo['level_'.$row['level']]; ?>
   <td width="70" align="center"><a onclick="window.open('<?=$PHP_SELF; ?>?mod=editusers&amp;action=edituser&amp;id=<?=$row['id']; ?>', '_Useredit', 'height=450,resizable=yes,scrollbars=yes,width=500');return false;" href="#"><?=$echo['edit']; ?></a>
   <td width="15" align="center"><input name="selected_users[]" value="<?=$row['id']; ?>" type="checkbox">

<?
   }
?>

</table>


to this:
Code:
//Pagination
              $news_per_page = 1;
              $start_from = ($_GET['start_from'] ? $_GET['start_from'] : '');
              $i = $start_from;
              $j = 0;
              $total_news = $sql->table_count('users');
//Pagination

   foreach($sql->select(array('table' => 'users')) as $row){
   
//Pagination
                  if ($j < $start_from){
                         $j++;
                         continue;
                   }
                   $i++;
//Pagination
?>

  <tr <?=cute_that(); ?>>
   <td width="125" align="center">&nbsp;<?=($row['name'] ? $row['name'] : $row['username']); ?>
   <td width="150" align="center"><?=langdate('j M Y', $row['date']); ?>
   <td width="210" align="center"><?=($row['last_visit'] ? langdate('j M Y', $row['last_visit']) : ''); ?>
   <td width="75" align="center"><?=$row['publications']; ?>
   <td width="100" align="center">&nbsp;<?=$echo['level_'.$row['level']]; ?>
   <td width="70" align="center"><a onclick="window.open('<?=$PHP_SELF; ?>?mod=editusers&amp;action=edituser&amp;id=<?=$row['id']; ?>', '_Useredit', 'height=450,resizable=yes,scrollbars=yes,width=500');return false;" href="#"><?=$echo['edit']; ?></a>
   <td width="15" align="center"><input name="selected_users[]" value="<?=$row['id']; ?>" type="checkbox">

<?

//Pagination
            if ($i >= $news_per_page + $start_from){
                   break;
             }
//Pagination

   }
   
//Pagination
            if ($start_from > 0){
                  $previous = $start_from - $news_per_page;
                  $npp_nav .= '<a href="'.$PHP_SELF.'?mod=editusers&amp;start_from='.$previous.'">&lt;&lt;</a>';
            }

            if ($total_news > $news_per_page){
                  $npp_nav .= ' [ ';
                  $enpages_count = @ceil($total_news / $news_per_page);
                  $enpages_start_from = 0;
                  $enpages = '';

                     for ($j = 1; $j <= $enpages_count; $j++){
                           if ($enpages_start_from != $start_from){
                                 $enpages .= '<a href="'.$PHP_SELF.'?mod=editusers&amp;start_from='.$enpages_start_from.'">'.$j.'</a> ';
                           } else {
                                 $enpages .= ' <b> <u>'.$j.'</u> </b> ';
                           }

                        $enpages_start_from += $news_per_page;
                     }

                   $npp_nav .= $enpages;
               $npp_nav .= ' ] ';
            }

            if ($total_news > $i){
                  $npp_nav .= '<a href="'.$PHP_SELF.'?mod=editusers&amp;start_from='.$i.'">&gt;&gt;</a>';
            }
//Pagination
?>

            <tr>
             <td><?=$npp_nav; ?></td>
            </tr>

</table>

Thu May 29, 2008 6:30 pm View user's profile Send private message
pollawat88



Joined: 29 Mar 2007
Posts: 10

Post Reply with quote
Thank you FI-DO u helped me a lot
Mon Jun 02, 2008 4:32 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
FI-DD

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Mon Jun 02, 2008 5:16 am View user's profile Send private message Visit poster's website AIM Address
pollawat88



Joined: 29 Mar 2007
Posts: 10

Post Reply with quote
sorry,i'm mistaked again

FI-DD !!!

thank u scott
Mon Jun 02, 2008 9:43 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 2027
Location: US

Post Reply with quote
lol, it made me laugh

_________________
www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me Wink
Wed Jun 04, 2008 5:16 am View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
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
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.