本文整理汇总了PHP中core_display_datetime函数的典型用法代码示例。如果您正苦于以下问题:PHP core_display_datetime函数的具体用法?PHP core_display_datetime怎么用?PHP core_display_datetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了core_display_datetime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sms_board_handle
function sms_board_handle($c_uid, $sms_datetime, $sms_sender, $sms_receiver, $board_keyword, $board_param = '')
{
global $web_title, $email_service, $email_footer, $gateway_module, $datetime_now;
$ok = false;
if ($sms_sender && $board_keyword && $board_param) {
// masked sender sets here
$masked_sender = substr_replace($sms_sender, 'xxxx', -4);
$db_query = "\n\t INSERT INTO " . _DB_PREF_ . "_featureBoard_log \n\t (in_gateway,in_sender,in_masked,in_keyword,in_msg,in_datetime) \n\t VALUES ('{$gateway_module}','{$sms_sender}','{$masked_sender}','{$board_keyword}','{$board_param}','{$datetime_now}')\n\t";
if ($cek_ok = @dba_insert_id($db_query)) {
$db_query1 = "SELECT board_forward_email FROM " . _DB_PREF_ . "_featureBoard WHERE board_keyword='{$board_keyword}'";
$db_result1 = dba_query($db_query1);
$db_row1 = dba_fetch_array($db_result1);
$email = $db_row1['board_forward_email'];
if ($email) {
// get name from c_uid's phonebook
$c_username = uid2username($c_uid);
$c_name = phonebook_number2name($sms_sender, $c_username);
$sms_sender = $c_name ? $c_name . ' <' . $sms_sender . '>' : $sms_sender;
$sms_datetime = core_display_datetime($sms_datetime);
$subject = "[SMSGW-" . $board_keyword . "] " . _('from') . " {$sms_sender}";
$body = _('Forward WebSMS') . " ({$web_title})\n\n";
$body .= _('Date and time') . ": {$sms_datetime}\n";
$body .= _('Sender') . ": {$sms_sender}\n";
$body .= _('Receiver') . ": {$sms_receiver}\n";
$body .= _('Keyword') . ": {$board_keyword}\n\n";
$body .= _('Message') . ":\n{$board_param}\n\n";
$body .= $email_footer . "\n\n";
sendmail($email_service, $email, $subject, $body);
}
$ok = true;
}
}
return $ok;
}
示例2: sms_command_handle
function sms_command_handle($sms_datetime, $sms_sender, $command_keyword, $command_param = '')
{
global $datetime_now, $plugin_config;
$ok = false;
$db_query = "SELECT command_exec,uid,command_return_as_reply FROM " . _DB_PREF_ . "_featureCommand WHERE command_keyword='{$command_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$command_exec = $db_row['command_exec'];
$sms_datetime = core_display_datetime($sms_datetime);
$command_exec = str_replace("{SMSDATETIME}", "\"{$sms_datetime}\"", $command_exec);
$command_exec = str_replace("{SMSSENDER}", "\"{$sms_sender}\"", $command_exec);
$command_exec = str_replace("{COMMANDKEYWORD}", "\"{$command_keyword}\"", $command_exec);
$command_exec = str_replace("{COMMANDPARAM}", "\"{$command_param}\"", $command_exec);
$command_exec = $plugin_config['feature']['sms_command']['bin'] . "/" . $command_exec;
$command_output = shell_exec(stripslashes($command_exec));
$username = uid2username($db_row['uid']);
if ($db_row['command_return_as_reply'] == 1) {
sendsms_pv($username, $sms_sender, $command_output, 'text', 0);
}
$db_query = "\n\tINSERT INTO " . _DB_PREF_ . "_featureCommand_log\n\t(sms_sender,command_log_datetime,command_log_keyword,command_log_exec) \n\tVALUES\n\t('{$sms_sender}','{$datetime_now}','{$command_keyword}','{$command_exec}')\n ";
if ($new_id = @dba_insert_id($db_query)) {
$ok = true;
}
return $ok;
}
示例3: pvat_hook_interceptincomingsms
function pvat_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
$msg = explode(" ", $message);
$ret = array();
if (count($msg) > 1) {
$pv = trim($msg[0]);
if (substr($pv, 0, 1) == '@') {
$c_username = substr($pv, 1);
$new_message = "PV " . $c_username . " ";
if (username2uid($c_username)) {
for ($i = 1; $i < count($msg); $i++) {
$new_message .= $msg[$i] . " ";
}
$new_message = substr($new_message, 0, -1);
// set 1 to param_modified to let parent function modify param values
$ret['modified'] = true;
// this time only message param changed
$ret['param']['message'] = $new_message;
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " m:" . $message . " mod:" . $ret['param']['message'], 3, "pvat");
// do not forget to tell parent that this SMS has been hooked
$ret['hooked'] = true;
}
}
}
return $ret;
}
示例4: sms_custom_handle
function sms_custom_handle($sms_datetime, $sms_sender, $custom_keyword, $custom_param = '')
{
global $datetime_now;
$ok = false;
$db_query = "SELECT custom_url FROM " . _DB_PREF_ . "_featureCustom WHERE custom_keyword='{$custom_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$custom_url = $db_row['custom_url'];
$sms_datetime = core_display_datetime($sms_datetime);
$custom_url = str_replace("{SMSDATETIME}", urlencode($sms_datetime), $custom_url);
$custom_url = str_replace("{SMSSENDER}", urlencode($sms_sender), $custom_url);
$custom_url = str_replace("{CUSTOMKEYWORD}", urlencode($custom_keyword), $custom_url);
$custom_url = str_replace("{CUSTOMPARAM}", urlencode($custom_param), $custom_url);
$url = parse_url($custom_url);
if (!$url['port']) {
$url['port'] = 80;
}
// fixme anton -deprecated when using PHP5
//$connection = fsockopen($url['host'],$url['port'],&$error_number,&$error_description,60);
$connection = fsockopen($url['host'], $url['port'], $error_number, $error_description, 60);
if ($connection) {
socket_set_blocking($connection, false);
fputs($connection, "GET {$custom_url} HTTP/1.0\r\n\r\n");
$db_query = "\n\t INSERT INTO " . _DB_PREF_ . "_featureCustom_log\n\t (sms_sender,custom_log_datetime,custom_log_keyword,custom_log_url) \n\t VALUES\n\t ('{$sms_sender}','{$datetime_now}','{$custom_keyword}','{$custom_url}')\n\t";
if ($new_id = @dba_insert_id($db_query)) {
$ok = true;
}
}
return $ok;
}
示例5: xlate_hook_recvsms_intercept
function xlate_hook_recvsms_intercept($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
$msg = explode(" ", $message);
$ret = array();
if (count($msg) > 1) {
$keyword = trim($msg[0]);
if (substr($keyword, 0, 1) == '@') {
$xlate = substr($keyword, 1);
$xlate = explode('2', $xlate);
$xlate_from = $xlate[0];
$xlate_to = $xlate[1];
if ($xlate_from && $xlate_to && strlen($xlate_from) == 2 && strlen($xlate_to) == 2) {
for ($i = 1; $i < count($msg); $i++) {
$words .= $msg[$i] . " ";
}
$words = trim($words);
// contact google
$lib = $core_config['apps_path']['plug'] . '/feature/xlate/lib/GoogleTranslate';
// load JSON.php for PHP version lower than 5.2.x
require_once $lib . '/JSON.php';
require_once $lib . '/googleTranslate.class.php';
if ($gt = new GoogleTranslateWrapper()) {
/* Translate */
$xlate_words = $gt->translate($words, $xlate_to, $xlate_from);
// incoming sms is handled
$ret['hooked'] = true;
/* Was translation successful */
$sms_datetime = core_display_datetime($sms_datetime);
if ($gt->isSuccess()) {
$reply = '@' . $xlate_from . '2' . $xlate_to . ' ' . $words . ' => ' . $xlate_words;
logger_print("success dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " w:" . $words . " from:" . $xlate_from . " to:" . $xlate_to . " xlate:" . $xlate_words, 2, "xlate");
} else {
$reply = '@' . $xlate_from . '2' . $xlate_to . ' ' . _("unable to translate") . ': ' . $words;
logger_print("failed dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " w:" . $words . " from:" . $xlate_from . " to:" . $xlate_to, 2, "xlate");
}
// detect reply message, set unicode if not ASCII
$unicode = core_detect_unicode($reply);
// send reply SMS using admin account
// should add a web menu in xlate.php to choose which account will be used to send reply SMS
// usualy we inspect the result of sendsms, but not this time
logger_print("send reply encoding:" . $encoding, 2, "xlate");
$reply = addslashes($reply);
list($ok, $to, $smslog_id, $queue) = sendsms_helper('admin', $sms_sender, $reply, 'text', $unicode);
// do not forget to tell parent that this SMS has been hooked
$ret['hooked'] = true;
} else {
// unable to load the class, set incoming sms unhandled
$ret['hooked'] = false;
logger_print("class not exists or fail to load", 2, "xlate");
}
}
}
}
return $ret;
}
示例6: myauto_hook_interceptincomingsms
function myauto_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
// reply message
$reply = 'Thank you for your message';
// detect reply message, set unicode if not ASCII
$unicode = core_detect_unicode($reply);
// send reply
list($ok, $to, $smslog_id, $queue) = sendsms('admin', $sms_sender, $reply, 'text', $unicode);
// log it
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " autorespon:" . $reply, 2, "myauto");
}
示例7: myauto_hook_interceptincomingsms
function myauto_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
// reply message
$reply = 'Thank you for your message';
// detect reply message, set unicode if not ASCII
$unicode = 0;
if (function_exists('mb_detect_encoding')) {
$encoding = mb_detect_encoding($reply, 'auto');
if ($encoding != 'ASCII') {
$unicode = 1;
}
}
// send reply
list($ok, $to, $smslog_id) = sendsms_pv('admin', $sms_sender, $reply, 'text', $unicode);
// log it
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " autorespon:" . $reply, 3, "myauto");
}
示例8: recvsmsd
function recvsmsd()
{
global $core_config;
$core_config['recvsmsd_limit'] = (int) $core_config['recvsmsd_limit'] ? (int) $core_config['recvsmsd_limit'] : 200;
$list = dba_search(_DB_PREF_ . '_tblRecvSMS', '*', array('flag_processed' => 1), '', array('LIMIT' => $core_config['recvsmsd_limit']));
$j = 0;
for ($j = 0; $j < count($list); $j++) {
if ($id = $list[$j]['id']) {
$sms_datetime = $list[$j]['sms_datetime'];
$sms_sender = $list[$j]['sms_sender'];
$message = $list[$j]['message'];
$sms_receiver = $list[$j]['sms_receiver'];
$smsc = $list[$j]['smsc'];
if (dba_update(_DB_PREF_ . '_tblRecvSMS', array('flag_processed' => 2), array('id' => $id))) {
logger_print("id:" . $id . " dt:" . core_display_datetime($sms_datetime) . " sender:" . $sms_sender . " m:" . $message . " receiver:" . $sms_receiver . " smsc:" . $smsc, 3, "recvsmsd");
recvsms_process(core_display_datetime($sms_datetime), $sms_sender, $message, $sms_receiver, $smsc);
}
}
}
}
示例9: sms_custom_handle
function sms_custom_handle($c_uid, $sms_datetime, $sms_sender, $sms_receiver, $custom_keyword, $custom_param = '', $smsc = '', $raw_message = '')
{
$ok = false;
$custom_keyword = strtoupper(trim($custom_keyword));
$custom_param = trim($custom_param);
$db_query = "SELECT custom_url,uid,custom_return_as_reply FROM " . _DB_PREF_ . "_featureCustom WHERE custom_keyword='{$custom_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$custom_url = $db_row['custom_url'];
$username = user_uid2username($db_row['uid']);
$custom_return_as_reply = $db_row['custom_return_as_reply'];
if ($custom_keyword && $custom_url && $username) {
$sms_datetime = core_display_datetime($sms_datetime);
$custom_url = str_replace("{SMSDATETIME}", urlencode($sms_datetime), $custom_url);
$custom_url = str_replace("{SMSSENDER}", urlencode($sms_sender), $custom_url);
$custom_url = str_replace("{CUSTOMKEYWORD}", urlencode($custom_keyword), $custom_url);
$custom_url = str_replace("{CUSTOMPARAM}", urlencode($custom_param), $custom_url);
$custom_url = str_replace("{CUSTOMRAW}", urlencode($raw_message), $custom_url);
logger_print("custom_url:" . $custom_url, 3, "sms custom");
$parsed_url = parse_url($custom_url);
$opts = array('http' => array('method' => 'POST', 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'content' => $parsed_url['query']));
$context = stream_context_create($opts);
$server_url = explode('?', $custom_url);
$returns = file_get_contents($server_url[0], false, $context);
if ($custom_return_as_reply == 1) {
if ($returns = trim($returns)) {
$unicode = core_detect_unicode($returns);
$returns = addslashes($returns);
logger_print("returns:" . $returns, 3, "sms custom");
sendsms_helper($username, $sms_sender, $returns, 'text', $unicode, $smsc);
} else {
logger_print("returns empty", 3, "sms custom");
}
}
$ok = true;
}
return $ok;
}
示例10: sms_custom_handle
function sms_custom_handle($sms_datetime, $sms_sender, $custom_keyword, $custom_param = '')
{
global $datetime_now;
$ok = false;
$db_query = "SELECT custom_url,uid,custom_return_as_reply FROM " . _DB_PREF_ . "_featureCustom WHERE custom_keyword='{$custom_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$custom_url = $db_row['custom_url'];
$sms_datetime = core_display_datetime($sms_datetime);
$custom_url = str_replace("{SMSDATETIME}", urlencode($sms_datetime), $custom_url);
$custom_url = str_replace("{SMSSENDER}", urlencode($sms_sender), $custom_url);
$custom_url = str_replace("{CUSTOMKEYWORD}", urlencode($custom_keyword), $custom_url);
$custom_url = str_replace("{CUSTOMPARAM}", urlencode($custom_param), $custom_url);
$username = uid2username($db_row['uid']);
$debug = dba_query("INSERT INTO " . _DB_PREF_ . "_toolsDebug (value)VALUES('{$username}')");
$url = parse_url($custom_url);
if (!$url['port']) {
$url['port'] = 80;
}
// fixme anton -deprecated when using PHP5
//$connection = fsockopen($url['host'],$url['port'],&$error_number,&$error_description,60);
//fixme Edward, change to file_get_contents
$returns = file_get_contents($custom_url);
if ($returns) {
//fixme Edward, change to file_get_contents
//socket_set_blocking($connection, false);
//fputs($connection, "GET $custom_url HTTP/1.0\r\n\r\n");
$username = uid2username($db_row['uid']);
if ($db_row['custom_return_as_reply'] == 1) {
sendsms_pv($username, $sms_sender, $returns, 'text', 0);
}
$db_query = "\n\t INSERT INTO " . _DB_PREF_ . "_featureCustom_log\n\t (sms_sender,custom_log_datetime,custom_log_keyword,custom_log_url) \n\t VALUES\n\t ('{$sms_sender}','{$datetime_now}','{$custom_keyword}','{$custom_url}')\n\t";
if ($new_id = @dba_insert_id($db_query)) {
$ok = true;
}
}
return $ok;
}
示例11: sms_command_handle
function sms_command_handle($c_uid, $sms_datetime, $sms_sender, $sms_receiver, $command_keyword, $command_param = '', $smsc = '', $raw_message = '')
{
global $plugin_config;
$ok = false;
$command_keyword = strtoupper(trim($command_keyword));
$command_param = trim($command_param);
$db_query = "SELECT command_exec,uid,command_return_as_reply FROM " . _DB_PREF_ . "_featureCommand WHERE command_keyword='{$command_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$command_exec = $db_row['command_exec'];
$command_return_as_reply = $db_row['command_return_as_reply'];
$username = user_uid2username($db_row['uid']);
if ($command_keyword && $command_exec && $username) {
$sms_datetime = core_display_datetime($sms_datetime);
$command_exec = str_replace("{SMSDATETIME}", "\"{$sms_datetime}\"", $command_exec);
$command_exec = str_replace("{SMSSENDER}", escapeshellarg($sms_sender), $command_exec);
$command_exec = str_replace("{COMMANDKEYWORD}", escapeshellarg($command_keyword), $command_exec);
$command_exec = str_replace("{COMMANDPARAM}", escapeshellarg($command_param), $command_exec);
$command_exec = str_replace("{COMMANDRAW}", escapeshellarg($raw_message), $command_exec);
$command_exec = str_replace("/", "", $command_exec);
$command_exec = $plugin_config['sms_command']['bin'] . "/" . $db_row['uid'] . "/" . $command_exec;
$command_exec = escapeshellcmd($command_exec);
logger_print("command_exec:" . addslashes($command_exec), 3, "sms command");
$command_output = shell_exec($command_exec);
if ($command_return_as_reply == 1) {
$unicode = core_detect_unicode($command_output);
if ($command_output = addslashes(trim($command_output))) {
logger_print("command_output:" . $command_output, 3, "sms command");
sendsms_helper($username, $sms_sender, $command_output, 'text', $unicode, $smsc);
} else {
logger_print("command_output is empty", 3, "sms command");
}
}
$ok = true;
}
return $ok;
}
示例12: insertsmstoinbox
function insertsmstoinbox($sms_datetime, $sms_sender, $target_user, $message, $sms_receiver = "")
{
global $core_config, $web_title, $email_service, $email_footer;
// sms to inbox will be handled by plugin/tools/* first
$ret_intercept = interceptsmstoinbox($sms_datetime, $sms_sender, $target_user, $message, $sms_receiver);
if ($ret_intercept['param_modified']) {
$sms_datetime = $ret_intercept['param']['sms_datetime'] ? $ret_intercept['param']['sms_datetime'] : $sms_datetime;
$sms_sender = $ret_intercept['param']['sms_sender'] ? $ret_intercept['param']['sms_sender'] : $sms_sender;
$target_user = $ret_intercept['param']['target_user'] ? $ret_intercept['param']['target_user'] : $target_user;
$message = $ret_intercept['param']['message'] ? $ret_intercept['param']['message'] : $message;
$sms_receiver = $ret_intercept['param']['sms_receiver'] ? $ret_intercept['param']['sms_receiver'] : $sms_receiver;
}
$ok = false;
if ($sms_sender && $target_user && $message) {
$user = user_getdatabyusername($target_user);
if ($uid = $user['uid']) {
// forward to Inbox
if ($fwd_to_inbox = $user['fwd_to_inbox']) {
$db_query = "\n\t\t INSERT INTO " . _DB_PREF_ . "_tblUserInbox\n\t\t (in_sender,in_receiver,in_uid,in_msg,in_datetime) \n\t\t VALUES ('{$sms_sender}','{$sms_receiver}','{$uid}','{$message}','{$sms_datetime}')\n\t\t";
logger_print("saving sender:" . $sms_sender . " receiver:" . $sms_receiver . " target:" . $target_user, 3, "insertsmstoinbox");
if ($cek_ok = @dba_insert_id($db_query)) {
logger_print("saved sender:" . $sms_sender . " receiver:" . $sms_receiver . " target:" . $target_user, 3, "insertsmstoinbox");
}
}
// forward to email
if ($fwd_to_email = $user['fwd_to_email']) {
if ($email = $user['email']) {
// make sure sms_datetime is in supported format and in user's timezone
$sms_datetime = core_display_datetime($sms_datetime);
// get name from target_user's phonebook
$c_name = phonebook_number2name($sms_sender, $target_user);
$sender = $c_name ? $c_name . ' <' . $sms_sender . '>' : $sms_sender;
// fixme anton - slash maddess
$message = stripslashes($message);
$subject = "[SMSGW-PV] " . _('from') . " {$sms_sender}";
$body = _('Forward Private WebSMS') . " ({$web_title})\n\n";
$body .= _('Date time') . ": {$sms_datetime}\n";
$body .= _('Sender') . ": {$sender}\n";
$body .= _('Receiver') . ": {$sms_receiver}\n\n";
$body .= _('Message') . ":\n{$message}\n\n";
$body .= $email_footer . "\n\n";
logger_print("send email from:" . $email_service . " to:" . $email, 3, "insertsmstoinbox");
sendmail($email_service, $email, $subject, $body);
logger_print("sent email from:" . $email_service . " to:" . $email, 3, "insertsmstoinbox");
}
$ok = true;
}
// forward to mobile
if ($fwd_to_mobile = $user['fwd_to_mobile']) {
if ($mobile = $user['mobile']) {
$unicode = 0;
if (function_exists('mb_detect_encoding')) {
$encoding = mb_detect_encoding($message, 'auto');
if ($encoding != 'ASCII') {
$unicode = 1;
}
}
$message = $sender . ' ' . $message;
logger_print("send to mobile:" . $mobile . " from:" . $sender . " user:" . $target_user, 3, "insertsmstoinbox");
list($ok, $to, $smslog_id) = sendsms_pv($target_user, $mobile, $message, 'text', $unicode);
if ($ok[0]) {
logger_print("sent to mobile:" . $mobile . " from:" . $sender . " user:" . $target_user, 3, "insertsmstoinbox");
}
}
}
}
}
return $ok;
}
示例13: themes_nav_session
$nav = themes_nav_session();
$search = themes_search_session();
$go = $_REQUEST['go'];
switch ($go) {
case 'export':
$conditions = array('A.uid' => $user_config['uid'], 'A.flag_deleted' => 0);
if ($queue_code = trim($_REQUEST['queue_code'])) {
$conditions['A.queue_code'] = $queue_code;
}
$table = _DB_PREF_ . '_tblSMSOutgoing';
$join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.uid=B.uid";
$list = dba_search($table . ' AS A', 'A.p_datetime, A.p_dst, A.p_msg, A.p_footer, A.p_status', $conditions, $search['dba_keywords'], '', $join);
$data[0] = array(_('Time'), _('To'), _('Message'), _('Status'));
for ($i = 0; $i < count($list); $i++) {
$j = $i + 1;
$data[$j] = array(core_display_datetime($list[$i]['p_datetime']), $list[$i]['p_dst'], $list[$i]['p_msg'] . $list[$i]['p_footer'], $list[$i]['p_status']);
}
$content = core_csv_format($data);
if ($queue_code) {
$fn = 'user_outgoing-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '-' . $queue_code . '.csv';
} else {
$fn = 'user_outgoing-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '.csv';
}
core_download($content, $fn, 'text/csv');
break;
case 'delete':
for ($i = 0; $i < $nav['limit']; $i++) {
$checkid = $_POST['checkid' . $i];
$itemid = $_POST['itemid' . $i];
if ($checkid == "on" && $itemid) {
$up = array('c_timestamp' => mktime(), 'flag_deleted' => '1');
示例14: _p
}
_p($content);
break;
case "actions":
$nav = themes_nav_session();
$search = themes_search_session();
$go = $_REQUEST['go'];
switch ($go) {
case 'export':
$conditions = array('in_uid' => $user_config['uid'], 'flag_deleted' => 0, 'in_status' => 1);
$extras = array('AND in_keyword' => '!= ""');
$list = dba_search(_DB_PREF_ . '_tblSMSIncoming', 'in_sender, in_keyword, in_datetime, in_feature, in_message', $conditions, $search['dba_keywords'], $extras);
$data[0] = array(_('Time'), _('From'), _('Keyword'), _('Content'), _('Feature'));
for ($i = 0; $i < count($list); $i++) {
$j = $i + 1;
$data[$j] = array(core_display_datetime($list[$i]['in_datetime']), $list[$i]['in_sender'], $list[$i]['in_keyword'], $list[$i]['in_message'], $list[$i]['in_feature']);
}
$content = core_csv_format($data);
$fn = 'user_incoming-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '.csv';
core_download($content, $fn, 'text/csv');
break;
case 'delete':
for ($i = 0; $i < $nav['limit']; $i++) {
$checkid = $_POST['checkid' . $i];
$itemid = $_POST['itemid' . $i];
if ($checkid == "on" && $itemid) {
$up = array('c_timestamp' => mktime(), 'flag_deleted' => '1');
dba_update(_DB_PREF_ . '_tblSMSIncoming', $up, array('in_uid' => $user_config['uid'], 'in_id' => $itemid));
}
}
$ref = $nav['url'] . '&search_keyword=' . $search['keyword'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav'];
示例15: themes_nav_session
break;
case "actions":
$nav = themes_nav_session();
$search = themes_search_session();
$go = $_REQUEST['go'];
switch ($go) {
case 'export':
$conditions = array('in_uid' => $user_config['uid'], 'flag_deleted' => 0);
if ($in_sender = trim($_REQUEST['in_sender'])) {
$conditions['in_sender'] = $in_sender;
}
$list = dba_search(_DB_PREF_ . '_tblSMSInbox', 'in_datetime, in_sender, in_msg', $conditions, $search['dba_keywords']);
$data[0] = array(_('Time'), _('From'), _('Message'));
for ($i = 0; $i < count($list); $i++) {
$j = $i + 1;
$data[$j] = array(core_display_datetime($list[$i]['in_datetime']), $list[$i]['in_sender'], $list[$i]['in_msg']);
}
$content = core_csv_format($data);
if ($in_sender) {
$fn = 'user_inbox-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '-' . $in_sender . '.csv';
} else {
$fn = 'user_inbox-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '.csv';
}
core_download($content, $fn, 'text/csv');
break;
case 'delete':
for ($i = 0; $i < $nav['limit']; $i++) {
$checkid = $_POST['checkid' . $i];
$itemid = $_POST['itemid' . $i];
if ($checkid == "on" && $itemid) {
$up = array('c_timestamp' => mktime(), 'flag_deleted' => '1');