Empty commit

This commit is contained in:
Git 2012-08-12 08:00:16 +00:00
parent 8f340b001b
commit d434e11eae
11 changed files with 125 additions and 95 deletions

View File

@ -523,7 +523,21 @@ function to_html($Array) {
case 'quote':
$this->NoImg++; // No images inside quote tags
if(!empty($Block['Attr'])) {
$Str.= '<strong>'.$this->to_html($Block['Attr']).'</strong> wrote: ';
$Exploded = explode("|", $this->to_html($Block['Attr']));
if(isset($Exploded[1]) && is_numeric($Exploded[1])) {
$PostURL = 'forums.php?action=viewthread&postid='.trim($Exploded[1]);
/* $Current = substr($_SERVER['PHP_SELF'], 1, -4);
switch($Current) {
case 'forums':
$PostURL = $Current.'?action=viewthread&postid='.$PostID;
break;
}*/
$Str.= '<a href="' .$PostURL. '"><strong>'.$Exploded[0].'</strong> wrote: </a>';
// $Str.= '<strong>'.$Exploded[0].'</strong> wrote: ';
}
else {
$Str.= '<strong>'.$Exploded[0].'</strong> wrote: ';
}
}
$Str.='<blockquote>'.$this->to_html($Block['Val']).'</blockquote>';
$this->NoImg--;

View File

@ -116,21 +116,31 @@
}
if(!empty($_GET['filter_cat'])) {
$Keys = array_keys($_GET['filter_cat']);
$SS->set_filter('categoryid', $Keys);
$CategoryArray = array_keys($_GET['filter_cat']);
if(count($CategoryArray) != count($Categories)) {
foreach($CategoryArray as $Key => $Index) {
if(!isset($Categories[$Index-1])) {
unset($CategoryArray[$Key]);
}
}
if(count($CategoryArray) >= 1) {
$SS->set_filter('categoryid', $CategoryArray);
}
}
}
if(!empty($_GET['releases'])) {
$ReleaseArray = $_GET['releases'];
if(count($ReleaseArray) != count($ReleaseTypes)) {
foreach($ReleaseArray as $Index => $Value) {
if(!is_number($Value)) {
print json_encode(array('status' => 'failure'));
die();
if(!isset($ReleaseTypes[$Value])) {
unset($ReleaseArray[$Index]);
}
}
$SS->set_filter('releasetype', $ReleaseArray);
if(count($ReleaseArray) >= 1) {
$SS->set_filter('releasetype', $ReleaseArray);
}
}
}
@ -139,16 +149,14 @@
if(count($FormatArray) != count($Formats)) {
$FormatNameArray = array();
foreach($FormatArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Formats)) {
$FormatNameArray[$Index] = $Formats[$MasterIndex];
} else {
//Hax
print json_encode(array('status' => 'failure'));
die();
if(isset($Formats[$MasterIndex])) {
$FormatNameArray[$Index] = '"'.strtr($Formats[$MasterIndex], '-.', ' ').'"';
}
}
$Queries[]='@formatlist '.implode(' | ', $FormatNameArray);
if(count($FormatNameArray) >= 1) {
$Queries[]='@formatlist (any | '.implode(' | ', $FormatNameArray).')';
}
}
}
@ -157,16 +165,14 @@
if(count($MediaArray) != count($Media)) {
$MediaNameArray = array();
foreach($MediaArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Media)) {
$MediaNameArray[$Index] = $Media[$MasterIndex];
} else {
//Hax
print json_encode(array('status' => 'failure'));
die();
if(isset($Media[$MasterIndex])) {
$MediaNameArray[$Index] = '"'.strtr($Media[$MasterIndex], '-.', ' ').'"';
}
}
$Queries[]='@medialist '.implode(' | ', $MediaNameArray);
if(count($MediaNameArray) >= 1) {
$Queries[]='@medialist (any | '.implode(' | ', $MediaNameArray).')';
}
}
}
@ -175,16 +181,14 @@
if(count($BitrateArray) != count($Bitrates)) {
$BitrateNameArray = array();
foreach($BitrateArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Bitrates)) {
$BitrateNameArray[$Index] = $SS->EscapeString($Bitrates[$MasterIndex]);
} else {
//Hax
print json_encode(array('status' => 'failure'));
die();
if(isset($Bitrates[$MasterIndex])) {
$BitrateNameArray[$Index] = '"'.strtr($SS->EscapeString($Bitrates[$MasterIndex]), '-.', ' ').'"';
}
}
$Queries[]='@bitratelist '.implode(' | ', $BitrateNameArray);
if(count($BitrateNameArray) >= 1) {
$Queries[]='@bitratelist (any | '.implode(' | ', $BitrateNameArray).')';
}
}
}
@ -206,8 +210,8 @@
}
}
if(!empty($_GET['page']) && is_number($_GET['page'])) {
$Page = min($_GET['page'], 50000/REQUESTS_PER_PAGE);
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
$Page = $_GET['page'];
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
} else {
$Page = 1;

View File

@ -386,7 +386,7 @@
<?=format_username($AuthorID, true, true, true, true, true)?>
<?=time_diff($AddedTime,2)?>
<? if(!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')){ ?>
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');">[Quote]</a>
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>', true);">[Quote]</a>
<? }
if (((!$ThreadInfo['IsLocked'] && check_forumperm($ForumID, 'Write')) && ($AuthorID == $LoggedUser['ID']) || check_perms('site_moderate_forums'))) { ?>
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
@ -482,7 +482,7 @@
</td>
</tr>
</table>
<form id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post" style="display: block; text-align: center;">
<form id="quickpostform" action="" <? if(!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?> method="post" style="display: block; text-align: center;">
<input type="hidden" name="action" value="reply" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="thread" value="<?=$ThreadID?>" />

View File

@ -0,0 +1,19 @@
<?
$FeaturedAlbum = $Cache->get_value('featured_album');
if($FeaturedAlbum === false) {
$DB->query("SELECT fa.GroupID, tg.Name, tg.WikiImage, fa.ThreadID, fa.Title FROM featured_albums AS fa JOIN torrents_group AS tg ON tg.ID=fa.GroupID WHERE Ended = 0");
$FeaturedAlbum = $DB->next_record();
$Cache->cache_value('featured_album', $FeaturedAlbum, 0);
}
if(is_number($FeaturedAlbum['GroupID'])) {
$Artists = get_artist($FeaturedAlbum['GroupID']);
?>
<div class="box">
<div class="head colhead_dark"><strong>Featured Album</strong></div>
<div class="center pad"><?=display_artists($Artists, true, true)?><a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>"><?=$FeaturedAlbum['Name']?></a></div>
<div class="center"><a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>" title="<?=display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>"><img src="<?=to_thumbnail($FeaturedAlbum['WikiImage'])?>" alt="<?=display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" /></a></div>
<div class="center pad"><a href="forums.php?action=viewthread&amp;threadid=<?=$FeaturedAlbum['ThreadID']?>"><em>Read the interview with the artist, discuss here</em></a></div>
</div>
<?
}
?>

View File

@ -30,30 +30,10 @@
<div class="thin">
<div class="sidebar">
<?
$FeaturedAlbum = $Cache->get_value('featured_album');
if($FeaturedAlbum === false) {
$DB->query("SELECT fa.GroupID, tg.Name, tg.WikiImage, fa.ThreadID, fa.Title FROM featured_albums AS fa JOIN torrents_group AS tg ON tg.ID=fa.GroupID WHERE Ended = 0");
$FeaturedAlbum = $DB->next_record();
$Cache->cache_value('featured_album', $FeaturedAlbum, 0);
}
if(is_number($FeaturedAlbum['GroupID'])) {
$Artists = get_artist($FeaturedAlbum['GroupID']);
?>
<div class="box">
<div class="head colhead_dark"><strong>Featured Album</strong></div>
<div class="center pad"><?=display_artists($Artists, true, true)?><a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>"><?=$FeaturedAlbum['Name']?></a></div>
<div class="center"><a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>" title="<?=display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>"><img src="<?=to_thumbnail($FeaturedAlbum['WikiImage'])?>" alt="<?=display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" /></a></div>
<div class="center pad"><a href="forums.php?action=viewthread&amp;threadid=<?=$FeaturedAlbum['ThreadID']?>"><em>Read the interview with the artist, discuss here</em></a></div>
</div>
<?
}
?>
include('feat_album.php');
<?
if (check_perms('users_mod')) {
if (check_perms('users_mod')) {
?>
<div class="box">

View File

@ -124,7 +124,7 @@
$Debug->log_var(array($CategoryArray, $Categories));
if(count($CategoryArray) != count($Categories)) {
foreach($CategoryArray as $Key => $Index) {
if(!isset($Categories[$Index])) {
if(!isset($Categories[$Index-1])) {
unset($CategoryArray[$Key]);
}
}

View File

@ -1,8 +1,9 @@
<?
if(!check_perms('users_view_email')) { error(403); }
if (!check_perms('users_view_email')) { error(403);
}
show_header('Manage email blacklist');
$DB->query("SELECT
$DB -> query("SELECT
eb.ID,
eb.UserID,
eb.Time,
@ -19,45 +20,46 @@
<td>Added</td>
<td>Submit</td>
</tr>
<? while(list($ID, $UserID, $Time, $Email, $Comment) = $DB->next_record()) { ?>
<tr>
<td colspan="4" class="colhead">Add To Email Blacklist</td>
</tr>
<tr class="rowa">
<form action="tools.php" method="post">
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<td>
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="text" name="email" value="<?=display_str($Email)?>" size="30" />
<input type="text" name="email" size="30" />
</td>
<td colspan="2">
<input type="text" name="comment" size="60" />
</td>
<td>
<input type="text" name="comment" value="<?=display_str($Comment)?>" size="60" />
</td>
<td>
<?=format_username($UserID, false, false, false)?><br />
<?=time_diff($Time, 1)?></td>
<td>
<input type="submit" name="submit" value="Edit" />
<input type="submit" name="submit" value="Delete" />
<input type="submit" value="Create" />
</td>
</form>
</tr>
<? } ?>
<tr>
<td colspan="4" class="colhead">Add To Email Blacklist</td>
</tr>
<tr class="rowa">
<form action="tools.php" method="post">
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<td>
<input type="text" name="email" size="30" />
</td>
<td colspan="2">
<input type="text" name="comment" size="60" />
</td>
<td>
<input type="submit" value="Create" />
</td>
</form>
</tr>
<? while(list($ID, $UserID, $Time, $Email, $Comment) = $DB->next_record()) {
?>
<tr>
<form action="tools.php" method="post">
<td>
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="text" name="email" value="<?=display_str($Email)?>" size="30" />
</td>
<td>
<input type="text" name="comment" value="<?=display_str($Comment)?>" size="60" />
</td>
<td><?=format_username($UserID, false, false, false)
?><br /><?=time_diff($Time, 1)
?></td>
<td>
<input type="submit" name="submit" value="Edit" />
<input type="submit" name="submit" value="Delete" />
</td>
</form>
</tr>
<? }?>
</table>
<? show_footer(); ?>
<? show_footer();?>

View File

@ -19,8 +19,10 @@
$Perms = get_permissions($UserInfo['PermissionID']);
$UserClass = $Perms['Class'];
if($LoggedUser['ID'] != $UserID && !check_paranoia(false, $User['Paranoia'], $UserClass, $UserID)) {
error(403);
if(!check_perms('users_mod')) {
if($LoggedUser['ID'] != $UserID && !check_paranoia(false, $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
}
if (isset($_GET['expire'])) {
@ -113,4 +115,4 @@
<div class="linkbox"><?=$Pages?></div>
<?
show_footer();
?>
?>

View File

@ -2,13 +2,17 @@ var username;
var postid;
function Quote(post, user) {
Quote(post, user, false)
}
function Quote(post, user, link) {
username = user;
postid = post;
ajax.get("?action=get_post&post=" + postid, function(response){
if ($('#quickpost').raw().value !== '') {
$('#quickpost').raw().value = $('#quickpost').raw().value + "\n\n";
}
$('#quickpost').raw().value = $('#quickpost').raw().value + "[quote="+username+"]" +
$('#quickpost').raw().value = $('#quickpost').raw().value + "[quote="+username + (link == true ? "|" + post : "") + "]" +
//response.replace(/(img|aud)(\]|=)/ig,'url$2').replace(/\[url\=(https?:\/\/[^\s\[\]<>"\'()]+?)\]\[url\](.+?)\[\/url\]\[\/url\]/gi, "[url]$1[/url]")
html_entity_decode(response)
+ "[/quote]";
@ -16,6 +20,7 @@ function Quote(post, user) {
});
}
function Edit_Form(post,key) {
postid = post;
if (location.href.match(/torrents\.php/)) {

View File

@ -3,6 +3,10 @@ pre br {
display:none;
}
.center {
text-align: center;
}
ul.collage_images {
padding: 0px;
width: 590px;

View File

@ -546,7 +546,7 @@ p.min_padding {
}
.sidebar .box img {
margin: 9px 0;
margin: 0;
}
.body {