私はJavaとすべてをセットアップしましたが、ページングではありません。ページネーションページのリンクが表示されますが、制限はありません。ここに私が持っているものがあります:
<div class="pagination-holder clearfix" style="float: right;">
<div id="compact-pagination" ></div></div>
</div>
<div class="pagination-holder clearfix" style="float: right;">
<div id="compact-pagination" style="float: right;"></div></div>
<div id="compact-pagination" style="float: right;"></div>
<SCRIPT type="text/javascript">
$(function() {
$('#compact-pagination').pagination({
edges: 2,
currentPage: 1,
hrefText: "#page-",
prevText: "Prev",
nextText: "Next",
items: <? echo $count; ?>,
itemsOnPage: 2,
cssStyle: 'compact-theme'
});
});
</SCRIPT>
次に、ここに私のphp。
では、なぜ制限しないのでしょうか。
リンク: http://flaviusmatis.github.com/simplePagination.js/
Php:
<?php $sql = "SELECT
*
FROM
users
ORDER BY user_id";
$result = mysql_query($sql);
if(!$result)
{
echo 'The category could not be displayed, please try again later.' . mysql_error();
}
else
{
if(mysql_num_rows($result) == 0)
{header('/');
echo 'This category does not exist.';
}
else
{
//display category data
while($row = mysql_fetch_assoc($result))
{
?>
<ul class="memberlist">
<li> <div id="memberlist" style="float: left; width: 300px; margin-left: 11px; margin-top: 10px; margin-bottom: 10px; border: 1px solid #CCC; border-radius:7px; background-color:#666;padding:5px 5px 5px 5px;">
<div id="memberlist_top">
<div id="memberlist_avatar">
<img src="<?php echo $row['avatar'] ?>" style="border: 1px solid #CBCBCB; padding: 3px; width: 100px; height: 100px;" />
</div>
<div id="memberlist_top_right">
<p id="memberlist_username"><a href="/index.php?page=user&id=<?php echo $row['user_id'] ?>"><?php echo $row['user_name'] ?></a></p>
<p style="text-align: center;"><img src="<?php echo$row['site_rank_image']?>"</p>
<p style="text-align: center;" id="ml_rep"> Reputation: 0 </p>
<p id="ml_posts">Post count: <?php echo $row['post'] ?></p>
</div>
<div class="clearfix" style="height: 5px;"> </div>
</div>
<div id="memberlist_bottom">
<p id="ml_bottom_p"><img src="template/images/layout/icon.png" style="vertical-align: middle" /> Date Registered: <span id="ml_bottom_span"><?php echo date(" F j, Y, g:i A", strtotime($row['user_date']))?> </span></p>
<p id="ml_bottom_p"><img src="template/images/layout/icon.png" style="vertical-align: middle" /> Last online: <span id="ml_bottom_span"><?php echo date(" F j, Y, g:i A", strtotime($row['dt']))?> </span></p>
<p id="ml_bottom_p" style="width: 284px; height: 30px; overflow-x: hidden; cursor: pointer;" title="Coming Soon"><img src="template/images/layout/icon.png" style="vertical-align: middle;" /> Last Activity: <span id="ml_bottom_span" style="text-decoration: underline;">Coming Soon</span></p>
<p id="ml_bottom_p"><img src="template/images/layout/icon.png" style="vertical-align: middle" /> Is online now: <span id="ml_bottom_span"> <? if($row
['online'] == 1) { // checks to see if the user allows their email to be shown, where '1' means they allow it to be shown
echo'Yes';
} else {
echo'No'; // if they allow it, it displays their email
} ?> </span></p>
</div>
</div> </li>
</ul>
<? }}}?>