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


PHP Requests::get_votes_array方法代码示例

本文整理汇总了PHP中Requests::get_votes_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Requests::get_votes_array方法的具体用法?PHP Requests::get_votes_array怎么用?PHP Requests::get_votes_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Requests的用法示例。


在下文中一共展示了Requests::get_votes_array方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: number_format

			<div class="head">
				<span style="font-weight: bold;">Requests (<?php 
    echo number_format(count($Requests));
    ?>
)</span>
				<a href="#" style="float: right;" onclick="$('#requests').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Show</a>
			</div>
			<table id="requests" class="request_table hidden">
				<tr class="colhead">
					<td>Format / Bitrate / Media</td>
					<td>Votes</td>
					<td>Bounty</td>
				</tr>
<?php 
    foreach ($Requests as $Request) {
        $RequestVotes = Requests::get_votes_array($Request['ID']);
        if ($Request['BitrateList'] != '') {
            $BitrateString = implode(', ', explode('|', $Request['BitrateList']));
            $FormatString = implode(', ', explode('|', $Request['FormatList']));
            $MediaString = implode(', ', explode('|', $Request['MediaList']));
            if ($Request['LogCue']) {
                $FormatString .= ' - ' . $Request['LogCue'];
            }
        } else {
            $BitrateString = 'Unknown';
            $FormatString = 'Unknown';
            $MediaString = 'Unknown';
        }
        ?>
				<tr class="requestrows <?php 
        echo ++$i % 2 ? 'rowa' : 'rowb';
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:details.php

示例2: sqltime

//We're all good! Fill!
$DB->query("\n\tUPDATE requests\n\tSET FillerID = {$FillerID},\n\t\tTorrentID = {$TorrentID},\n\t\tTimeFilled = '" . sqltime() . "'\n\tWHERE ID = {$RequestID}");
if ($CategoryName === 'Music') {
    $ArtistForm = Requests::get_artists($RequestID);
    $ArtistName = Artists::display_artists($ArtistForm, false, true);
    $FullName = $ArtistName . $Title;
} else {
    $FullName = $Title;
}
$DB->query("\n\tSELECT UserID\n\tFROM requests_votes\n\tWHERE RequestID = {$RequestID}");
$UserIDs = $DB->to_array();
foreach ($UserIDs as $User) {
    list($VoterID) = $User;
    Misc::send_pm($VoterID, 0, "The request \"{$FullName}\" has been filled", 'One of your requests&#8202;&mdash;&#8202;[url=' . site_url() . "requests.php?action=view&amp;id={$RequestID}]{$FullName}" . '[/url]&#8202;&mdash;&#8202;has been filled. You can view it here: [url]' . site_url() . "torrents.php?torrentid={$TorrentID}" . '[/url]');
}
$RequestVotes = Requests::get_votes_array($RequestID);
Misc::write_log("Request {$RequestID} ({$FullName}) was filled by user {$FillerID} ({$FillerUsername}) with the torrent {$TorrentID} for a " . Format::get_size($RequestVotes['TotalBounty']) . ' bounty.');
// Give bounty
$DB->query("\n\tUPDATE users_main\n\tSET Uploaded = (Uploaded + " . $RequestVotes['TotalBounty'] . ")\n\tWHERE ID = {$FillerID}");
$Cache->delete_value("user_stats_{$FillerID}");
$Cache->delete_value("request_{$RequestID}");
if ($GroupID) {
    $Cache->delete_value("requests_group_{$GroupID}");
}
$DB->query("\n\tSELECT ArtistID\n\tFROM requests_artists\n\tWHERE RequestID = {$RequestID}");
$ArtistIDs = $DB->to_array();
foreach ($ArtistIDs as $ArtistID) {
    $Cache->delete_value("artists_requests_{$ArtistID}");
}
Requests::update_sphinx_requests($RequestID);
$SphQL = new SphinxqlQuery();
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:take_fill.php

示例3: error

    error('You do not have enough uploaded to make a request.');
}
if (!$NewRequest) {
    if (empty($ReturnEdit)) {
        $Request = Requests::get_request($RequestID);
        if ($Request === false) {
            error(404);
        }
        // Define these variables to simplify _GET['groupid'] requests later on
        $CategoryID = $Request['CategoryID'];
        $Title = $Request['Title'];
        $Year = $Request['Year'];
        $Image = $Request['Image'];
        $ReleaseType = $Request['ReleaseType'];
        $GroupID = $Request['GroupID'];
        $VoteArray = Requests::get_votes_array($RequestID);
        $VoteCount = count($VoteArray['Voters']);
        $LogCue = $Request['LogCue'];
        $NeedCue = strpos($LogCue, 'Cue') !== false;
        $NeedLog = strpos($LogCue, 'Log') !== false;
        if ($NeedLog) {
            if (strpos($LogCue, '%') !== false) {
                preg_match('/\\d+/', $LogCue, $Matches);
                $MinLogScore = (int) $Matches[0];
            }
        }
        $IsFilled = !empty($Request['TorrentID']);
        $CategoryName = $Categories[$CategoryID - 1];
        $ProjectCanEdit = check_perms('project_team') && !$IsFilled && ($CategoryID === '0' || $CategoryName === 'Music' && $Request['Year'] === '0');
        $CanEdit = !$IsFilled && $LoggedUser['ID'] === $Request['UserID'] && $VoteCount < 2 || $ProjectCanEdit || check_perms('site_moderate_requests');
        if (!$CanEdit) {
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:new_edit.php


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