本文整理汇总了PHP中Comments::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::load方法的具体用法?PHP Comments::load怎么用?PHP Comments::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comments
的用法示例。
在下文中一共展示了Comments::load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
}
} elseif ($CategoryName === 'Audiobooks' || $CategoryName === 'Comedy') {
$FullName = "{$Request['Title']} [{$Request['Year']}]";
$DisplayLink = "<span dir=\"ltr\">{$Request['Title']}</span> [{$Request['Year']}]";
} else {
$FullName = $Request['Title'];
$DisplayLink = "<span dir=\"ltr\">{$Request['Title']}</span>";
}
//Votes time
$RequestVotes = Requests::get_votes_array($RequestID);
$VoteCount = count($RequestVotes['Voters']);
$ProjectCanEdit = check_perms('project_team') && !$IsFilled && ($Request['CategoryID'] === '0' || $CategoryName === 'Music' && $Request['Year'] === '0');
$UserCanEdit = !$IsFilled && $LoggedUser['ID'] === $Request['UserID'] && $VoteCount < 2;
$CanEdit = $UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests');
// Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly)
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('requests', $RequestID);
View::show_header("View request: {$FullName}", 'comments,requests,bbcode,subscriptions');
?>
<div class="thin">
<div class="header">
<h2><a href="requests.php">Requests</a> > <?php
echo $CategoryName;
?>
> <?php
echo $DisplayLink;
?>
</h2>
<div class="linkbox">
<?php
if ($CanEdit) {
?>
示例2: json_die
<?php
if (empty($_GET['id']) || !is_number($_GET['id'])) {
json_die("failure");
}
list($NumComments, $Page, $Thread) = Comments::load('torrents', (int) $_GET['id'], false);
//---------- Begin printing
$JsonComments = array();
foreach ($Thread as $Key => $Post) {
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
$JsonComments[] = array('postId' => (int) $PostID, 'addedTime' => $AddedTime, 'bbBody' => $Body, 'body' => Text::full_format($Body), 'editedUserId' => (int) $EditedUserID, 'editedTime' => $EditedTime, 'editedUsername' => $EditedUsername, 'userinfo' => array('authorId' => (int) $AuthorID, 'authorName' => $Username, 'artist' => $Artist == 1, 'donor' => $Donor == 1, 'warned' => $Warned != '0000-00-00 00:00:00', 'avatar' => $Avatar, 'enabled' => $Enabled == 2 ? false : true, 'userTitle' => $UserTitle));
}
json_die("success", array('page' => (int) $Page, 'pages' => ceil($NumComments / TORRENT_COMMENTS_PER_PAGE), 'comments' => $JsonComments));
示例3: error
/**********|| Page to show individual threads || ********************************\
Things to expect in $_GET:
ThreadID: ID of the forum curently being browsed
page: The page the user's on.
page = 1 is the same as no page
********************************************************************************/
//---------- Things to sort out before it can start printing/generating content
// Check for lame SQL injection attempts
if (!is_number($_GET['collageid'])) {
error(0);
}
$CollageID = (int) $_GET['collageid'];
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('collages', $CollageID);
$DB->query("\n\tSELECT Name\n\tFROM collages\n\tWHERE ID = '{$CollageID}'");
list($Name) = $DB->next_record();
// Start printing
View::show_header("Comments for collage {$Name}", 'comments,bbcode,subscriptions');
?>
<div class="thin">
<div class="header">
<h2>
<a href="collages.php">Collages</a> >
<a href="collages.php?id=<?php
echo $CollageID;
?>
"><?php
echo $Name;
?>
示例4: array
print_r($TorrentTags);
print_r($Tags);
print_r($TorrentTagUserIDs);
die();
}*/
$CoverArt = $Cache->get_value("torrents_cover_art_{$GroupID}");
if (!$CoverArt) {
$DB->query("\n\t\tSELECT ID, Image, Summary, UserID, Time\n\t\tFROM cover_art\n\t\tWHERE GroupID = '{$GroupID}'\n\t\tORDER BY Time ASC");
$CoverArt = array();
$CoverArt = $DB->to_array();
if ($DB->has_results()) {
$Cache->cache_value("torrents_cover_art_{$GroupID}", $CoverArt, 0);
}
}
// Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly)
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('torrents', $GroupID);
// Start output
View::show_header($Title, 'browse,comments,torrent,bbcode,recommend,cover_art,subscriptions');
?>
<div class="thin">
<div class="header">
<h2><?php
echo $DisplayName;
?>
</h2>
<div class="linkbox">
<?php
if (check_perms('site_edit_wiki')) {
?>
<a href="torrents.php?action=editgroup&groupid=<?php
echo $GroupID;
示例5: count
//Votes time
$RequestVotes = Requests::get_votes_array($RequestID);
$VoteCount = count($RequestVotes['Voters']);
$ProjectCanEdit = check_perms('project_team') && !$IsFilled && ($CategoryID == 0 || $CategoryName == 'Music' && $Request['Year'] == 0);
$UserCanEdit = !$IsFilled && $LoggedUser['ID'] == $Request['UserID'] && $VoteCount < 2;
$CanEdit = $UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests');
if ($CategoryName == "Music") {
$JsonMusicInfo = array('composers' => isset($ArtistForm[4]) ? pullmediainfo($ArtistForm[4]) : array(), 'dj' => isset($ArtistForm[6]) ? pullmediainfo($ArtistForm[6]) : array(), 'artists' => isset($ArtistForm[1]) ? pullmediainfo($ArtistForm[1]) : array(), 'with' => isset($ArtistForm[2]) ? pullmediainfo($ArtistForm[2]) : array(), 'conductor' => isset($ArtistForm[5]) ? pullmediainfo($ArtistForm[5]) : array(), 'remixedBy' => isset($ArtistForm[3]) ? pullmediainfo($ArtistForm[3]) : array(), 'producer' => isset($ArtistForm[7]) ? pullmediainfo($ArtistForm[7]) : array());
} else {
$JsonMusicInfo = new stdClass();
//json_encodes into an empty object: {}
}
$JsonTopContributors = array();
$VoteMax = $VoteCount < 5 ? $VoteCount : 5;
for ($i = 0; $i < $VoteMax; $i++) {
$User = array_shift($RequestVotes['Voters']);
$JsonTopContributors[] = array('userId' => (int) $User['UserID'], 'userName' => $User['Username'], 'bounty' => (int) $User['Bounty']);
}
reset($RequestVotes['Voters']);
list($NumComments, $Page, $Thread) = Comments::load('requests', $RequestID, false);
$JsonRequestComments = array();
foreach ($Thread as $Key => $Post) {
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
$JsonRequestComments[] = array('postId' => (int) $PostID, 'authorId' => (int) $AuthorID, 'name' => $Username, 'donor' => $Donor == 1, 'warned' => $Warned != '0000-00-00 00:00:00', 'enabled' => $Enabled == 2 ? false : true, 'class' => Users::make_class_string($PermissionID), 'addedTime' => $AddedTime, 'avatar' => $Avatar, 'comment' => Text::full_format($Body), 'editedUserId' => (int) $EditedUserID, 'editedUsername' => $EditedUsername, 'editedTime' => $EditedTime);
}
$JsonTags = array();
foreach ($Request['Tags'] as $Tag) {
$JsonTags[] = $Tag;
}
json_print('success', array('requestId' => (int) $RequestID, 'requestorId' => (int) $Request['UserID'], 'requestorName' => $Requestor['Username'], 'isBookmarked' => Bookmarks::has_bookmarked('request', $RequestID), 'requestTax' => $RequestTax, 'timeAdded' => $Request['TimeAdded'], 'canEdit' => $CanEdit, 'canVote' => $CanVote, 'minimumVote' => $MinimumVote, 'voteCount' => $VoteCount, 'lastVote' => $Request['LastVote'], 'topContributors' => $JsonTopContributors, 'totalBounty' => (int) $RequestVotes['TotalBounty'], 'categoryId' => (int) $CategoryID, 'categoryName' => $CategoryName, 'title' => $Request['Title'], 'year' => (int) $Request['Year'], 'image' => $Request['Image'], 'bbDescription' => $Request['Description'], 'description' => Text::full_format($Request['Description']), 'musicInfo' => $JsonMusicInfo, 'catalogueNumber' => $Request['CatalogueNumber'], 'releaseType' => (int) $Request['ReleaseType'], 'releaseName' => $ReleaseName, 'bitrateList' => preg_split('/\\|/', $Request['BitrateList'], null, PREG_SPLIT_NO_EMPTY), 'formatList' => preg_split('/\\|/', $Request['FormatList'], null, PREG_SPLIT_NO_EMPTY), 'mediaList' => preg_split('/\\|/', $Request['MediaList'], null, PREG_SPLIT_NO_EMPTY), 'logCue' => html_entity_decode($Request['LogCue']), 'isFilled' => $IsFilled, 'fillerId' => (int) $Request['FillerID'], 'fillerName' => $Filler ? $Filler['Username'] : '', 'torrentId' => (int) $Request['TorrentID'], 'timeFilled' => $Request['TimeFilled'], 'tags' => $JsonTags, 'comments' => $JsonRequestComments, 'commentPage' => (int) $Page, 'commentPages' => (int) ceil($NumComments / TORRENT_COMMENTS_PER_PAGE), 'recordLabel' => $Request['RecordLabel'], 'oclc' => $Request['OCLC']));
示例6: ob_get_clean
?>
</td>
</tr>
<?php
}
}
if (!empty($TorrentList)) {
?>
</table>
</div>
<?php
}
$TorrentDisplayList = ob_get_clean();
//----------------- End building list and getting stats
// Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly)
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('artist', $ArtistID);
View::show_header($Name, 'browse,requests,bbcode,comments,voting,recommend,subscriptions');
?>
<div class="thin">
<div class="header">
<h2><?php
echo display_str($Name);
if ($RevisionID) {
?>
(Revision #<?php
echo $RevisionID;
?>
)<?php
}
if ($VanityHouseArtist) {
?>