예제 #1
0
function initialize_create_post()
{
    if (!is_logged_in()) {
        Error("Access Forbidden");
    }
    AddJs('create_post.js');
}
예제 #2
0
function initialize_create_item()
{
    if (!is_admin()) {
        Error('Invalid Access');
    }
    AddJs('create_item.js');
}
예제 #3
0
function initialize_stream_post()
{
    global $posts;
    global $totalPage;
    $result = null;
    if (!isset($_GET['p'])) {
        $_GET['p'] = 0;
    } else {
        $_GET['p'] = ($_GET['p'] - 1) * $GLOBALS['POSTS_PER_PAGE'];
    }
    if (isset($_GET['q'])) {
        if (!isset($_GET['advanced'])) {
            $_GET['advanced'] = [];
        }
        if (isset($_GET['username'])) {
            $result = GetUserFilteredPost($_GET['username'], $_GET['q'], $_GET['advanced'], $_GET['p']);
        } else {
            $result = GetFilteredPost($_GET['q'], $_GET['advanced'], $_GET['p']);
        }
    } else {
        if (isset($_GET['username'])) {
            $result = GetUserPosts($_GET['username'], $_GET['p']);
        } else {
            $result = GetAllPosts($_GET['p']);
        }
    }
    if ($result != null) {
        $posts = $result['posts'];
        $totalPage = ceil($result['count'] / $GLOBALS['POSTS_PER_PAGE']);
    }
    AddJs('stream_post.js');
}
예제 #4
0
function initialize_edit_user()
{
    if (!is_logged_in()) {
        Redirect('index.php');
    }
    AddJs('user_form_libraries.js');
    AddJs('user_script.js');
}
예제 #5
0
function initialize_edit_item()
{
    global $item;
    if (!is_admin() || !is_get_parameter_complete(array('iditem'))) {
        Error('Invalid Access');
    }
    $iditem = $_GET['iditem'];
    //$GLOBALS['items'] = SelectItem($itemid);
    $item = SelectItem($iditem);
    if ($item == NULL) {
        error("Item not found!");
    }
    AddJs('edit_item.js');
}
예제 #6
0
function initialize_register()
{
    AddJs('user_form_libraries.js');
    AddJs('user_script.js');
}