Esempio n. 1
0
show_menu();
list($username, $password) = get_data();
if (!check_forum_id($_GET['id']) || !$_GET['id']) {
    _err("ID non Specificato!");
}
$id = (int) $_GET['id'];
// controllo se il forum è protetto
if (check_access_forum($id) != NULL && check_access_forum($id) != 'user') {
    if (login($username, $password) == TRUE) {
        if (level($username) != 'admin' && level($username) != 'mod') {
            if (level($username) != check_access_forum($id)) {
                _err('Non hai i permessi per visualizzare questo topic!');
            }
        }
    } else {
        if (check_access_forum($id) != NULL && check_access_forum($id) != 'user') {
            header('Location: index.php');
        }
    }
}
if (isset($_GET['page']) && is_numeric($_GET['page']) && (int) $_GET['page'] > 0) {
    $page = (int) $_GET['page'];
} else {
    $page = 1;
}
$query = "SELECT * \n\t\t\t  FROM " . __PREFIX__ . "topic \n\t\t\t WHERE f_id = '" . $id . "' \n\t\t\t   AND replyof < 0 \n\t\t\t ORDER by last DESC";
$res = mysql_query($query);
$limit = 10;
//quanti topic per pagina?
$Pager = new Pagination();
$pager = $Pager->paginazione($res, $limit, $page);
Esempio n. 2
0
function check_graphic_access_forum($id)
{
    $check = check_access_forum($id);
    $graphic = NULL;
    if ($check == 'admin') {
        $graphic = "<i><font color='darkred'>(Protetto ADMIN)</font></i>";
    }
    if ($check == 'mod') {
        $graphic = "<i><font color='green'>(Protetto MOD)</font></i>";
    }
    if ($check == 'vip') {
        $graphic = "<i><font color='gold'>(Protetto VIP)</font></i>";
    }
    return $graphic;
}