コード例 #1
0
ファイル: comments.php プロジェクト: Kufirc/Gazelle
if ($Count > 0) {
    $DB->set_query_id($Comments);
    while (list($AuthorID, $Page, $PageID, $Name, $PostID, $Body, $AddedTime, $EditedTime, $EditedUserID) = $DB->next_record()) {
        $Link = Comments::get_url($Page, $PageID, $PostID);
        switch ($Page) {
            case 'artist':
                $Header = " on <a href=\"artist.php?id={$PageID}\">{$Name}</a>";
                break;
            case 'collages':
                $Header = " on <a href=\"collages.php?id={$PageID}\">{$Name}</a>";
                break;
            case 'requests':
                $Header = ' on ' . Artists::display_artists($Artists[$PageID]) . " <a href=\"requests.php?action=view&id={$PageID}\">{$Name}</a>";
                break;
            case 'torrents':
                $Header = ' on ' . Artists::display_artists($Artists[$PageID]) . " <a href=\"torrents.php?id={$PageID}\">{$Name}</a>";
                break;
        }
        CommentsView::render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $EditedTime, $Link, false, $Header, false);
    }
} else {
    ?>
	<div class="center">No results.</div>
<?php 
}
?>
	<div class="linkbox">
		<?php 
echo $Pages;
?>
	</div>
コード例 #2
0
ファイル: index.php プロジェクト: bigsony/Gazelle
     }
     //foreach ($Top10 as $Torrent)
     // Send warnings to uploaders of torrents that will be deleted this week
     $DB->query("\n\t\t\tSELECT\n\t\t\t\tt.ID,\n\t\t\t\tt.GroupID,\n\t\t\t\ttg.Name,\n\t\t\t\tt.Format,\n\t\t\t\tt.Encoding,\n\t\t\t\tt.UserID\n\t\t\tFROM torrents AS t\n\t\t\t\tJOIN torrents_group AS tg ON tg.ID = t.GroupID\n\t\t\t\tJOIN users_info AS u ON u.UserID = t.UserID\n\t\t\tWHERE t.last_action < NOW() - INTERVAL 20 DAY\n\t\t\t\tAND t.last_action != 0\n\t\t\t\tAND u.UnseededAlerts = '1'\n\t\t\tORDER BY t.last_action ASC");
     $TorrentIDs = $DB->to_array();
     $TorrentAlerts = array();
     foreach ($TorrentIDs as $TorrentID) {
         list($ID, $GroupID, $Name, $Format, $Encoding, $UserID) = $TorrentID;
         if (array_key_exists($UserID, $InactivityExceptionsMade) && time() < $InactivityExceptionsMade[$UserID]) {
             // don't notify exceptions
             continue;
         }
         if (!array_key_exists($UserID, $TorrentAlerts)) {
             $TorrentAlerts[$UserID] = array('Count' => 0, 'Msg' => '');
         }
         $ArtistName = Artists::display_artists(Artists::get_artist($GroupID), false, false, false);
         if ($ArtistName) {
             $Name = "{$ArtistName} - {$Name}";
         }
         if ($Format && $Encoding) {
             $Name .= " [{$Format} / {$Encoding}]";
         }
         $TorrentAlerts[$UserID]['Msg'] .= "\n[url=" . site_url() . "torrents.php?torrentid={$ID}]" . $Name . "[/url]";
         $TorrentAlerts[$UserID]['Count']++;
     }
     foreach ($TorrentAlerts as $UserID => $MessageInfo) {
         Misc::send_pm($UserID, 0, 'Unseeded torrent notification', $MessageInfo['Count'] . " of your uploads will be deleted for inactivity soon. Unseeded torrents are deleted after 4 weeks. If you still have the files, you can seed your uploads by ensuring the torrents are in your client and that they aren't stopped. You can view the time that a torrent has been unseeded by clicking on the torrent description line and looking for the \"Last active\" time. For more information, please go [url=" . site_url() . "wiki.php?action=article&amp;id=663]here[/url].\n\nThe following torrent" . ($MessageInfo['Count'] > 1 ? 's' : '') . ' will be removed for inactivity:' . $MessageInfo['Msg'] . "\n\nIf you no longer wish to receive these notifications, please disable them in your profile settings.");
     }
 }
 $DB->query("\n\t\tUPDATE staff_pm_conversations\n\t\tSET Status = 'Resolved', ResolverID = '0'\n\t\tWHERE Date < NOW() - INTERVAL 1 MONTH\n\t\t\tAND Status = 'Open'\n\t\t\tAND AssignedToUser IS NULL");
 Donations::schedule();
コード例 #3
0
ファイル: take_fill.php プロジェクト: Kufirc/Gazelle
    if ($FormatList && $FormatList != 'Any' && !Misc::search_joined_string($FormatList, $Format)) {
        $Err = "{$Format} is not an allowed format for this request.";
    }
    if ($MediaList && $MediaList != 'Any' && !Misc::search_joined_string($MediaList, $Media)) {
        $Err = "{$Media} is not allowed media for this request.";
    }
}
// Fill request
if (!empty($Err)) {
    error($Err);
}
//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}");
コード例 #4
0
ファイル: editgroupid.php プロジェクト: Kufirc/Gazelle
				<ul>
					<li><?php 
    echo Artists::display_artists($Artists[$OldGroupID], true, false);
    ?>
 - <a href="torrents.php?id=<?php 
    echo $OldGroupID;
    ?>
"><?php 
    echo $Name;
    ?>
</a></li>
				</ul>
				<h3>Into the group:</h3>
				<ul>
					<li><?php 
    echo Artists::display_artists($Artists[$GroupID], true, false);
    ?>
 - <a href="torrents.php?id=<?php 
    echo $GroupID;
    ?>
"><?php 
    echo $NewName;
    ?>
</a></li>
				</ul>
				<input type="submit" value="Confirm" />
			</form>
		</div>
	</div>
<?php 
    View::show_footer();
コード例 #5
0
ファイル: torrents.php プロジェクト: karamanolev/Gazelle
function generate_torrent_json($Caption, $Tag, $Details, $Limit)
{
    global $LoggedUser, $Categories;
    $results = array();
    foreach ($Details as $Detail) {
        list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TorrentTags, $Format, $Encoding, $Media, $Scene, $HasLog, $HasCue, $LogScore, $Year, $GroupYear, $RemasterTitle, $Snatched, $Seeders, $Leechers, $Data, $ReleaseType, $Size) = $Detail;
        $Artist = Artists::display_artists(Artists::get_artist($GroupID), false, true);
        $TruncArtist = substr($Artist, 0, strlen($Artist) - 3);
        $TagList = array();
        if ($TorrentTags != '') {
            $TorrentTags = explode(' ', $TorrentTags);
            foreach ($TorrentTags as $TagKey => $TagName) {
                $TagName = str_replace('_', '.', $TagName);
                $TagList[] = $TagName;
            }
        }
        // Append to the existing array.
        $results[] = array('torrentId' => (int) $TorrentID, 'groupId' => (int) $GroupID, 'artist' => $TruncArtist, 'groupName' => $GroupName, 'groupCategory' => (int) $GroupCategory, 'groupYear' => (int) $GroupYear, 'remasterTitle' => $RemasterTitle, 'format' => $Format, 'encoding' => $Encoding, 'hasLog' => $HasLog == 1, 'hasCue' => $HasCue == 1, 'media' => $Media, 'scene' => $Scene == 1, 'year' => (int) $Year, 'tags' => $TagList, 'snatched' => (int) $Snatched, 'seeders' => (int) $Seeders, 'leechers' => (int) $Leechers, 'data' => (int) $Data, 'size' => (int) $Size);
    }
    return array('caption' => $Caption, 'tag' => $Tag, 'limit' => (int) $Limit, 'results' => $results);
}
コード例 #6
0
ファイル: browse.php プロジェクト: karamanolev/Gazelle
         $TotalSnatched += $T['Snatched'];
     }
 } else {
     $Torrents = array($Result['id'] => $GroupInfo['Torrents'][$Result['id']]);
 }
 $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
 $JsonArtists = array();
 if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
     unset($ExtendedArtists[2]);
     unset($ExtendedArtists[3]);
     $DisplayName = Artists::display_artists($ExtendedArtists, false, false, true);
     foreach ($ExtendedArtists[1] as $Artist) {
         $JsonArtists[] = array('id' => (int) $Artist['id'], 'name' => $Artist['name'], 'aliasid' => (int) $Artist['id']);
     }
 } elseif (!empty($Artists)) {
     $DisplayName = Artists::display_artists(array(1 => $Artists), false, false, true);
     foreach ($Artists as $Artist) {
         $JsonArtists[] = array('id' => (int) $Artist['id'], 'name' => $Artist['name'], 'aliasid' => (int) $Artist['id']);
     }
 } else {
     $DisplayName = '';
 }
 if ($GroupResults && (count($Torrents) > 1 || isset($GroupedCategories[$CategoryID - 1]))) {
     // These torrents are in a group
     $LastRemasterYear = '-';
     $LastRemasterTitle = '';
     $LastRemasterRecordLabel = '';
     $LastRemasterCatalogueNumber = '';
     $LastMedia = '';
     $EditionID = 0;
     unset($FirstUnknown);
コード例 #7
0
            if ($CategoryName == 'Music') {
                $Links .= Artists::display_artists(Requests::get_artists($Result['PageID'])) . '<a href="requests.php?action=view&amp;id=' . $Result['PageID'] . '" dir="ltr">' . $Request['Title'] . " [" . $Request['Year'] . "]</a>";
            } elseif ($CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
                $Links .= '<a href="requests.php?action=view&amp;id=' . $Result['PageID'] . '" dir="ltr">' . $Request['Title'] . " [" . $Request['Year'] . "]</a>";
            } else {
                $Links .= '<a href="requests.php?action=view&amp;id=' . $Result['PageID'] . '">' . $Request['Title'] . "</a>";
            }
            $JumpLink = 'requests.php?action=view&amp;id=' . $Result['PageID'] . '&amp;postid=' . $Result['PostID'] . '#post' . $Result['PostID'];
            break;
        case 'torrents':
            if (!isset($TorrentGroups[$Result['PageID']])) {
                // Deleted or moved torrent group
                continue 2;
            }
            $GroupInfo = $TorrentGroups[$Result['PageID']];
            $Links = 'Torrent: ' . Artists::display_artists($GroupInfo['ExtendedArtists']) . '<a href="torrents.php?id=' . $GroupInfo['ID'] . '" dir="ltr">' . $GroupInfo['Name'] . '</a>';
            if ($GroupInfo['Year'] > 0) {
                $Links .= " [" . $GroupInfo['Year'] . "]";
            }
            if ($GroupInfo['ReleaseType'] > 0) {
                $Links .= " [" . $ReleaseTypes[$GroupInfo['ReleaseType']] . "]";
            }
            $JumpLink = 'torrents.php?id=' . $GroupInfo['ID'] . '&postid=' . $Result['PostID'] . '#post' . $Result['PostID'];
            break;
        default:
            continue 2;
    }
    ?>
	<table class="forum_post box vertical_margin noavatar">
		<tr class="colhead_dark notify_<?php 
    echo $Result['Page'];
コード例 #8
0
ファイル: user.php プロジェクト: Kufirc/Gazelle
				</a>
			</td>
		</tr>
<?php 
    $PageSize = 0;
    foreach ($TorrentsInfo as $TorrentID => $Info) {
        list($GroupID, , $Time) = array_values($Info);
        extract(Torrents::array_group($Results[$GroupID]));
        $Torrent = $Torrents[$TorrentID];
        $TorrentTags = new Tags($TagList);
        if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5])) {
            unset($ExtendedArtists[2]);
            unset($ExtendedArtists[3]);
            $DisplayName = Artists::display_artists($ExtendedArtists);
        } elseif (!empty($Artists)) {
            $DisplayName = Artists::display_artists(array(1 => $Artists));
        } else {
            $DisplayName = '';
        }
        $DisplayName .= '<a href="torrents.php?id=' . $GroupID . '&amp;torrentid=' . $TorrentID . '" class="tooltip" title="View torrent" dir="ltr">' . $GroupName . '</a>';
        if ($GroupYear > 0) {
            $DisplayName .= " [{$GroupYear}]";
        }
        if ($GroupVanityHouse) {
            $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
        }
        $ExtraInfo = Torrents::torrent_info($Torrent);
        if ($ExtraInfo) {
            $DisplayName .= " - {$ExtraInfo}";
        }
        ?>
コード例 #9
0
ファイル: upload_handle.php プロジェクト: Kufirc/Gazelle
    header("Location: torrents.php?id={$GroupID}");
}
if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
} else {
    ignore_user_abort(true);
    ob_flush();
    flush();
    ob_start();
    // So we don't keep sending data to the client
}
//******************************************************************************//
//--------------- IRC announce and feeds ---------------------------------------//
$Announce = '';
if ($Type == 'Music') {
    $Announce .= Artists::display_artists($ArtistForm, false);
}
$Announce .= trim($Properties['Title']) . ' ';
if ($Type == 'Music') {
    $Announce .= '[' . trim($Properties['Year']) . ']';
    if ($Type == 'Music' && $Properties['ReleaseType'] > 0) {
        $Announce .= ' [' . $ReleaseTypes[$Properties['ReleaseType']] . ']';
    }
    $Announce .= ' - ';
    $Announce .= trim($Properties['Format']) . ' / ' . trim($Properties['Bitrate']);
    if ($HasLog == 1) {
        $Announce .= ' / Log';
    }
    if ($LogInDB) {
        $Announce .= ' / ' . $LogScoreAverage . '%';
    }
コード例 #10
0
ファイル: text.class.php プロジェクト: Kufirc/Gazelle
 private static function to_html($Array)
 {
     global $SSL;
     self::$Levels++;
     /*
      * Hax prevention
      * That's the original comment on this.
      * Most likely this was implemented to avoid anyone nesting enough
      * elements to reach PHP's memory limit as nested elements are
      * solved recursively.
      * Original value of 10, it is now replaced in favor of
      * $MaximumNests.
      * If this line is ever executed then something is, infact
      * being haxed as the if before the block type switch for different
      * tags should always be limiting ahead of this line.
      * (Larger than vs. smaller than.)
      */
     if (self::$Levels > self::$MaximumNests) {
         return $Block['Val'];
         // Hax prevention, breaks upon exceeding nests.
     }
     $Str = '';
     foreach ($Array as $Block) {
         if (is_string($Block)) {
             $Str .= self::smileys($Block);
             continue;
         }
         if (self::$Levels < self::$MaximumNests) {
             switch ($Block['Type']) {
                 case 'b':
                     $Str .= '<strong>' . self::to_html($Block['Val']) . '</strong>';
                     break;
                 case 'u':
                     $Str .= '<span style="text-decoration: underline;">' . self::to_html($Block['Val']) . '</span>';
                     break;
                 case 'i':
                     $Str .= '<span style="font-style: italic;">' . self::to_html($Block['Val']) . "</span>";
                     break;
                 case 's':
                     $Str .= '<span style="text-decoration: line-through;">' . self::to_html($Block['Val']) . '</span>';
                     break;
                 case 'important':
                     $Str .= '<strong class="important_text">' . self::to_html($Block['Val']) . '</strong>';
                     break;
                 case 'user':
                     $Str .= '<a href="user.php?action=search&amp;search=' . urlencode($Block['Val']) . '">' . $Block['Val'] . '</a>';
                     break;
                 case 'artist':
                     $Str .= '<a href="artist.php?artistname=' . urlencode(Format::undisplay_str($Block['Val'])) . '">' . $Block['Val'] . '</a>';
                     break;
                 case 'rule':
                     $Rule = trim(strtolower($Block['Val']));
                     if ($Rule[0] != 'r' && $Rule[0] != 'h') {
                         $Rule = 'r' . $Rule;
                     }
                     $Str .= '<a href="rules.php?p=upload#' . urlencode(Format::undisplay_str($Rule)) . '">' . preg_replace('/[aA-zZ]/', '', $Block['Val']) . '</a>';
                     break;
                 case 'torrent':
                     $Pattern = '/(' . NONSSL_SITE_URL . '\\/torrents\\.php.*[\\?&]id=)?(\\d+)($|&|\\#).*/i';
                     $Matches = array();
                     if (preg_match($Pattern, $Block['Val'], $Matches)) {
                         if (isset($Matches[2])) {
                             $GroupID = $Matches[2];
                             $Groups = Torrents::get_groups(array($GroupID), true, true, false);
                             if ($Groups[$GroupID]) {
                                 $Group = $Groups[$GroupID];
                                 $Str .= Artists::display_artists($Group['ExtendedArtists']) . '<a href="torrents.php?id=' . $GroupID . '">' . $Group['Name'] . '</a>';
                             } else {
                                 $Str .= '[torrent]' . str_replace('[inlineurl]', '', $Block['Val']) . '[/torrent]';
                             }
                         }
                     } else {
                         $Str .= '[torrent]' . str_replace('[inlineurl]', '', $Block['Val']) . '[/torrent]';
                     }
                     break;
                 case 'wiki':
                     $Str .= '<a href="wiki.php?action=article&amp;name=' . urlencode($Block['Val']) . '">' . $Block['Val'] . '</a>';
                     break;
                 case 'tex':
                     $Str .= '<img style="vertical-align: middle;" src="' . STATIC_SERVER . 'blank.gif" onload="if (this.src.substr(this.src.length - 9, this.src.length) == \'blank.gif\') { this.src = \'https://chart.googleapis.com/chart?cht=tx&amp;chf=bg,s,FFFFFF00&amp;chl=' . urlencode(mb_convert_encoding($Block['Val'], 'UTF-8', 'HTML-ENTITIES')) . '&amp;chco=\' + hexify(getComputedStyle(this.parentNode, null).color); }" alt="' . $Block['Val'] . '" />';
                     break;
                 case 'plain':
                     $Str .= $Block['Val'];
                     break;
                 case 'pre':
                     $Str .= '<pre>' . $Block['Val'] . '</pre>';
                     break;
                 case 'code':
                     $Str .= '<code>' . $Block['Val'] . '</code>';
                     break;
                 case 'list':
                     $Str .= "<{$Block['ListType']} class=\"postlist\">";
                     foreach ($Block['Val'] as $Line) {
                         $Str .= '<li>' . self::to_html($Line) . '</li>';
                     }
                     $Str .= '</' . $Block['ListType'] . '>';
                     break;
                 case 'align':
                     $ValidAttribs = array('left', 'center', 'right');
                     if (!in_array($Block['Attr'], $ValidAttribs)) {
                         $Str .= '[align=' . $Block['Attr'] . ']' . self::to_html($Block['Val']) . '[/align]';
                     } else {
                         $Str .= '<div style="text-align: ' . $Block['Attr'] . ';">' . self::to_html($Block['Val']) . '</div>';
                     }
                     break;
                 case 'color':
                 case 'colour':
                     $ValidAttribs = array('aqua', 'black', 'blue', 'fuchsia', 'green', 'grey', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red', 'silver', 'teal', 'white', 'yellow');
                     if (!in_array($Block['Attr'], $ValidAttribs) && !preg_match('/^#[0-9a-f]{6}$/', $Block['Attr'])) {
                         $Str .= '[color=' . $Block['Attr'] . ']' . self::to_html($Block['Val']) . '[/color]';
                     } else {
                         $Str .= '<span style="color: ' . $Block['Attr'] . ';">' . self::to_html($Block['Val']) . '</span>';
                     }
                     break;
                 case 'headline':
                     $text = self::to_html($Block['Val']);
                     $raw = self::raw_text($Block['Val']);
                     if (!in_array($Block['Attr'], self::$HeadlineLevels)) {
                         $Str .= sprintf('%1$s%2$s%1$s', str_repeat('=', $Block['Attr'] + 1), $text);
                     } else {
                         $id = '_' . crc32($raw . self::$HeadlineID);
                         if (self::$InQuotes === 0) {
                             self::$Headlines[] = array($Block['Attr'], $raw, $id);
                         }
                         $Str .= sprintf('<h%1$d id="%3$s">%2$s</h%1$d>', $Block['Attr'] + 2, $text, $id);
                         self::$HeadlineID++;
                     }
                     break;
                 case 'inlinesize':
                 case 'size':
                     $ValidAttribs = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10');
                     if (!in_array($Block['Attr'], $ValidAttribs)) {
                         $Str .= '[size=' . $Block['Attr'] . ']' . self::to_html($Block['Val']) . '[/size]';
                     } else {
                         $Str .= '<span class="size' . $Block['Attr'] . '">' . self::to_html($Block['Val']) . '</span>';
                     }
                     break;
                 case 'quote':
                     self::$NoImg++;
                     // No images inside quote tags
                     self::$InQuotes++;
                     if (self::$InQuotes == self::$NestsBeforeHide) {
                         //Put quotes that are nested beyond the specified limit in [hide] tags.
                         $Str .= '<strong>Older quotes</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
                         $Str .= '<blockquote class="hidden spoiler">';
                     }
                     if (!empty($Block['Attr'])) {
                         $Exploded = explode('|', self::to_html($Block['Attr']));
                         if (isset($Exploded[1]) && (is_numeric($Exploded[1]) || in_array($Exploded[1][0], array('a', 't', 'c', 'r')) && is_numeric(substr($Exploded[1], 1)))) {
                             // the part after | is either a number or starts with a, t, c or r, followed by a number (forum post, artist comment, torrent comment, collage comment or request comment, respectively)
                             $PostID = trim($Exploded[1]);
                             $Str .= '<a href="#" onclick="QuoteJump(event, \'' . $PostID . '\'); return false;"><strong class="quoteheader">' . $Exploded[0] . '</strong> wrote: </a>';
                         } else {
                             $Str .= '<strong class="quoteheader">' . $Exploded[0] . '</strong> wrote: ';
                         }
                     }
                     $Str .= '<blockquote>' . self::to_html($Block['Val']) . '</blockquote>';
                     if (self::$InQuotes == self::$NestsBeforeHide) {
                         //Close quote the deeply nested quote [hide].
                         $Str .= '</blockquote><br />';
                         // Ensure new line after quote train hiding
                     }
                     self::$NoImg--;
                     self::$InQuotes--;
                     break;
                 case 'hide':
                     $Str .= '<strong>' . ($Block['Attr'] ? $Block['Attr'] : 'Hidden text') . '</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
                     $Str .= '<blockquote class="hidden spoiler">' . self::to_html($Block['Val']) . '</blockquote>';
                     break;
                 case 'mature':
                     if (G::$LoggedUser['EnableMatureContent']) {
                         if (!empty($Block['Attr'])) {
                             $Str .= '<strong class="mature" style="font-size: 1.2em;">Mature content:</strong><strong> ' . $Block['Attr'] . '</strong><br /> <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
                             $Str .= '<blockquote class="hidden spoiler">' . self::to_html($Block['Val']) . '</blockquote>';
                         } else {
                             $Str .= '<strong>Use of the [mature] tag requires a description.</strong> The correct format is as follows: <strong>[mature=description] ...content... [/mature]</strong>, where "description" is a mandatory description of the post. Misleading descriptions will be penalized. For further information on our mature content policies, please refer to this <a href="wiki.php?action=article&amp;id=1063">wiki</a>.';
                         }
                     } else {
                         $Str .= '<span class="mature_blocked" style="font-style: italic;"><a href="wiki.php?action=article&amp;id=1063">Mature content</a> has been blocked. You can choose to view mature content by editing your <a href="user.php?action=edit&amp;userid=' . G::$LoggedUser['ID'] . '">settings</a>.</span>';
                     }
                     break;
                 case 'img':
                     if (self::$NoImg > 0 && self::valid_url($Block['Val'])) {
                         $Str .= '<a rel="noreferrer" target="_blank" href="' . $Block['Val'] . '">' . $Block['Val'] . '</a> (image)';
                         break;
                     }
                     if (!self::valid_url($Block['Val'], '\\.(jpe?g|gif|png|bmp|tiff)')) {
                         $Str .= '[img]' . $Block['Val'] . '[/img]';
                     } else {
                         $LocalURL = self::local_url($Block['Val']);
                         if ($LocalURL) {
                             $Str .= '<img class="scale_image" onclick="lightbox.init(this, $(this).width());" alt="' . $Block['Val'] . '" src="' . $LocalURL . '" />';
                         } else {
                             $Str .= '<img class="scale_image" onclick="lightbox.init(this, $(this).width());" alt="' . $Block['Val'] . '" src="' . ImageTools::process($Block['Val']) . '" />';
                         }
                     }
                     break;
                 case 'aud':
                     if (self::$NoImg > 0 && self::valid_url($Block['Val'])) {
                         $Str .= '<a rel="noreferrer" target="_blank" href="' . $Block['Val'] . '">' . $Block['Val'] . '</a> (audio)';
                         break;
                     }
                     if (!self::valid_url($Block['Val'], '\\.(mp3|ogg|wav)')) {
                         $Str .= '[aud]' . $Block['Val'] . '[/aud]';
                     } else {
                         //TODO: Proxy this for staff?
                         $Str .= '<audio controls="controls" src="' . $Block['Val'] . '"><a rel="noreferrer" target="_blank" href="' . $Block['Val'] . '">' . $Block['Val'] . '</a></audio>';
                     }
                     break;
                 case 'url':
                     // Make sure the URL has a label
                     if (empty($Block['Val'])) {
                         $Block['Val'] = $Block['Attr'];
                         $NoName = true;
                         // If there isn't a Val for this
                     } else {
                         $Block['Val'] = self::to_html($Block['Val']);
                         $NoName = false;
                     }
                     if (!self::valid_url($Block['Attr'])) {
                         $Str .= '[url=' . $Block['Attr'] . ']' . $Block['Val'] . '[/url]';
                     } else {
                         $LocalURL = self::local_url($Block['Attr']);
                         if ($LocalURL) {
                             if ($NoName) {
                                 $Block['Val'] = substr($LocalURL, 1);
                             }
                             $Str .= '<a href="' . $LocalURL . '">' . $Block['Val'] . '</a>';
                         } else {
                             $Str .= '<a rel="noreferrer" target="_blank" href="' . $Block['Attr'] . '">' . $Block['Val'] . '</a>';
                         }
                     }
                     break;
                 case 'inlineurl':
                     if (!self::valid_url($Block['Attr'], '', true)) {
                         $Array = self::parse($Block['Attr']);
                         $Block['Attr'] = $Array;
                         $Str .= self::to_html($Block['Attr']);
                     } else {
                         $LocalURL = self::local_url($Block['Attr']);
                         if ($LocalURL) {
                             $Str .= '<a href="' . $LocalURL . '">' . substr($LocalURL, 1) . '</a>';
                         } else {
                             $Str .= '<a rel="noreferrer" target="_blank" href="' . $Block['Attr'] . '">' . $Block['Attr'] . '</a>';
                         }
                     }
                     break;
             }
         }
     }
     self::$Levels--;
     return $Str;
 }
コード例 #11
0
 /**
  * Parses a simple display name
  *
  * @param array $ExtendedArtists
  * @param array $Artists
  * @param string $VanityHouse
  * @return string $DisplayName
  */
 public static function display_name(array &$ExtendedArtists, array &$Artists, $VanityHouse)
 {
     $DisplayName = '';
     if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
         unset($ExtendedArtists[2], $ExtendedArtists[3]);
         $DisplayName = Artists::display_artists($ExtendedArtists, true, false);
     } elseif (count($Artists) > 0) {
         $DisplayName = Artists::display_artists(array('1' => $Artists), true, false);
     }
     if ($VanityHouse) {
         $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
     }
     return $DisplayName;
 }
コード例 #12
0
ファイル: history.php プロジェクト: Kufirc/Gazelle
	<tr class="colhead">
		<td class="center" style="width: 15px;"></td>
		<td class="center"></td>
		<td><strong>Name</strong></td>
	</tr>
<?php 
    foreach ($Details as $Detail) {
        list($Rank, $TitleString, $TagString, $TorrentID, $GroupID, $GroupName, $GroupCategoryID, $TorrentTags, $Format, $Encoding, $Media, $Scene, $HasLog, $HasCue, $LogScore, $Year, $GroupYear, $RemasterTitle, $Snatched, $Seeders, $Leechers, $Data) = $Detail;
        // highlight every other row
        $Highlight = $Rank % 2 ? 'a' : 'b';
        if ($GroupID) {
            // Group still exists
            $DisplayName = '';
            $Artists = Artists::get_artist($GroupID);
            if (!empty($Artists)) {
                $DisplayName = Artists::display_artists($Artists, true, true);
            }
            $DisplayName .= "<a href=\"torrents.php?id={$GroupID}&amp;torrentid={$TorrentID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">{$GroupName}</a>";
            if ($GroupCategoryID == 1 && $GroupYear > 0) {
                $DisplayName .= " [{$GroupYear}]";
            }
            // append extra info to torrent title
            $ExtraInfo = '';
            $AddExtra = '';
            if ($Format) {
                $ExtraInfo .= $Format;
                $AddExtra = ' / ';
            }
            if ($Encoding) {
                $ExtraInfo .= $AddExtra . $Encoding;
                $AddExtra = ' / ';
コード例 #13
0
ファイル: torrents.php プロジェクト: Kufirc/Gazelle
function generate_torrent_table($Caption, $Tag, $Details, $Limit)
{
    global $LoggedUser, $Categories, $ReleaseTypes, $GroupBy;
    ?>
		<h3>Top <?php 
    echo "{$Limit} {$Caption}";
    if (empty($_GET['advanced'])) {
        ?>
		<small class="top10_quantity_links">
<?php 
        switch ($Limit) {
            case 100:
                ?>
				- <a href="top10.php?details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 10</a>
				- <span class="brackets">Top 100</span>
				- <a href="top10.php?type=torrents&amp;limit=250&amp;details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 250</a>
<?php 
                break;
            case 250:
                ?>
				- <a href="top10.php?details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 10</a>
				- <a href="top10.php?type=torrents&amp;limit=100&amp;details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 100</a>
				- <span class="brackets">Top 250</span>
<?php 
                break;
            default:
                ?>
				- <span class="brackets">Top 10</span>
				- <a href="top10.php?type=torrents&amp;limit=100&amp;details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 100</a>
				- <a href="top10.php?type=torrents&amp;limit=250&amp;details=<?php 
                echo $Tag;
                ?>
" class="brackets">Top 250</a>
<?php 
        }
        ?>
		</small>
<?php 
    }
    ?>
		</h3>
	<table class="torrent_table cats numbering border">
	<tr class="colhead">
		<td class="center" style="width: 15px;"></td>
		<td class="cats_col"></td>
		<td>Name</td>
		<td style="text-align: right;">Size</td>
		<td style="text-align: right;">Data</td>
		<td style="text-align: right;" class="sign snatches"><img src="static/styles/<?php 
    echo $LoggedUser['StyleName'];
    ?>
/images/snatched.png" alt="Snatches" title="Snatches" class="tooltip" /></td>
		<td style="text-align: right;" class="sign seeders"><img src="static/styles/<?php 
    echo $LoggedUser['StyleName'];
    ?>
/images/seeders.png" alt="Seeders" title="Seeders" class="tooltip" /></td>
		<td style="text-align: right;" class="sign leechers"><img src="static/styles/<?php 
    echo $LoggedUser['StyleName'];
    ?>
/images/leechers.png" alt="Leechers" title="Leechers" class="tooltip" /></td>
		<td style="text-align: right;">Peers</td>
	</tr>
<?php 
    // Server is already processing a top10 query. Starting another one will make things slow
    if ($Details === false) {
        ?>
		<tr class="rowb">
			<td colspan="9" class="center">
				Server is busy processing another top list request. Please try again in a minute.
			</td>
		</tr>
		</table><br />
<?php 
        return;
    }
    // in the unlikely event that query finds 0 rows...
    if (empty($Details)) {
        ?>
		<tr class="rowb">
			<td colspan="9" class="center">
				Found no torrents matching the criteria.
			</td>
		</tr>
		</table><br />
<?php 
        return;
    }
    $Rank = 0;
    foreach ($Details as $Detail) {
        $GroupIDs[] = $Detail[1];
    }
    $Artists = Artists::get_artists($GroupIDs);
    foreach ($Details as $Detail) {
        list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TagsList, $Format, $Encoding, $Media, $Scene, $HasLog, $HasCue, $LogScore, $Year, $GroupYear, $RemasterTitle, $Snatched, $Seeders, $Leechers, $Data, $ReleaseType, $Size) = $Detail;
        $IsBookmarked = Bookmarks::has_bookmarked('torrent', $GroupID);
        $IsSnatched = Torrents::has_snatched($TorrentID);
        // highlight every other row
        $Rank++;
        $Highlight = $Rank % 2 ? 'a' : 'b';
        // generate torrent's title
        $DisplayName = '';
        if (!empty($Artists[$GroupID])) {
            $DisplayName = Artists::display_artists($Artists[$GroupID], true, true);
        }
        $DisplayName .= "<a href=\"torrents.php?id={$GroupID}&amp;torrentid={$TorrentID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">{$GroupName}</a>";
        if ($GroupCategoryID == 1 && $GroupYear > 0) {
            $DisplayName .= " [{$GroupYear}]";
        }
        if ($GroupCategoryID == 1 && $ReleaseType > 0) {
            $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
        }
        // append extra info to torrent title
        $ExtraInfo = '';
        $AddExtra = '';
        if (empty($GroupBy)) {
            if ($Format) {
                $ExtraInfo .= $Format;
                $AddExtra = ' / ';
            }
            if ($Encoding) {
                $ExtraInfo .= $AddExtra . $Encoding;
                $AddExtra = ' / ';
            }
            // "FLAC / Lossless / Log (100%) / Cue / CD";
            if ($HasLog) {
                $ExtraInfo .= $AddExtra . 'Log (' . $LogScore . '%)';
                $AddExtra = ' / ';
            }
            if ($HasCue) {
                $ExtraInfo .= $AddExtra . 'Cue';
                $AddExtra = ' / ';
            }
            if ($Media) {
                $ExtraInfo .= $AddExtra . $Media;
                $AddExtra = ' / ';
            }
            if ($Scene) {
                $ExtraInfo .= $AddExtra . 'Scene';
                $AddExtra = ' / ';
            }
            if ($Year > 0) {
                $ExtraInfo .= $AddExtra . $Year;
                $AddExtra = ' ';
            }
            if ($RemasterTitle) {
                $ExtraInfo .= $AddExtra . $RemasterTitle;
            }
            if ($IsSnatched) {
                if ($GroupCategoryID == 1) {
                    $ExtraInfo .= ' / ';
                }
                $ExtraInfo .= Format::torrent_label('Snatched!');
            }
            if ($ExtraInfo != '') {
                $ExtraInfo = "- [{$ExtraInfo}]";
            }
        }
        $TorrentTags = new Tags($TagsList);
        //Get report info, use the cache if available, if not, add to it.
        $Reported = false;
        $Reports = Torrents::get_reports($TorrentID);
        if (count($Reports) > 0) {
            $Reported = true;
        }
        // print row
        ?>
	<tr class="torrent row<?php 
        echo $Highlight . ($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '');
        ?>
">
		<td style="padding: 8px; text-align: center;"><strong><?php 
        echo $Rank;
        ?>
</strong></td>
		<td class="center cats_col"><div title="<?php 
        echo $TorrentTags->title();
        ?>
" class="tooltip <?php 
        echo Format::css_category($GroupCategoryID);
        ?>
 <?php 
        echo $TorrentTags->css_name();
        ?>
"></div></td>
		<td class="big_info">
<?php 
        if ($LoggedUser['CoverArt']) {
            ?>
			<div class="group_image float_left clear">
				<?php 
            ImageTools::cover_thumb($WikiImage, $GroupCategoryID);
            ?>
			</div>
<?php 
        }
        ?>
			<div class="group_info clear">

				<span><a href="torrents.php?action=download&amp;id=<?php 
        echo $TorrentID;
        ?>
&amp;authkey=<?php 
        echo $LoggedUser['AuthKey'];
        ?>
&amp;torrent_pass=<?php 
        echo $LoggedUser['torrent_pass'];
        ?>
" title="Download" class="brackets tooltip">DL</a></span>

				<strong><?php 
        echo $DisplayName;
        ?>
</strong> <?php 
        echo $ExtraInfo;
        if ($Reported) {
            ?>
 - <strong class="torrent_label tl_reported">Reported</strong><?php 
        }
        if ($IsBookmarked) {
            ?>
				<span class="remove_bookmark float_right">
					<a href="#" id="bookmarklink_torrent_<?php 
            echo $GroupID;
            ?>
" class="bookmarklink_torrent_<?php 
            echo $GroupID;
            ?>
 brackets" onclick="Unbookmark('torrent', <?php 
            echo $GroupID;
            ?>
, 'Bookmark'); return false;">Remove bookmark</a>
				</span>
<?php 
        } else {
            ?>
				<span class="add_bookmark float_right">
					<a href="#" id="bookmarklink_torrent_<?php 
            echo $GroupID;
            ?>
" class="bookmarklink_torrent_<?php 
            echo $GroupID;
            ?>
 brackets" onclick="Bookmark('torrent', <?php 
            echo $GroupID;
            ?>
, 'Remove bookmark'); return false;">Bookmark</a>
				</span>
<?php 
        }
        ?>
				<div class="tags"><?php 
        echo $TorrentTags->format();
        ?>
</div>
			</div>
		</td>
		<td class="number_column nobr"><?php 
        echo Format::get_size($Size);
        ?>
</td>
		<td class="number_column nobr"><?php 
        echo Format::get_size($Data);
        ?>
</td>
		<td class="number_column"><?php 
        echo number_format((double) $Snatched);
        ?>
</td>
		<td class="number_column"><?php 
        echo number_format((double) $Seeders);
        ?>
</td>
		<td class="number_column"><?php 
        echo number_format((double) $Leechers);
        ?>
</td>
		<td class="number_column"><?php 
        echo number_format($Seeders + $Leechers);
        ?>
</td>
	</tr>
<?php 
    }
    //foreach ($Details as $Detail)
    ?>
	</table><br />
<?php 
}
コード例 #14
0
ファイル: feat_album.php プロジェクト: Kufirc/Gazelle
			<div class="center pad">
				<a href="torrents.php?id=<?php 
    echo $FeaturedAlbum['GroupID'];
    ?>
" class="tooltip" title="<?php 
    echo Artists::display_artists($Artists, false, false);
    ?>
 - <?php 
    echo $FeaturedAlbum['Name'];
    ?>
">
					<img src="<?php 
    echo ImageTools::process($FeaturedAlbum['WikiImage'], true);
    ?>
" alt="<?php 
    echo Artists::display_artists($Artists, false, false);
    ?>
 - <?php 
    echo $FeaturedAlbum['Name'];
    ?>
" width="100%" />
				</a>
			</div>
			<div class="center pad">
				<a href="forums.php?action=viewthread&amp;threadid=<?php 
    echo $FeaturedAlbum['ThreadID'];
    ?>
"><em>Read the interview with the artist, discuss here</em></a>
			</div>
		</div>
<?php 
コード例 #15
0
ファイル: details.php プロジェクト: Kufirc/Gazelle
include SERVER_ROOT . '/sections/torrents/functions.php';
$TorrentCache = get_group_info($GroupID, true, $RevisionID);
$TorrentDetails = $TorrentCache[0];
$TorrentList = $TorrentCache[1];
// Group details
list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID, $GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs, $TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($TorrentDetails);
$DisplayName = "<span dir=\"ltr\">{$GroupName}</span>";
$AltName = $GroupName;
// Goes in the alt text of the image
$Title = $GroupName;
// goes in <title>
$WikiBody = Text::full_format($WikiBody);
$Artists = Artists::get_artist($GroupID);
if ($Artists) {
    $DisplayName = Artists::display_artists($Artists, true) . "{$DisplayName}";
    $AltName = display_str(Artists::display_artists($Artists, false)) . $AltName;
    $Title = $AltName;
}
if ($GroupYear > 0) {
    $DisplayName .= " [{$GroupYear}]";
    $AltName .= " [{$GroupYear}]";
    $Title .= " [{$GroupYear}]";
}
if ($GroupVanityHouse) {
    $DisplayName .= ' [Vanity House]';
    $AltName .= ' [Vanity House]';
}
if ($GroupCategoryID == 1) {
    $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
    $AltName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
}
コード例 #16
0
ファイル: transcode_beta.php プロジェクト: Kufirc/Gazelle
		</tr>
<?php 
if ($ResultCount == 0) {
    ?>
		<tr><td colspan="4">No results found!</td></tr>
<?php 
} else {
    foreach ($Groups as $GroupID => $Group) {
        $GroupYear = $Group['Year'];
        $ExtendedArtists = $Group['ExtendedArtists'];
        $GroupName = $Group['Name'];
        $ReleaseType = $Group['ReleaseType'];
        if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
            unset($ExtendedArtists[2]);
            unset($ExtendedArtists[3]);
            $ArtistNames = Artists::display_artists($ExtendedArtists);
        } else {
            $ArtistNames = '';
        }
        $TorrentTags = new Tags($Group['TagList']);
        foreach ($Group['Editions'] as $RemIdent => $Edition) {
            // TODO: point to the correct FLAC (?)
            $FlacID = array_search(true, $Edition['FlacIDs']);
            $DisplayName = $ArtistNames . "<a href=\"torrents.php?id={$GroupID}&amp;torrentid={$FlacID}#torrent{$FlacID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">{$GroupName}</a>";
            if ($GroupYear > 0) {
                $DisplayName .= " [{$GroupYear}]";
            }
            if ($ReleaseType > 0) {
                $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
            }
            if ($Edition['FLACIsSnatched']) {
コード例 #17
0
        $Artists = Artists::get_artists($GroupIDs);
        $Number = 0;
        foreach ($GroupIDs as $GroupID) {
            if (!isset($TorrentList[$GroupID])) {
                continue;
            }
            $Group = $TorrentList[$GroupID];
            extract(Torrents::array_group($Group));
            $DisplayName = '';
            $TorrentTags = new Tags($TagList);
            if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
                unset($ExtendedArtists[2]);
                unset($ExtendedArtists[3]);
                $DisplayName .= Artists::display_artists($ExtendedArtists);
            } elseif (count($Artists) > 0) {
                $DisplayName .= Artists::display_artists(array('1' => $Artists));
            }
            $DisplayName .= "<a href=\"torrents.php?id={$GroupID}\" class=\"tooltip\" title=\"View torrent group\" dir=\"ltr\">{$GroupName}</a>";
            if ($GroupYear > 0) {
                $DisplayName = "{$DisplayName} [{$GroupYear}]";
            }
            if ($GroupVanityHouse) {
                $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
            }
            $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
            // Start an output buffer, so we can store this output in $TorrentTable
            ob_start();
            if (count($Torrents) > 1 || $GroupCategoryID == 1) {
                ?>
			<tr class="group discog<?php 
                echo $SnatchedGroupClass;
コード例 #18
0
ファイル: token_history.php プロジェクト: Kufirc/Gazelle
	</tr>
<?php 
foreach ($Tokens as $Token) {
    $GroupIDs[] = $Token['GroupID'];
}
$Artists = Artists::get_artists($GroupIDs);
$i = true;
foreach ($Tokens as $Token) {
    $i = !$i;
    list($TorrentID, $GroupID, $Time, $Expired, $Downloaded, $Uses, $Name, $Format, $Encoding) = $Token;
    if ($Name != '') {
        $Name = "<a href=\"torrents.php?torrentid={$TorrentID}\">{$Name}</a>";
    } else {
        $Name = "(<i>Deleted torrent <a href=\"log.php?search=Torrent+{$TorrentID}\">{$TorrentID}</a></i>)";
    }
    $ArtistName = Artists::display_artists($Artists[$GroupID]);
    if ($ArtistName) {
        $Name = $ArtistName . $Name;
    }
    if ($Format && $Encoding) {
        $Name .= " [{$Format} / {$Encoding}]";
    }
    ?>
	<tr class="<?php 
    echo $i ? 'rowa' : 'rowb';
    ?>
">
		<td><?php 
    echo $Name;
    ?>
</td>
コード例 #19
0
ファイル: download.php プロジェクト: mohirt/Gazelle
    $DB->query("\n\t\tSELECT 1\n\t\tFROM users_downloads\n\t\tWHERE UserID = {$UserID}\n\t\t\tAND TorrentID = {$TorrentID}\n\t\tLIMIT 4");
    if ($DB->record_count() === 4) {
        error('You have already downloaded this torrent file four times. If you need to download it again, please do so from your browser.', true);
        die;
    }
}
$Info = $Cache->get_value('torrent_download_' . $TorrentID);
if (!is_array($Info) || !array_key_exists('PlainArtists', $Info) || empty($Info[10])) {
    $DB->query("\n\t\tSELECT\n\t\t\tt.Media,\n\t\t\tt.Format,\n\t\t\tt.Encoding,\n\t\t\tIF(t.RemasterYear = 0, tg.Year, t.RemasterYear),\n\t\t\ttg.ID AS GroupID,\n\t\t\ttg.Name,\n\t\t\ttg.WikiImage,\n\t\t\ttg.CategoryID,\n\t\t\tt.Size,\n\t\t\tt.FreeTorrent,\n\t\t\tt.info_hash\n\t\tFROM torrents AS t\n\t\t\tINNER JOIN torrents_group AS tg ON tg.ID = t.GroupID\n\t\tWHERE t.ID = '" . db_string($TorrentID) . "'");
    if (!$DB->has_results()) {
        error(404);
    }
    $Info = array($DB->next_record(MYSQLI_NUM, array(4, 5, 6, 10)));
    $Artists = Artists::get_artist($Info[0][4], false);
    $Info['Artists'] = Artists::display_artists($Artists, false, true);
    $Info['PlainArtists'] = Artists::display_artists($Artists, false, true, false);
    $Cache->cache_value("torrent_download_{$TorrentID}", $Info, 0);
}
if (!is_array($Info[0])) {
    error(404);
}
list($Media, $Format, $Encoding, $Year, $GroupID, $Name, $Image, $CategoryID, $Size, $FreeTorrent, $InfoHash) = array_shift($Info);
// used for generating the filename
$Artists = $Info['Artists'];
// If he's trying use a token on this, we need to make sure he has one,
// deduct it, add this to the FLs table, and update his cache key.
if ($_REQUEST['usetoken'] && $FreeTorrent == '0') {
    if (isset($LoggedUser)) {
        $FLTokens = $LoggedUser['FLTokens'];
        if ($LoggedUser['CanLeech'] != '1') {
            error('You cannot use tokens while leech disabled.');
コード例 #20
0
ファイル: manage.php プロジェクト: Kufirc/Gazelle
$Number = 0;
foreach ($GroupIDs as $GroupID) {
    if (!isset($TorrentList[$GroupID])) {
        continue;
    }
    $Group = $TorrentList[$GroupID];
    extract(Torrents::array_group($Group));
    list(, $UserID, $Username, $Sort, $CatNum) = array_values($CollageDataList[$GroupID]);
    $Number++;
    $DisplayName = '';
    if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
        unset($ExtendedArtists[2]);
        unset($ExtendedArtists[3]);
        $DisplayName .= Artists::display_artists($ExtendedArtists, true, false);
    } elseif (count($Artists) > 0) {
        $DisplayName .= Artists::display_artists(array('1' => $Artists), true, false);
    }
    $TorrentLink = "<a href=\"torrents.php?id={$GroupID}\" class=\"tooltip\" title=\"View torrent group\">{$GroupName}</a>";
    $GroupYear = $GroupYear > 0 ? $GroupYear : '';
    if ($GroupVanityHouse) {
        $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
    }
    $AltCSS = $Number % 2 === 0 ? 'rowa' : 'rowb';
    ?>
			<tr class="drag <?php 
    echo $AltCSS;
    ?>
" id="li_<?php 
    echo $GroupID;
    ?>
">
コード例 #21
0
ファイル: torrent_collage.php プロジェクト: Kufirc/Gazelle
        echo number_format($Torrent['Leechers']);
        ?>
</td>
			</tr>
<?php 
    }
    $TorrentTable .= ob_get_clean();
    // Album art
    ob_start();
    $DisplayName = '';
    if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
        unset($ExtendedArtists[2]);
        unset($ExtendedArtists[3]);
        $DisplayName .= Artists::display_artists($ExtendedArtists, false);
    } elseif (count($GroupArtists) > 0) {
        $DisplayName .= Artists::display_artists(array('1' => $GroupArtists), false);
    }
    $DisplayName .= $GroupName;
    if ($GroupYear > 0) {
        $DisplayName = "{$DisplayName} [{$GroupYear}]";
    }
    $Tags = display_str($TorrentTags->format());
    $PlainTags = implode(', ', $TorrentTags->get_tags());
    ?>
				<li class="image_group_<?php 
    echo $GroupID;
    ?>
">
					<a href="torrents.php?id=<?php 
    echo $GroupID;
    ?>
コード例 #22
0
ファイル: single.php プロジェクト: Kufirc/Gazelle
	<table width="100%" class="torrent_table">
		<tr class="colhead">
			<td>Torrent</td>
		</tr>
<?php 
foreach ($Results as $GroupID => $FlacID) {
    if (!isset($Groups[$GroupID])) {
        continue;
    }
    $Group = $Groups[$GroupID];
    extract(Torrents::array_group($Group));
    $TorrentTags = new Tags($TagList);
    if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
        unset($ExtendedArtists[2]);
        unset($ExtendedArtists[3]);
        $DisplayName = Artists::display_artists($ExtendedArtists);
    } else {
        $DisplayName = '';
    }
    $DisplayName .= "<a href=\"torrents.php?id={$GroupID}&amp;torrentid={$FlacID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">{$GroupName}</a>";
    if ($GroupYear > 0) {
        $DisplayName .= " [{$GroupYear}]";
    }
    if ($ReleaseType > 0) {
        $DisplayName .= " [" . $ReleaseTypes[$ReleaseType] . "]";
    }
    $ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
    if ($ExtraInfo) {
        $DisplayName .= ' - ' . $ExtraInfo;
    }
    ?>
コード例 #23
0
ファイル: redownload.php プロジェクト: Kufirc/Gazelle
        default:
            error(0);
    }
}
$DownloadsQ = $DB->query("\n\tSELECT\n\t\tt.ID AS TorrentID,\n\t\tDATE_FORMAT({$Month}, '%Y - %m') AS Month,\n\t\tt.GroupID,\n\t\tt.Media,\n\t\tt.Format,\n\t\tt.Encoding,\n\t\tIF(t.RemasterYear = 0, tg.Year, t.RemasterYear) AS Year,\n\t\ttg.Name,\n\t\tt.Size\n\tFROM torrents AS t\n\t\tJOIN torrents_group AS tg ON t.GroupID = tg.ID\n\t{$SQL}\n\tGROUP BY TorrentID");
$Collector = new TorrentsDL($DownloadsQ, "{$Username}'s " . ucfirst($_GET['type']));
while (list($Downloads, $GroupIDs) = $Collector->get_downloads('TorrentID')) {
    $Artists = Artists::get_artists($GroupIDs);
    $TorrentIDs = array_keys($GroupIDs);
    $TorrentFilesQ = $DB->query('
		SELECT TorrentID, File
		FROM torrents_files
		WHERE TorrentID IN (' . implode(',', $TorrentIDs) . ')', false);
    if (is_int($TorrentFilesQ)) {
        // Query failed. Let's not create a broken zip archive
        foreach ($TorrentIDs as $TorrentID) {
            $Download =& $Downloads[$TorrentID];
            $Download['Artist'] = Artists::display_artists($Artists[$Download['GroupID']], false, true, false);
            $Collector->fail_file($Download);
        }
        continue;
    }
    while (list($TorrentID, $TorrentFile) = $DB->next_record(MYSQLI_NUM, false)) {
        $Download =& $Downloads[$TorrentID];
        $Download['Artist'] = Artists::display_artists($Artists[$Download['GroupID']], false, true, false);
        $Collector->add_file($TorrentFile, $Download, $Download['Month']);
        unset($Download);
    }
}
$Collector->finalize(false);
define('SKIP_NO_CACHE_HEADERS', 1);
コード例 #24
0
ファイル: grouplog.php プロジェクト: Kufirc/Gazelle
<?php

$GroupID = $_GET['groupid'];
if (!is_number($GroupID)) {
    error(404);
}
View::show_header("History for Group {$GroupID}");
$Groups = Torrents::get_groups(array($GroupID), true, true, false);
if (!empty($Groups[$GroupID])) {
    $Group = $Groups[$GroupID];
    $Title = Artists::display_artists($Group['ExtendedArtists']) . '<a href="torrents.php?id=' . $GroupID . '">' . $Group['Name'] . '</a>';
} else {
    $Title = "Group {$GroupID}";
}
?>

<div class="thin">
	<div class="header">
		<h2>History for <?php 
echo $Title;
?>
</h2>
	</div>
	<table>
		<tr class="colhead">
			<td>Date</td>
			<td>Torrent</td>
			<td>User</td>
			<td>Info</td>
		</tr>
<?php 
コード例 #25
0
ファイル: user.php プロジェクト: Kufirc/Gazelle
						<td>
							<strong>Added</strong>
						</td>
					</tr>
<?php 
        $Row = 'a';
        $Requests = Requests::get_requests(array_keys($SphRequests));
        foreach ($SphRequests as $RequestID => $SphRequest) {
            $Request = $Requests[$RequestID];
            $VotesCount = $SphRequest['votes'];
            $Bounty = $SphRequest['bounty'] * 1024;
            // Sphinx stores bounty in kB
            $CategoryName = $Categories[$Request['CategoryID'] - 1];
            if ($CategoryName == 'Music') {
                $ArtistForm = Requests::get_artists($RequestID);
                $ArtistLink = Artists::display_artists($ArtistForm, true, true);
                $FullName = "{$ArtistLink}<a href=\"requests.php?action=view&amp;id={$RequestID}\">{$Request['Title']} [{$Request['Year']}]</a>";
            } elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
                $FullName = "<a href=\"requests.php?action=view&amp;id={$RequestID}\">{$Request['Title']} [{$Request['Year']}]</a>";
            } else {
                $FullName = "<a href=\"requests.php?action=view&amp;id={$RequestID}\">{$Request['Title']}</a>";
            }
            ?>
					<tr class="row<?php 
            echo $Row === 'b' ? 'a' : 'b';
            ?>
">
						<td>
							<?php 
            echo $FullName;
            ?>
コード例 #26
0
ファイル: transcode.php プロジェクト: Kufirc/Gazelle
        }
    }
}
$JsonResults = array();
foreach ($TorrentGroups as $GroupID => $Editions) {
    $GroupInfo = $Groups[$GroupID];
    $GroupYear = $GroupInfo['Year'];
    $ExtendedArtists = $GroupInfo['ExtendedArtists'];
    $GroupCatalogueNumber = $GroupInfo['CatalogueNumber'];
    $GroupName = $GroupInfo['Name'];
    $GroupRecordLabel = $GroupInfo['RecordLabel'];
    $ReleaseType = $GroupInfo['ReleaseType'];
    if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
        unset($ExtendedArtists[2]);
        unset($ExtendedArtists[3]);
        $ArtistNames = Artists::display_artists($ExtendedArtists, false, false, false);
    } else {
        $ArtistNames = '';
    }
    $TagList = array();
    $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
    $TorrentTags = array();
    foreach ($TagList as $Tag) {
        $TorrentTags[] = "<a href=\"torrents.php?taglist={$Tag}\">{$Tag}</a>";
    }
    $TorrentTags = implode(', ', $TorrentTags);
    foreach ($Editions as $RemIdent => $Edition) {
        if (!$Edition['FlacID'] || !empty($Edition['Formats']) && $_GET['type'] === '3' || $Edition['Formats'][$Encodings[$_GET['type']]] == true) {
            continue;
        }
        $JsonResults[] = array('torrentId' => (int) $Edition['FlacID'], 'groupId' => (int) $GroupID, 'artist' => $ArtistNames, 'groupName' => $GroupName, 'groupYear' => (int) $GroupYear, 'missingV2' => !isset($Edition['Formats']['V2 (VBR)']), 'missingV0' => !isset($Edition['Formats']['V0 (VBR)']), 'missing320' => !isset($Encodings['Formats']['320']), 'downloadUrl' => 'torrents.php?action=download&id=' . $Edition['FlacID'] . '&authkey=' . $LoggedUser['AuthKey'] . '&torrent_pass='******'torrent_pass']);
コード例 #27
0
ファイル: torrents.class.php プロジェクト: Kufirc/Gazelle
 /**
  * Return the display string for a given torrent group $GroupID.
  * @param int $GroupID
  * @return string
  */
 public static function display_string($GroupID, $Mode = self::DISPLAYSTRING_DEFAULT)
 {
     global $ReleaseTypes;
     // I hate this
     $GroupInfo = self::get_groups(array($GroupID), true, true, false)[$GroupID];
     $ExtendedArtists = $GroupInfo['ExtendedArtists'];
     if ($Mode & self::DISPLAYSTRING_ARTISTS) {
         if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
             unset($ExtendedArtists[2], $ExtendedArtists[3]);
             $DisplayName = Artists::display_artists($ExtendedArtists, $Mode & self::DISPLAYSTRING_LINKED);
         } else {
             $DisplayName = '';
         }
     }
     if ($Mode & self::DISPLAYSTRING_LINKED) {
         $DisplayName .= "<a href=\"torrents.php?id={$GroupID}\" class=\"tooltip\" title=\"View torrent group\" dir=\"ltr\">{$GroupInfo['Name']}</a>";
     } else {
         $DisplayName .= $GroupInfo['Name'];
     }
     if ($Mode & self::DISPLAYSTRING_YEAR && $GroupInfo['Year'] > 0) {
         $DisplayName .= " [{$GroupInfo['Year']}]";
     }
     if ($Mode & self::DISPLAYSTRING_VH && $GroupInfo['VanityHouse']) {
         if ($Mode & self::DISPLAYSTRING_HTML) {
             $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
         } else {
             $DisplayName .= ' [VH]';
         }
     }
     if ($Mode & self::DISPLAYSTRING_RELEASETYPE && $GroupInfo['ReleaseType'] > 0) {
         $DisplayName .= ' [' . $ReleaseTypes[$GroupInfo['ReleaseType']] . ']';
     }
     return $DisplayName;
 }
コード例 #28
0
ファイル: reseed.php プロジェクト: bigsony/Gazelle
$TorrentID = (int) $_GET['torrentid'];
$DB->query("\n\tSELECT last_action, LastReseedRequest, UserID, Time, GroupID\n\tFROM torrents\n\tWHERE ID = '{$TorrentID}'");
list($LastActive, $LastReseedRequest, $UploaderID, $UploadedTime, $GroupID) = $DB->next_record();
if (!check_perms('users_mod')) {
    if (time() - strtotime($LastReseedRequest) < 864000) {
        error('There was already a re-seed request for this torrent within the past 10 days.');
    }
    if ($LastActive == '0000-00-00 00:00:00' || time() - strtotime($LastActive) < 345678) {
        error(403);
    }
}
$DB->query("\n\tUPDATE torrents\n\tSET LastReseedRequest = NOW()\n\tWHERE ID = '{$TorrentID}'");
$Group = Torrents::get_groups(array($GroupID));
extract(Torrents::array_group($Group[$GroupID]));
$Name = Artists::display_artists(array('1' => $Artists), false, true);
$Name .= $GroupName;
$usersToNotify = array();
$DB->query("\n\tSELECT s.uid AS id, MAX(s.tstamp) AS tstamp\n\tFROM xbt_snatched as s\n\tINNER JOIN users_main as u\n\tON s.uid = u.ID\n\tWHERE s.fid = '{$TorrentID}'\n\tAND u.Enabled = '1'\n\tGROUP BY s.uid\n       ORDER BY tstamp DESC\n\tLIMIT 100");
if ($DB->has_results()) {
    $Users = $DB->to_array();
    foreach ($Users as $User) {
        $UserID = $User['id'];
        $TimeStamp = $User['tstamp'];
        $usersToNotify[$UserID] = array("snatched", $TimeStamp);
    }
}
$usersToNotify[$UploaderID] = array("uploaded", strtotime($UploadedTime));
foreach ($usersToNotify as $UserID => $info) {
    $Username = Users::user_info($UserID)['Username'];
    list($action, $TimeStamp) = $info;
コード例 #29
0
ファイル: private.php プロジェクト: mohirt/Gazelle
            // No vanity.house tag.
            $Tags = explode(' ', str_replace('_', '.', $TagList));
            $TagLinks = array();
            foreach ($Tags as $Tag) {
                if ($Tag == 'vanity.house') {
                    continue;
                }
                $TagLinks[] = "<a href=\"torrents.php?action=basic&amp;taglist={$Tag}\">{$Tag}</a> ";
            }
            $TagStr = "<br />\n<div class=\"tags\">" . implode(', ', $TagLinks) . '</div>';
        }
        ?>
			<tr>
				<td>
					<?php 
        echo Artists::display_artists($Recommend_artists[$GroupID]);
        ?>
					<a href="torrents.php?id=<?php 
        echo $GroupID;
        ?>
"><?php 
        echo $GroupName;
        ?>
</a> (by <?php 
        echo Users::format_username($UserID, false, false, false);
        ?>
)
					<?php 
        echo $TagStr;
        ?>
				</td>
コード例 #30
0
ファイル: notify.php プロジェクト: Kufirc/Gazelle
     continue;
 }
 $TorrentInfo = $GroupInfo['Torrents'][$TorrentID];
 // generate torrent's title
 $DisplayName = '';
 if (!empty($GroupInfo['ExtendedArtists'])) {
     $MatchingArtists = array();
     foreach ($GroupInfo['ExtendedArtists'] as $GroupArtists) {
         foreach ($GroupArtists as $GroupArtist) {
             if (isset($Filters[$FilterID]['Artists'][mb_strtolower($GroupArtist['name'], 'UTF-8')])) {
                 $MatchingArtists[] = $GroupArtist['name'];
             }
         }
     }
     $MatchingArtistsText = !empty($MatchingArtists) ? 'Caught by filter for ' . implode(', ', $MatchingArtists) : '';
     $DisplayName = Artists::display_artists($GroupInfo['ExtendedArtists'], true, true);
 }
 $DisplayName .= "<a href=\"torrents.php?id={$GroupID}&amp;torrentid={$TorrentID}#torrent{$TorrentID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">" . $GroupInfo['Name'] . '</a>';
 $GroupCategoryID = $GroupInfo['CategoryID'];
 if ($GroupCategoryID == 1) {
     if ($GroupInfo['Year'] > 0) {
         $DisplayName .= " [{$GroupInfo['Year']}]";
     }
     if ($GroupInfo['ReleaseType'] > 0) {
         $DisplayName .= ' [' . $ReleaseTypes[$GroupInfo['ReleaseType']] . ']';
     }
 }
 // append extra info to torrent title
 $ExtraInfo = Torrents::torrent_info($TorrentInfo, true, true);
 $TorrentTags = new Tags($GroupInfo['TagList']);
 if ($GroupInfo['TagList'] == '') {