本文整理汇总了PHP中Functions_Lib::in_multiarray方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions_Lib::in_multiarray方法的具体用法?PHP Functions_Lib::in_multiarray怎么用?PHP Functions_Lib::in_multiarray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions_Lib
的用法示例。
在下文中一共展示了Functions_Lib::in_multiarray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_page
/**
* method build_page
* param
* return main method, loads everything
*/
private function build_page()
{
// some values by default
$parse = $this->_lang;
$parse['js_path'] = XGP_ROOT . JS_PATH;
// display an specific category of items
if (isset($_GET['dsp']) && $_GET['dsp'] == 1 && $this->_have_premium) {
$mode = '';
$get_messages = '';
foreach ($_GET as $field => $value) {
if (Functions_Lib::in_multiarray($field, $this->_message_type)) {
$type_id = Functions_lib::recursive_array_search($field, $this->_message_type);
$get_messages .= $type_id . ',';
$active[$type_id] = 1;
}
}
// get list of messages
$message_list = parent::$db->query("SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `" . MESSAGES . "`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `message_receiver` = " . $this->_current_user['user_id'] . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `message_type` IN (" . rtrim($get_messages, ',') . ");");
// set messages as read
parent::$db->query("UPDATE `" . MESSAGES . "`\n\t\t\t\t\t\t\t\t\tSET `message_read` = '1'\n\t\t\t\t\t\t\t\t\tWHERE `message_receiver` = " . $this->_current_user['user_id'] . "\n\t\t\t\t\t\t\t\t\t\tAND `message_type` IN (" . rtrim($get_messages, ',') . ");");
} else {
$mode = isset($_GET['mode']) ? $_GET['mode'] : NULL;
}
// to delete something
$to_delete = isset($_POST['deletemessages']) ? $_POST['deletemessages'] : NULL;
if (isset($to_delete)) {
$mode = "delete";
}
$write_to = isset($_GET['id']) ? (int) $_GET['id'] : NULL;
switch ($mode) {
case 'write':
$text = '';
$error_page = '';
if (!is_numeric($write_to)) {
Functions_Lib::redirect('game.php?page=messages');
} else {
$OwnerHome = parent::$db->query_fetch("SELECT u.`user_name`, p.`planet_galaxy`, p.`planet_system`, p.`planet_planet`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . PLANETS . " AS p\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN " . USERS . " as u ON p.planet_user_id = u.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE p.`planet_user_id` = '" . (int) $write_to . "';");
if (!$OwnerHome) {
Functions_Lib::redirect('game.php?page=messages');
}
}
if ($_POST) {
$error = 0;
if (!$_POST['subject']) {
$error++;
$parse['error_text'] = $this->_lang['mg_no_subject'];
$parse['error_color'] = '#FF0000';
$error_page = parent::$page->parse_template(parent::$page->get_template('messages/messages_error_table'), $parse);
}
if (!$_POST['text']) {
$error++;
$parse['error_text'] = $this->_lang['mg_no_text'];
$parse['error_color'] = '#FF0000';
$error_page = parent::$page->parse_template(parent::$page->get_template('messages/messages_error_table'), $parse);
}
if ($error == 0) {
$parse['error_text'] = $this->_lang['mg_msg_sended'];
$parse['error_color'] = '#00FF00';
$error_page = parent::$page->parse_template(parent::$page->get_template('messages/messages_error_table'), $parse);
$Owner = $write_to;
$Sender = $this->_current_user['user_id'];
$From = $this->_current_user['user_name'] . ' [' . $this->_current_user['user_galaxy'] . ':' . $this->_current_user['user_system'] . ':' . $this->_current_user['user_planet'] . ']';
$Subject = $_POST['subject'];
$Message = Functions_Lib::format_text($_POST['text']);
Functions_Lib::send_message($Owner, $Sender, '', 4, $From, $Subject, $Message);
$subject = '';
$text = '';
}
}
$parse['id'] = $write_to;
$parse['to'] = $OwnerHome['user_name'] . ' [' . $OwnerHome['planet_galaxy'] . ':' . $OwnerHome['planet_system'] . ':' . $OwnerHome['planet_planet'] . ']';
$parse['subject'] = !isset($subject) ? $this->_lang['mg_no_subject'] : $subject;
$parse['text'] = $text;
$parse['status_message'] = $error_page;
parent::$page->display(parent::$page->parse_template(parent::$page->get_template('messages/messages_pm_form_view'), $parse));
break;
case 'delete':
if ($to_delete == 'deleteall') {
parent::$db->query("DELETE FROM " . MESSAGES . "\n\t\t\t\t\t\t\t\t\t\tWHERE `message_receiver` = '" . $this->_current_user['user_id'] . "';");
} elseif ($to_delete == 'deletemarked') {
foreach ($_POST as $Message => $Answer) {
if (preg_match("/delmes/i", $Message) && $Answer == 'on') {
$MessId = str_replace("delmes", "", $Message);
$MessHere = parent::$db->query_fetch("SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . MESSAGES . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `message_id` = '" . (int) $MessId . "' AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`message_receiver` = '" . $this->_current_user['user_id'] . "';");
if ($MessHere) {
parent::$db->query("DELETE FROM " . MESSAGES . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `message_id` = '" . (int) $MessId . "';");
}
}
}
} elseif ($to_delete == 'deleteunmarked') {
foreach ($_POST as $Message => $Answer) {
$CurMess = preg_match("/showmes/i", $Message);
$MessId = str_replace("showmes", "", $Message);
$Selected = "delmes" . $MessId;
$IsSelected = $_POST[$Selected];
//.........这里部分代码省略.........