Empty commit

This commit is contained in:
Git 2011-10-12 08:00:15 +00:00
parent 547fdc9829
commit 35e88914c8
6 changed files with 54 additions and 46 deletions

View File

@ -140,6 +140,42 @@
<? } else { ?> <? } else { ?>
<h2>Browse collages<?=(!empty($UserLink) ? (isset($CollageIDs) ? ' with contributions by '.$UserLink : ' started by '.$UserLink) : '')?></h2> <h2>Browse collages<?=(!empty($UserLink) ? (isset($CollageIDs) ? ' with contributions by '.$UserLink : ' started by '.$UserLink) : '')?></h2>
<? } ?> <? } ?>
<div class="linkbox">
<? if (!$BookmarkView) {
if (check_perms('site_collages_create')) { ?>
<a href="collages.php?action=new">[New collage]</a>
<? }
if (check_perms('site_collages_personal')) {
$DB->query("SELECT ID FROM collages WHERE UserID='$LoggedUser[ID]' AND CategoryID='0' AND Deleted='0'");
if($DB->record_count() == 0) {
?>
<a href="collages.php?action=create_personal">[New <strong>personal</strong> collage]</a>
<? } else {
list($CollageID) = $DB->next_record();
?>
<a href="collages.php?id=<?=$CollageID?>">[Your personal collage]</a>
<?
}
}
if (check_perms('site_collages_recover')) { ?>
<a href="collages.php?action=recover">[Recover collage]</a>
<?
}
if (check_perms('site_collages_create') || check_perms('site_collages_personal') || check_perms('site_collages_recover')) {
?>
<br /><br />
<?
}
?>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>">[Collages you started]</a>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>&amp;contrib=1">[Collages you've contributed to]</a>
<? } else { ?>
<a href="bookmarks.php?type=torrents">[Torrents]</a>
<a href="bookmarks.php?type=artists">[Artists]</a>
<a href="bookmarks.php?type=collages">[Collages]</a>
<a href="bookmarks.php?type=requests">[Requests]</a>
<? } ?>
</div>
<? if (!$BookmarkView) { ?> <? if (!$BookmarkView) { ?>
<div> <div>
<form action="" method="get"> <form action="" method="get">
@ -197,40 +233,6 @@
</div> </div>
<? } // if (!$BookmarkView) ?> <? } // if (!$BookmarkView) ?>
<div class="linkbox"> <div class="linkbox">
<? if (!$BookmarkView) {
if (check_perms('site_collages_create')) { ?>
<a href="collages.php?action=new">[New collage]</a>
<? }
if (check_perms('site_collages_personal')) {
$DB->query("SELECT ID FROM collages WHERE UserID='$LoggedUser[ID]' AND CategoryID='0' AND Deleted='0'");
if($DB->record_count() == 0) {
?>
<a href="collages.php?action=create_personal">[New <strong>personal</strong> collage]</a>
<? } else {
list($CollageID) = $DB->next_record();
?>
<a href="collages.php?id=<?=$CollageID?>">[Your personal collage]</a>
<?
}
}
if (check_perms('site_collages_recover')) { ?>
<a href="collages.php?action=recover">[Recover collage]</a>
<?
}
if (check_perms('site_collages_create') || check_perms('site_collages_personal') || check_perms('site_collages_recover')) {
?>
<br /><br />
<?
}
?>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>">[Collages you started]</a>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>&amp;contrib=1">[Collages you've contributed to]</a>
<? } else { ?>
<a href="bookmarks.php?type=torrents">[Torrents]</a>
<a href="bookmarks.php?type=artists">[Artists]</a>
<a href="bookmarks.php?type=collages">[Collages]</a>
<a href="bookmarks.php?type=requests">[Requests]</a>
<? } ?>
<? <?
$Pages=get_pages($Page,$NumResults,COLLAGES_PER_PAGE,9); $Pages=get_pages($Page,$NumResults,COLLAGES_PER_PAGE,9);
echo $Pages; echo $Pages;

View File

@ -70,7 +70,7 @@
?> ?>
<div class="thin"> <div class="thin">
<h2><a href="forums.php">Forums</a> &gt; <?=$Forums[$ForumID]['Name']?></h2> <h2><a href="forums.php">Forums</a> &gt; <?=$Forums[$ForumID]['Name']?></h2>
<? if($LoggedUser['Class'] >= $Forums[$ForumID]['MinClassCreate']){ ?> <? if(check_forumperm($ForumID, 'Write') && check_forumperm($ForumID, 'Create')){ ?>
<div class="linkbox"> <div class="linkbox">
[<a href="forums.php?action=new&amp;forumid=<?=$ForumID?>">New Thread</a>] [<a href="forums.php?action=new&amp;forumid=<?=$ForumID?>">New Thread</a>]
</div> </div>

View File

@ -44,6 +44,9 @@ function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
function check_forumperm($ForumID, $Perm = 'Read') { function check_forumperm($ForumID, $Perm = 'Read') {
global $LoggedUser, $Forums; global $LoggedUser, $Forums;
if ($LoggedUser['CustomForums'][$ForumID] == 1) {
return true;
}
if($Forums[$ForumID]['MinClass'.$Perm] > $LoggedUser['Class'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) { if($Forums[$ForumID]['MinClass'.$Perm] > $LoggedUser['Class'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) {
return false; return false;
} }

View File

@ -118,6 +118,8 @@
case 'edit_rules': case 'edit_rules':
require(SERVER_ROOT.'/sections/forums/edit_rules.php'); require(SERVER_ROOT.'/sections/forums/edit_rules.php');
break; break;
case 'thread_subscribe':
break;
default: default:
error(404); error(404);
} }

View File

@ -19,7 +19,7 @@
} }
if($LoggedUser['Class'] < $Forum['MinClassCreate']) { error(403); } if(!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) { error(403); }
show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode'); show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
?> ?>
<div class="thin"> <div class="thin">

View File

@ -10,8 +10,9 @@
error(0); error(0);
} }
$DB->query('SELECT MinClassRead, ID FROM forums WHERE forums.ID = (SELECT ForumID FROM forums_topics WHERE ID = '.db_string($_GET['topicid']).')'); require(SERVER_ROOT.'/sections/forums/index.php');
list($MinClassRead, $ForumID) = $DB->next_record(); $DB->query('SELECT ID FROM forums WHERE forums.ID = (SELECT ForumID FROM forums_topics WHERE ID = '.db_string($_GET['topicid']).')');
list($ForumID) = $DB->next_record();
if(!check_forumperm($ForumID)) { if(!check_forumperm($ForumID)) {
die(); die();
} }