mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 10:56:26 +00:00
60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
|
|
|
enforce_login();
|
|
|
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
|
$Text = new TEXT;
|
|
|
|
require(SERVER_ROOT.'/sections/comments/post.php'); // Post formatting function.
|
|
|
|
$action = '';
|
|
if(!empty($_REQUEST['action']))
|
|
$action = $_REQUEST['action'];
|
|
|
|
/**
|
|
* Getting a userid if applicable
|
|
*/
|
|
if(isset($_GET['id'])) {
|
|
$UserID = $_GET['id'];
|
|
if(!is_number($UserID))
|
|
error(404);
|
|
|
|
$UserInfo = Users::user_info($UserID);
|
|
|
|
$Username = $UserInfo['Username'];
|
|
if($LoggedUser['ID'] == $UserID) {
|
|
$Self = true;
|
|
} else {
|
|
$Self = false;
|
|
}
|
|
$Perms = Permissions::get_permissions($UserInfo['PermissionID']);
|
|
$UserClass = $Perms['Class'];
|
|
if (!check_paranoia('torrentcomments', $UserInfo['Paranoia'], $UserClass, $UserID))
|
|
error(403);
|
|
} else {
|
|
$UserID = $LoggedUser['ID'];
|
|
$Username = $LoggedUser['Username'];
|
|
$Self = true;
|
|
}
|
|
|
|
/**
|
|
* Posts per page limit stuff
|
|
*/
|
|
if (isset($LoggedUser['PostsPerPage'])) {
|
|
$PerPage = $LoggedUser['PostsPerPage'];
|
|
} else {
|
|
$PerPage = POSTS_PER_PAGE;
|
|
}
|
|
list($Page,$Limit) = Format::page_limit($PerPage);
|
|
|
|
switch($action) {
|
|
case 'artists':
|
|
require (SERVER_ROOT.'/sections/comments/artistcomments.php');
|
|
break;
|
|
case 'torrents':
|
|
case 'my_torrents':
|
|
default:
|
|
require(SERVER_ROOT.'/sections/comments/torrentcomments.php');
|
|
break;
|
|
}
|