 |
 |
 |
 |
 |
| Author |
Message |
pollawat88
Joined: 29 Mar 2007 Posts: 10
|
|
pagination for Manage users and Manage banned IPs in admin |
|
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

|
|
| Thu May 22, 2008 8:30 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
pollawat88
Joined: 29 Mar 2007 Posts: 10
|
|
|
|
pls help me FIDO
|
|
| Sat May 24, 2008 1:34 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
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 
_________________ 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  |
|
| Sun May 25, 2008 5:10 pm |
|
 |
pollawat88
Joined: 29 Mar 2007 Posts: 10
|
|
|
|
i'm sorry to changed FI-DO name
i really need u help for my question ,pls.
|
|
| Mon May 26, 2008 12:43 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
In inc/mod/editusers.mdu change this:
 |  | foreach($sql->select(array('table' => 'users')) as $row){
?>
<tr <?=cute_that(); ?>>
<td width="125" align="center"> <?=($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"> <?=$echo['level_'.$row['level']]; ?>
<td width="70" align="center"><a onclick="window.open('<?=$PHP_SELF; ?>?mod=editusers&action=edituser&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:
 |  | //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"> <?=($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"> <?=$echo['level_'.$row['level']]; ?>
<td width="70" align="center"><a onclick="window.open('<?=$PHP_SELF; ?>?mod=editusers&action=edituser&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&start_from='.$previous.'"><<</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&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&start_from='.$i.'">>></a>';
}
//Pagination
?>
<tr>
<td><?=$npp_nav; ?></td>
</tr>
</table> |
|
|
| Thu May 29, 2008 6:30 pm |
|
 |
pollawat88
Joined: 29 Mar 2007 Posts: 10
|
|
|
|
Thank you FI-DO u helped me a lot
|
|
| Mon Jun 02, 2008 4:32 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
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  |
|
| Mon Jun 02, 2008 5:16 am |
|
 |
pollawat88
Joined: 29 Mar 2007 Posts: 10
|
|
|
|
sorry,i'm mistaked again
FI-DD !!!
thank u scott
|
|
| Mon Jun 02, 2008 9:43 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
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  |
|
| Wed Jun 04, 2008 5:16 am |
|
 |
|
|
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
|
|
 |
 |
 |
|