本文整理汇总了PHP中Artists类的典型用法代码示例。如果您正苦于以下问题:PHP Artists类的具体用法?PHP Artists怎么用?PHP Artists使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Artists类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sidebar
function sidebar()
{
$return .= "\n\t<h4>Music Library</h4>\n\t<dl>\n\t\t<dt>Tracks</dt>\n\t\t<dd>" . number_format(Tracks::get_total_tracks()) . "</dd>\n\t\t<dt>Artists</dt>\n\t\t<dd>" . number_format(Artists::count()) . "</dd>\n\t\t<dt>Albums</dt>\n\t\t<dd>" . number_format(Albums::count()) . "</dd>\n\t</dl>";
function bytes($a)
{
$unim = array("B", "KB", "MB", "GB", "TB", "PB");
$c = 0;
while ($a >= 1024) {
$c++;
$a = $a / 1024;
}
return number_format($a, $c ? 2 : 0, ".", ",") . " " . $unim[$c];
}
$return .= "\n\t<h4>Archive Storage</h4>\n\t<dl>";
foreach (Archives::get_all() as $archive) {
$pc = (int) (100 - $archive->get_free_space() / $archive->get_total_space() * 100);
if ($archive->get_free_space() > 536870912000.0) {
$colour = "success";
} else {
if ($archive->get_free_space() > 214748364800.0) {
$colour = "warning";
} else {
$colour = "danger";
}
}
$return .= "\n\t\t<dt>" . $archive->get_name() . "</dt>\n\t\t<dd><div class=\"progress\" style=\"margin: 3px 0px; \"><div class=\"progress-bar progress-bar-" . $colour . "\" style=\"width: " . $pc . "%;\"></div></div></dd>\n\t\t<dd>" . bytes($archive->get_free_space()) . " free of " . bytes($archive->get_total_space()) . "</dd>";
}
$return .= "</dl>";
return $return;
}
开发者ID:radiowarwick,项目名称:digiplay,代码行数:30,代码来源:sidebar.php
示例2: actionArtistas
public function actionArtistas()
{
$this->pageTitle = 'Artistas - ' . $this->pageTitle;
$this->pageDescription = 'Ven y disfruta en familia de lo mejor de la salsa, el merengue, el vallenato y mucho más en las ferias de Duitama 2016.';
$this->tagImage = '/images/facebook-artistas.png';
$artists = Artists::model()->findAllByAttributes(array('status_artist' => 1));
$this->render('artistas', array('artists' => $artists));
}
开发者ID:DodMediaGroup,项目名称:FeriasDuitama,代码行数:8,代码来源:SiteController.php
示例3: loadModel
public function loadModel($id)
{
$model = Artists::model()->findByAttributes(array('id_artist' => $id, 'status_artist' => 1));
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
开发者ID:DodMediaGroup,项目名称:FeriasDuitama,代码行数:8,代码来源:ArtistaController.php
示例4: del_artists
public function del_artists($artists)
{
if (!is_array($artists)) {
$tmp = $artists;
$artists = array($tmp);
}
foreach ($artists as $artist) {
$object = Artists::get_by_name($artist);
$object->del_from_track($this);
}
}
开发者ID:radiowarwick,项目名称:digiplay,代码行数:11,代码来源:Advert.php
示例5: index
public function index()
{
//Set keyword to proper format using Str::lower - it's the same as strtolower
$keyword = Str::lower(Input::get('keyword'));
//Use Query builder to look for the keyword in various category
$data['comics'] = Comicbooks::where('book_name', 'LIKE', '%' . $keyword . '%')->select('book_name')->distinct()->get();
$data['characters'] = Characters::where('character_name', 'LIKE', '%' . $keyword . '%')->select('character_name')->distinct()->get();
$data['authors'] = Authors::where('author_name', 'LIKE', '%' . $keyword . '%')->select('author_name')->distinct()->get();
$data['artists'] = Artists::where('artist_name', 'LIKE', '%' . $keyword . '%')->select('artist_name')->distinct()->get();
$data['publishers'] = Publishers::where('publisher_name', 'LIKE', '%' . $keyword . '%')->select('publisher_name')->distinct()->get();
$this->layout->content = View::make('search', $data);
}
开发者ID:sudroid,项目名称:comicake,代码行数:12,代码来源:SearchController.php
示例6: loadLogos
function loadLogos($dir)
{
if (!is_dir($dir)) {
echo "Invalid directory";
} else {
global $nbInsert;
global $_PATH;
if ($handle = opendir($dir)) {
while (($file = readdir($handle)) !== false) {
///---Extraction
$parts = explode('.', $file);
$ext = array_pop($parts);
///---Valid formats
if (!($ext == 'gif' || $ext == 'jpg' || $ext == 'png')) {
continue;
}
///---Name repack
$name = join(".", $parts);
$name = str_replace('__', '.', $name);
$name = str_replace('_', '%', $name);
///---Extra Validations
//Check for special caracters not encoded
if (strpos($name, '_') !== false || strpos($name, ' ') !== false) {
echo "<b>" . $name . " sould be rename to " . str_replace(array('_', ' '), array('+', '+'), $name) . ".</b><br/>";
continue;
} else {
if (strpos($name, '%') === false) {
$nameCheck = urlencode(str_replace(array('+'), array(''), $name));
//Char excludes
//Some caracter are not support yet
if (strpos($nameCheck, '%') !== false) {
echo "<b>" . $name . " is not properly parse.</b><br/>";
continue;
}
}
}
$prev = $name;
///---Insert in db
if (artistExist($name)) {
continue;
}
echo $name . " - ";
$newDate = filemtime(Config::FOLDER_LOGOS . $file);
//Date of modification (new file)
$newArtist = new Artist($name, $file, "", -1, $newDate);
Artists::addArtist($newArtist);
$nbInsert++;
}
closedir($handle);
}
}
}
开发者ID:h3xstream,项目名称:bandlogos,代码行数:52,代码来源:filldb.php
示例7: show
/**
* Output the image with the logos of each artist
*/
public function show()
{
if (count($this->artists) == 0) {
throw new Exception("Missing some informations (artists).");
}
$totalHeight = array(self::$marginTop, self::$marginTop);
$listImageRessources = array(array(), array());
$forcedWidth = self::$width / 2 - self::$seperation / 2;
foreach ($this->artists as $name) {
if (count($listImageRessources[0]) + count($listImageRessources[1]) == $this->nbArtists) {
break;
}
$a = Artists::getArtistByName($name);
if ($a != null) {
$image = Artists::imageFromArtist($a);
if (isset($image)) {
$i = $totalHeight[1] < $totalHeight[0] ? 1 : 0;
$x = imagesx($image);
$y = imagesy($image);
$newHeight = floor($y * $forcedWidth / $x);
$totalHeight[$i] += $newHeight + self::$seperation;
array_push($listImageRessources[$i], $image);
}
}
}
$container = imagecreatetruecolor(self::$width, max($totalHeight));
//Some colors needed
$colWhite = imagecolorallocate($container, 255, 255, 255);
//Background color
imagefilledrectangle($container, 0, 0, self::$width, max($totalHeight), $colWhite);
$currentHeight = array(self::$marginTop, self::$marginTop);
for ($l = 0; $l < count($listImageRessources); $l++) {
$list = $listImageRessources[$l];
foreach ($list as $image) {
$x = imagesx($image);
$y = imagesy($image);
$newHeight = floor($y * $forcedWidth / $x);
$resized = imagecreatetruecolor($forcedWidth, $newHeight);
imagecopyresampled($resized, $image, 0, 0, 0, 0, $forcedWidth, $newHeight, $x, $y);
imagecopymerge($container, $resized, ($forcedWidth + self::$seperation) * $l, $currentHeight[$l], 0, 0, $forcedWidth, $newHeight, 100);
//echo $currentHeight[$l] . "-";
$currentHeight[$l] += $newHeight + self::$seperation;
}
}
ImageUtil::applyFilter($container, $this->color);
imagepng($container);
}
开发者ID:h3xstream,项目名称:bandlogos,代码行数:50,代码来源:TwoColumnsLayout.class.php
示例8: show
/**
* Output the image with the logos of each artist
*/
public function show()
{
if (count($this->artists) == 0) {
throw new Exception("Missing some informations (artists).");
}
$totalHeight = 0;
$listImageRessources = array();
foreach ($this->artists as $name) {
if (count($listImageRessources) == $this->nbArtists) {
break;
}
$a = Artists::getArtistByName($name);
if ($a != null) {
$image = Artists::imageFromArtist($a);
if (isset($image)) {
$totalHeight += imagesy($image) + self::$seperation;
array_push($listImageRessources, $image);
}
}
}
//echo $totalHeight;
$totalHeight += self::$marginTop;
$container = imagecreatetruecolor(self::$width, $totalHeight);
//Some colors needed
$colWhite = imagecolorallocate($container, 255, 255, 255);
//Background color
imagefilledrectangle($container, 0, 0, self::$width, $totalHeight, $colWhite);
$expectWidth = self::$width - 2 * self::$marginSide;
$currentHeight = self::$marginTop;
foreach ($listImageRessources as $image) {
$widthImg = imagesx($image);
//echo $this->width."-2 * ".self::$marginSide);
//echo $widthImg."--".$expectWidth."<br/>";
imagecopymerge($container, $image, self::$marginSide + ($widthImg < $expectWidth ? ($expectWidth - $widthImg) * 0.5 : 0), $currentHeight, 0, 0, imagesx($image), imagesy($image), 100);
$currentHeight += imagesy($image) + self::$seperation;
}
ImageUtil::applyFilter($container, $this->color);
imagepng($container);
}
开发者ID:hazrpg,项目名称:bandlogos,代码行数:42,代码来源:OneColumnLayout.class.php
示例9: getBrowse
public function getBrowse($category)
{
//Get browse category
$category_filtered = strtoupper(trim($category));
//Page Title
$data['title'] = $category_filtered;
//Switch to get appropriate data, redirect to error if options aren't listed
switch ($category_filtered) {
case 'SERIES':
$data['comics'] = Comicbooks::orderBy('book_name', 'asc')->get();
break;
case 'AUTHORS':
$data['comics'] = Authors::select('author_name')->orderBy('author_name', 'asc')->distinct()->get();
break;
case 'ARTISTS':
$data['comics'] = Artists::select('artist_name')->orderBy('artist_name', 'asc')->distinct()->get();
break;
case 'CHARACTERS':
$data['comics'] = Characters::select('character_name')->orderBy('character_name', 'asc')->distinct()->get();
break;
case 'PUBLISHERS':
$data['comics'] = Publishers::select('publisher_name')->orderBy('publisher_name', 'asc')->distinct()->get();
break;
case 'GENRES':
$data['comics'] = Genres::orderBy('genre_name', 'asc')->get();
break;
case 'YEARS':
//This needed to be a raw query because of the date
$data['comics'] = Comicissues::select(DB::raw('year(published_date) as year'))->orderBy('published_date', 'asc')->distinct()->get();
break;
default:
return Redirect::to('error');
break;
}
$this->layout->content = View::make('browse', $data);
}
开发者ID:sudroid,项目名称:comicake,代码行数:36,代码来源:BrowseController.php
示例10: generate_torrent_json
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);
}
开发者ID:karamanolev,项目名称:Gazelle,代码行数:21,代码来源:torrents.php
示例11: foreach
if (check_paranoia_here('snatched')) {
$DB->query("\n\t\tSELECT\n\t\t\tg.ID,\n\t\t\tg.Name,\n\t\t\tg.WikiImage\n\t\tFROM xbt_snatched AS s\n\t\t\tINNER JOIN torrents AS t ON t.ID = s.fid\n\t\t\tINNER JOIN torrents_group AS g ON t.GroupID = g.ID\n\t\tWHERE s.uid = '{$UserID}'\n\t\t\tAND g.CategoryID = '1'\n\t\t\tAND g.WikiImage != ''\n\t\tGROUP BY g.ID\n\t\tORDER BY s.tstamp DESC\n\t\tLIMIT {$Limit}");
$RecentSnatches = $DB->to_array(false, MYSQLI_ASSOC);
$Artists = Artists::get_artists($DB->collect('ID'));
foreach ($RecentSnatches as $Key => $SnatchInfo) {
$RecentSnatches[$Key]['artists'][] = $Artists[$SnatchInfo['ID']];
$RecentSnatches[$Key]['ID'] = (int) $RecentSnatches[$Key]['ID'];
}
$Results['snatches'] = $RecentSnatches;
} else {
$Results['snatches'] = "hidden";
}
if (check_paranoia_here('uploads')) {
$DB->query("\n\t\tSELECT\n\t\t\tg.ID,\n\t\t\tg.Name,\n\t\t\tg.WikiImage\n\t\tFROM torrents_group AS g\n\t\t\tINNER JOIN torrents AS t ON t.GroupID = g.ID\n\t\tWHERE t.UserID = '{$UserID}'\n\t\t\tAND g.CategoryID = '1'\n\t\t\tAND g.WikiImage != ''\n\t\tGROUP BY g.ID\n\t\tORDER BY t.Time DESC\n\t\tLIMIT {$Limit}");
$RecentUploads = $DB->to_array(false, MYSQLI_ASSOC);
$Artists = Artists::get_artists($DB->collect('ID'));
foreach ($RecentUploads as $Key => $UploadInfo) {
$RecentUploads[$Key]['artists'][] = $Artists[$UploadInfo['ID']];
$RecentUploads[$Key]['ID'] = (int) $RecentUploads[$Key]['ID'];
}
$Results['uploads'] = $RecentUploads;
} else {
$Results['uploads'] = "hidden";
}
json_die("success", $Results);
function check_paranoia_here($Setting)
{
global $Paranoia, $Class, $UserID, $Preview;
if ($Preview == 1) {
return check_paranoia($Setting, $Paranoia, $Class);
} else {
开发者ID:karamanolev,项目名称:Gazelle,代码行数:31,代码来源:user_recents.php
示例12: error
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);
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:redownload.php
示例13: store
/**
* Adding a comicbook series into the database
* GET /content/store
*
* @return Response
*/
public function store()
{
//Get string inputs
$inputs = Input::only('book_name', 'publisher_name', 'author_name', 'artist_name');
//Trim string inputs
Input::merge(array_map('trim', $inputs));
//Create session
$this->createSession();
//Set validation rules
$rules = array('book_name' => 'required|alpha_num|unique:comicdb_books', 'publisher_name' => 'required|alpha_num|min:1', 'book_description' => 'max:2000', 'genres' => 'min:1', 'author_name' => 'required|alpha_num|min:1', 'artist_name' => 'required|alpha_num|min:1', 'published_date' => 'required|date_format:yy-m-d', 'cover_image' => 'required|image', 'characters' => 'min:1', 'issue_summary' => 'max:2000');
//Laravel Validation class and make method takes the inputs in the first argument
//then the rules on the data in the second
$validator = Validator::make(Input::all(), $rules);
//Validator instance use the pass method to continue
if ($validator->passes()) {
dd($validator->passes());
//Instance of Comicbook model
$comic = new Comicbooks();
//Instance of Publisher model
$publishers = new Publishers();
//Setting variables
$publisher = strtolower(Input::get('publisher_name'));
$author = strtolower(Input::get('author_name'));
$artist = strtolower(Input::get('artist_name'));
$publisherExists = $publishers->where('publisher_name', $publisher)->select('id')->first();
$authorExists = Authors::where('author_name', $author)->select('id')->first();
$artistExists = Artists::where('artist_name', $artist)->select('id')->first();
//Check if publisher already exist in the database
if (isset($publisherExists->id)) {
//if it does get the id
$publisher_id = $publisherExists->id;
} else {
//else create it in the Publisher table using the instance of publisher model
$publisher_id = $publishers->insertGetId(array('publisher_name' => $publisher));
}
//Check if author already exist in the database
if (isset($authorExists)) {
//if they do get the id
$author_id = $authorExists->id;
} else {
//else create it in the Authors table using the instance of author model
$author_id = Authors::insertGetId(array('author_name' => $author));
}
//Check if artist already exist in the database
if (isset($artistExists)) {
//if they do get the id
$artist_id = $artistExists->id;
} else {
//else create it in the Artists table using the instance of artist model
$artist_id = Artists::insertGetId(array('artist_name' => $artist));
}
//Add book series information to comicdb_books
$comic->book_name = strtolower(Input::get('book_name'));
$comic->book_description = Input::get('book_description');
$comic->publisher_id_FK = $publisher_id;
$comic->save();
//Add genre and book ids in the comicdb_genrebook using Query Builder
foreach (Input::get('genres') as $key => $genre) {
DB::table('comicdb_genrebook')->insert(array('book_id_FK' => $comic->id, 'genre_id_FK' => $genre));
}
//Add cover image to local file and set location string into database
if (Input::hasFile('cover_image')) {
$fileName = strtolower(Input::get('book_name')) . '01_Cov_' . Str::random(10) . '.' . Input::file('cover_image')->getClientOriginalExtension();
$cover_image = Input::file('cover_image')->move('public/img/comic_covers/', $fileName);
}
//Add issue character information into the comicdb_character table and keys into the comicdb_characterbook table using Query Builder
foreach (Input::get('characters') as $key => $character) {
$character_id = Characters::insertGetId(array('character_name' => $character));
DB::table('comicdb_characterbook')->insert(array('book_id_FK' => $comic->id, 'character_id_FK' => $character_id));
}
//Add issues information to comicdb_issues
Comicissues::insert(array('book_id' => $comic->id, 'issue_id' => 1, 'artist_id_FK' => $artist_id, 'author_id_FK' => $author_id, 'summary' => Input::get('issue_summary'), 'published_date' => Input::get('published_date'), 'cover_image' => 'img/comic_covers/' . $fileName, 'created_at' => date('Y-m-d H:i:s', time())));
$this->destorySession();
return Redirect::to('browse')->with('postMsg', 'Thanks for submiting!');
} else {
return Redirect::to('content/series')->with('postMsg', 'Whoops! Looks like you got some errors.')->withErrors($validator);
}
}
开发者ID:sudroid,项目名称:comicake,代码行数:84,代码来源:ContentController.php
示例14: number_format
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;
?>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:torrent_collage.php
示例15:
<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();
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:editgroupid.php
示例16: authorize
authorize();
$UserID = $LoggedUser['ID'];
$GroupID = db_string($_POST['groupid']);
$Importances = $_POST['importance'];
$AliasNames = $_POST['aliasname'];
if (!is_number($GroupID) || !$GroupID) {
error(0);
}
$DB->query("\n\tSELECT Name\n\tFROM torrents_group\n\tWHERE ID = {$GroupID}");
if (!$DB->has_results()) {
error(404);
}
list($GroupName) = $DB->next_record(MYSQLI_NUM, false);
$Changed = false;
for ($i = 0; $i < count($AliasNames); $i++) {
$AliasName = Artists::normalise_artist_name($AliasNames[$i]);
$Importance = $Importances[$i];
if ($Importance != '1' && $Importance != '2' && $Importance != '3' && $Importance != '4' && $Importance != '5' && $Importance != '6' && $Importance != '7') {
break;
}
if (strlen($AliasName) > 0) {
$DB->query("\n\t\t\tSELECT AliasID, ArtistID, Redirect, Name\n\t\t\tFROM artists_alias\n\t\t\tWHERE Name = '" . db_string($AliasName) . "'");
while (list($AliasID, $ArtistID, $Redirect, $FoundAliasName) = $DB->next_record(MYSQLI_NUM, false)) {
if (!strcasecmp($AliasName, $FoundAliasName)) {
if ($Redirect) {
$AliasID = $Redirect;
}
break;
}
}
if (!$AliasID) {
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:add_alias.php
示例17: foreach
<?php
echo Artists::display_artist($Artist);
?>
</li>
<?php
}
}
if (!empty($ArtistForm[7]) && count($ArtistForm[7]) > 0) {
?>
<li class="artists_producer"><strong>Produced by:</strong></li>
<?php
foreach ($ArtistForm[7] as $Artist) {
?>
<li class="artists_remix">
<?php
echo Artists::display_artist($Artist);
?>
</li>
<?php
}
}
?>
</ul>
</div>
<?php
}
?>
<div class="box box_tags">
<div class="head"><strong>Tags</strong></div>
<ul class="stats nobullet">
<?php
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:request.php
示例18: error
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 — [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}");
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:take_fill.php
示例19: list
$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;
开发者ID:bigsony,项目名称:Gazelle,代码行数:30,代码来源:reseed.php
示例20: NOW
}
//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&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();
开发者ID:bigsony,项目名称:Gazelle,代码行数:31,代码来源:index.php
注:本文中的Artists类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论