function initialize_create_post() { if (!is_logged_in()) { Error("Access Forbidden"); } AddJs('create_post.js'); }
function initialize_create_item() { if (!is_admin()) { Error('Invalid Access'); } AddJs('create_item.js'); }
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'); }
function initialize_edit_user() { if (!is_logged_in()) { Redirect('index.php'); } AddJs('user_form_libraries.js'); AddJs('user_script.js'); }
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'); }
function initialize_register() { AddJs('user_form_libraries.js'); AddJs('user_script.js'); }