本文整理汇总了PHP中Format::get_pages方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::get_pages方法的具体用法?PHP Format::get_pages怎么用?PHP Format::get_pages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::get_pages方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// Main query
$DB->query("\n\tSELECT\n\t\tSQL_CALC_FOUND_ROWS\n\t\tf.FriendID,\n\t\tf.Comment,\n\t\tm.Username,\n\t\tm.Uploaded,\n\t\tm.Downloaded,\n\t\tm.PermissionID,\n\t\tm.Paranoia,\n\t\tm.LastAccess,\n\t\ti.Avatar\n\tFROM friends AS f\n\t\tJOIN users_main AS m ON f.FriendID = m.ID\n\t\tJOIN users_info AS i ON f.FriendID = i.UserID\n\tWHERE f.UserID = '{$UserID}'\n\tORDER BY Username\n\tLIMIT {$Limit}");
$Friends = $DB->to_array(false, MYSQLI_BOTH, array(6, 'Paranoia'));
// Number of results (for pagination)
$DB->query('SELECT FOUND_ROWS()');
list($Results) = $DB->next_record();
// Start printing stuff
?>
<div class="thin">
<div class="header">
<h2>Friends List</h2>
</div>
<div class="linkbox">
<?php
// Pagination
$Pages = Format::get_pages($Page, $Results, FRIENDS_PER_PAGE, 9);
echo $Pages;
?>
</div>
<div class="box pad">
<?php
if ($Results == 0) {
echo '<p>You have no friends! :(</p>';
}
// Start printing out friends
foreach ($Friends as $Friend) {
list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Paranoia, $LastAccess, $Avatar) = $Friend;
?>
<form class="manage_form" name="friends" action="friends.php" method="post">
<input type="hidden" name="auth" value="<?php
echo $LoggedUser['AuthKey'];
示例2: error
if (!check_perms("users_mod")) {
error(404);
}
Text::$TOC = true;
define('QUESTIONS_PER_PAGE', 25);
list($Page, $Limit) = Format::page_limit(QUESTIONS_PER_PAGE);
$DB->query("\n\t\tSELECT\n\t\t\tuq.ID,\n\t\t\tuq.Question,\n\t\t\tuq.UserID,\n\t\t\tuq.Date,\n\t\t\t(\n\t\t\t\tSELECT COUNT(1)\n\t\t\t\tFROM staff_answers AS sa\n\t\t\t\tWHERE sa.QuestionID = uq.ID\n\t\t\t) AS Responses\n\t\tFROM user_questions AS uq\n\t\tWHERE uq.ID NOT IN\n\t\t\t\t(\n\t\t\t\t\tSELECT siq.QuestionID\n\t\t\t\t\tFROM staff_ignored_questions AS siq\n\t\t\t\t\tWHERE siq.UserID = '{$LoggedUser['ID']}'\n\t\t\t\t)\n\t\t\tAND uq.ID NOT IN\n\t\t\t\t(\n\t\t\t\t\tSELECT sq.QuestionID\n\t\t\t\t\tFROM staff_answers AS sq\n\t\t\t\t\tWHERE sq.UserID = '{$LoggedUser['ID']}'\n\t\t\t\t)\n\t\tORDER BY uq.Date DESC\n\t\tLIMIT {$Limit}");
$Questions = $DB->to_array();
$DB->query("\n\tSELECT COUNT(1)\n\tFROM user_questions");
list($TotalQuestions) = $DB->next_record();
View::show_header('Ask the Staff', 'questions,bbcode');
if ($TotalQuestions > QUESTIONS_PER_PAGE) {
?>
<div class="linkbox">
<?php
$Pages = Format::get_pages($Page, $TotalQuestions, QUESTIONS_PER_PAGE);
echo $Pages;
?>
</div>
<?php
}
?>
<div class="thin">
<div class="header">
<h2>User Questions</h2>
<h3><?php
echo number_format($TotalQuestions);
?>
questions asked; <?php
echo number_format(count($Questions));
?>
示例3: FOUND_ROWS
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
} else {
$DB->query("\n\t\tSELECT\n\t\t\tSQL_CALC_FOUND_ROWS\n\t\t\tunt.TorrentID,\n\t\t\tunt.UnRead,\n\t\t\tunt.FilterID,\n\t\t\tt.GroupID\n\t\tFROM users_notify_torrents AS unt\n\t\t\tJOIN torrents AS t ON t.ID = unt.TorrentID\n\t\tWHERE unt.UserID = {$UserID}" . ($FilterID ? " AND unt.FilterID = {$FilterID}" : '') . "\n\t\tORDER BY {$OrderCol} {$OrderWay}\n\t\tLIMIT {$Limit}");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query('SELECT FOUND_ROWS()');
list($TorrentCount) = $DB->next_record();
}
$GroupIDs = $FilterIDs = $UnReadIDs = array();
foreach ($Results as $Torrent) {
$GroupIDs[$Torrent['GroupID']] = 1;
$FilterIDs[$Torrent['FilterID']] = 1;
if ($Torrent['UnRead']) {
$UnReadIDs[] = $Torrent['TorrentID'];
}
}
$Pages = Format::get_pages($Page, $TorrentCount, NOTIFICATIONS_PER_PAGE, 9);
if (!empty($GroupIDs)) {
$GroupIDs = array_keys($GroupIDs);
$FilterIDs = array_keys($FilterIDs);
$TorrentGroups = Torrents::get_groups($GroupIDs);
// Get the relevant filter labels
$DB->query('
SELECT ID, Label, Artists
FROM users_notify_filters
WHERE ID IN (' . implode(',', $FilterIDs) . ')');
$Filters = $DB->to_array('ID', MYSQLI_ASSOC, array('Artists'));
foreach ($Filters as &$Filter) {
$Filter['Artists'] = explode('|', trim($Filter['Artists'], '|'));
foreach ($Filter['Artists'] as &$FilterArtist) {
$FilterArtist = mb_strtolower($FilterArtist, 'UTF-8');
}
示例4: FOUND_ROWS
</form>
</div>
<?php
if ($RunQuery) {
$Results = $DB->query($SQL);
$DB->query('SELECT FOUND_ROWS()');
list($NumResults) = $DB->next_record();
$DB->set_query_id($Results);
} else {
$DB->query('SET @nothing = 0');
$NumResults = 0;
}
?>
<div class="linkbox">
<?php
$Pages = Format::get_pages($Page, $NumResults, USERS_PER_PAGE, 11);
echo $Pages;
?>
</div>
<div class="box pad center">
<h2><?php
echo number_format($NumResults);
?>
results</h2>
<table width="100%">
<tr class="colhead">
<td>Username</td>
<td>Ratio</td>
<td>IP address</td>
<td>Email</td>
<td>Joined</td>
示例5: list
}
break;
}
list($Page, $Limit) = Format::page_limit(MESSAGES_PER_PAGE);
// Get messages
$StaffPMs = $DB->query("\n\tSELECT\n\t\tSQL_CALC_FOUND_ROWS\n\t\tID,\n\t\tSubject,\n\t\tUserID,\n\t\tStatus,\n\t\tLevel,\n\t\tAssignedToUser,\n\t\tDate,\n\t\tUnread,\n\t\tResolverID\n\tFROM staff_pm_conversations\n\t{$WhereCondition}\n\tORDER BY {$SortStr} Level DESC, Date DESC\n\tLIMIT {$Limit}\n");
$DB->query('SELECT FOUND_ROWS()');
list($NumResults) = $DB->next_record();
$DB->set_query_id($StaffPMs);
$CurURL = Format::get_url();
if (empty($CurURL)) {
$CurURL = 'staffpm.php?';
} else {
$CurURL = "staffpm.php?{$CurURL}&";
}
$Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
$Row = 'a';
// Start page
?>
<div class="thin">
<div class="header">
<h2><?php
echo $ViewString;
?>
Staff PMs</h2>
<div class="linkbox">
<?php
if ($IsStaff) {
?>
<a href="staffpm.php" class="brackets">View your unanswered</a>
<?php
示例6: list
<tr>
<td><strong>Posted by:</strong></td>
<td><input type="search" id="username" name="user" placeholder="Username" size="70" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" name="submit" value="Search" />
</td>
</tr>
</table>
</form>
<br />
</div>
</div>
<?php
$Pages = Format::get_pages($Page, $ThreadInfo['Posts'], $PerPage, 9);
echo $Pages;
?>
</div>
<?php
if ($ThreadInfo['NoPoll'] == 0) {
if (!(list($Question, $Answers, $Votes, $Featured, $Closed) = $Cache->get_value("polls_{$ThreadID}"))) {
$DB->query("\n\t\t\tSELECT Question, Answers, Featured, Closed\n\t\t\tFROM forums_polls\n\t\t\tWHERE TopicID = '{$ThreadID}'");
list($Question, $Answers, $Featured, $Closed) = $DB->next_record(MYSQLI_NUM, array(1));
$Answers = unserialize($Answers);
$DB->query("\n\t\t\tSELECT Vote, COUNT(UserID)\n\t\t\tFROM forums_polls_votes\n\t\t\tWHERE TopicID = '{$ThreadID}'\n\t\t\tGROUP BY Vote");
$VoteArray = $DB->to_array(false, MYSQLI_NUM);
$Votes = array();
foreach ($VoteArray as $VoteSet) {
list($Key, $Value) = $VoteSet;
$Votes[$Key] = $Value;
示例7: implode
$SQL = "\n\t\tSELECT\n\t\t\tSQL_CALC_FOUND_ROWS\n\t\t\tGroupID,\n\t\t\tTorrentID,\n\t\t\tTime,\n\t\t\tCategoryID\n\t\tFROM temp_sections_torrents_user";
if (!empty($Words)) {
$SQL .= "\n\t\tWHERE Name LIKE '%" . implode("%' AND Name LIKE '%", $Words) . "%'";
}
$SQL .= "\n\t\tORDER BY {$Order} {$Way}\n\t\tLIMIT {$Limit}";
}
$DB->query($SQL);
$GroupIDs = $DB->collect('GroupID');
$TorrentsInfo = $DB->to_array('TorrentID', MYSQLI_ASSOC);
$DB->query('SELECT FOUND_ROWS()');
list($TorrentCount) = $DB->next_record();
$Results = Torrents::get_groups($GroupIDs);
$Action = display_str($_GET['type']);
$User = Users::user_info($UserID);
View::show_header($User['Username'] . "'s {$Action} torrents", 'voting');
$Pages = Format::get_pages($Page, $TorrentCount, TORRENTS_PER_PAGE);
?>
<div class="thin">
<div class="header">
<h2><a href="user.php?id=<?php
echo $UserID;
?>
"><?php
echo $User['Username'];
?>
</a><?php
echo "'s {$Action} torrents";
?>
</h2>
</div>
<div>
示例8: array
}
?>
</table>
<div class="box box2 box_request_desc">
<div class="head"><strong>Description</strong></div>
<div class="pad">
<?php
echo Text::full_format($Request['Description']);
?>
</div>
</div>
<div id="request_comments">
<div class="linkbox">
<a name="comments"></a>
<?php
$Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
echo $Pages;
?>
</div>
<?php
//---------- Begin printing
CommentsView::render_comments($Thread, $LastRead, "requests.php?action=view&id={$RequestID}");
if ($Pages) {
?>
<div class="linkbox pager"><?php
echo $Pages;
?>
</div>
<?php
}
View::parse('generic/reply/quickreply.php', array('InputName' => 'pageid', 'InputID' => $RequestID, 'Action' => 'comments.php?page=requests', 'InputAction' => 'take_post', 'SubscribeBox' => true));
示例9: db_string
if (!empty($_REQUEST['notes'])) {
$sql .= "WHERE Reason LIKE '%" . db_string($_REQUEST['notes']) . "%' ";
}
if (!empty($_REQUEST['ip']) && preg_match('/' . IP_REGEX . '/', $_REQUEST['ip'])) {
if (!empty($_REQUEST['notes'])) {
$sql .= "AND '" . Tools::ip_to_unsigned($_REQUEST['ip']) . "' BETWEEN FromIP AND ToIP ";
} else {
$sql .= "WHERE '" . Tools::ip_to_unsigned($_REQUEST['ip']) . "' BETWEEN FromIP AND ToIP ";
}
}
$sql .= "ORDER BY FromIP ASC";
$sql .= " LIMIT " . $Limit;
$Bans = $DB->query($sql);
$DB->query('SELECT FOUND_ROWS()');
list($Results) = $DB->next_record();
$PageLinks = Format::get_pages($Page, $Results, BANS_PER_PAGE, 11);
View::show_header('IP Address Bans');
$DB->set_query_id($Bans);
?>
<div class="header">
<h2>IP Address Bans</h2>
</div>
<div>
<form class="search_form" name="bans" action="" method="get">
<table cellpadding="6" cellspacing="1" border="0" class="layout border" width="100%">
<tr>
<td class="label"><label for="ip">IP address:</label></td>
<td>
<input type="hidden" name="action" value="ip_ban" />
<input type="search" id="ip" name="ip" size="20" value="<?php
示例10: error
if (!check_perms('users_mod')) {
error(403);
}
define('USERS_PER_PAGE', 50);
list($Page, $Limit) = Format::page_limit(USERS_PER_PAGE);
$SearchQuery = '';
if ($_GET['username']) {
$SearchString = db_string($_GET['username']);
$SearchQuery = " WHERE Username LIKE '%{$SearchString}%' ";
}
$Title = "Donor Rewards";
$DB->query("\n\tSELECT\n\t\tSQL_CALC_FOUND_ROWS\n\t\tu.Username,\n\t\td.UserID,\n\t\td.Rank,\n\t\td.Hidden,\n\t\td.DonationTime,\n\t\tr.IconMouseOverText,\n\t\tr.AvatarMouseOverText,\n\t\tr.CustomIcon,\n\t\tr.SecondAvatar,\n\t\tr.CustomIconLink\n\tFROM users_donor_ranks AS d\n\t\tLEFT JOIN users_main AS u ON u.ID = d.UserID\n\t\tLEFT JOIN donor_rewards AS r ON r.UserID = d.UserID\n\t{$SearchQuery}\n\tORDER BY d.Rank DESC\n\tLIMIT {$Limit}");
$Users = $DB->to_array();
$DB->query('SELECT FOUND_ROWS()');
list($Results) = $DB->next_record();
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 9);
View::show_header($Title);
?>
<div class="header">
<h2><?php
echo $Title;
?>
</h2>
<div class="linkbox">
<?php
echo $Pages;
?>
</div>
</div>
<form action="" method="get">
示例11: FOUND_ROWS
$SQL .= " AND t.AuthorID = '{$AuthorID}' ";
}
if (!empty($ThreadAfterDate)) {
$SQL .= " AND t.CreatedTime >= '{$ThreadAfterDate}'";
}
if (!empty($ThreadBeforeDate)) {
$SQL .= " AND t.CreatedTime <= '{$ThreadBeforeDate}'";
}
$SQL .= "\n\t\tORDER BY t.LastPostTime DESC\n\t\tLIMIT {$Limit}";
}
// Perform the query
$Records = $DB->query($SQL);
$DB->query('SELECT FOUND_ROWS()');
list($Results) = $DB->next_record();
$DB->set_query_id($Records);
$Pages = Format::get_pages($Page, $Results, POSTS_PER_PAGE, 9);
echo $Pages;
?>
</div>
<table cellpadding="6" cellspacing="1" border="0" class="forum_list border" width="100%">
<tr class="colhead">
<td>Forum</td>
<td><?php
echo !empty($ThreadID) ? 'Post begins' : 'Topic';
?>
</td>
<td>Topic creation time</td>
<td>Last post time</td>
</tr>
<?php
if (!$DB->has_results()) {
示例12: implode
echo $Max;
?>
&chd=t:<?php
echo implode(',', $InFlow);
?>
|<?php
echo implode(',', $OutFlow);
?>
&chls=2,4,0&chdl=New+Registrations|Disabled+Users&chf=bg,s,FFFFFF00" alt="User Flow vs. Time" />
</div>
<?php
}
?>
<div class="linkbox">
<?php
$Pages = Format::get_pages($Page, $Results, DAYS_PER_PAGE, 11);
echo $Pages;
?>
</div>
<table width="100%">
<tr class="colhead">
<td>Date</td>
<td>(+) Joined</td>
<td>(-) Manual</td>
<td>(-) Ratio</td>
<td>(-) Inactivity</td>
<td>(-) Total</td>
<td>Net Growth</td>
</tr>
<?php
while (list($Date, $Month, $Joined, $Manual, $Ratio, $Inactivity) = $DB->next_record()) {
示例13:
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="4" class="center">
<input type="submit" value="Search" />
</td>
</tr>
</table>
</form>
</div>
<br />
<?php
$Pages = Format::get_pages($Page, $NumResults, ARTICLES_PER_PAGE);
if ($Pages) {
?>
<div class="linkbox pager"><?php
echo $Pages;
?>
</div>
<?php
}
?>
<table width="100%">
<tr class="colhead">
<td>Article</td>
<td>Last updated on</td>
<td>Last edited by</td>
</tr>
示例14:
<?php
if ($UnreadSQL) {
?>
<a href="userhistory.php?action=quote_notifications&showall=1" class="brackets">Show all quotes</a>
<?php
} else {
?>
<a href="userhistory.php?action=quote_notifications" class="brackets">Show unread quotes</a>
<?php
}
?>
<a href="userhistory.php?action=subscriptions" class="brackets">Show subscriptions</a>
<a href="userhistory.php?action=quote_notifications&catchup=1" class="brackets">Catch up</a>
<br /><br />
<?php
$Pages = Format::get_pages($Page, $NumResults, TOPICS_PER_PAGE, 9);
echo $Pages;
?>
</div>
</div>
<?php
if (!$NumResults) {
?>
<div class="center">No<?php
echo $UnreadSQL ? ' new' : '';
?>
quotes.</div>
<?php
}
?>
<br />
示例15: foreach
</div>
</div>
<?php
if (!$NumResults) {
?>
<div class="center">
No subscriptions<?php
echo $ShowUnread ? ' with unread posts' : '';
?>
</div>
<?php
} else {
?>
<div class="linkbox">
<?php
$Pages = Format::get_pages($Page, $NumResults, $PerPage, 11);
echo $Pages;
?>
</div>
<?php
foreach ($Results as $Result) {
switch ($Result['Page']) {
case 'artist':
$Links = 'Artist: <a href="artist.php?id=' . $Result['PageID'] . '">' . display_str($Result['Name']) . '</a>';
$JumpLink = 'artist.php?id=' . $Result['PageID'] . '&postid=' . $Result['PostID'] . '#post' . $Result['PostID'];
break;
case 'collages':
$Links = 'Collage: <a href="collages.php?id=' . $Result['PageID'] . '">' . display_str($Result['Name']) . '</a>';
$JumpLink = 'collages.php?action=comments&collageid=' . $Result['PageID'] . '&postid=' . $Result['PostID'] . '#post' . $Result['PostID'];
break;
case 'requests':