当前位置: 首页>>代码示例>>PHP>>正文


PHP Format::get_pages方法代码示例

本文整理汇总了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'];
开发者ID:karamanolev,项目名称:Gazelle,代码行数:31,代码来源:friends.php

示例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));
?>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:questions.php

示例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');
        }
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:notify.php

示例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>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:advancedsearch.php

示例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 
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:staff_inbox.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;
开发者ID:mohirt,项目名称:Gazelle,代码行数:31,代码来源:thread.php

示例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>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:user.php

示例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&amp;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));
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:request.php

示例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 
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:bans.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">
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:donor_rewards.php

示例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()) {
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:search.php

示例12: implode

    echo $Max;
    ?>
&amp;chd=t:<?php 
    echo implode(',', $InFlow);
    ?>
|<?php 
    echo implode(',', $OutFlow);
    ?>
&amp;chls=2,4,0&amp;chdl=New+Registrations|Disabled+Users&amp;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()) {
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:user_flow.php

示例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>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:search.php

示例14:

<?php 
if ($UnreadSQL) {
    ?>
			<a href="userhistory.php?action=quote_notifications&amp;showall=1" class="brackets">Show all quotes</a>&nbsp;&nbsp;&nbsp;
<?php 
} else {
    ?>
			<a href="userhistory.php?action=quote_notifications" class="brackets">Show unread quotes</a>&nbsp;&nbsp;&nbsp;
<?php 
}
?>
			<a href="userhistory.php?action=subscriptions" class="brackets">Show subscriptions</a>&nbsp;&nbsp;&nbsp;
			<a href="userhistory.php?action=quote_notifications&amp;catchup=1" class="brackets">Catch up</a>&nbsp;&nbsp;&nbsp;
			<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 />
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:quote_notifications.php

示例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'] . '&amp;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'] . '&amp;postid=' . $Result['PostID'] . '#post' . $Result['PostID'];
                break;
            case 'requests':
开发者ID:karamanolev,项目名称:Gazelle,代码行数:31,代码来源:subscriptions.php


注:本文中的Format::get_pages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。