function RewardDetail() { $rid = jget('rid', 'int'); $tid = jget('tid', 'int'); if (!$rid || !$tid) { response_text('无效的有奖转发ID'); } $reward = jlogic('reward')->getRewardInfo($rid); if (!$reward) { response_text('无效的有奖转发ID'); } if ($reward['time_lesser'] > 0) { $hours = $reward['time_lesser'] % 86400; $day = floor($reward['time_lesser'] / 86400) ? floor($reward['time_lesser'] / 86400) . '天' : ''; $i = $hours % 3600; $hours = floor($hours / 3600) ? floor($hours / 3600) . '时' : ''; $i = floor($i / 60) ? floor($i / 60) . '分' : ''; $reward['time_lesser'] = '距离转发结束还有 ' . $day . $hours . $i; } else { $reward['time_lesser'] = '有奖转发结束'; } if ($reward['rules']['tag']) { $content = '#' . implode('##', $reward['rules']['tag']) . '#'; } include template('widget/widget_reward_view'); }
function db_response_news($postObj, $newsid) { /* * note: * 1 text * dfault and 2 :news * * */ $params = array(array($newsid, SQLSRV_PARAM_IN)); $sp = "{call app_get_news(?)}"; $rs = sp_execute($sp, $params); if (count($rs) == 1) { $msgtype = $rs[0]["kind"]; //is_numeric($rs[0]["type"])?intval($rs[0]["type"]):0; // if ($msgtype == 1) { //text mode response_text($postObj, $rs[0]["describle"]); } else { //2 $newsContent = array("title" => $rs[0]["title"], "description" => $rs[0]["describle"], "picUrl" => $rs[0]["picurl"], "url" => $rs[0]["url"]); response_news($postObj, $newsContent); } } elseif (count($rs) > 1) { //多行新闻的方式 $arr = array(); foreach ($rs as $row) { $newsContent = array("title" => $row["title"], "description" => $row["describle"], "picUrl" => $row["picurl"], "url" => $row["url"]); array_push($arr, $newsContent); } response_multiNews($postObj, $arr); } else { response_text($postObj, "未定义的newsid[{$newsid}]"); } }
function Execute() { ob_start(); switch ($this->Code) { case 'follow': $this->follow(); break; case 'fans': $this->fans(); break; case 'blacklist': $this->blacklist(); break; case 'add_follow': $this->addFollow(); break; case 'del_follow': $this->delFollow(); break; case 'check_follow': $this->checkFollow(); break; case 'add_blacklist': $this->addBlacklist(); break; case 'del_blacklist': $this->delBlacklist(); break; case 'check_blacklist': $this->checkBlacklist(); break; } response_text(ob_get_clean()); }
function Execute() { ob_start(); switch ($this->Code) { case 'getfilter': $this->getFilter(); break; case 'keyword': $this->KeyWord(); break; case 'xiami': $this->getXiaMimusic(); break; case 'getsigntag': $this->getSignTag(); break; case 'app_medal': $this->appMedal(); break; case 'resultlist': $this->resultList(); break; case 'sel': $this->makeSel(); break; default: break; } response_text(ob_get_clean()); }
function Main() { if (MEMBER_ID < 1) { response_text('登录后才能继续操作'); } global $_J; if (!isset($_J['plugins'])) { jlogic('plugin')->loadplugincache(); } $pluginid = jget('id'); if (!empty($pluginid)) { list($identifier, $module) = explode(':', $pluginid); $module = $module !== NULL ? $module : $identifier; } if (!is_array($_J['plugins']['hookmod']) || !array_key_exists($pluginid, $_J['plugins']['hookmod'])) { response_text("插件不存在或已关闭"); } if (empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $module)) { response_text("未定义的操作"); } if (@(!file_exists($modfile = PLUGIN_DIR . '/' . $identifier . '/' . $module . '.mod.php'))) { response_text("插件模块文件(" . $modfile . ")不存在或者插件文件不完整"); } if ($_J['plugins']['hookmod'][$pluginid]['role_id'] && 'admin' != MEMBER_ROLE_TYPE) { response_text("您没有权限进行该操作"); } include $modfile; }
/** * @param $postObj */ function handleClick($postObj) { //处理签到 if ($postObj->EventKey == "3bd50cf09752dc08ab1d78ba0c6d4099") { response_text($postObj, "签到成功"); } else { } }
function Execute() { ob_start(); switch ($this->Code) { default: break; } response_text(ob_get_clean()); }
function auto_run() { ob_start(); if ($this->Code && method_exists('ModuleObject', $this->Code)) { $this->{$this->Code}(); } else { exit('method ' . $this->Code . ' is not exists'); } response_text(ob_get_clean()); }
function handleText($postObj) { $arr = explode(" ", $postObj->Content); //preview news 1 $action = $arr[0]; $param1 = $arr[1]; if (count($arr) > 2) { $param2 = $arr[2]; } else { $param2 = ""; } //$param2 = $arr[2]; //strcasecmp忽略字符串大小写 if (strcasecmp($action, "set") == 0) { if (strcasecmp($param1, "master") == 0) { $ret = " "; $params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array($ret, SQLSRV_PARAM_INOUT)); $sp = "{call app_set_master(?,?)}"; $rs = sp_execute($sp, $params); if ($ret == "ok") { response_text($postObj, "您已成为[" . $rs[0]["cname"] . "]微信管理员"); } else { response_text($postObj, "操作不成功,管理位置是不是另有他人了呢?"); } } else { response_text($postObj, "我不明白,你想设置啥呢?"); } } else { if (strcasecmp($action, "preview") == 0) { if (strcasecmp($param1, "news") == 0) { if (is_numeric($param2)) { db_response_news($postObj, $param2); } else { response_text($postObj, "您要预览的新闻编号[{$param2}]有误,请输入新闻编号"); } } else { if (is_numeric($param1)) { db_response_news($postObj, $param1); } else { response_text($postObj, "未定义的预览类型[{$param1}]"); } } } else { if (strcasecmp($action, "hqewm") == 0 || strcasecmp($action, "获取二维码") == 0 || strcasecmp($action, "dst") == 0 || strcasecmp($action, "大食堂") == 0) { response_image($postObj, "Tz7KKK4QFPZbEIclqnbhsWYy8keSL-3McoYu9I749Vk"); } else { if (strcasecmp($action, "help") == 0) { response_text($postObj, '欢迎关注大食堂<br>预览新闻 发"preview 新闻编号\\r\\n获取大食堂二维码,发送"hqewm"'); } else { response_text($postObj, "未定义action[{$action}]"); } } } } }
/** * @param $postObj */ function handleClick($postObj) { //处理签到 if ($postObj->EventKey == "3bd50cf09752dc08ab1d78ba0c6d4099") { $rep = " "; $params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array($rep, SQLSRV_PARAM_OUT)); sp_execute("{call app_weixin_checkin(?,?)}", $params); response_text($postObj, $rep); } else { } }
function ModuleObject($config) { $this->MasterObject($config); if (MEMBER_ID < 1) { response_text("请先登录或者注册一个帐号"); } Load::logic('vote'); $this->VoteLogic = new VoteLogic(); $this->TopicLogic = jlogic('topic'); $this->Execute(); }
function handleImage($postObj) { //https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID $access_token = db_get_token_ticket(CFG_APPID, CFG_SECRET)["token"]; $mediaId = $postObj->MediaId; $url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token={$access_token}&media_id={$mediaId}"; $fileinfo = downloadWeixinFile($url); // $uploadPath = dirname(__FILE__) . "/upload/weixin/"; $tmpFile = time() . ".jpg"; saveWeixinFile($uploadPath . $tmpFile, $fileinfo["body"]); response_text($postObj, "图片上传完成"); }
function _init_uid($uid = 0) { $uid = max(0, (int) $uid); if (!defined('MEMBER_ID') && $uid > 0 && ($members = DB::fetch_first("select * from " . TABLE_PREFIX . "members where `uid`='{$uid}'"))) { define("MEMBER_ID", (int) $members['uid']); define("MEMBER_UCUID", (int) $members['ucuid']); define("MEMBER_NAME", $members['username']); define("MEMBER_NICKNAME", $members['nickname']); define("MEMBER_ROLE_TYPE", $members['role_type']); } else { response_text(''); } }
function handleImage($postObj) { //https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID $access_token = db_get_token_ticket(CFG_APPID, CFG_SECRET)["token"]; $mediaId = $postObj->MediaId; $url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token={$access_token}&media_id={$mediaId}"; $fileinfo = downloadWeixinFile($url); // $uploadPath = dirname(__FILE__) . "/upload/weixin/"; $fileName = time() . ".jpg"; saveWeixinFile($uploadPath . $fileName, $fileinfo["body"]); response_text($postObj, "图片上传完成"); //保存图片信息 $params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array("" . $fileName, SQLSRV_PARAM_IN)); sp_execute("{call app_upload_image(?,?)}", $params); }
function Execute() { ob_start(); switch ($this->Code) { case 'login': $this->login(); break; case 'register': $this->register(); break; case 'edit_profile': $this->editProfile(); case 'userinfo': $this->getUserInfo(); break; } response_text(ob_get_clean()); }
function Execute() { ob_start(); switch ($this->Code) { case 'sign': $this->sign(); break; case 'reminded': $this->reminded(); break; case 'clear_reminded': $this->clearReminded(); break; default: exit; } response_text(ob_get_clean()); }
function Execute() { ob_start(); switch ($this->Code) { case 'onloadPic': $this->onloadPic(); break; case 'create': $this->create(); break; case 'publish_share': $this->publishShare(); break; case 'simple_talk': $this->simpleTalk(); break; case 'store': $this->store(); break; case 'app': $this->app(); break; case 'need_info': $this->need_info(); break; case 'manage': $this->manage(); break; case 'choose': $this->choose(); break; case 'eventpost': $this->eventPost(); break; case 'eventlist': $this->eventList(); break; default: break; } response_text(ob_get_clean()); }
function Topic() { if (MEMBER_ID < 1) { response_text('您是游客,没有权限举报'); } $tid = jget('totid', 'int', 'P'); $report_reason = $this->Post['report_reason']; $report_content = $this->Post['report_content']; $data = array('uid' => MEMBER_ID, 'username' => MEMBER_NICKNAME, 'ip' => $GLOBALS['_J']['client_ip'], 'reason' => (int) $report_reason, 'content' => strip_tags($report_content), 'tid' => (int) $tid, 'dateline' => time()); $result = jtable('report')->insert($data); if ($notice_to_admin = $this->Config['notice_to_admin']) { $message = "用户" . MEMBER_NICKNAME . "举报了微博ID:{$tid}(" . $data['content'] . "),<a href='admin.php?mod=report&code=report_manage' target='_blank'>点击</a>进入管理。"; $pm_post = array('message' => $message, 'to_user' => str_replace('|', ',', $notice_to_admin)); $admin_info = DB::fetch_first('select `uid`,`username`,`nickname` from `' . TABLE_PREFIX . 'members` where `uid` = 1'); load::logic('pm'); $PmLogic = new PmLogic(); $PmLogic->pmSend($pm_post, $admin_info['uid'], $admin_info['username'], $admin_info['nickname']); } response_text('举报成功'); }
function AddBuddyRemark() { $remark = trim(strip_tags($this->Post['remark'])); $buddyid = is_numeric($this->Post['buddyid']) ? $this->Post['buddyid'] : 0; if ($buddyid < 1) { response_text('请指定一个好友ID'); } $buddy_info = jlogic('buddy')->info($buddyid, MEMBER_ID); if (!$buddy_info) { response_text('你的好友已经不存在了'); } $f_rets = filter($remark); if ($f_rets && $f_rets['error']) { response_text($f_rets['msg']); } if ($remark && preg_match('~[\\<\\>\'\\"]~', $remark)) { response_text('不能包含特殊字符'); } if ($remark != $buddy_info['remark']) { $ret = jlogic('buddy')->set_remark(MEMBER_ID, $buddyid, $remark); } }
function Main() { response_text("正在建设中"); }
function handleVideo($postObj) { response_text($postObj, "谢谢上传"); }
function tcQun() { $tc = 1; $province = (int) trim($this->Get['province']); $city = (int) trim($this->Get['city']); if (empty($province) && empty($city)) { response_text('错误的操作'); exit; } $filed = $city ? "city" : "province"; $id = $city ? $city : $province; $name = DB::result_first("select name from " . DB::table('common_district') . " where id='{$id}'"); $limit = 10; $qun_list = array(); $query = DB::query("SELECT *\r\n\t\t\t\t\t\t\tFROM " . DB::table('qun') . "\r\n\t\t\t\t\t\t\tWHERE {$filed} = '{$name}'\r\n\t\t\t\t\t\t\tORDER BY member_num DESC\r\n\t\t\t\t\t\t\tLIMIT {$limit}"); while ($value = DB::fetch($query)) { $value['icon'] = $this->QunLogic->qun_avatar($value['qid'], 's'); $value['desc'] = getstr($value['desc'], 80); $qun_list[] = $value; } include_once template('qun/qun_list'); }
function handleEvent($postObj) { if ($postObj->Event == "subscribe") { handleSubscribe($postObj); } else { if ($postObj->Event == "unsubscribe") { handleUnsubscribe($postObj); } else { if ($postObj->Event == "SCAN") { handleScan($postObj); } else { if ($postObj->Event == "CLICK") { response_text($postObj, "签到成功"); //handleClick($postObj); } else { if ($postObj->Event == "VIEW") { log_file("view test"); } else { if ($postObj->Event == "TEMPLATESENDJOBFINISH") { log_file("template msg send finished"); } else { if ($postObj->Event == "LOCATION") { handleLocation($postObj); } } } } } } } }
function handleText($postObj) { response_text($postObj, " "); }
function Modify() { if (MEMBER_ID < 1) { response_text("您没有权限编辑该附件,请您先登陆!"); } $id = $modify_id = max(0, (int) $this->Post['id']); if ($id < 1) { js_alert_output('附件ID 错误'); } $attach_info = $this->AttachLogic->get_info($modify_id); if (!$attach_info) { response_text('您要编辑的附件已经不存在了'); } if (MEMBER_ROLE_TYPE != 'admin') { if (MEMBER_ID != $attach_info['uid']) { response_text("您没有权限编辑该附件,只有后台管理员和附件上传者可进行该操作!"); } } include template('modify_attach_ajax'); }
function Delete() { $tid = jget('tid', 'int'); if ($tid < 1) { js_alert_output("请指定一个您要删除的话题"); } $topic = $this->TopicLogic->Get($tid); if (!$topic) { js_alert_output("话题已经不存在了"); } if (jdisallow($topic['uid'])) { js_alert_output("您无权删除该话题"); } $return = $this->TopicLogic->Delete($tid); response_text($return . $this->js_show_msg()); }
function Main() { response_text('page is not exits'); }
function Main() { response_text('正在建设中……'); }
$headers = $structure->headers; foreach ($headers as $key => $value) { if (is_array($value)) { foreach ($value as $itemkey => $item) { $headers["{$key}"][$itemkey] = htmlspecialchars(last_ditch_mime_decode(iconv_mime_decode($item, 2, 'utf-8'), get_charset($structure)), ENT_QUOTES, 'utf-8'); } } else { $headers["{$key}"] = htmlspecialchars(last_ditch_mime_decode(iconv_mime_decode($value, 2, 'utf-8'), get_charset($structure)), ENT_QUOTES, 'utf-8'); } } if (isset($headers['content-type'])) { unset($headers['content-type']); } $smarty->assign('headers', $headers); $smarty->assign('sender_email', $sender_email); } else { // Dump the raw contents of the e-mail, making sure to // escape any HTML tags it might contain, so the raw source // gets displayed. $smarty->assign("message", "<pre>" . htmlentities(wordwrap($contents, 70)) . "</pre>"); } $smarty->assign("error", ""); } else { $smarty->assign("error", "error"); } $sth->free(); $smarty->assign("return_route", "view.php"); // depreciated, needed for legacy support in viewmail.tpl. $smarty->assign("ajax", $ajax); $smarty->assign("actionlang", response_text($cache_type)); $smarty->display("view.tpl");
function main() { response_text("正在建设中……"); }