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


PHP Requests::update_sphinx_requests方法代码示例

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


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

示例1: foreach

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 — [url=' . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . '[/url] — 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();
$SphQL->raw_query("UPDATE requests, requests_delta SET torrentid = {$TorrentID}, fillerid = {$FillerID} WHERE id = {$RequestID}", false);
header("Location: requests.php?action=view&id={$RequestID}");
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:take_fill.php

示例2: trim

            }
            if ($HasCue == "'1'") {
                $Title .= ' / Cue';
            }
            $Title .= ' / ' . trim($Media);
            if ($Scene == '1') {
                $Title .= ' / Scene';
            }
            if ($Freeleech == '1') {
                $Title .= ' / Freeleech!';
            }
            if ($Freeleech == '2') {
                $Title .= ' / Neutral leech!';
            }
            $UploaderInfo = Users::user_info($UploaderID);
            $Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&authkey=[[AUTHKEY]]&torrent_pass=[[PASSKEY]]&id=' . $TorrentID, $UploaderInfo['Username'], "torrents.php?id={$PageID}", trim($TagList));
            $Feed->populate('torrents_bookmarks_t_' . $LoggedUser['torrent_pass'], $Item);
        }
    } elseif ($Type == 'request') {
        $DB->query("\n\t\t\tSELECT UserID\n\t\t\tFROM {$Table}\n\t\t\tWHERE {$Col} = '" . db_string($PageID) . "'");
        if ($DB->record_count() < 100) {
            // Sphinx doesn't like huge MVA updates. Update sphinx_requests_delta
            // and live with the <= 1 minute delay if we have more than 100 bookmarkers
            $Bookmarkers = implode(',', $DB->collect('UserID'));
            $SphQL = new SphinxqlQuery();
            $SphQL->raw_query("UPDATE requests, requests_delta SET bookmarker = ({$Bookmarkers}) WHERE id = {$PageID}");
        } else {
            Requests::update_sphinx_requests($PageID);
        }
    }
}
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:add.php


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