コード例 #1
0
ファイル: guest.php プロジェクト: azanium/PopBloop-Web
function article_guest_get($alias = NULL)
{
    if (!isset($alias)) {
        $alias = func_arg(0);
    }
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Articles');
    $lilo_mongo->selectCollection('Article');
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    $user_property = user_user_property();
    $template->user_property = json_decode($user_property);
    $template->heartBeatInterval = 60000;
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    //	$article_id = func_arg(0);
    //	$template_file = "modules/011_articles/templates_popbloopdark/article_guest_read_".$article_id.".php";
    //	$template->middle = $template->render($template_file);
    $article = $lilo_mongo->findOne(array('alias' => $alias));
    $template->middle = $article['text'];
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #2
0
ファイル: admin - Copy.php プロジェクト: azanium/PopBloop-Web
function quest_admin_dialog()
{
    $template = new Template();
    $logged_in = user_user_loggedin();
    // Deteksi User Agent
    $template->logged_in = $logged_in;
    $template->basepath = $_SESSION['basepath'];
    $return = $template->render("modules/006_quest_engine/templates/quest_admin_dialog.php");
    return $return;
}
コード例 #3
0
ファイル: user - Copy.php プロジェクト: azanium/PopBloop-Web
function friend_user_default()
{
    // ajax only
    //	$ret .= "&bull;&nbsp;Search people to be added as friends<br />";
    //	$ret .= "&bull;&nbsp;List of friends by groups/circles<br />";
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    // Deteksi User Agent
    $template_file = "modules/004_friends/templates/friend_user_default.php";
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $template->circles = (array) friend_user_ws_circle($_SESSION['user_id'], 'array');
    $return = $template->render($template_file);
    return $return;
}
コード例 #4
0
ファイル: admin.php プロジェクト: azanium/PopBloop-Web
function ui_admin_avatar_editor()
{
    $ajax = func_arg(0);
    if ($ajax == 'ajax') {
        $basepath = $_SESSION['basepath'];
        $template = new Template();
        $logged_in = user_user_loggedin();
        // Deteksi User Agent
        $template->logged_in = $logged_in;
        $template->basepath = $basepath;
        $return = $template->render("modules/000_user_interface/templates/ui_admin_avatar_editor.php");
        return $return;
    } else {
        $template_file = "modules/000_user_interface/templates/ui_admin_avatar_editor.php";
        return ui_admin_default($template_file);
    }
}
コード例 #5
0
ファイル: user.php プロジェクト: azanium/PopBloop-Web
/**
 * return property dari user ini
 */
function user_user_property($args = NULL, $rettype = NULL)
{
    if (!user_user_loggedin()) {
        return "0";
    }
    // write_log(array('log_text' => print_r($args, true)));
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Users');
    $lilo_mongo->selectCollection('Account');
    $array_criteria = array('username' => $_SESSION['username']);
    if (isset($args)) {
        $array_criteria = $args;
    }
    $myproperty = $lilo_mongo->findOne($array_criteria);
    unset($myproperty['password']);
    unset($myproperty['_id']);
    // write_log(array('log_text' => print_r($myproperty, true)));
    $lilo_mongo->selectCollection('Properties');
    $array_criteria = array('lilo_id' => $myproperty['lilo_id']);
    $myproperty2 = $lilo_mongo->findOne($array_criteria);
    if (trim($myproperty2['profile_picture']) == '') {
        $myproperty2['profile_picture'] = 'default.png';
    }
    unset($myproperty2['_id']);
    unset($myproperty2['lilo_id']);
    //	count_unread_msg
    //	jumlah pesan dengan 'receiver' = $user_id dan 'read' != '1'
    $lilo_mongo->selectDB('Social');
    $lilo_mongo->selectCollection('Messages');
    $count_unread_msg = $lilo_mongo->count(array('receiver' => $_SESSION['user_id'], 'read' => array('$not' => '1')));
    $myproperty2['count_unread_msg'] = intval($count_unread_msg);
    //	power
    $lilo_mongo->selectDB('Game');
    $lilo_mongo->selectCollection('Achievement');
    $power_array = $lilo_mongo->findOne(array('userid' => $_SESSION['user_id'], 'tipe' => 'energy'));
    $myproperty2['power'] = $power_array['value'];
    $myproperty = array_merge((array) $myproperty, (array) $myproperty2);
    // write_log(array('log_text' => print_r($myproperty, true)));
    if ($rettype == 'array') {
        return $myproperty;
    }
    return json_encode($myproperty);
}
コード例 #6
0
ファイル: guest.php プロジェクト: azanium/PopBloop-Web
function ui_guest_signupform()
{
    //die("<pre>" . print_r($_REQUEST, true) . "</pre>");
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    // Deteksi User Agent
    $template->basepath = $basepath;
    $template->signup_fullname = $_POST['signup_fullname'];
    $template->signup_email = $_POST['signup_email'];
    $template->signup_password = $_POST['signup_password'];
    $middle = $template->render("modules/000_user_interface/templates/ui_guest_signupform.php");
    $template->top = NULL;
    $template->left = NULL;
    $template->right = NULL;
    $template->bottom = NULL;
    $template->middle = $middle;
    $return = $template->render("modules/000_user_interface/templates/ui_guest_default.php");
    return $return;
}
コード例 #7
0
ファイル: admin.php プロジェクト: azanium/PopBloop-Web
/**
 * mengecek apakah current_user [atau user dgn username yg diberikan] adalah administrator
 */
function user_admin_is_admin($uname = NULL)
{
    // PERBAIKI, AMBIL DATA LANGSUNG DARI Users.Admin
    // sementara
    return true;
    // sementara
    $username = isset($uname) ? $uname : $_SESSION['username'];
    $is_admin = 0;
    if (user_user_loggedin()) {
        $user_property = user_user_property(array('username' => $username));
        $user_property = json_decode($user_property);
        if (isset($user_property->user_group) && is_array($user_property->user_group)) {
            foreach ($user_property['user_group'] as $ug) {
                if (strtolower($ug) == "admin") {
                    $is_admin = 1;
                }
            }
        }
    }
    return $is_admin;
}
コード例 #8
0
ファイル: user.php プロジェクト: azanium/PopBloop-Web
function ui_user_microsite($file_to_load = NULL)
{
    if (!isset($file_to_load)) {
        $file_to_load = func_arg(0);
    }
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $template->session_id = user_user_sessionid();
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    //	$return = $template->render($template_file);
    //	return $return;
    $user_property = user_user_property();
    $template->user_property = json_decode($user_property);
    $template->heartBeatInterval = 60000;
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    $template->middle = $template->render("modules/000_user_interface/templates_microsite/" . $file_to_load . ".php");
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #9
0
ファイル: user.php プロジェクト: azanium/PopBloop-Web
function friend_user_facebook_invite()
{
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $template->session_id = user_user_sessionid();
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    //	$return = $template->render($template_file);
    //	return $return;
    $user_property = user_user_property();
    $template->user_property = json_decode($user_property);
    $template->heartBeatInterval = 60000;
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    //	$template->middle = $template->render("modules/000_user_interface/templates/ui_user_play.php");
    //	$template->middle = $template->render("modules/004_friends/templates/friend_user_people.php");
    $template->middle = $template->render("modules/004_friends/templates/friend_user_facebook_invite.php");
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #10
0
ファイル: guest.php プロジェクト: azanium/PopBloop-Web
function message_guest_shouttest()
{
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    // Deteksi User Agent
    $template->basepath = $basepath;
    $middle = $template->render("modules/005_messaging/templates/message_guest_shouttest.php");
    $template->middle = $middle;
    $template->username = $_SESSION['username'];
    $user_property = user_user_property();
    $template->user_property = json_decode($user_property);
    $template->heartBeatInterval = 60000;
    // komponen2 template lain
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #11
0
ファイル: user.php プロジェクト: azanium/PopBloop-Web
function message_user_status()
{
    // return print_r($_REQUEST, true);
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    // dapatkan semua bagian avatar berdasar tipe
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Assets');
    $lilo_mongo->selectCollection('Avatar');
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    $user_property = user_user_property();
    $template->user_property = json_decode($user_property);
    $template->heartBeatInterval = 60000;
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    $template_file = "modules/005_messaging/templates_popbloopdark/message_user_status.php";
    $template->middle = $template->render($template_file);
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #12
0
ファイル: admin.php プロジェクト: azanium/PopBloop-Web
function quest_admin_editdialogstory($lilo_id = NULL)
{
    if (!isset($lilo_id)) {
        $lilo_id = func_arg(0);
    }
    if (!isset($lilo_id)) {
        return false;
    }
    $dialog_story_detail = quest_admin_dialogstorydetailbyid($lilo_id);
    $template = new Template();
    $logged_in = user_user_loggedin();
    // Deteksi User Agent
    $template->logged_in = $logged_in;
    $template->basepath = $_SESSION['basepath'];
    $template->lilo_id = $lilo_id;
    $template->dialog_story_detail = $dialog_story_detail;
    //json_encode($dialog_story_detail);
    $return = $template->render("modules/006_quest_engine/templates/quest_admin_editdialogstory.php");
    return $return;
}
コード例 #13
0
ファイル: guest.php プロジェクト: azanium/PopBloop-Web
function user_guest_property()
{
    $user_id = $_SESSION['user_id'];
    if (!isset($user_id)) {
        header("Location: " . $_SESSION['basepath']);
        exit;
    }
    $username = func_arg(0);
    if (!isset($username)) {
        $username = $_SESSION['username'];
    }
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Users');
    $lilo_mongo->selectCollection('Account');
    $usernames = $lilo_mongo->command_values(array("distinct" => "Account", "key" => "username", "query" => array()));
    if (!in_array($username, $usernames)) {
        return "HTTP/1.0 404 Not Found";
    }
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $template->session_id = user_user_sessionid();
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    //	$return = $template->render($template_file);
    //	return $return;
    $user_property = user_user_property();
    $user_property = json_decode($user_property);
    // dapatkan umur dan gender
    $user_property->age = date("Y") - $user_property->birthday_yy;
    $user_property->sex = ucfirst($user_property->sex);
    $template->user_property = $user_property;
    $template->heartBeatInterval = 60000;
    $template->top = $template->render("modules/000_user_interface/templates/top.php");
    $template->left = $template->render("modules/000_user_interface/templates/left.php");
    $template->right = $template->render("modules/000_user_interface/templates/right.php");
    $template->bottom = $template->render("modules/000_user_interface/templates/bottom.php");
    if ($username == $_SESSION['username']) {
        $template->middle = $template->render("modules/001_user_management/templates/user_guest_property.php");
    } else {
        $acc_prop = user_guest_accountproperties($username);
        $acc_prop['properties']['sex'] = ucfirst($acc_prop['properties']['sex']);
        $birthday_expl = explode('-', $acc_prop['properties']['birthday']);
        $acc_prop['properties']['age'] = date("Y") - (int) $birthday_expl[2];
        $template->account_properties = $acc_prop;
        $template->username = $username;
        $template->middle = $template->render("modules/001_user_management/templates/user_guest_property_other.php");
    }
    $return = $template->render("modules/000_user_interface/templates/ui_user_default.php");
    return $return;
}
コード例 #14
0
ファイル: old.user.php プロジェクト: azanium/PopBloop-Web
function avatar_user_avatar_category()
{
    // die("<pre>" . print_r($_POST, true) . "</pre>");
    /*
    Array
    (
    		[tipe] => body
    		[gender] => male
    		[category] => T-Shirt
    		[size] => fat
    )
    */
    extract($_POST);
    if (trim($tipe) == '') {
        die("Error - Incomplete argument");
    }
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Assets');
    $lilo_mongo->selectCollection('Avatar');
    $var_name = $tipe . "_array";
    $avatar_array = array();
    //		$avatar_cursor = $lilo_mongo->find(array('tipe' => $tipe_));
    $avatar_cursor = $lilo_mongo->find(array('tipe' => $tipe, 'gender' => $gender, 'category' => $category, 'size' => $size), 0, array('gender' => 1, 'name' => 1, 'category' => 1));
    while ($curr = $avatar_cursor->getNext()) {
        $avatar_array[] = array('id' => $curr['lilo_id'], 'gender' => $curr['gender'], 'size' => $curr['size'], 'color' => $curr['color'], 'tipe' => $curr['tipe'], 'name' => $curr['name'], 'element' => $curr['element'], 'material' => $curr['material'], 'preview_image' => $curr['preview_image']);
    }
    $basepath = $_SESSION['basepath'];
    $template = new Template();
    $logged_in = user_user_loggedin();
    $template->logged_in = $logged_in;
    $template->basepath = $basepath;
    $template->avatar_array = $avatar_array;
    $template->tipe = $tipe;
    $template->background_image = str_replace('"', "'", $background_image);
    $template->element_dir = $_SESSION['element_dir'];
    $template->material_dir = $_SESSION['material_dir'];
    $template->preview_dir = $_SESSION['preview_dir'];
    $return = $template->render("modules/003_avatar_editor/templates/avatar_user_avatar_category.php");
    return $return;
}