mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-07 13:59:07 +00:00
Empty commit
This commit is contained in:
parent
13568d1565
commit
c483573095
@ -4,9 +4,7 @@ function compare($X, $Y) {
|
|||||||
return($Y['count'] - $X['count']);
|
return($Y['count'] - $X['count']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/sections/requests/functions.php');
|
include(SERVER_ROOT.'/sections/requests/functions.php');
|
||||||
include(SERVER_ROOT.'/sections/bookmarks/functions.php');
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
|
||||||
@ -231,7 +229,7 @@ function compare($X, $Y) {
|
|||||||
'releaseType' => (int) $ReleaseType,
|
'releaseType' => (int) $ReleaseType,
|
||||||
'wikiImage' => $WikiImage,
|
'wikiImage' => $WikiImage,
|
||||||
'groupVanityHouse' => $GroupVanityHouse == 1,
|
'groupVanityHouse' => $GroupVanityHouse == 1,
|
||||||
'hasBookmarked' => $hasBookmarked = Bookmarks::has_bookmarked('torrent', $GroupID),
|
'hasBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
|
||||||
'torrent' => $InnerTorrents
|
'torrent' => $InnerTorrents
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -319,7 +317,7 @@ function compare($X, $Y) {
|
|||||||
'id' => (int) $ArtistID,
|
'id' => (int) $ArtistID,
|
||||||
'name' => $Name,
|
'name' => $Name,
|
||||||
'notificationsEnabled' => $notificationsEnabled,
|
'notificationsEnabled' => $notificationsEnabled,
|
||||||
'hasBookmarked' => has_bookmarked('artist', $ArtistID),
|
'hasBookmarked' => Bookmarks::has_bookmarked('artist', $ArtistID),
|
||||||
'image' => $Image,
|
'image' => $Image,
|
||||||
'body' => $Text->full_format($Body),
|
'body' => $Text->full_format($Body),
|
||||||
'vanityHouse' => $VanityHouseArtist == 1,
|
'vanityHouse' => $VanityHouseArtist == 1,
|
||||||
|
@ -11,13 +11,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
include(SERVER_ROOT.'/sections/requests/functions.php');
|
include(SERVER_ROOT.'/sections/requests/functions.php');
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php');
|
include(SERVER_ROOT.'/classes/class_text.php');
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
|
||||||
if (empty($_GET['id']) || !is_number($_GET['id'])) {
|
if (empty($_GET['id']) || !is_number($_GET['id'])) {
|
||||||
json_die("failure");
|
json_die("failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
$RequestID = $_GET['id'];
|
$RequestID = $_GET['id'];
|
||||||
@ -191,6 +189,7 @@
|
|||||||
'requestId' => (int) $RequestID,
|
'requestId' => (int) $RequestID,
|
||||||
'requestorId' => (int) $RequestorID,
|
'requestorId' => (int) $RequestorID,
|
||||||
'requestorName' => $RequestorName,
|
'requestorName' => $RequestorName,
|
||||||
|
'isBookmarked' => Bookmarks::has_bookmarked('request', $RequestID),
|
||||||
'requestTax' => $RequestTax,
|
'requestTax' => $RequestTax,
|
||||||
'timeAdded' => $TimeAdded,
|
'timeAdded' => $TimeAdded,
|
||||||
'canEdit' => $CanEdit,
|
'canEdit' => $CanEdit,
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
<?php
|
<?
|
||||||
|
|
||||||
|
|
||||||
require(SERVER_ROOT.'/sections/torrents/functions.php');
|
require(SERVER_ROOT.'/sections/torrents/functions.php');
|
||||||
include(SERVER_ROOT.'/sections/bookmarks/functions.php');
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
|
||||||
@ -12,7 +9,7 @@
|
|||||||
$TorrentID = (int)$_GET['id'];
|
$TorrentID = (int)$_GET['id'];
|
||||||
$TorrentHash = (string)$_GET['hash'];
|
$TorrentHash = (string)$_GET['hash'];
|
||||||
|
|
||||||
if ($GroupID && $TorrentHash) {
|
if ($TorrentID && $TorrentHash) {
|
||||||
json_die("failure", "bad parameters");
|
json_die("failure", "bad parameters");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,6 +36,12 @@
|
|||||||
|
|
||||||
list($TorrentDetails, $TorrentList) = $TorrentCache;
|
list($TorrentDetails, $TorrentList) = $TorrentCache;
|
||||||
|
|
||||||
|
if (!isset($TorrentList[$TorrentID])) {
|
||||||
|
json_die("failure", "bad id parameter");
|
||||||
|
}
|
||||||
|
|
||||||
|
$GroupID = $TorrentDetails['ID'];
|
||||||
|
|
||||||
$ArtistForm = Artists::get_artist($GroupID);
|
$ArtistForm = Artists::get_artist($GroupID);
|
||||||
if ($TorrentDetails['CategoryID'] == 0) {
|
if ($TorrentDetails['CategoryID'] == 0) {
|
||||||
$CategoryName = "Unknown";
|
$CategoryName = "Unknown";
|
||||||
@ -74,11 +77,11 @@
|
|||||||
'categoryName' => $CategoryName,
|
'categoryName' => $CategoryName,
|
||||||
'time' => $TorrentDetails['Time'],
|
'time' => $TorrentDetails['Time'],
|
||||||
'vanityHouse' => $TorrentDetails['VanityHouse'] == 1,
|
'vanityHouse' => $TorrentDetails['VanityHouse'] == 1,
|
||||||
'isBookmarked' => has_bookmarked('torrent', $GroupID),
|
'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
|
||||||
'musicInfo' => $JsonMusicInfo
|
'musicInfo' => $JsonMusicInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
$Torrent = array_pop($TorrentList);
|
$Torrent = $TorrentList[$TorrentID];
|
||||||
// Convert file list back to the old format
|
// Convert file list back to the old format
|
||||||
$FileList = explode("\n", $Torrent['FileList']);
|
$FileList = explode("\n", $Torrent['FileList']);
|
||||||
foreach ($FileList as &$File) {
|
foreach ($FileList as &$File) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?
|
<?
|
||||||
//TODO: replace 24-43 with Users::user_info()
|
|
||||||
/*
|
/*
|
||||||
User post history page
|
User post history page
|
||||||
*/
|
*/
|
||||||
@ -34,25 +33,8 @@ function error_out($reason = '') {
|
|||||||
|
|
||||||
list($Page,$Limit) = Format::page_limit($PerPage);
|
list($Page,$Limit) = Format::page_limit($PerPage);
|
||||||
|
|
||||||
if (($UserInfo = $Cache->get_value('user_info_'.$UserID)) === false) {
|
$UserInfo = Users::user_info($UserID);
|
||||||
$DB->query("SELECT
|
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||||
m.Username,
|
|
||||||
m.Enabled,
|
|
||||||
m.Title,
|
|
||||||
i.Avatar,
|
|
||||||
i.Donor,
|
|
||||||
i.Warned
|
|
||||||
FROM users_main AS m
|
|
||||||
JOIN users_info AS i ON i.UserID = m.ID
|
|
||||||
WHERE m.ID = $UserID");
|
|
||||||
|
|
||||||
if ($DB->record_count() == 0) { // If user doesn't exist
|
|
||||||
error_out('User does not exist!');
|
|
||||||
}
|
|
||||||
list($Username, $Enabled, $Title, $Avatar, $Donor, $Warned) = $DB->next_record();
|
|
||||||
} else {
|
|
||||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($LoggedUser['CustomForums']) {
|
if ($LoggedUser['CustomForums']) {
|
||||||
unset($LoggedUser['CustomForums']['']);
|
unset($LoggedUser['CustomForums']['']);
|
||||||
|
@ -6,7 +6,6 @@ function compare($X, $Y) {
|
|||||||
return($Y['count'] - $X['count']);
|
return($Y['count'] - $X['count']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
<?
|
|
||||||
|
|
||||||
function can_bookmark($Type) {
|
|
||||||
return in_array($Type, array('torrent', 'artist', 'collage', 'request'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recommended usage:
|
|
||||||
// list($Table, $Col) = bookmark_schema('torrent');
|
|
||||||
function bookmark_schema($Type) {
|
|
||||||
switch ($Type) {
|
|
||||||
case 'torrent':
|
|
||||||
return array('bookmarks_torrents', 'GroupID');
|
|
||||||
break;
|
|
||||||
case 'artist':
|
|
||||||
return array('bookmarks_artists', 'ArtistID');
|
|
||||||
break;
|
|
||||||
case 'collage':
|
|
||||||
return array('bookmarks_collages', 'CollageID');
|
|
||||||
break;
|
|
||||||
case 'request':
|
|
||||||
return array('bookmarks_requests', 'RequestID');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
die('HAX');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function has_bookmarked($Type, $ID) {
|
|
||||||
return in_array($ID, all_bookmarks($Type));
|
|
||||||
}
|
|
||||||
|
|
||||||
function all_bookmarks($Type, $UserID = false) {
|
|
||||||
global $DB, $Cache, $LoggedUser;
|
|
||||||
if ($UserID === false) {
|
|
||||||
$UserID = $LoggedUser['ID'];
|
|
||||||
}
|
|
||||||
$CacheKey = 'bookmarks_'.$Type.'_'.$UserID;
|
|
||||||
if (($Bookmarks = $Cache->get_value($CacheKey)) === FALSE) {
|
|
||||||
list($Table, $Col) = bookmark_schema($Type);
|
|
||||||
$DB->query("SELECT $Col FROM $Table WHERE UserID = '$UserID'");
|
|
||||||
$Bookmarks = $DB->collect($Col);
|
|
||||||
$Cache->cache_value($CacheKey, $Bookmarks, 0);
|
|
||||||
}
|
|
||||||
return $Bookmarks;
|
|
||||||
}
|
|
||||||
?>
|
|
@ -7,7 +7,6 @@ function compare($X, $Y) {
|
|||||||
return($Y['count'] - $X['count']);
|
return($Y['count'] - $X['count']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||||
|
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
* This is the page that displays the request to the end user after being created.
|
* This is the page that displays the request to the end user after being created.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php');
|
include(SERVER_ROOT.'/classes/class_text.php');
|
||||||
|
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
<?
|
<?
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
|
|
||||||
$Where = array();
|
$Where = array();
|
||||||
|
|
||||||
if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
||||||
|
@ -7,7 +7,6 @@ function compare($X, $Y) {
|
|||||||
define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default
|
define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default
|
||||||
define('MAX_COLLAGES', 5); // How many normal collages should be shown by default
|
define('MAX_COLLAGES', 5); // How many normal collages should be shown by default
|
||||||
|
|
||||||
// Bookmarks::has_bookmarked()
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php');
|
include(SERVER_ROOT.'/classes/class_text.php');
|
||||||
|
|
||||||
$Text = NEW TEXT;
|
$Text = NEW TEXT;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?
|
<?
|
||||||
//TODO: replace 24-43 with Users::user_info()
|
|
||||||
/*
|
/*
|
||||||
User post history page
|
User post history page
|
||||||
*/
|
*/
|
||||||
@ -26,25 +25,8 @@
|
|||||||
|
|
||||||
list($Page,$Limit) = Format::page_limit($PerPage);
|
list($Page,$Limit) = Format::page_limit($PerPage);
|
||||||
|
|
||||||
if (($UserInfo = $Cache->get_value('user_info_'.$UserID)) === false) {
|
$UserInfo = Users::user_info($UserID);
|
||||||
$DB->query("SELECT
|
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||||
m.Username,
|
|
||||||
m.Enabled,
|
|
||||||
m.Title,
|
|
||||||
i.Avatar,
|
|
||||||
i.Donor,
|
|
||||||
i.Warned
|
|
||||||
FROM users_main AS m
|
|
||||||
JOIN users_info AS i ON i.UserID = m.ID
|
|
||||||
WHERE m.ID = $UserID");
|
|
||||||
|
|
||||||
if ($DB->record_count() == 0) { // If user doesn't exist
|
|
||||||
error(404);
|
|
||||||
}
|
|
||||||
list($Username, $Enabled, $Title, $Avatar, $Donor, $Warned) = $DB->next_record();
|
|
||||||
} else {
|
|
||||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
|
||||||
}
|
|
||||||
|
|
||||||
View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode');
|
View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user