<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(73); $msg_obj = new Keke_witkey_msg_tpl_class(); $config_msg_arr = $kekezu->get_table_data("*", "witkey_msg_config", " 1 = 1 ", "config_id desc ", '', '', 'config_id'); $now_msg_arr = db_factory::get_one(" select * from " . TABLEPRE . "witkey_msg_config where k='{$slt_tpl_code}'"); $now_v = unserialize($now_msg_arr['v']); if (isset($tpl_code)) { $msg_tpl = db_factory::query(" select * from " . TABLEPRE . "witkey_msg_tpl where tpl_code='{$tpl_code}'"); if ($msg_tpl) { kekezu::echojson('', 1, $msg_tpl); } else { echo json_encode(array("status" => 0)); } } $objMsgC = new Keke_witkey_msg_config_class(); if (isset($sbt_edit)) { if ($slt_tpl_code) { $objMsgC->setWhere("k='{$slt_tpl_code}'"); $objMsgC->setContent($tar_msg_temp_content); $res = $objMsgC->edit_keke_witkey_msg_config(); } if ($res) { kekezu::admin_system_log($_lang['edit_sms_tpl']); kekezu::admin_show_msg($_lang['edit_sms_tpl_success'], 'index.php?do=msg&view=intertpl&slt_tpl_code=' . $slt_tpl_code, 3, '', 'success'); } } $msg_tpl = db_factory::get_one("select content from " . TABLEPRE . "witkey_msg_config where k='{$slt_tpl_code}'"); $msg_tpl = $msg_tpl['content']; require $kekezu->_tpl_obj->template(ADMIN_DIRECTORY . '/tpl/admin_msg_' . $view);
private function getmessagetpl() { global $_cache_obj; $tpl = $_cache_obj->get("msg_tpl_" . $this->_k . "_cache"); if (!$tpl) { $objMsgConfig = new Keke_witkey_msg_config_class(); $objMsgConfig->setWhere("k='{$this->_k}'"); $tpl = $objMsgConfig->query_keke_witkey_msg_config(); $_cache_obj->set("msg_tpl_" . $this->_k . "_cache", $tpl); } return $tpl; }
static function notify_user($title, $content, $uid, $username = "") { if (!$username) { $userinfo = kekezu::get_user_info($uid); $username = $userinfo['username']; } if (is_array($content)) { $objMsgConfig = new Keke_witkey_msg_config_class(); $wh = "`k` = '{$content['tpl']}' limit 1"; $objMsgConfig->setWhere($wh); $res = $objMsgConfig->query_keke_witkey_msg_config(); $content = strtr($res[0]['content'], $content['data']); } $message_obj = new Keke_witkey_msg_class(); $message_obj->setTitle($title); $message_obj->setContent($content); $message_obj->setOn_time(time()); $message_obj->setTo_uid($uid); $message_obj->setTo_username($username); $message_obj->create_keke_witkey_msg(); }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(73); $msg_obj = new Keke_witkey_msg_config_class(); $message_send_type = keke_glob_class::get_message_send_type(); $message_send_obj = keke_glob_class::get_message_send_obj(); if (isset($sbt_edit)) { if (is_array($fds)) { foreach ($fds as $k => $v) { $send_type = array(); switch ($v['send_open']) { case 0: foreach ($message_send_type['0'] as $v2) { $send_type[$v2] = intval(0); } break; case 1: switch (!empty($ckb[$k])) { case 1: foreach ($ckb[$k] as $k3 => $v3) { $send_type[$k3] = intval($v3); } break; case 0: foreach ($message_send_type['0'] as $v2) { $send_type[$v2] = intval(0); } break; } break;