function returnmsg($p1, $p2, $p3) { if (defined('IN_ADMINCP')) { cpmsg($p1, $p2, $p3 ? $p3 : 'error'); } else { showmessage($p1, $p2, $p3); } }
function onsetting() { $email = $_POST['eamil']; $user = new UserModel(); if ($user->update(array("email" => $email), array("uid" => $_SESSION['uid']))) { cpmsg("更新成功"); } }
private function _msg($message, $extra = '') { if (defined('ADMINSCRIPT')) { cpmsg($message, '', 'succeed', array(), ($extra ? $extra . '<br />' : '') . '<br /><a href="' . ADMINSCRIPT . '?action=plugins">' . $this->lang['back'] . '</a>'); } else { showmessage($message . '<br />' . $extra, $url, $values, array('alert' => 'info')); } }
function onls() { $status = 0; $operate = getgpc('o'); if ($operate == 'list') { if ($delete = $_POST['delete']) { if (is_array($delete)) { foreach ($delete as $filename) { @unlink('./data/backup/' . str_replace(array('/', '\\'), '', $filename)); } } $status = 2; $this->writelog('db_delete', "delete=" . implode(',', $_POST['delete'])); } $baklist = array(); if (is_dir(UC_ROOT . './data/backup/')) { $dir = dir(UC_ROOT . './data/backup/'); while ($entry = $dir->read()) { $file = './data/backup/' . $entry; if (is_dir($file) && preg_match("/backup_(\\d+)_\\w+/i", $file, $match)) { $baklist[] = array('name' => $match[0], 'date' => $match[1]); } } $dir->close(); } else { cpmsg('db_export_dest_invalid'); } $this->view->assign('baklist', $baklist); } elseif ($operate == 'view') { $dir = getgpc('dir'); $this->load('app'); $applist = $_ENV['app']->get_apps(); $this->view->assign('applist', $applist); $this->view->assign('dir', $dir); } elseif ($operate == 'ping') { $appid = intval(getgpc('appid')); $app = $this->cache['apps'][$appid]; $dir = trim(getgpc('dir')); $url = $app['url'] . '/api/dbbak.php?apptype=' . $app['type']; $code = $this->authcode('&method=ping&dir=' . $dir . '&time=' . time(), 'ENCODE', $app['authkey']); $url .= '&code=' . urlencode($code); $res = $_ENV['misc']->dfopen2($url, 0, '', '', 1, $app['ip'], 20, TRUE); if ($res == '1') { $this->message($this->_parent_js($appid, '<img src="images/correct.gif" border="0" class="statimg" /><span class="green">' . $this->lang['dumpfile_exists'] . '</span>') . '<script>parent.import_status[' . $appid . ']=true;</script>'); } else { $this->message($this->_parent_js($appid, '<img src="images/error.gif" border="0" class="statimg" /><span class="red">' . $this->lang['dumpfile_not_exists'] . '</span>') . '<script>parent.import_status[' . $appid . ']=false;</script>'); } exit; } else { $this->load('app'); $applist = $_ENV['app']->get_apps(); $this->view->assign('applist', $applist); $this->view->assign('dir', 'backup_' . date('ymd', time()) . '_' . $this->random(6)); } $this->view->assign('operate', $operate); $this->view->display('admin_db'); }
function checkpermission($action, $break = 1) { if(!isset($GLOBALS['admincp'])) { cpmsg('action_access_noexists'); } elseif($break && !$GLOBALS['admincp'][$action]) { cpmsg('action_noaccess_config'); } else { return $GLOBALS['admincp'][$action]; } }
function getsetting() { global $_G; $custom = DB::fetch_first("SELECT name FROM " . DB::table('common_advertisement_custom') . " WHERE id='{$_G['gp_customid']}'"); if (!$custom) { echo '<br >'; cpmsg(lang('adv/custom', 'custom_id_notfound')); } $this->customname = $custom['name']; }
function down($file, $subfolder = '') { global $plugin_lang, $program_ver, $plugin_dir, $plugin_id; $temp = dfsockopen("http://dsu.googlecode.com/svn/trunk/PluginUpdater/{$plugin_id}/{$file}"); if (!$temp) { cpmsg("下载文件 {$file} 失败,请稍候再试", '', 'error'); } @unlink($plugin_dir . '/' . ($subfolder ? $subfolder . '/' : '') . $file); file_put_contents($plugin_dir . '/' . ($subfolder ? $subfolder . '/' : '') . $file, $temp); }
function getsetting() { global $_G; $custom = C::t('common_advertisement_custom')->fetch($_GET['customid']); if (!$custom) { echo '<br >'; cpmsg(lang('adv/custom', 'custom_id_notfound')); } $this->customname = $custom['name']; }
function show() { $pid = intval($_GET[pid]); $project = new ProjectModel(); $pro = $project->getby_pid($pid); if ($pro[uid] != $_SESSION['uid']) { cpmsg("无权限", 'error', "?m=xing"); exit; } $xing = new XingModel(); $browsers = $xing->get_browsers($pid); include view_file(); }
function admincp_check() { global $_G; $_G['gp_getCountLimit'] = intval($_G['gp_getCountLimit']); $_G['gp_startTime'] = $_G['gp_startTime'] ? strtotime($_G['gp_startTime']) : 0; $_G['gp_endTime'] = $_G['gp_endTime'] ? strtotime($_G['gp_endTime']) : 0; if ($_G['gp_getCountLimit'] < 0) { cpmsg('领取数量必须为正数!请返回。', '', 'error'); } if ($_G['gp_endTime'] && $_G['gp_startTime'] && $_G['gp_startTime'] > $_G['gp_endTime']) { cpmsg('结束时间必须晚于开始时间!请返回。', '', 'error'); } }
/** * 在数据提交后对数据进行合法性检验 */ function admincp_check() { global $_G, $medalid; $ppercon = is_numeric($_G['gp_ppercon']); if ($ppercon || empty($ppercon)) { } else { cpmsg('打卡机-连续签到次数设置错误!', 'action=plugins&operation=config&identifier=dsu_medalCenter&pmod=admin_manage&pdo=edit&medalid=' . $medalid, 'error'); } $pperaddup = is_numeric($_G['gp_pperaddup']); if ($pperaddup || empty($pperaddup)) { } else { cpmsg('打卡机-累计签到次数设置错误!', 'action=plugins&operation=config&identifier=dsu_medalCenter&pmod=admin_manage&pdo=edit&medalid=' . $medalid, 'error'); } }
/** * 在数据提交后对数据进行合法性检验 */ function admincp_check() { global $_G, $medalid; $month_sign = is_numeric($_G['gp_month_sign']); if ($month_sign || empty($month_sign)) { } else { cpmsg('每日签到-月签到次数设置错误!', 'action=plugins&operation=config&identifier=dsu_medalCenter&pmod=admin_manage&pdo=edit&medalid=' . $medalid, 'error'); } $all_sign = is_numeric($_G['gp_all_sign']); if ($all_sign || empty($all_sign)) { } else { cpmsg('每日签到-总签到次数设置错误!', 'action=plugins&operation=config&identifier=dsu_medalCenter&pmod=admin_manage&pdo=edit&medalid=' . $medalid, 'error'); } }
function down($file, $filetype = 0, $subfolder = '', $urladd = '') { global $plugin_lang, $program_ver, $plugin_dir, $plugin_id; $temp = file_get_contents("http://update.dsu.cc/{$plugin_id}/dl.php?ver={$program_ver}&file={$file}" . $urladd); if (!$temp) { cpmsg("下载文件 {$file} 失败,请稍候再试", '', 'error'); } if ($filetype == 1) { $temp = '<?php' . "\r\n{$temp}\r\n" . '?>'; } elseif ($filetype == 2) { $temp = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\r\n" . $temp; } @unlink($plugin_dir . '/' . ($subfolder ? $subfolder . '/' : '') . $file); file_put_contents($plugin_dir . '/' . ($subfolder ? $subfolder . '/' : '') . $file, $temp); }
function del() { global $_G; if (!$_GET['id']) { cpmsg('抱歉,要删除的签到ID不存在', 'error', "m=sign&a=main"); return false; } $id = intval($_GET['id']); if (!$_GET['ok']) { cpmsg('您确定要删除当前签到记录吗?删除后不可恢复?', 'error', "m=sign&a=del&ok=1&id=" . $id, '确定删除', "<p><a href='" . URL . "m=sign&a=main'>取消</a></p>"); return false; } else { DB::delete("sign", "id=" . $id); cpmsg('删除成功', 'success', "m=sign&a=main"); return false; } }
function onreg() { $incode = new IncodeModel(); $code = $_POST['incode']; $name = $_POST['reg_1']; $pass = $_POST['reg_2']; if ($incode->is_ok($code)) { $user = new UserModel(); if ($user->reg($name, $pass)) { $incode->del($code); if ($user->login($name, $pass)) { header("Location:?m=xing"); } } } else { cpmsg("注册失败鸟"); } }
function domaincheck($domain, $domainroot, $domainlength, $msgtype = 1) { if (strlen($domain) < $domainlength) { showmessage('domain_length_error', '', array('length' => $domainlength), array('return' => true)); } if (strlen($domain) > 30) { $msgtype ? showmessage('two_domain_length_not_more_than_30_characters', '', array(), array('return' => true)) : cpmsg('two_domain_length_not_more_than_30_characters', '', 'error'); } if (!preg_match("/^[a-z0-9]*\$/", $domain)) { $msgtype ? showmessage('only_two_names_from_english_composition_and_figures', '', array(), array('return' => true)) : cpmsg('only_two_names_from_english_composition_and_figures', '', 'error'); } if ($msgtype && isholddomain($domain)) { showmessage('domain_be_retained', '', array(), array('return' => true)); } if (existdomain($domain, $domainroot)) { $msgtype ? showmessage('two_domain_have_been_occupied', '', array(), array('return' => true)) : cpmsg('two_domain_have_been_occupied', '', 'error'); } return true; }
function seo_set() { global $head_url; if (!submitcheck('submit')) { $info = pick_common_get(); $info['open_seo_mod'] = dunserialize($info['open_seo_mod']); $info['open_seo_mod_show'][0] = in_array(1, $info['open_seo_mod']) ? 1 : 0; //门户 $info['open_seo_mod_show'][1] = in_array(2, $info['open_seo_mod']) ? 1 : 0; //论坛 $info['open_seo_mod_show'][2] = in_array(3, $info['open_seo_mod']) ? 1 : 0; //博客 $info = dhtmlspecialchars($info); return $info; } else { $set = $_GET['set']; $set['open_seo_mod'] = serialize($set['open_seo_mod']); pick_common_set($set); cpmsg(milu_lang('op_success'), PICK_GO . "seo", 'succeed'); } }
public static function censor($message, $modword = NULL, $return = FALSE) { global $_G; $censor = discuz_censor::instance(); $censor->check($message, $modword); if ($censor->modbanned() && empty($_G['group']['ignorecensor'])) { $wordbanned = implode(', ', $censor->words_found); if ($return) { return array('message' => lang('message', 'word_banned', array('wordbanned' => $wordbanned))); } if (!defined('IN_ADMINCP')) { showmessage('word_banned', '', array('wordbanned' => $wordbanned)); } else { cpmsg(lang('message', 'word_banned'), '', 'error', array('wordbanned' => $wordbanned)); } } if ($_G['group']['allowposturl'] == 0 || $_G['group']['allowposturl'] == 2) { $urllist = self::get_url_list($message); if (is_array($urllist[1])) { foreach ($urllist[1] as $key => $val) { if (!($val = trim($val))) { continue; } if (!iswhitelist($val)) { if ($_G['group']['allowposturl'] == 0) { if ($return) { return array('message' => 'post_url_nopermission'); } showmessage('post_url_nopermission'); } elseif ($_G['group']['allowposturl'] == 2) { $message = str_replace('[url]' . $urllist[0][$key] . '[/url]', $urllist[0][$key], $message); $message = preg_replace(array("@\\[url=[^\\]]*?" . preg_quote($urllist[0][$key], '@') . "[^\\]]*?\\](.*?)\\[/url\\]@is", "@href=('|\")" . preg_quote($urllist[0][$key], '@') . "\\1@is", "@\\[url\\]([^\\]]*?" . preg_quote($urllist[0][$key], '@') . "[^\\]]*?)\\[/url\\]@is"), array('\\1', '', '\\1'), $message); } } } } } return $message; }
function virtualdata_set() { global $head_url, $header_config; if (!submitcheck('submit')) { require_once libfile('function/forumlist'); $info = pick_common_get(); $info['vir_cache_time'] = $info['vir_cache_time'] ? $info['vir_cache_time'] : 10; $info['vir_data_forum'] = unserialize($info['vir_data_forum']); $info['vir_data_usergroup'] = unserialize($info['vir_data_usergroup']); $info['forumselect'] = '<select name="set[vir_data_forum][]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $info['vir_data_forum'], TRUE) . '</select>'; return $info; } else { $set = $_GET['set']; if (!$set['vir_data_forum'][0] && count($set['vir_data_forum']) == 1) { $set['vir_data_forum'] = ''; } pick_common_set($set); save_syscache('milu_pick_vir_postdata', ''); save_syscache('milu_pick_vir_data', ''); save_syscache('milu_pick_vir_online', ''); cpmsg(milu_lang('op_success'), PICK_GO . "virtual_data", 'succeed'); } }
/** * 創建相冊 * @param * @return 相冊id */ function createalbum($shopid = 0, $catid = 0, $uid = 0, $username = '', $subject = '', $description = '') { global $_G, $_SGLOBAL; $arr_data = array(); //id foreach (array('shopid', 'catid', 'uid') as $value) { ${$value} = intval(${$value}); } //字符串 foreach (array('subject', 'description') as $value) { ${$value} = trim(strip_tags(${$value})); } //判斷必填,設置插入數據庫的數據 foreach (array('shopid', 'catid', 'uid', 'username', 'subject') as $value) { if (empty(${$value})) { cpmsg($value . '_not_selected', '', '', '', true, true); } $arr_data[$value] = ${$value}; } $arr_data['description'] = $description; if ($_SGLOBAL['panelinfo']['group']['verifyalbum'] && !pkperm('isadmin')) { $arr_data['grade'] = 0; } else { $arr_data['grade'] = 3; } $arr_data['dateline'] = $_G['timestamp']; $albumid = inserttable('albumitems', $arr_data, 1); if (!$albumid) { cpmsg('album_creat_error', '', '', '', true, true); } //相冊屬性 if (!empty($_POST['attr_ids'])) { require_once B_ROOT . "./batch.attribute.php"; setattributesettings($catid, $albumid, $_POST['attr_ids']); } return $albumid; }
loadcache('posttableids'); $posttables = !empty($_G['cache']['posttableids']) ? $_G['cache']['posttableids'] : array(0); foreach ($posttables as $ptid) { foreach (C::t('forum_post')->fetch_all_pid_by_invisible_dateline($ptid, -5, $timestamp, 0, $pernum) as $post) { $postlist[$ptid][] = $post['pid']; } } $postsundel = 0; if ($postlist) { foreach ($postlist as $ptid => $deletepids) { $postsdel += recyclebinpostdelete($deletepids, $ptid); } $startlimit += $pernum; cpmsg('recyclebinpost_clean_next', 'action=recyclebinpost&operation=clean&cleanrbsubmit=1&days=' . $days . '&postsdel=' . $postsdel, 'succeed', array('postsdel' => $postsdel)); } else { cpmsg('recyclebinpost_succeed', 'action=recyclebinpost&operation=clean', 'succeed', array('postsdel' => $postsdel, 'postsundel' => $postsundel)); } } } function recyclebinpostshowpostlist($fid, $authors, $starttime, $endtime, $keywords, $start_limit, $lpp) { global $_G, $lang, $posttableid, $security; $tids = $fids = array(); if ($security) { $postlist = C::t('#security#security_evilpost')->fetch_all_by_search($posttableid, null, $keywords, -5, $fid, null, $authors ? explode(',', str_replace(' ', '', $authors)) : null, strtotime($starttime), strtotime($endtime), null, null, $start_limit, $lpp); } else { $postlist = C::t('forum_post')->fetch_all_by_search($posttableid, null, $keywords, -5, $fid, null, $authors ? explode(',', str_replace(' ', '', $authors)) : null, strtotime($starttime), strtotime($endtime), null, null, $start_limit, $lpp); } if (empty($postlist)) { return false; }
} } else { if (submitcheck('deletesubmit')) { if ($_POST['ids']) { $_POST['ids'] = daddslashes($_POST['ids']); DB::query('DELETE FROM ' . DB::table('common_block_item') . " WHERE bid IN (" . dimplode($_POST['ids']) . ")"); DB::query('DELETE FROM ' . DB::table('common_block') . " WHERE bid IN (" . dimplode($_POST['ids']) . ")"); DB::delete('common_block_permission', 'bid IN (' . dimplode($_POST['ids']) . ')'); cpmsg('block_delete_succeed', 'action=block&operation=jscall', 'succeed'); } else { cpmsg('block_choose_at_least_one_block', 'action=block&operation=jscall', 'error'); } } elseif (submitcheck('clearsubmit')) { include_once libfile('function/block'); block_clear(); cpmsg('block_clear_unused_succeed', 'action=block', 'succeed'); } else { loadcache(array('diytemplatename')); $searchctrl = '<span style="float: right; padding-right: 40px;">' . '<a href="javascript:;" onclick="$(\'tb_search\').style.display=\'\';$(\'a_search_show\').style.display=\'none\';$(\'a_search_hide\').style.display=\'\';" id="a_search_show" style="display:none">' . cplang('show_search') . '</a>' . '<a href="javascript:;" onclick="$(\'tb_search\').style.display=\'none\';$(\'a_search_show\').style.display=\'\';$(\'a_search_hide\').style.display=\'none\';" id="a_search_hide">' . cplang('hide_search') . '</a>' . '</span>'; showsubmenu('block', array(array('block_list', 'block', $operation == 'list'), array('block_jscall', 'block&operation=jscall', $operation == 'jscall')), $searchctrl); $mpurl = ADMINSCRIPT . '?action=block&operation=' . $operation; $intkeys = array('bid'); $strkeys = array('blockclass'); $strkeys[] = 'targettplname'; $randkeys = array(); $likekeys = array('name'); $results = getwheres($intkeys, $strkeys, $randkeys, $likekeys); foreach ($likekeys as $k) { $_GET[$k] = htmlspecialchars(stripslashes($_GET[$k])); } $wherearr = $results['wherearr'];
function import_block($xmlurl, $clientid, $xmlkey = '', $signtype = '', $ignoreversion = 1, $update = 0) { global $_G, $importtxt; $_G['gp_importtype'] = $_G['gp_importtxt'] = ''; $xmlurl = strip_tags($xmlurl); $clientid = strip_tags($clientid); $xmlkey = strip_tags($xmlkey); $parse = parse_url($xmlurl); if (!empty($parse['host'])) { $queryarr = explode('&', $parse['query']); $para = array(); foreach ($queryarr as $value) { $k = $v = ''; list($k, $v) = explode('=', $value); if (!empty($k) && !empty($v)) { $para[$k] = $v; } } $para['clientid'] = $clientid; $para['op'] = 'getconfig'; $para['charset'] = CHARSET; $signurl = create_sign_url($para, $xmlkey, $signtype); $pos = strpos($xmlurl, '?'); $pos = $pos === false ? strlen($xmlurl) : $pos; $signurl = substr($xmlurl, 0, $pos) . '?' . $signurl; $importtxt = @dfsockopen($signurl); } else { $importtxt = @implode('', file($xmlurl)); } $blockarrays = getimportdata('Discuz! Block', 0); if (empty($blockarrays['name']) || empty($blockarrays['fields']) || empty($blockarrays['getsetting'])) { cpmsg(cplang('import_data_typeinvalid') . cplang($importtxt), '', 'error'); } if (empty($ignoreversion) && strip_tags($blockarrays['version']) != strip_tags($_G['setting']['version'])) { cpmsg(cplang('blockxml_import_version_invalid'), '', 'error', array('cur_version' => $blockarrays['version'], 'set_version' => $_G['setting']['version'])); } $data = array('name' => htmlspecialchars($blockarrays['name']), 'version' => htmlspecialchars($blockarrays['version']), 'url' => $xmlurl, 'clientid' => $clientid, 'key' => $xmlkey, 'signtype' => !empty($signtype) ? 'MD5' : '', 'data' => serialize($blockarrays)); $data = daddslashes($data); if (!$update) { DB::insert('common_block_xml', $data); } else { DB::update('common_block_xml', $data, "`id`='{$update}'"); } }
function movedate($query) { global $sourcesize, $tableid, $movesize, $targettableid, $hash, $tableindex, $threadtableids, $fieldstr, $fromtableid, $posttable_info; $tids = array(); while ($value = DB::fetch($query)) { $tids[$value['tid']] = $value['tid']; } $fromtable = getposttable($fromtableid, true); $condition = " tid IN(" . dimplode($tids) . ")"; DB::query("INSERT INTO " . DB::table(getposttable($targettableid)) . " ({$fieldstr}) SELECT {$fieldstr} FROM {$fromtable} WHERE {$condition}", 'SILENT'); if (DB::errno()) { DB::delete(getposttable($targettableid), $condition); } else { foreach ($threadtableids as $threadtableid) { $table = $threadtableid ? "forum_thread_{$threadtableid}" : 'forum_thread'; DB::update($table, array('posttableid' => $targettableid), $condition); if (DB::affected_rows() == count($tids)) { break; } } DB::delete(getposttable($fromtableid), $condition); } $status = gettablestatus(DB::table(getposttable($targettableid)), false); $targetsize = $sourcesize + $movesize * 1048576; $nowdatasize = $targetsize - $status['Data_length']; if ($status['Data_length'] >= $targetsize) { cpmsg('postsplit_done', 'action=postsplit&operation=optimize&tableid=' . $fromtableid, 'form'); } cpmsg('postsplit_doing', 'action=postsplit&operation=movepost&fromtable=' . $tableid . '&movesize=' . $movesize . '&targettable=' . $targettableid . '&hash=' . $hash . '&tindex=' . $tableindex, 'loadingform', array('datalength' => sizecount($status['Data_length']), 'nowdatalength' => sizecount($nowdatasize))); }
$share['title_template'] = lang('spacecp', 'share_image'); break; case 'article': $feed_hash_data = 'articleid' . $share['itemid']; $share['title_template'] = lang('spacecp', 'share_article'); break; case 'link': $feed_hash_data = ''; break; } feed_add('share', '{actor} ' . $share['title_template'], array('hash_data' => $feed_hash_data), $share['body_template'], dunserialize($share['body_data']), $share['body_general'], array($share['image']), array($share['image_link']), '', '', '', 0, 0, '', $share['uid'], $share['username']); } updatemoderate('sid', $moderation['validate'], 2); } if (!empty($moderation['delete'])) { require libfile('function/delete'); $shares = deleteshares($moderation['delete']); $deletes = count($shares); updatemoderate('sid', $moderation['delete'], 2); } if ($ignore_sids = dimplode($moderation['ignore'])) { $ignores = C::t('home_share')->update($moderation['ignore'], array('status' => 2)); updatemoderate('sid', $moderation['ignore'], 1); } if ($_GET['fast']) { echo callback_js($_GET['sid']); exit; } else { cpmsg('moderate_shares_succeed', "action=moderate&operation=shares&page={$page}&filter={$filter}&dateline={$_GET['dateline']}&username={$_GET['username']}&keyword={$_GET['keyword']}&tpp={$_GET['tpp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'deletes' => $deletes)); } }
showformheader('plugins&operation=config&identifier=dzapp_haodai&pmod=admincp_callback&want=import'); showtableheader('import_callback'); showsetting($lang['appkey'], 'AKEY', defined('HD_AKEY') ? HD_AKEY : '', 'text'); showsetting($lang['appsecret'], 'SKEY', defined('HD_SKEY') ? HD_SKEY : '', 'text'); showsetting($lang['ref'], 'REF', defined('HD_REF') ? HD_REF : '', 'text'); showsetting($lang['callback_url'], 'CALLBACK_URL', defined('HD_CALLBACK_URL') ? HD_CALLBACK_URL : $_G['siteurl'] . 'plugin.php?id=dzapp_haodai:callback', 'text'); showsetting($lang['host_url'], 'API_HOST', defined('HD_API_HOST') ? HD_API_HOST : 'http://api.haodai.com/', 'text'); showsubmit('ok', "ok"); showtablefooter(); showformfooter(); } else { $config = array(); $config['HD_REF'] = $_GET['REF']; $config['HD_AKEY'] = $_GET['AKEY']; $config['HD_SKEY'] = $_GET['SKEY']; $config['HD_CALLBACK_URL'] = $_GET['CALLBACK_URL']; $config['HD_API_HOST'] = $_GET['API_HOST']; $config['HD_CITY'] = defined('HD_CITY') ? HD_CITY : ''; $config = daddslashes($config); $configfile = "<?php \r\n"; foreach ($config as $key => $value) { $configfile .= "define('{$key}', '{$value}');\r\n"; } $configfile .= "?>"; $file = DISCUZ_ROOT . "./data/dzapp_haodai_config.php"; $fp = fopen($file, 'w'); fwrite($fp, $configfile); fclose($fp); cpmsg('import_succeed', 'action=plugins&operation=config&identifier=dzapp_haodai&pmod=admincp_callback', 'succeed'); } }
$_G['setting']['forumpicstyle'] = array('thumbwidth' => 214, 'thumbheight' => 160); } require_once libfile('function/post'); $coversql = empty($allthread) ? 'AND cover=\'0\'' : ''; $cover = empty($allthread) ? 0 : null; $_G['forum']['ismoderator'] = 1; foreach (C::t('forum_thread')->fetch_all_by_fid_cover_lastpost($fid, $cover, $starttime, $endtime, $current, $pertask) as $thread) { $processed = 1; $pid = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid'], 0); $pid = $pid['pid']; setthreadcover($pid); } if ($processed) { cpmsg("{$lang['counter_thread_cover']}: " . cplang('counter_processing', array('current' => $current, 'next' => $next)), $nextlink, 'loading'); } else { cpmsg('counter_thread_cover_succeed', 'action=counter', 'succeed'); } } else { shownav('tools', 'nav_updatecounters'); showsubmenu('nav_updatecounters'); showtips('counter_tips'); showformheader('counter'); showtableheader(); showsubtitle(array('', 'counter_amount')); showhiddenfields(array('pertask' => '')); showtablerow('', array('class="td21"'), array("{$lang['counter_forum']}:", '<input name="pertask1" type="text" class="txt" value="15" /><input type="submit" class="btn" name="forumsubmit" onclick="this.form.pertask.value=this.form.pertask1.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_digest']}:", '<input name="pertask2" type="text" class="txt" value="1000" /><input type="submit" class="btn" name="digestsubmit" onclick="this.form.pertask.value=this.form.pertask2.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_member']}:", '<input name="pertask3" type="text" class="txt" value="1000" /><input type="submit" class="btn" name="membersubmit" onclick="this.form.pertask.value=this.form.pertask3.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_thread']}:", '<input name="pertask4" type="text" class="txt" value="500" /><input type="submit" class="btn" name="threadsubmit" onclick="this.form.pertask.value=this.form.pertask4.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_special']}:", '<input name="pertask7" type="text" class="txt" value="1" disabled/><input type="submit" class="btn" name="specialarrange" onclick="this.form.pertask.value=this.form.pertask7.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_groupnum']}:", '<input name="pertask8" type="text" class="txt" value="10" /><input type="submit" class="btn" name="groupnum" onclick="this.form.pertask.value=this.form.pertask8.value" value="' . $lang['submit'] . '" />'));
if (!$sub_button['keyurl']) { cpmsg(lang('plugin/wechat', 'wsq_menu_keyurl_empty'), '', 'error'); } $parse = parse_url($sub_button['keyurl']); $item = array('type' => $parse['host'] ? 'view' : 'click', 'name' => convertname($sub_button['name']), $parse['host'] ? 'url' : 'key' => $sub_button['keyurl']); $sub_buttons[] = $item; } $item = array('name' => convertname($button['name']), 'sub_button' => $sub_buttons); $pubmenu['button'][] = $item; } } require_once DISCUZ_ROOT . './source/plugin/wechat/wechat.lib.class.php'; $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']); $wechat_client = new WeChatClient($_G['wechat']['setting']['wechat_appId'], $_G['wechat']['setting']['wechat_appsecret']); if ($wechat_client->setMenu($pubmenu)) { cpmsg(lang('plugin/wechat', 'wsq_menu_pub_succeed'), 'action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=menu_setting', 'succeed'); } else { cpmsg(lang('plugin/wechat', 'wsq_menu_pub_error', array('errno' => $wechat_client->error())), '', 'error'); } } else { cpmsg('setting_update_succeed', 'action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=menu_setting', 'succeed'); } } function convertname($str) { return urlencode(diconv($str, CHARSET, 'UTF-8')); } function buttoncmp($a, $b) { return $a['displayorder'] > $b['displayorder'] ? 1 : -1; }
} } elseif ($operation == 'clean') { if (!submitcheck('rbsubmit', 1)) { shownav('topic', 'nav_recyclebin'); showsubmenu('nav_recyclebin', array(array('recyclebin_list', 'recyclebin', 0), array('search', 'recyclebin&operation=search', 0), array('clean', 'recyclebin&operation=clean', 1))); showformheader('recyclebin&operation=clean'); showtableheader('recyclebin_clean'); showsetting('recyclebin_clean_days', 'days', '30', 'text'); showsubmit('rbsubmit'); showtablefooter(); showformfooter(); } else { $deletetids = array(); $timestamp = TIMESTAMP; $pernum = 500; $threadsdel = intval($_GET['threadsdel']); $days = intval($_GET['days']); foreach (C::t('forum_threadmod')->fetch_all_recyclebin_by_dateline($timestamp - $days * 86400, 0, $pernum) as $thread) { $deletetids[] = $thread['tid']; } if ($deletetids) { require_once libfile('function/delete'); $delcount = deletethread($deletetids); $threadsdel += $delcount; $startlimit += $pernum; cpmsg('recyclebin_clean_next', 'action=recyclebin&operation=clean&rbsubmit=1&threadsdel=' . $threadsdel . '&days=' . $days, 'succeed', array('threadsdel' => $threadsdel)); } else { cpmsg('recyclebin_succeed', 'action=recyclebin&operation=clean', 'succeed', array('threadsdel' => $threadsdel, 'threadsundel' => 0)); } } }
move_uploaded_file($filename, $destination); $editcat = array('area' => $_GET['area'], 'introduction' => $_GET['introduction'], 'name' => $_GET['name'], 'areaid' => $_GET['areaid'], 'level' => $_GET['level'], 'pic' => $destination); $editcat['dateline'] = TIMESTAMP; $editcat['username'] = $_G['username']; if ($operation == 'add') { $_GET['catid'] = C::t('yuexiamen_poi')->insert($editcat, true); } elseif ($operation == 'edit') { $sql = array(); foreach ($editcat as $key => $value) { array_push($sql, $key . "='" . $value . "'"); } C::t('yuexiamen_poi')->update($sql, $poiid); } $url = $operation == 'add' ? 'action=yuexiamen#cat' . $_GET['catid'] : 'action=yuexiamen&operation=edit&catid=' . $_GET['catid']; $url = 'yuexiamen&operation=list&area=' . $area . '&do=poi'; cpmsg('portalcategory_edit_succeed', $url, 'succeed'); } } function showcategoryrow($key, $level = 0, $last = '') { global $_G; loadcache('yuexiamen'); $value = $_G['cache']['yuexiamen'][$key]; $return = ''; // include_once libfile('function/portalcp'); $value['articles'] = category_get_num('portal', $key); $publish = ''; if (empty($_G['cache']['portalcategory'][$key]['disallowpublish'])) { $publish = ' <a href="portal.php?mod=portalcp&ac=article&catid=' . $key . '" target="_blank">' . cplang('portalcategory_publish') . '</a>'; } if ($level == 2) {