本文整理汇总了PHP中func_arg函数的典型用法代码示例。如果您正苦于以下问题:PHP func_arg函数的具体用法?PHP func_arg怎么用?PHP func_arg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了func_arg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mobile_banner_list
function mobile_banner_list()
{
$start_from = (int) func_arg(0);
$limit = (int) func_arg(1);
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Assets');
$lilo_mongo->selectCollection('Banner');
$temp_data = $lilo_mongo->find_pagging(array(), $start_from, $limit, array('dateAdd' => -1));
$count = $lilo_mongo->count();
$data = array();
if ($temp_data) {
foreach ($temp_data as $dt) {
$_id = !isset($dt['_id']) ? "" : (string) $dt['_id'];
$ID = !isset($dt['ID']) ? "" : $dt['ID'];
$name = !isset($dt['name']) ? "" : $dt['name'];
$Descriptions = !isset($dt['Descriptions']) ? "" : $dt['Descriptions'];
$type = !isset($dt['type']) ? "" : $dt['type'];
$urlPicture = !isset($dt['urlPicture']) ? "" : $dt['urlPicture'];
$dataValue = !isset($dt['dataValue']) ? "" : $dt['dataValue'];
$picture = !isset($dt['picture']) ? "" : $dt['picture'];
$path_upload = URL_ASSET_IMAGE . "images/";
$data[] = array('_id' => $_id, 'ID' => $ID, 'name' => $name, 'descriptions' => $Descriptions, 'type' => $type, 'urlPicture' => $urlPicture, 'dataValue' => $dataValue, 'picture' => $picture);
}
}
$output = array('count' => $count, 'data' => $data);
return json_encode($output);
}
示例2: mobile_feature_list
function mobile_feature_list()
{
$output = array();
$email = func_arg(0);
$func = func_arg(1);
$start = func_arg(2);
$limit = func_arg(3);
if ($func == "root") {
$output = __features_root();
} else {
if ($func == "allcolors") {
$output['data'][] = array('tipe' => 'skincolor', 'title' => 'Skin Color', 'picture' => 'skincolor.png', 'action' => '/ItemFeature?f=skincolors', 'value' => '');
$output = json_encode($output);
} else {
if ($func == "skincolors") {
$output['count'] = 19;
for ($i = 1; $i <= 19; $i++) {
$output['data'][] = array('tipe' => 'color' . $i, 'title' => 'Color #' . $i, 'picture' => $i . '.png', 'action' => '/AvatarPreview?f=color&v=' . $i, 'value' => '');
}
$output = json_encode($output);
} else {
$output = __features_part($email, $func, $start, $limit);
}
}
}
return $output;
}
示例3: article_guest_get
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;
}
示例4: mobile_avastream_list
function mobile_avastream_list()
{
$start_from = (int) func_arg(0);
$limit = (int) func_arg(1);
$output = array();
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Assets');
$lilo_mongo->selectCollection('AvatarStream');
$temp_data = $lilo_mongo->find_pagging(array(), $start_from, $limit, array('dateAdd' => -1));
$output['count'] = $lilo_mongo->count();
if ($temp_data) {
foreach ($temp_data as $dt) {
$_id = !isset($dt['_id']) ? "" : (string) $dt['_id'];
$ID = !isset($dt['ID']) ? "" : $dt['ID'];
$name = !isset($dt['name']) ? "" : $dt['name'];
$brand_id = !isset($dt['brand_id']) ? "" : $dt['brand_id'];
$type = !isset($dt['type']) ? "" : $dt['type'];
$urlPicture = !isset($dt['urlPicture']) ? "" : $dt['urlPicture'];
$dataValue = !isset($dt['dataValue']) ? "" : $dt['dataValue'];
$picture = !isset($dt['picture']) ? "" : $dt['picture'];
$output['data'][] = array('_id' => $_id, 'ID' => $ID, 'name' => $name, 'brand_id' => $brand_id, 'type' => $type, 'dataValue' => $dataValue);
}
}
return json_encode($output);
}
示例5: server_admin_delete
function server_admin_delete($server_to_delete = NULL)
{
$server_id = isset($server_to_delete) ? $server_to_delete : func_arg(0);
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Servers');
$lilo_mongo->selectCollection('GameServer');
$lilo_mongo->remove(array('lilo_id' => $server_id));
return '1';
}
示例6: asset_user_session_to_user_id
function asset_user_session_to_user_id($session_id = NULL)
{
if (!isset($session_id)) {
$session_id = func_arg(0);
}
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('Session');
$array_criteria = array('session_id' => $session_id);
$result_array = $lilo_mongo->findOne($array_criteria);
return $result_array['user_id'];
}
示例7: report_user_achievement
/**
* examples:
* -to get online time for user rully, use: http://localhost/popbloop/report/user/achievement/4df6e7192cbfd4e6c000fd9b/online_time/get
* -to increase online time for user rully by 200ms, use: http://localhost/popbloop/report/user/achievement/4df6e7192cbfd4e6c000fd9b/online_time/dec/200
*/
function report_user_achievement($user_id = NULL, $achievement_type = NULL, $op = NULL, $value = NULL)
{
$user_id = isset($user_id) ? $user_id : $_SESSION['user_id'];
if (!isset($user_id)) {
$user_id = func_arg(0);
}
if (!isset($achievement_type)) {
$achievement_type = func_arg(1);
}
if (!isset($op)) {
// inc, set, dec, * get
// * = default
$op = func_arg(2);
}
$op = strtolower(trim($op));
if (!isset($value)) {
$value = func_arg(3);
}
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Game');
$lilo_mongo->selectCollection('Achievement');
// jika ada, dapatkan dulu current value
$criteria = array('tipe' => $achievement_type, 'userid' => $user_id);
$curr_ach = $lilo_mongo->findOne($criteria);
if (!($op == '' || $op == 'get') && count($curr_ach)) {
$lilo_mongo->selectCollection('AchievementLog');
// sebelum isi db diubah, backup dulu ke table AchievementLog
$curr_ach_log = array_merge((array) $curr_ach, array('q' => $_REQUEST['q'], 'time' => time()));
$lilo_mongo->insert($curr_ach_log);
}
$lilo_mongo->selectCollection('Achievement');
switch ($op) {
case '':
case 'get':
return $curr_ach['value'];
break;
case 'set':
$lilo_mongo->update_set($criteria, array('value' => $value));
break;
case 'inc':
$lilo_mongo->update_set($criteria, array('value' => (int) $curr_ach['value'] + (int) $value));
break;
case 'dec':
$lilo_mongo->update_set($criteria, array('value' => (int) $curr_ach['value'] - (int) $value));
break;
}
return "1";
}
示例8: ui_admin_avatar_editor
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);
}
}
示例9: log_guest_pageview
function log_guest_pageview($op, $var)
{
// op: getall, var: ...
// op: getbydate, var: 2012-03-28
// op: inc, var: ...
if (!isset($op)) {
$op = func_arg(0);
}
if (!isset($var)) {
$var = func_arg(1);
}
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Logs');
$lilo_mongo->selectCollection('PageView');
//
// jika ada, dapatkan dulu current value
$criteria = array('tipe' => $achievement_type, 'userid' => $user_id);
$curr_ach = $lilo_mongo->findOne($criteria);
if (!($op == '' || $op == 'get') && count($curr_ach)) {
$lilo_mongo->selectCollection('AchievementLog');
// sebelum isi db diubah, backup dulu ke table AchievementLog
$curr_ach_log = array_merge((array) $curr_ach, array('q' => $_REQUEST['q'], 'time' => time()));
$lilo_mongo->insert($curr_ach_log);
}
$lilo_mongo->selectCollection('Achievement');
switch ($op) {
case '':
case 'get':
return $curr_ach['value'];
break;
case 'set':
$lilo_mongo->update_set($criteria, array('value' => $value));
break;
case 'inc':
$lilo_mongo->update_set($criteria, array('value' => (int) $curr_ach['value'] + (int) $value));
break;
case 'dec':
$lilo_mongo->update_set($criteria, array('value' => (int) $curr_ach['value'] - (int) $value));
break;
}
return "1";
}
示例10: mobile_content_detail
function mobile_content_detail()
{
$_id = func_arg(0) != "" ? func_arg(0) : "";
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Articles');
$lilo_mongo->selectCollection('ContentPage');
$dt = $lilo_mongo->findOne(array("_id" => $lilo_mongo->mongoid($_id)));
$output = array('title' => "No Title", 'text' => "no Text", 'alias' => "no alias", 'document_update' => date("Y-m-d H:i:s"), 'state_document' => "");
if ($dt) {
$tgl = "";
if ($dt['document_update'] != "") {
$tgl = date('Y-m-d H:i:s', $dt['document_update']->sec);
}
$title = !isset($dt['title']) ? "" : $dt['title'];
$text = !isset($dt['text']) ? "" : $dt['text'];
$alias = !isset($dt['alias']) ? "" : $dt['alias'];
$state_document = !isset($dt['state_document']) ? "" : $dt['state_document'];
$output = array('title' => $title, 'alias' => $alias, 'text' => replace_text_content(filter_text($text)), 'document_update' => $tgl, 'state_document' => $state_document);
}
return json_encode($output);
}
示例11: mobile_stream_news
function mobile_stream_news()
{
$_id = func_arg(0) != "" ? func_arg(0) : "";
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Articles');
$lilo_mongo->selectCollection('ContentNews');
$dt = $lilo_mongo->findOne(array("_id" => $lilo_mongo->mongoid($_id)));
$output = array('title' => "No Title", 'text' => "no Text", 'update' => date("Y-m-d H:i:s"), 'state_document' => "");
if ($dt) {
$tgl = "";
if ($dt['update'] != "") {
$tgl = date('Y-m-d H:i:s', $dt['update']->sec);
}
$path_upload = URL_ASSET_IMAGE . "images/";
$title = !isset($dt['title']) ? "" : $dt['title'];
$text = !isset($dt['text']) ? "" : $dt['text'];
$state_document = !isset($dt['state_document']) ? "" : $dt['state_document'];
$picture = !isset($dt['picture']) ? "" : $dt['picture'];
$output = array('title' => $title, 'text' => replace_text_content(filter_text($text)), 'update' => $tgl, 'imageName' => $picture, 'pathImage' => $path_upload, 'state_document' => $state_document);
}
return json_encode($output);
}
示例12: mobile_query_setconfavatar
function mobile_query_setconfavatar()
{
$user_email = func_arg(0);
$id_user = _get_id_user($user_email);
$get_type = func_arg(1);
$get_field = func_arg(2);
$get_field = $get_field == "all" ? "" : $get_field;
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('Avatar');
$filter = array("user_id" => $id_user);
$data = $lilo_mongo->findOne($filter);
$datareturn['isSuccsesUpdate'] = FALSE;
if ($data) {
$datatinsert = array();
$datareturn['isSuccsesUpdate'] = TRUE;
if ($get_type == "configurations") {
$conf = json_decode(str_replace("'", '"', $data['configuration']));
if ($get_field != "") {
if (strtolower($get_field) == "all") {
$datanew = "";
$temp = isset($_GET['massage']) ? $_GET['massage'] : "";
$datatemparray = explode("|", $temp);
if ($datatemparray) {
foreach ($datatemparray as $jml_json) {
$datanew .= "{";
$datatemp = explode(",", $jml_json);
if ($datatemp) {
foreach ($datatemp as $dttemp) {
$dtinsert = explode(":", $dttemp);
$key = $dtinsert[0];
$value = isset($dtinsert[1]) ? $dtinsert[1] : "";
$datanew .= "'" . $key . "':'" . $value . "',";
}
$datanew = substr($datanew, 0, strlen($datanew) - 1);
}
$datanew .= "},";
}
$datanew = substr($datanew, 0, strlen($datanew) - 1);
}
$datatinsert = array("configuration" => "[" . $datanew . "]");
} else {
foreach ($conf as $dt => $listtemp) {
if ($listtemp->tipe == $get_field) {
continue;
}
$datanew .= "{";
foreach ($listtemp as $dt_json => $value_key) {
$datanew .= "'" . $dt_json . "':'" . $value_key . "',";
}
$datanew = substr($datanew, 0, strlen($datanew) - 1);
$datanew .= "},";
}
$datanew .= "{";
$datamessage = isset($_GET['massage']) ? $_GET['massage'] : "";
$datajson = explode(",", $datamessage);
if ($datajson) {
foreach ($datajson as $dttemp) {
$dtinsert = explode(":", $dttemp);
$key = $dtinsert[0];
$value = isset($dtinsert[1]) ? $dtinsert[1] : "";
$datanew .= "'" . $key . "':'" . $value . "',";
}
$datanew = substr($datanew, 0, strlen($datanew) - 1);
}
$datanew .= "}";
$datatinsert = array("configuration" => "[" . $datanew . "]");
}
}
} else {
if ($get_type == "size") {
$datasize = isset($_GET['massage']) ? $_GET['massage'] : "medium";
$datatinsert = array("size" => $datasize);
}
}
$lilo_mongo->update_set($filter, $datatinsert);
} else {
$size = "medium";
$gender = "female";
$lilo_mongo->selectDB("Assets");
$lilo_mongo->selectCollection("DefaultAvatar");
$data3 = $lilo_mongo->findOne(array('gender' => $gender, 'size' => $size));
if ($data3) {
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('Avatar');
$lilo_mongo->update(array("size" => $size, "user_id" => $id_user), array('$set' => array("configuration" => $data3['configuration'])), array('upsert' => TRUE));
}
}
return json_encode($datareturn);
}
示例13: unity_user_delstatus
function unity_user_delstatus()
{
$status_id = func_arg(0);
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('UserProfile');
$cekada = $lilo_mongo->delete(array('_id' => $lilo_mongo->mongoid($status_id), 'lilo_id' => (string) $_SESSION['a_id']));
$retData = array('success' => false, 'message' => "Status gagal dihapus");
if ($cekada) {
$retData = array('valid' => TRUE, 'status' => "Status berhasil dihapus");
}
return json_encode($retData);
}
示例14: friend_user_detailbyuserid
/**
* return: array, detail user dari table Users.Account dan Users.Properties
*/
function friend_user_detailbyuserid($user_id = NULL)
{
if (!isset($user_id)) {
$user_id = func_arg(0);
}
$lilo_mongo = new LiloMongo();
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('Account');
$account_data = $lilo_mongo->findOne(array('lilo_id' => $user_id));
$lilo_mongo->selectCollection('Properties');
$property_data = $lilo_mongo->findOne(array('lilo_id' => $user_id));
if (trim($property_data['foto']) == '') {
$property_data['foto'] = 'default.png';
}
$property_data['foto_url'] = $_SESSION['basepath'] . 'user_generated_data/profile_picture/' . $property_data['foto'];
$result = array_merge((array) $account_data, (array) $property_data);
unset($result['lilo_id']);
unset($result['_id']);
unset($result['password']);
return json_encode($result);
}
示例15: unity_query_avatar_animation
function unity_query_avatar_animation()
{
$user_id = func_arg(0);
$gender = "male";
$lilo_mongo = new LiloMongo();
/*
//CODE BELOW COMMENTED, BECAUSE USERS DOESN'T HAVE SPECIFIC ANIMATIONS EMO ATM
$lilo_mongo->selectDB('Users');
$lilo_mongo->selectCollection('Animation');
$data2 = $lilo_mongo->findOne(array("user_id" => $user_id));
$output = "";
if ($data2)
{
$temp = array();
foreach ($data2['configuration'] as $dt) {
$temp[] = $dt;
}
$output = json_encode($temp);
}
else
{*/
$gender = __cek_gender($user_id);
$lilo_mongo2 = new LiloMongo();
$lilo_mongo2->selectDB('Assets');
$lilo_mongo2->selectCollection('Animation');
// Get the default animation
$data4 = $lilo_mongo2->command_values(array("distinct" => "Animation", "key" => "animation_file", "query" => array("gender" => $gender, "permission" => "default")));
// Sometimes the default animation is named Default, get that too
$data5 = $lilo_mongo2->command_values(array("distinct" => "Animation", "key" => "animation_file", "query" => array("gender" => $gender, "permission" => "Default")));
$list_temp = array($gender . '@bye', $gender . '@happy', $gender . '@idle1', $gender . '@idle2', $gender . '@jump', $gender . '@pickup', $gender . '@run', $gender . '@walk');
if ($data4) {
$temp = "";
foreach ($data4['values'] as $dt2) {
$temp = str_replace(".unity3d", "", $dt2);
if (!in_array($temp, $list_temp)) {
$list_temp[] = $temp;
}
}
foreach ($data5['values'] as $dt2) {
$temp = str_replace(".unity3d", "", $dt2);
if (!in_array($temp, $list_temp)) {
$list_temp[] = $temp;
}
}
$output = json_encode($list_temp);
}
//}
return $output;
}