function in_list() { parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $fgid = intval($this->fun->accept('fgid', 'G')); if (empty($fgid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $form = $this->get_form_purview($fgid); $form['action'] = $this->get_link('acform', $form, admin_LNG); $attrread = $this->get_formatt($fgid); if ($form['titlestyle']) { $titlestyleArray = array('{typename}' => $form['formgroupname'], '{sitename}' => $this->lng['sitename']); $this->lng['sitename'] = $this->fun->formatstring($form['titlestyle'], $titlestyleArray); } else { $this->lng['sitename'] = $form['formgroupname'] . '-' . $this->lng['sitename']; } $this->pagetemplate->assign('lngpack', $this->lng); $this->pagetemplate->assign('form', $form); $this->pagetemplate->assign('array', $attrread); $template = $form['template'] ? $form['template'] : 'form'; $this->pagetemplate->assign('path', 'form'); $this->pagetemplate->assign('current', $fgid); $this->pagetemplate->assign('tokenkey', $this->fun->token()); $this->pagetemplate->assign('seccodelink', $this->get_link('seccode')); $templatesDIR = $this->get_templatesdir('form'); $templatefilename = $lng . '/' . $templatesDIR . '/' . $template; $this->pagetemplate->display($templatefilename, $form['formcode'] . '_list', false, $filename, admin_LNG); }
function in_index() { parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; if ($this->CON['is_html']) { $lng_dir = $this->get_lng_dirpack(admin_LNG); if ($this->CON['is_alonelng']) { $index_file = admin_ROOT . $this->CON['file_htmldir'] . $this->CON['entrance_file'] . '.' . $this->CON['file_fileex']; $urlfile = admin_URL . $this->CON['file_htmldir']; $strfile = $this->CON['file_htmldir'] . $this->CON['entrance_file'] . '.' . $this->CON['file_fileex']; } else { $index_file = admin_ROOT . $this->CON['file_htmldir'] . $lng_dir . '/' . $this->CON['entrance_file'] . '.' . $this->CON['file_fileex']; $urlfile = admin_URL . $this->CON['file_htmldir'] . $lng_dir . '/'; $strfile = $this->CON['file_htmldir'] . $lng_dir . '/' . $this->CON['entrance_file'] . '.' . $this->CON['file_fileex']; } if (is_file($index_file)) { header("HTTP/1.1 301 Moved Permanently"); header('location: ' . $urlfile); exit; } else { header('Content-type: text/html; charset=utf-8'); exit('错误:HTML静态网页不存在,请登陆后台进行静态页面生成!<br>Filename : ' . $strfile . '<br><a href="' . admin_URL . adminfile . '">点陆登陆管理平台!</a>'); } } $this->pagetemplate->assign('id', 5); $this->pagetemplate->assign('mlink', $this->mlink); $this->pagetemplate->assign('path', 'index'); $this->pagetemplate->display(admin_LNGDIR . 'index', 'index', false, null, admin_LNG); }
function in_index() { parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $this->pagetemplate->assign('mlink', $this->mlink); $this->pagetemplate->assign('path', 'index'); $this->pagetemplate->display(admin_LNGDIR . 'index', 'index', false, null, admin_LNG); }
function in_bbs() { parent::start_pagetemplate(); $this->pagetemplate->libfile = true; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; include admin_ROOT . 'datacache/' . $lng . '_pack.php'; $this->pagetemplate->assign('lngpack', $LANPACK); $btid = intval($this->fun->accept('btid', 'G')); $limit = intval($this->fun->accept('limit', 'G')); $limit = empty($limit) ? 10 : $limit; $filename = $this->fun->accept('filename', 'G'); if (!empty($filename)) { if (!preg_match("/^[\\w-]+\$/i", $filename)) { exit; } } else { $filename = 'bbslist'; } $db_table = db_prefix . 'bbs'; $db_where = " WHERE upbid=0 AND isclass=1 AND lng='{$lng}'"; if (!empty($btid)) { $db_where .= " AND btid={$btid}"; } $sql = "SELECT * FROM {$db_table} {$db_where} ORDER BY bid DESC LIMIT 0,{$limit}"; $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $rsList['link'] = $this->get_link('forumread', $rsList, admin_LNG); $array[] = $rsList; } $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('pathurl', admin_URL); $this->pagetemplate->assign('lngpack', $LANPACK); $output = $this->pagetemplate->fetch($lng . '/lib/' . $filename); $outHTML = addslashes($output); $textArray = preg_split('/[\\r\\n]/i', $outHTML); if (is_array($textArray)) { $outHTML = null; foreach ($textArray as $key => $value) { $outHTML .= 'document.write("' . $value . '");'; } exit($outHTML); } else { exit('document.writeln("' . $outHTML . '")'); } }
function onclearcache() { parent::start_template(); $execute = $this->fun->accept('execute', 'P'); $cleartype = $this->fun->accept('cleartype', 'P'); if (!empty($execute)) { if ($cleartype == 1) { $retrun = $this->dbcache->clearcache(); if ($retrun) { exit('true'); } else { $falseerr = $this->dbcache->cachefile . $this->lng['mangerlist_filecheck_js_filedirno']; exit($falseerr); } } elseif ($cleartype == 2) { parent::start_pagetemplate(); $retrun = $this->pagetemplate->clearcache(null, null, true); if ($retrun) { exit('true'); } else { $falseerr = $this->pagetemplate->cache_dir . $this->lng['mangerlist_filecheck_js_filedirno']; exit($falseerr); } } elseif ($cleartype == 3) { parent::start_pagetemplate(); $retrun = $this->pagetemplate->clearpic(true); if ($retrun) { exit('true'); } else { $falseerr = $this->pagetemplate->cache_pic . $this->lng['mangerlist_filecheck_js_filedirno']; exit($falseerr); } } elseif ($cleartype == 4) { parent::start_pagetemplate(); $retrun = $this->pagetemplate->cleartemplates(true); if ($retrun) { exit('true'); } else { $falseerr = $this->pagetemplate->tpl_c_dir . $this->lng['mangerlist_filecheck_js_filedirno']; exit($falseerr); } } } $digheight = $this->fun->accept('digheight', 'R'); $this->ectemplates->assign('digheight', $digheight); $this->ectemplates->display('admin/admin_manager_clearcache'); }
function in_order() { parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $this->lng['sitename'] = '充值中心' . '-' . $this->lng['sitename']; $this->pagetemplate->assign('moneys', $this->CON['moneys']); $this->pagetemplate->assign('lngpack', $this->lng); $this->pagetemplate->assign('mlink', $this->mlink); $this->pagetemplate->assign('member', $rsMember); $this->pagetemplate->assign('path', 'order'); $this->pagetemplate->assign('tokenkey', $this->fun->token()); $this->pagetemplate->assign('mem_isaddress', $this->CON['mem_isaddress']); // 支付模版 $opid = 2; // 宝付支付 $payread = !empty($opid) ? $this->get_payplug_view($opid) : 0; $plugcode = $payread['paycode']; if (!empty($plugcode)) { include_once admin_ROOT . 'public/plug/payment/' . $plugcode . '.php'; $payobj = new $plugcode(); $this->pagetemplate->assign('display_code', $payobj->get_display_code()); } $templatesDIR = $this->get_templatesdir('order'); $templatefilename = $lng . '/' . $templatesDIR . '/order_buy_center'; $this->pagetemplate->assign('out', 'buyedit'); unset($array, $this->mlink, $LANPACK, $this->lng); $this->pagetemplate->display($templatefilename, 'order_list', false, '', admin_LNG); }
function lib_order() { $this->softbase(); parent::start_pagetemplate(); $this->pagetemplate->libfile = true; }
function in_ajaxlist() { parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $page = $this->fun->accept('page', 'G'); $page = isset($page) ? intval($page) : 1; $limitstard = $this->fun->accept('limitstard', 'R'); $limitstard = isset($limitstard) ? intval($limitstard) : 0; $tid = intval($this->fun->accept('tid', 'G')); if (empty($tid)) { exit('false'); } $typeread = $this->get_type($tid); if (!$typeread['isclass']) { exit("Information parameter error!"); } elseif ($typeread['purview'] > 0) { parent::member_purview($typeread['purview'], null, true); } $mid = $typeread['mid']; $modelview = $this->get_modelview($mid); $modelname = $modelview['modelname']; $pagemax = $modelview['pagemax']; $pagemax = empty($typeread['pagemax']) ? empty($pagemax) ? 20 : $pagemax : $typeread['pagemax']; $template_list = admin_WAP ? $typeread['waptempalte'] : $typeread['template']; $template_index = $typeread['indextemplates']; $readtemplate = admin_WAP ? $typeread['wapreadtemplate'] : $typeread['readtemplate']; $styleid = $typeread['styleid'] == 1 && admin_WAP ? 2 : $typeread['styleid']; $typeread['rsslink'] = $this->get_link('typerss', $typeread, admin_LNG); $typeread['typelink'] = $this->get_link('type', $typeread, admin_LNG); $this->pagetemplate->assign('type', $typeread); $templatesDIR = $this->get_templatesdir('ajax_list'); $listtemplatefilename = $lng . '/' . $templatesDIR . '/' . $template_list; if ($styleid != 2) { exit; } else { if ($typeread['gotoid'] > 0) { $tid = $typeread['gotoid']; } $db_table = db_prefix . 'document'; if ($typeread['ispart']) { $db_where = ' WHERE isclass=1 AND mid=' . $mid . ' AND ' . $this->get_typeid($tid, 'tid', 0, $mid, 0, $lng) . " OR FIND_IN_SET('{$tid}',extid)"; } else { $db_where = ' WHERE isclass=1 AND mid=' . $mid . ' AND tid=' . $tid . " OR FIND_IN_SET('{$tid}',extid)"; } $countnum = $this->db_numrows($db_table, $db_where); if ($countnum > 0) { $numpage = ceil($countnum / $pagemax); } else { $numpage = 1; } $db_table = db_prefix . 'document'; $ordertype = $typeread['ordertype'] == 1 ? 'ORDER BY pid,did' : 'order by pid,addtime'; if ($typeread['isorderby']) { $ordertype = $ordertype . ' DESC'; } else { $ordertype = $ordertype . ' ASC'; } $sql = "SELECT * FROM {$db_table} {$db_where} {$ordertype} LIMIT {$limitstard},{$pagemax}"; $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $attarray = array(); $attarray = $this->get_document_attr($rsList['did']); $typeread_last = $this->get_type($rsList['tid']); $rsList['typename'] = $typeread_last['typename']; $rsList['typelink'] = $this->get_link('type', $typeread_last, admin_LNG); $rsList['pageclass'] = $typeread_last['pageclass']; $rsList['link'] = $this->get_link('doc', $rsList, admin_LNG); $rsList['buylink'] = $this->get_link('buylink', $rsList, admin_LNG); $rsList['enqlink'] = $this->get_link('enqlink', $rsList, admin_LNG); $rsList['ctitle'] = empty($rsList['color']) ? $rsList['title'] : "<font color='" . $rsList['color'] . "'>" . $rsList['title'] . "</font>"; $array[] = is_array($attarray) ? array_merge($attarray, $rsList) : $rsList; } $this->pagetemplate->assign('array', $array); unset($array, $typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($listtemplatefilename, $dirname . '_list_ajax', false, $filename, admin_LNG); } }
function in_taglist() { parent::start_pagetemplate(); include_once admin_ROOT . 'public/class_pagebotton.php'; $page = $this->fun->accept('page', 'G'); $page = isset($page) ? intval($page) : 1; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $tagkey = urldecode($this->fun->accept('tagkey', 'R')); $tagkey = $this->fun->inputcodetrim($tagkey); $db_where = ' WHERE lng=\'' . $lng . '\' AND isclass=1'; if (empty($tagkey)) { $linkURL = $_SERVER['HTTP_REFERER']; $this->callmessage($this->lng['search_err'], $linkURL, $this->lng['gobackbotton']); } if (!empty($tagkey)) { $db_where .= " AND FIND_IN_SET('{$tagkey}',tags)"; } $pagemax = 20; $pagesylte = 1; $templatesDIR = $this->get_templatesdir('article'); $templatefilename = $lng . '/' . $templatesDIR . '/search'; $db_table = db_prefix . 'document'; $countnum = $this->db_numrows($db_table, $db_where); if ($countnum > 0) { $numpage = ceil($countnum / $pagemax); } else { $numpage = 1; } $sql = "SELECT did,lng,pid,mid,aid,tid,sid,fgid,linkdid,isclass,islink,ishtml,ismess,isorder,purview,recommend,tsn,title,longtitle,\n\t\t\tcolor,author,source,pic,link,oprice,bprice,click,description,keywords,addtime,template,filename,filepath FROM {$db_table} {$db_where} LIMIT 0,{$pagemax}"; $this->htmlpage = new PageBotton($sql, $pagemax, $page, $countnum, $numpage, $pagesylte, $this->CON['file_fileex'], 5, $this->lng['pagebotton'], $this->lng['gopageurl'], $this->CON['is_rewrite']); $sql = $this->htmlpage->PageSQL('pid,did', 'down'); $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $rsList['typename'] = $this->get_type($rsList['tid'], 'typename'); $rsList['link'] = $this->get_link('doc', $rsList, admin_LNG); $rsList['buylink'] = $this->get_link('buylink', $rsList, admin_LNG); $rsList['enqlink'] = $this->get_link('enqlink', $rsList, admin_LNG); $rsList['ctitle'] = empty($rsList['color']) ? $rsList['title'] : "<font color='" . $rsList['color'] . "'>" . $rsList['title'] . "</font>"; $rsList[$keyname] = str_ireplace($keyword, '<font color="#F00000"><u>' . $keyword . '</u></font>', $rsList[$keyname]); $array[] = $rsList; } $this->pagetemplate->assign('pagetext', $this->htmlpage->PageStat($this->lng['pagetext'])); $this->pagetemplate->assign('pagebotton', $this->htmlpage->PageList()); $this->pagetemplate->assign('pagenu', $this->htmlpage->Bottonstyle(false)); $this->pagetemplate->assign('pagese', $this->htmlpage->pageSelect()); $this->pagetemplate->assign('pagevt', $this->htmlpage->Prevbotton()); $this->pagetemplate->assign('keyword', $tagkey); $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('path', 'search'); unset($array, $typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($templatefilename, 'search', false, $filename, admin_LNG); }
function in_ordereditsave() { parent::start_pagetemplate(); parent::member_purview(0, $this->mlink['orderlist']); $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token()) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } $userid = $this->ec_member_username_id; if (empty($userid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $oid = intval($this->fun->accept('oid', 'P')); if (empty($oid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $consignee = trim($this->fun->accept('alias', 'P', true, true)); $consignee = $this->fun->substr($consignee, 12); $country = intval($this->fun->accept('cityone', 'P')); $country = empty($country) ? 0 : $country; $province = intval($this->fun->accept('citytwo', 'P')); $province = empty($province) ? 0 : $province; $city = intval($this->fun->accept('citythree', 'P')); $city = empty($city) ? 0 : $city; $district = intval($this->fun->accept('district', 'P')); $district = empty($district) ? 0 : $district; $address = trim($this->fun->accept('address', 'P', true, true)); $address = $this->fun->substr($address, 120); $zipcode = trim($this->fun->accept('zipcode', 'P', true, true)); $zipcode = $this->fun->substr($zipcode, 10); $tel = trim($this->fun->accept('tel', 'P', true, true)); $tel = $this->fun->substr($tel, 20); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); $mobile = $this->fun->substr($mobile, 15); $sendtime = intval($this->fun->accept('sendtime', 'R')); $content = trim($this->fun->accept('content', 'P', true, true)); $content = $this->fun->substr($content, 500); $db_where = 'oid=' . $oid . ' AND userid=' . $userid; $db_table = db_prefix . 'order'; $db_set = "consignee='{$consignee}',country={$country},province={$province},city={$city},district={$district},address='{$address}',zipcode='{$zipcode}',tel='{$tel}',mobile='{$mobile}',sendtime='{$sendtime}',content='{$content}'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); $this->callmessage($this->lng['order_memberinfoedit_ok'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); }
function in_save() { $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token() && !$this->CON['is_html']) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; if ($this->CON['bbs_isseccode'] && !admin_WAP) { $seccode = $this->fun->accept('seccode', 'P'); include_once admin_ROOT . 'public/class_seccode.php'; list($new_seccode, $expiration) = explode("\t", $this->fun->eccode($_COOKIE['ecisp_home_seccode'], 'DECODE')); $code = new seccode(); $code->seccodeconvert($new_seccode); if ($new_seccode != strtoupper($seccode)) { $this->callmessage($this->lng['seescodeerr'], $linkURL, $this->lng['gobackbotton']); } } $did = intval($this->fun->accept('did', 'P')); $did = empty($did) ? 0 : $did; if (empty($did)) { $this->callmessage($this->lng['db_err'], $linkURL, $this->lng['gobackbotton']); } $readinfo = $this->get_documentview($did); if (!$readinfo) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } if (!$readinfo['isclass'] || !$readinfo['ismess']) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } elseif ($readinfo['purview'] > 0) { parent::member_purview($readinfo['purview'], null, true); } $db_table = db_prefix . "document_message"; $userid = intval($this->fun->accept('userid', 'P')); $userid = empty($userid) ? 0 : $userid; $name = $this->fun->accept('name', 'P', true, true); $name = $this->fun->substr($name, 20); $content = $this->fun->accept('content', 'P'); $content = empty($content) ? '' : $this->fun->Text2Html($content, false); if (empty($name) || empty($content)) { $this->callmessage($this->lng['forum_input_err'], $linkURL, $this->lng['gobackbotton']); } $email = $this->fun->accept('email', 'P'); if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $linkURL, $this->lng['gobackbotton']); } $isclass = $this->CON['bbs_isclass'] ? 0 : 1; if (!$this->CON['is_anonymous']) { parent::member_purview(1); } $ipadd = $this->fun->ip($_SERVER['REMOTE_ADDR']); $addtime = time(); if (!empty($this->ec_member_username_id)) { $rsMember = $this->get_member(null, $this->ec_member_username_id); $lockusername = explode(',', $this->CON['bbs_username']); if (in_array($this->ec_member_username, $lockusername)) { $this->callmessage($this->lng['forum_mem_username'], $_SERVER['HTTP_REFERER'], $this->lng['gobackbotton']); } } if (!empty($this->CON['bbs_filter'])) { if ($this->fun->screening_key($content, $this->CON['bbs_filter'])) { $this->callmessage($this->lng['forum_input_filter'], $linkURL, $this->lng['gobackbotton']); } } $usersessionid = md5($ipadd + $did . 'input'); $inputseesion = $this->fun->accept($usersessionid, 'C'); if (empty($inputseesion) && $this->CON['bbs_inputtime']) { $this->fun->setcookie($usersessionid, $addtime, $this->CON['bbs_inputtime']); } elseif ($this->CON['bbs_inputtime']) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackurlbotton']); } $db_field = 'did,userid,adminid,ipadd,lng,name,email,content,recontent,isreply,isclass,addtime,retime,support,oppose'; $db_values = "{$did},{$userid},0,'{$ipadd}','{$lng}','{$name}','{$email}','{$content}','',0,{$isclass},{$addtime},0,0,0"; $this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')'); $insert_id = $this->db->insert_id(); $this->fun->setcookie('ecisp_home_seccode', null); if ($this->CON['bbs_ismail']) { $this->bbsmailsend('bbsrequest', $insert_id); } $this->callmessage($this->lng['forum_input_ok'], $linkURL, $this->lng['gobackurlbotton']); }
function in_lostpasswd() { parent::start_pagetemplate(); if (!$this->CON['mem_isclose']) { $linkURL = $_SERVER['HTTP_REFERER']; $this->callmessage($this->lng['mem_close'], $linkURL, $this->lng['gobackbotton']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $templatesDIR = $this->get_templatesdir('member'); $templatefilename = $lng . '/' . $templatesDIR . '/member_lostpasswd'; $this->pagetemplate->assign('seccodelink', $this->get_link('seccode')); $this->pagetemplate->assign('mlink', $this->mlink); $this->pagetemplate->assign('path', 'member'); $this->pagetemplate->assign('mem_isseccode', $this->CON['mem_isseccode']); unset($this->mlink, $LANPACK, $this->lng); $this->pagetemplate->display($templatefilename, 'index', false, null, admin_LNG); }
function in_list() { parent::start_pagetemplate(); include_once admin_ROOT . 'public/class_pagebotton.php'; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $page = $this->fun->accept('page', 'G'); $page = isset($page) ? intval($page) : 1; $tid = intval($this->fun->accept('tid', 'G')); if (empty($tid)) { exit('false'); } $typeread = $this->get_type($tid); if (!$typeread['isclass']) { exit("Information parameter error!"); } elseif ($typeread['purview'] > 0) { parent::member_purview($typeread['purview'], null, true); } $current = !$typeread['upid'] ? $typeread['tid'] : $typeread['topid']; $this->pagetemplate->assign('path', 'article'); $this->pagetemplate->assign('current', $current); $mid = $typeread['mid']; $modelview = $this->get_modelview($mid); $modelname = $modelview['modelname']; $pagemax = $modelview['pagemax']; $pagemax = empty($typeread['pagemax']) ? empty($pagemax) ? 20 : $pagemax : $typeread['pagemax']; $pagesylte = $modelview['pagesylte']; $template_list = $typeread['template']; $template_index = $typeread['indextemplates']; $readtemplate = $typeread['readtemplate']; $styleid = $typeread['styleid']; $typeread['rsslink'] = $this->get_link('typerss', $typeread, admin_LNG); $typeread['typelink'] = $this->get_link('type', $typeread, admin_LNG); $this->pagetemplate->assign('type', $typeread); if ($styleid != 4) { if (!empty($typeread['keywords'])) { $this->lng['keyword'] = $typeread['keywords']; } if (!empty($typeread['description'])) { $this->lng['description'] = $typeread['description']; } $this->pagetemplate->assign('lngpack', $this->lng); } $templatesDIR = $this->get_templatesdir('article'); $indextemplatefilename = $lng . '/' . $templatesDIR . '/' . $template_index; $listtemplatefilename = $lng . '/' . $templatesDIR . '/' . $template_list; $readtemplatefilename = $lng . '/' . $templatesDIR . '/' . $readtemplate; if ($styleid == 1) { unset($typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($indextemplatefilename, $dirname . '_index', false, $filename, admin_LNG); } elseif ($styleid == 2) { if ($typeread['gotoid'] > 0) { $tid = $typeread['gotoid']; } $db_table = db_prefix . 'document'; if ($typeread['ispart']) { $db_where = ' WHERE isclass=1 AND mid=' . $mid . ' AND ' . $this->get_typeid($tid, 'tid', 0, $mid, 0, $lng) . " OR FIND_IN_SET('{$tid}',extid)"; } else { $db_where = ' WHERE isclass=1 AND mid=' . $mid . ' AND tid=' . $tid . " OR FIND_IN_SET('{$tid}',extid)"; } $countnum = $this->db_numrows($db_table, $db_where); if ($countnum > 0) { $numpage = ceil($countnum / $pagemax); } else { $numpage = 1; } $db_table = db_prefix . 'document'; $sql = "SELECT * FROM {$db_table} {$db_where} LIMIT 0,{$pagemax}"; $this->htmlpage = new PageBotton($sql, $pagemax, $page, $countnum, $numpage, $pagesylte, $this->CON['file_fileex'], 5, $this->lng['pagebotton'], $this->lng['gopageurl'], $this->CON['is_rewrite']); $ordertype = $typeread['ordertype'] == 1 ? 'pid,did' : 'pid,addtime'; if ($typeread['isorderby']) { $sql = $this->htmlpage->PageSQL($ordertype, 'down'); } else { $sql = $this->htmlpage->PageSQL($ordertype, 'ASC'); } $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $attarray = array(); $attarray = $this->get_document_attr($rsList['did']); $typeread = $this->get_type($rsList['tid']); $rsList['typename'] = $typeread['typename']; $rsList['typelink'] = $this->get_link('type', $typeread, admin_LNG); $rsList['link'] = $this->get_link('doc', $rsList, admin_LNG); $rsList['buylink'] = $this->get_link('buylink', $rsList, admin_LNG); $rsList['enqlink'] = $this->get_link('enqlink', $rsList, admin_LNG); $rsList['ctitle'] = empty($rsList['color']) ? $rsList['title'] : "<font color='" . $rsList['color'] . "'>" . $rsList['title'] . "</font>"; $array[] = is_array($attarray) ? array_merge($attarray, $rsList) : $rsList; } $this->pagetemplate->assign('pagetext', $this->htmlpage->PageStat($this->lng['pagetext'])); $this->pagetemplate->assign('pagebotton', $this->htmlpage->PageList()); $this->pagetemplate->assign('pagenu', $this->htmlpage->Bottonstyle(false)); $this->pagetemplate->assign('pagese', $this->htmlpage->pageSelect()); $this->pagetemplate->assign('pagevt', $this->htmlpage->Prevbotton()); $this->pagetemplate->assign('array', $array); unset($array, $typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($listtemplatefilename, $dirname . '_list', false, $filename, admin_LNG); } elseif ($styleid == 3) { $typeurl = $typeread['typeurl']; header("location:{$typeurl}"); exit; } elseif ($styleid == 4) { if ($typeread['gotoid'] > 0) { $gotodid = $this->get_type($typeread['gotoid'], 'linkid'); if ($gotodid) { $typeread['linkid'] = $gotodid; $typeread['nowtid'] = $typeread['tid']; } } if ($typeread['linkid']) { $readinfo = $this->get_document($typeread['linkid']); if ($typeread['nowtid']) { $readinfo['tid'] = $typeread['nowtid']; } if ($readinfo['did']) { $db_table = db_prefix . 'document'; $db_where = "isclass=1 AND did=" . $readinfo['did']; $db_set = "click=click+1"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); } if (!empty($readinfo['tags'])) { $tagArray = explode(',', $readinfo['tags']); $tagArray = array_unique($tagArray); $newTagArray = array(); foreach ($tagArray as $key => $value) { $newTagArray[$key]['title'] = $value; $view = $this->get_tag_view(null, $value, null, true); $newTagArray[$key]['link'] = $view['islink'] == 1 ? $view['linkurl'] : $this->get_link('taglink', array('key' => $value), admin_LNG); } } $readinfo['content'] = html_entity_decode($readinfo['content']); $exCotnet = explode('<!-- pagebreak -->', $readinfo['content']); $filepage = count($exCotnet); $pageArray = array(); if ($filepage > 1) { $nkey = $page + 1; $pkey = $page > 1 ? $page - 1 : 1; $readinfo['nlink'] = $nkey <= $filepage ? $this->get_link('doc', $readinfo, admin_LNG, $nkey) : null; $readinfo['plink'] = $page > 1 ? $this->get_link('doc', $readinfo, admin_LNG, $pkey) : null; for ($index = 0; $index < $filepage; $index++) { $num = $index + 1; $pageArray[$index]['num'] = $num; $pageArray[$index]['n'] = $num == $page ? 1 : 0; $pageArray[$index]['link'] = $this->get_link('doc', $readinfo, admin_LNG, $num); } $outkey = $page - 1; $readinfo['content'] = $exCotnet[$outkey]; } $this->pagetemplate->assign('page', $pageArray); if (!empty($readinfo['keywords'])) { $this->lng['keyword'] = $readinfo['keywords']; } if (!empty($readinfo['description'])) { $this->lng['description'] = $readinfo['description']; } $this->pagetemplate->assign('lngpack', $this->lng); $this->pagetemplate->assign('tag', $newTagArray); $readinfo['buylink'] = $this->get_link('buylink', $readinfo, admin_LNG); $readinfo['enqlink'] = $this->get_link('enqlink', $readinfo, admin_LNG); if (!empty($readinfo['linkdid'])) { $readinfo['linkdid'] = str_replace(',', '/', $readinfo['linkdid']); } $albumarray = $this->get_album_array($readinfo['did']); $this->pagetemplate->assign('read', $readinfo); $this->pagetemplate->assign('photo', $albumarray['list']); } unset($readinfo, $typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($readtemplatefilename, $dirname . '_list', false, $filename, admin_LNG); } }
function in_ordersave() { parent::start_pagetemplate(); $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token()) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } if ($this->CON['order_ismember']) { parent::member_purview(0, $this->mlink['orderpay']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $cartid = $this->fun->eccode($this->fun->accept('ecisp_order_list', 'C'), 'DECODE', db_pscode); $cartid = stripslashes(htmlspecialchars_decode($cartid)); $uncartid = !empty($cartid) ? unserialize($cartid) : 0; $ordersncode = $this->fun->accept('ecisp_order_sncode', 'C'); $userid = intval($this->fun->accept('userid', 'P')); $userid = empty($userid) ? 0 : $userid; $consignee = trim($this->fun->accept('alias', 'P', true, true)); $consignee = $this->fun->substr($consignee, 12); $email = $this->fun->accept('email', 'P', true, true); $country = intval($this->fun->accept('cityone', 'P')); $country = empty($country) ? 0 : $country; $province = intval($this->fun->accept('citytwo', 'P')); $province = empty($province) ? 0 : $province; $city = intval($this->fun->accept('citythree', 'P')); $city = empty($city) ? 0 : $city; $district = intval($this->fun->accept('district', 'P')); $district = empty($district) ? 0 : $district; $address = trim($this->fun->accept('address', 'P', true, true)); $address = $this->fun->substr($address, 120); $zipcode = trim($this->fun->accept('zipcode', 'P', true, true)); $zipcode = $this->fun->substr($zipcode, 10); $tel = trim($this->fun->accept('tel', 'P', true, true)); $tel = $this->fun->substr($tel, 20); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); $mobile = $this->fun->substr($mobile, 15); $sendtime = intval($this->fun->accept('sendtime', 'R')); $content = trim($this->fun->accept('content', 'P', true, true)); $content = $this->fun->substr($content, 500); $invpayee = trim($this->fun->accept('invpayee', 'P', true, true)); $invpayee = $this->fun->substr($invpayee, 60); $invcontent = trim($this->fun->accept('invcontent', 'P', true, true)); $invcontent = $this->fun->substr($invcontent, 60); $opid = intval($this->fun->accept('opid', 'P')); $opid = empty($opid) ? 0 : $opid; $osid = intval($this->fun->accept('osid', 'P')); $osid = empty($osid) ? 0 : $osid; $productmoney = floatval($this->fun->accept('productmoney', 'P')); $discount_productmoney = floatval($this->fun->accept('discount_productmoney', 'P')); $discountmoney = floatval($this->fun->accept('discountmoney', 'P')); $cookiceprice = $this->fun->eccode(md5("{$productmoney}|{$discount_productmoney}"), 'ENCODE', db_pscode); if ($uncartid && is_array($uncartid) && !empty($ordersncode) && $cookiceprice == $ordersncode) { $ptitle = $this->fun->accept('ptitle', 'P'); $tsn = $this->fun->accept('tsn', 'P'); $bprice = $this->fun->accept('bprice', 'P'); $oprice = $this->fun->accept('oprice', 'P'); $did = $this->fun->accept('did', 'P'); $amount = $this->fun->accept('amount', 'P'); $countprice = $this->fun->accept('countprice', 'P'); if (empty($did) || empty($bprice) || empty($amount) || empty($countprice) || empty($opid) || empty($osid)) { $buylink = $this->get_link('order', array(), admin_LNG); $this->callmessage($this->lng['order_input_err'], $buylink, $this->lng['oder_buy_goback']); } if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackbotton']); } $payprice = 0; $shipprice = 0; $payread = !empty($opid) ? $this->get_payplug_view($opid) : 0; $shipprice = !empty($osid) ? $this->get_shipplug_view($osid, 'price') : 0; $shipprice = floatval($shipprice); if ($payread['payis'] > 0) { $payread['payis'] = floatval($payread['payis']); $payprice = $payread['payis'] / 100 * $discount_productmoney; } $orderamount = $discount_productmoney + $payprice + $shipprice; $order_snfont = $this->CON['order_snfont']; $ordersn = $order_snfont . date('YmdHis') . rand(100, 9999); $db_table = db_prefix . 'order'; $db_table2 = db_prefix . 'order_info'; $addtime = time(); $db_field = 'ordersn,userid,ordertype,osid,opid,shippingsn,paysn,consignee,country,province,city,district,address, zipcode,tel,mobile,email,sendtime,invpayee,invcontent,content,treatnote,paytime,shippingtime,productmoney,shippingmoney, paymoney,orderamount,discount,integral,addtime'; $db_values = "'{$ordersn}',{$userid},1,{$osid},{$opid},'','','{$consignee}',{$country},{$province},{$city},{$district},'{$address}',\n\t\t\t\t'{$zipcode}','{$tel}','{$mobile}','{$email}','{$sendtime}','{$invpayee}','{$invcontent}','{$content}','',0,0,{$productmoney},{$shipprice},\n\t\t\t\t{$payprice},{$orderamount},{$discountmoney},0,{$addtime}"; $this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')'); $insert_id = $this->db->insert_id(); $db_values = ''; $arraycount = count($did) - 1; foreach ($did as $key => $value) { $value = intval($value); $oprice[$key] = floatval($oprice[$key]); $bprice[$key] = floatval($bprice[$key]); $countprice[$key] = floatval($countprice[$key]); $amount[$key] = intval($amount[$key]); if ($key == $arraycount) { $db_values .= "({$insert_id},{$value},'{$tsn[$key]}','{$ptitle[$key]}',{$oprice[$key]},{$bprice[$key]},{$countprice[$key]},{$amount[$key]},1)"; } else { $db_values .= "({$insert_id},{$value},'{$tsn[$key]}','{$ptitle[$key]}',{$oprice[$key]},{$bprice[$key]},{$countprice[$key]},{$amount[$key]},1),"; } } $db_field = 'oid,did,tsn,title,oprice,bprice,countprice,amount,inventory'; $this->db->query('INSERT INTO ' . $db_table2 . ' (' . $db_field . ') VALUES ' . $db_values); if ($this->CON['is_email']) { $this->ordermailsend('orderen', $insert_id, $email); $this->ordermailsend('orderwarn', $insert_id, $this->CON['admine_mail']); } if ($this->CON['is_moblie']) { $OrderArray = array('ordersn' => $ordersn); $mobile = $this->CON['moblie_number']; $this->membersmssend($OrderArray, $mobile, 'orderto'); } if (!empty($opid)) { $rsOrder = array('ordersn' => $ordersn, 'orderamount' => $orderamount, 'oid' => $insert_id); $paylist = $this->fun->formatarray($payread['pluglist']); $plugcode = $payread['paycode']; if (!empty($plugcode)) { include_once admin_ROOT . 'public/plug/payment/' . $plugcode . '.php'; $payobj = new $plugcode(); $codesn = $this->fun->eccode($plugcode . $ordersn . $insert_id, 'ENCODE', db_pscode, FALSE); $respondArray = array('code' => $plugcode, 'ordersn' => $ordersn, 'oid' => $insert_id, 'codesn' => $codesn); $return_url = $this->get_link('paybackurl', $respondArray, admin_LNG); $orderonline = $payobj->get_code($rsOrder, $paylist, $return_url, $return_url); } } $order_integral = empty($this->CON['order_integral']) ? 1 : intval($this->CON['order_integral']); $internum = $orderamount * $order_integral; $this->pagetemplate->assign('internum', intval($internum)); $this->pagetemplate->assign('mlink', $this->mlink); $this->pagetemplate->assign('orderonline', $orderonline); $this->pagetemplate->assign('ordersn', $ordersn); $this->pagetemplate->assign('orderamount', number_format($orderamount, 2)); $this->pagetemplate->assign('payprice', number_format($payprice, 2)); $this->pagetemplate->assign('shipprice', number_format($shipprice, 2)); $this->pagetemplate->assign('discount', number_format($discount_productmoney, 2)); $this->pagetemplate->assign('productmoney', number_format($productmoney, 2)); $this->pagetemplate->assign('discountmoney', number_format($discountmoney, 2)); $this->pagetemplate->assign('moneytype', $this->CON['order_moneytype']); $this->pagetemplate->assign('order_ismember', $this->CON['order_ismember']); $this->lng['sitename'] = $this->lng['ordertitle'] . '-' . $this->lng['sitename']; $this->pagetemplate->assign('lngpack', $this->lng); $this->fun->setcookie('ecisp_order_list', null); $this->fun->setcookie('ecisp_order_productmoney', null); $templatesDIR = $this->get_templatesdir('order'); $templatefilename = $lng . '/' . $templatesDIR . '/order_buy_center'; $this->pagetemplate->assign('out', 'buyok'); $this->pagetemplate->assign('path', 'order'); unset($this->mlink, $LANPACK, $this->lng); $this->pagetemplate->display($templatefilename, 'order_ok', false, '', admin_LNG); } else { $buylink = $this->get_link('order', array(), admin_LNG); $this->callmessage($this->lng['order_nolist'], $buylink, $this->lng['oder_buy_goback']); } }
function in_getvalidatecode() { parent::start_pagetemplate(); parent::member_purview(); $userid = intval($this->ec_member_username_id); $username = $this->fun->accept('username', 'P'); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); if (empty($userid) || empty($username) || empty($mobile)) { exit('false'); } if (!preg_match("/^[^!@~`\\'\"#\$\\%\\^&\\*\\(\\)\\+\\-\\{\\}\\[\\]\\|\\/\\?\\<\\>\\,\\.\\:\\;]{2,16}\$/i", $username)) { exit('false'); } if (!preg_match("/^1[0-9]{10}\$/i", $mobile)) { exit('false'); } $mobliesn = $this->fun->random(8, 1); $date = time(); $db_table = db_prefix . 'member'; $db_where = "userid={$this->ec_member_username_id} AND username='******'"; $db_set = "mobliesn='{$mobliesn}',mobliesntime={$date}"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); if ($this->CON['is_moblie']) { $rsMember = $this->get_member('', $this->ec_member_username_id); $rsMember['idcode'] = $mobliesn; $this->membersmssend($rsMember, $mobile, 'mobliecode'); } }
function in_im() { parent::start_pagetemplate(); $this->pagetemplate->libfile = true; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; include admin_ROOT . 'datacache/' . $lng . '_pack.php'; $this->pagetemplate->assign('lngpack', $LANPACK); if (!$this->CON['is_imcall']) { exit; } if (!$this->get_app_view('im', 'isetup')) { return null; } $call['call_style'] = $this->CON['call_style']; $call['call_type'] = $this->CON['call_type']; $call['call_position'] = $this->CON['call_position']; $wxid = intval($this->fun->accept('wxid', 'G')); $call_array = $this->get_calling_array(0, 1, $lng); $array = $call_array['list']; if (is_array($array)) { foreach ($array as $key => $value) { if ($value['type'] == 1) { $array[$key]['code'] = stripslashes(htmlspecialchars_decode($value['code'])); } } } if ($wxid && $this->get_app_view('weixin', 'isetup')) { $db_table = db_prefix . 'weixin_api'; $db_where = " WHERE wxid={$wxid} AND isclass=1"; $db_sql = 'SELECT * FROM ' . $db_table . $db_where . ' ORDER BY wxid DESC'; $wxread = $this->db->fetch_first($db_sql); $this->pagetemplate->assign('wxread', $wxread); } $this->pagetemplate->assign('bbslink', $this->get_link('forum', array(), $lngpack)); $this->pagetemplate->assign('memberlink', $this->get_link('memberlogin', array(), $lngpack)); $this->pagetemplate->assign('lng', $lng); $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('call', $call); $this->pagetemplate->assign('lngpack', $LANPACK); $filename = $this->fun->accept('filename', 'G'); if (!empty($filename)) { if (!preg_match("/^[\\w-]+\$/i", $filename)) { exit; } } else { $filename = 'im'; } $output = $this->pagetemplate->fetch($lng . '/lib/' . $filename); $outHTML = addslashes($output); $textArray = preg_split('/[\\r\\n]/i', $outHTML); if (is_array($textArray)) { $outHTML = null; foreach ($textArray as $key => $value) { $outHTML .= 'document.write("' . $value . '");'; } exit($outHTML); } else { exit('document.writeln("' . $outHTML . '")'); } }
function in_payok() { parent::start_pagetemplate(); if ($this->CON['order_ismember']) { parent::member_purview(0, $this->mlink['login']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $linkURL = $_SERVER['HTTP_REFERER']; $paycode = $this->fun->accept('code', 'G'); $ordersn = $this->fun->accept('ordersn', 'G'); $oid = intval($this->fun->accept('oid', 'G')); $codesn = $this->fun->accept('codesn', 'G'); $integral = intval($this->CON['order_integral']); $sncode = $this->fun->eccode($paycode . $ordersn . $oid, 'ENCODE', db_pscode, FALSE); if ($sncode != $codesn) { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['order_pay_no'], $linkURL, $this->lng['member_center_botton']); } if ($this->CON['order_ismember']) { $userid = intval($this->ec_member_username_id); if (empty($userid)) { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['db_err'], $linkURL, $this->lng['member_center_botton']); } } if (empty($oid)) { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['db_err'], $linkURL, $this->lng['member_center_botton']); } if (!empty($paycode)) { $db_table1 = db_prefix . 'order_pay'; $db_table2 = db_prefix . 'order'; $db_table3 = db_prefix . 'order_payreceipt'; $db_where = "paycode='{$paycode}'"; $rsList = $this->db->fetch_first('SELECT * FROM ' . $db_table1 . ' WHERE ' . $db_where); if ($rsList) { $config_list = unserialize($rsList['pluglist']); foreach ($config_list as $config) { $paymentvlue[$config['name']] = $config['value']; } include_once admin_ROOT . 'public/plug/payment/' . $paycode . '.php'; $payment = new $paycode(); $paymentType = $payment->respond($paymentvlue, $rsList); $db_where = "oid={$oid} AND ordertype<>2"; $rsRead = $this->db->fetch_first('SELECT * FROM ' . $db_table2 . ' WHERE ' . $db_where); if ($paymentType && $rsRead) { $ipadd = $this->fun->ip($_SERVER['REMOTE_ADDR']); $addtime = time(); if (!empty($integral)) { $integral = intval($rsRead['orderamount'] / intval($integral)); } else { $integral = 0; } $db_set = "ordertype=2,paysn='{$paymentType}',paytime='{$addtime}',integral={$integral}"; $this->db->query('UPDATE ' . $db_table2 . ' SET ' . $db_set . ' WHERE ' . $db_where); $db_field = 'oid,opid,paysn,ordersn,orderamount,bankaccount,bankname,username,content,userid,isclass,paytime,addtime'; $db_values = "{$oid},{$rsRead['opid']},'{$rsRead['paysn']}','{$ordersn}',{$rsRead['orderamount']},'{$paymentvlue['paypal_account']}','{$paycode}','onlineuser','',{$rsRead['userid']},1,{$addtime},{$addtime}"; $this->db->query('INSERT INTO ' . $db_table3 . ' (' . $db_field . ') VALUES (' . $db_values . ')'); if ($rsRead['userid'] > 0) { $this->set_member_integral($rsRead['userid'], $integral); } if ($this->CON['is_email']) { $this->ordermailsend('orderpal', $oid, $rsRead['email']); $this->ordermailsend('orderpayadmin', $oid, $this->CON['admine_mail']); } if ($this->CON['is_moblie']) { $mobile = $this->CON['moblie_number']; $this->membersmssend($rsRead, $mobile, 'orderpay'); } $this->pagetemplate->assign('order', $rsRead); $this->pagetemplate->assign('pay', $rsList); $this->pagetemplate->assign('paysn', $paymentType); $linkURL = $this->mlink['center']; $readlink = $this->get_link('orderread', $rsRead, admin_LNG); $this->callmessage($this->lng['order_pay_ok'], $linkURL, $this->lng['member_center_botton'], 1, $this->lng['order_read_botton'], 1, $readlink); } else { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['order_pay_no'], $linkURL, $this->lng['member_center_botton']); } } else { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['order_pay_no'], $linkURL, $this->lng['member_center_botton']); } } else { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['order_pay_no'], $linkURL, $this->lng['member_center_botton']); } }
function in_list() { parent::start_pagetemplate(); include_once admin_ROOT . 'public/class_pagebotton.php'; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $page = $this->fun->accept('page', 'G'); $page = isset($page) ? intval($page) : 1; $sid = intval($this->fun->accept('sid', 'G')); $subread = $this->get_subjectlist_purview($sid); if (!$subread['isclass']) { exit("Information parameter error!"); } elseif ($subread['purview'] > 0) { parent::member_purview($subread['purview'], null, true); } if (!empty($subread['keywords'])) { $this->lng['keyword'] = $subread['keywords']; } if (!empty($subread['description'])) { $this->lng['description'] = $subread['description']; } $this->pagetemplate->assign('lngpack', $this->lng); $mid = $subread['mid']; $modelview = $this->get_modelview($mid); $modelname = $modelview['modelname']; $pagemax = $modelview['pagemax']; $pagemax = empty($subread['pagemax']) ? empty($pagemax) ? 20 : $pagemax : $subread['pagemax']; $pagesylte = $modelview['pagesylte']; $styleid = $subread['styleid']; $subread['link'] = $this->get_link('subtype', $subread, admin_LNG); $this->pagetemplate->assign('sub', $subread); $templatesDIR = $this->get_templatesdir('article'); $list_templatefilename = $lng . '/' . $templatesDIR . '/' . $subread['template']; $index_templatefilename = $lng . '/' . $templatesDIR . '/' . $subread['indextemplates']; if ($styleid == 1) { unset($subread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($index_templatefilename, $dirname . '_index', false, $filename, admin_LNG); } elseif ($styleid == 2) { $db_table = db_prefix . 'document'; $db_where = ' WHERE isclass=1 AND mid=' . $mid . ' AND sid=' . $sid; $countnum = $this->db_numrows($db_table, $db_where); if ($countnum > 0) { $numpage = ceil($countnum / $pagemax); } else { $numpage = 1; } $db_table = db_prefix . 'document'; $sql = "SELECT * FROM {$db_table} {$db_where} LIMIT 0,{$pagemax}"; $this->htmlpage = new PageBotton($sql, $pagemax, $page, $countnum, $numpage, $pagesylte, $this->CON['file_fileex'], 5, $this->lng['pagebotton'], $this->lng['gopageurl'], $this->CON['is_rewrite']); $sql = $this->htmlpage->PageSQL('pid,did', 'down'); $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $attarray = array(); $attarray = $this->get_document_attr($rsList['did']); $typeread = $this->get_type($rsList['tid']); $rsList['typename'] = $typeread['typename']; $rsList['typelink'] = $this->get_link('type', $typeread, admin_LNG); $rsList['link'] = $this->get_link('doc', $rsList, admin_LNG); $rsList['buylink'] = $this->get_link('buylink', $rsList, admin_LNG); $rsList['enqlink'] = $this->get_link('enqlink', $rsList, admin_LNG); $rsList['ctitle'] = empty($rsList['color']) ? $rsList['title'] : "<font color='" . $rsList['color'] . "'>" . $rsList['title'] . "</font>"; $array[] = is_array($attarray) ? array_merge($attarray, $rsList) : $rsList; } $this->pagetemplate->assign('pagetext', $this->htmlpage->PageStat($this->lng['pagetext'])); $this->pagetemplate->assign('pagebotton', $this->htmlpage->PageList()); $this->pagetemplate->assign('pagenu', $this->htmlpage->Bottonstyle(false)); $this->pagetemplate->assign('pagese', $this->htmlpage->pageSelect()); $this->pagetemplate->assign('pagevt', $this->htmlpage->Prevbotton()); $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('path', 'special'); unset($array, $typeread, $modelview, $LANPACK, $this->lng); $this->pagetemplate->display($list_templatefilename, $dirname . '_list', false, $filename, admin_LNG); } }
function in_save() { $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token()) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } parent::start_pagetemplate(); parent::member_purview(0, $this->mlink['orderlist']); $userid = $this->ec_member_username_id; if (empty($userid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $bid = intval($this->fun->accept('bid', 'P')); if (empty($bid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $db_table = db_prefix . "bbs"; $title = trim($this->fun->accept('title', 'P', true, true)); $title = $this->fun->substr($title, 80); $username = $this->fun->accept('username', 'P', true, true); $username = $this->fun->substr($username, 20); $email = trim($this->fun->accept('email', 'P', true, true)); $content = $this->fun->accept('content', 'P'); $content = empty($content) ? '' : $this->fun->Text2Html($content, false); if (empty($title)) { $this->callmessage($this->lng['forum_title_err'], $linkURL, $this->lng['gobackbotton']); } if (empty($content) || empty($username)) { $this->callmessage($this->lng['forum_input_err'], $linkURL, $this->lng['gobackbotton']); } if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $linkURL, $this->lng['gobackbotton']); } $qq = $this->fun->accept('qq', 'P', true, true); $qq = $this->fun->substr($qq, 10); $msn = $this->fun->accept('msn', 'P', true, true); $address = $this->fun->accept('address', 'P', true, true); $address = $this->fun->substr($address, 150); $tel = $this->fun->accept('tel', 'P', true, true); $tel = $this->fun->substr($tel, 15); $mobile = $this->fun->accept('mobile', 'P', true, true); $mobile = $this->fun->substr($mobile, 15); $ipadd = $this->fun->ip($_SERVER['REMOTE_ADDR']); $addtime = time(); if (!empty($this->CON['bbs_filter'])) { if ($this->fun->screening_key($content, $this->CON['bbs_filter']) || $this->fun->screening_key($title, $this->CON['bbs_filter'])) { $this->callmessage($this->lng['forum_input_filter'], $linkURL, $this->lng['gobackbotton']); } } $db_where = 'bid=' . $bid . ' AND userid=' . $userid; $db_set = "title='{$title}',content='{$content}',username='******',email='{$email}',qq='{$qq}',msn='{$msn}',address='{$address}',tel='{$tel}',mobile='{$mobile}'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); $this->callmessage($this->lng['forummain_edit_ok'], $this->mlink['forumlist'], $this->lng['gobackurlbotton']); }
function in_bbs() { parent::start_pagetemplate(); $this->pagetemplate->libfile = true; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; include admin_ROOT . 'datacache/' . $lng . '_pack.php'; $this->pagetemplate->assign('lngpack', $LANPACK); $recommend = intval($this->fun->accept('recommend', 'G')); $btid = intval($this->fun->accept('btid', 'G')); $blid = intval($this->fun->accept('blid', 'G')); $limit = intval($this->fun->accept('limit', 'G')); $limit = empty($limit) ? 10 : $limit; $filename = $this->fun->accept('filename', 'G'); $filename = empty($filename) ? 'bbslist' : $filename; $db_table = db_prefix . 'bbs'; $db_where = " WHERE linkebid=0 AND isclass=1 AND lng='{$lng}'"; if (!empty($recommend)) { $db_where .= " AND recommend={$recommend}"; } if (!empty($btid)) { $db_where .= " AND btid={$btid}"; } if (!empty($blid)) { $db_where .= " AND blid={$blid}"; } $label = $this->get_bbslabel_array(0, $lng, 1); $labelarray = $this->fun->key_array_name($label['list'], 'blid', 'labelname'); $sql = "SELECT * FROM {$db_table} {$db_where} ORDER BY bid DESC LIMIT 0,{$limit}"; $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $rsList['link'] = $this->get_link('forumread', $rsList, admin_LNG); if ($rsList['userid'] > 0) { $member = $this->get_member(null, $rsList['userid']); $rsList['author'] = empty($member['alias']) ? $member['username'] : $member['alias']; if (empty($rsList['author'])) { $rsList['author'] = $LANPACK['forum_anonymity']; } } else { $rsList['author'] = $LANPACK['forum_anonymity']; } $rsList['labelname'] = $labelarray[$rsList['blid']]; $array[] = $rsList; } $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('pathurl', admin_URL); $this->pagetemplate->assign('lngpack', $LANPACK); $output = $this->pagetemplate->fetch($lng . '/lib/' . $filename); $outHTML = addslashes($output); $textArray = preg_split('/[\\r\\n]/i', $outHTML); if (is_array($textArray)) { $outHTML = null; foreach ($textArray as $key => $value) { $outHTML .= 'document.write("' . $value . '");'; } exit($outHTML); } else { exit('document.writeln("' . $outHTML . '")'); } }
function in_index() { parent::start_pagetemplate(); exit('抱歉,暂无WAP功能!'); }
function in_enquirysave() { parent::start_pagetemplate(); $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token()) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; if ($this->CON['is_enquiry_memclass']) { parent::member_purview(0, $this->get_link('enquiry', array(), admin_LNG)); } $cartid = $this->fun->eccode($this->fun->accept('ecisp_enquiry_list', 'C'), 'DECODE', db_pscode); $cartid = stripslashes(htmlspecialchars_decode($cartid)); $uncartid = !empty($cartid) ? unserialize($cartid) : 0; $userid = intval($this->fun->accept('userid', 'P')); $userid = !empty($userid) ? $userid : 0; $linkman = trim($this->fun->accept('linkman', 'P', true, true)); $linkman = $this->fun->substr($linkman, 20); $email = $this->fun->accept('email', 'P', true, true); $sex = $this->fun->accept('sex', 'P'); $sex = empty($sex) ? 0 : intval($sex); $country = intval($this->fun->accept('cityone', 'P')); $country = empty($country) ? 0 : $country; $province = intval($this->fun->accept('citytwo', 'P')); $province = empty($province) ? 0 : $province; $city = intval($this->fun->accept('citythree', 'P')); $city = empty($city) ? 0 : $city; $district = intval($this->fun->accept('district', 'P')); $district = empty($district) ? 0 : $district; $address = trim($this->fun->accept('address', 'P', true, true)); $address = $this->fun->substr($address, 120); $zipcode = trim($this->fun->accept('zipcode', 'P', true, true)); $zipcode = $this->fun->substr($zipcode, 10); $tel = trim($this->fun->accept('tel', 'P', true, true)); $tel = $this->fun->substr($tel, 20); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); $mobile = $this->fun->substr($mobile, 15); $fax = trim($this->fun->accept('fax', 'P', true, true)); $fax = $this->fun->substr($fax, 15); $content = trim($this->fun->accept('content', 'P', true, true)); $content = $this->fun->substr($content, 500); $amount = $this->fun->accept('amount', 'P'); $ptitle = $this->fun->accept('ptitle', 'P'); $tsn = $this->fun->accept('tsn', 'P'); $did = $this->fun->accept('did', 'P'); if (empty($did) || empty($amount) || empty($ptitle)) { $enquirylink = $this->get_link('enquiry', array(), admin_LNG); $this->callmessage($this->lng['enquiry_input_err'], $enquirylink, $this->lng['enquiry_into_listbotton']); } if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackbotton']); } $enquirysn = date('YmdHis') . rand(100, 9999); $db_table = db_prefix . 'enquiry'; $db_table2 = db_prefix . 'enquiry_info'; $addtime = time(); $db_field = 'enquirysn,userid,linkman,sex,country,province,city,district,address,zipcode,tel,fax,mobile,email,content,isclass,addtime,edittime'; $db_values = "'{$enquirysn}',{$userid},'{$linkman}',{$sex},{$country},{$province},{$city},{$district},'{$address}','{$zipcode}','{$tel}','{$fax}','{$mobile}','{$email}','{$content}',0,{$addtime},0"; $this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')'); $insert_id = $this->db->insert_id(); $db_values = ''; $arraycount = count($did) - 1; foreach ($did as $key => $value) { $value = intval($value); $amount[$key] = intval($amount[$key]); if ($key == $arraycount) { $db_values .= "({$insert_id},{$value},'{$tsn[$key]}','{$ptitle[$key]}',{$amount[$key]},'')"; } else { $db_values .= "({$insert_id},{$value},'{$tsn[$key]}','{$ptitle[$key]}',{$amount[$key]},''),"; } } $db_field = 'eid,did,tsn,title,amount,comment'; $this->db->query('INSERT INTO ' . $db_table2 . ' (' . $db_field . ') VALUES ' . $db_values); if ($this->CON['is_email'] == 1) { $this->enquirymailsend('enquirywarn', $insert_id, $this->CON['admine_mail']); $this->enquirymailsend('enquiryre', $insert_id, $email); } if ($this->CON['is_moblie']) { $OrderArray = array('enquirysn' => $enquirysn); $mobile = $this->CON['moblie_number']; $this->membersmssend($OrderArray, $mobile, 'enqueryto'); } $this->fun->setcookie('ecisp_enquiry_list', null); $enquirylink = $this->get_link('enquiry', array(), admin_LNG); $this->callmessage($this->lng['enquiry_ok'], $enquirylink, $this->lng['enquiry_into_listbotton']); }
function in_save() { $linkURL = $_SERVER['HTTP_REFERER']; if (!$this->fun->is_token()) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackbotton']); } parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $inputclass = $this->fun->accept('inputclass', 'P'); $btid = intval($this->fun->accept('btid', 'P')); if (empty($btid)) { $this->callmessage($this->lng['db_err'], $linkURL, $this->lng['gobackurlbotton']); } $db_table = db_prefix . "bbs"; $title = trim($this->fun->accept('title', 'P', true, true)); $title = $this->fun->substr($title, 80); $username = $this->fun->accept('username', 'P', true, true); $username = $this->fun->substr($username, 20); $email = trim($this->fun->accept('email', 'P', true, true)); $content = $this->fun->accept('content', 'P'); $content = empty($content) ? '' : $this->fun->Text2Html($content, false); $userid = intval($this->fun->accept('userid', 'P')); if (empty($title)) { $this->callmessage($this->lng['forum_title_err'], $linkURL, $this->lng['gobackbotton']); } if (empty($content) || empty($username)) { $this->callmessage($this->lng['forum_input_err'], $linkURL, $this->lng['gobackbotton']); } if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $linkURL, $this->lng['gobackbotton']); } $typeread = $this->get_bbstype_view($btid); if (!$typeread) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $qq = $this->fun->accept('qq', 'P', true, true); $qq = $this->fun->substr($qq, 10); $msn = $this->fun->accept('msn', 'P', true, true); $address = $this->fun->accept('address', 'P', true, true); $address = $this->fun->substr($address, 150); $tel = $this->fun->accept('tel', 'P', true, true); $tel = $this->fun->substr($tel, 15); $mobile = $this->fun->accept('mobile', 'P', true, true); $mobile = $this->fun->substr($mobile, 15); if ($typeread['isseccode']) { $seccode = $this->fun->accept('seccode', 'P'); include_once admin_ROOT . 'public/class_seccode.php'; list($new_seccode, $expiration) = explode("\t", $this->fun->eccode($_COOKIE['ecisp_home_seccode'], 'DECODE')); $code = new seccode(); $code->seccodeconvert($new_seccode); if ($new_seccode != strtoupper($seccode)) { $this->callmessage($this->lng['seescodeerr'], $linkURL, $this->lng['gobackbotton']); } } if (!$typeread['isclass']) { exit("Information parameter error!"); } elseif ($typeread['purview'] > 0) { parent::member_purview($purview); } $isclass = $typeread['isaddclass'] ? 0 : 1; if ($typeread['purview'] > 0) { parent::member_purview($typeread['purview']); } if (!empty($this->ec_member_username_id)) { $rsMember = $this->get_member(null, $this->ec_member_username_id); $lockusername = explode(',', $this->CON['bbs_username']); if (in_array($this->ec_member_username, $lockusername)) { $this->callmessage($this->lng['forum_mem_username'], $_SERVER['HTTP_REFERER'], $this->lng['gobackbotton']); } } if (!empty($this->CON['bbs_filter'])) { if ($this->fun->screening_key($content, $this->CON['bbs_filter']) || $this->fun->screening_key($title, $this->CON['bbs_filter'])) { $this->callmessage($this->lng['forum_input_filter'], $linkURL, $this->lng['gobackbotton']); } } $ipadd = $this->fun->ip($_SERVER['REMOTE_ADDR']); $addtime = time(); $usersessionid = md5($ipadd + $btid . 'input'); $inputseesion = $this->fun->accept($usersessionid, 'C'); if (empty($inputseesion) && $typeread['inputtime']) { $this->fun->setcookie($usersessionid, $addtime, $typeread['inputtime']); } elseif ($typeread['inputtime']) { $this->callmessage($this->lng['repeatinput'], $linkURL, $this->lng['gobackurlbotton']); } if ($inputclass == 'add') { $db_field = 'btid,upbid,adminid,userid,lng,title,content,username,email,qq,msn,address,tel,mobile,replynum,click,addtime,retime,isclass,istop,ipadd'; $db_values = "{$btid},0,0,{$userid},'{$lng}','{$title}','{$content}','{$username}','{$email}','{$qq}','{$msn}','{$address}','{$tel}','{$mobile}',0,0,{$addtime},0,{$isclass},0,'{$ipadd}'"; $this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')'); $insert_id = $this->db->insert_id(); $this->fun->setcookie('ecisp_home_seccode', null); if ($typeread['ispage'] == 2) { $linkURL = $this->get_link('forum', $typeread, admin_LNG); } if ($typeread['ismail'] && $this->CON['is_email']) { $mailcode = $typeread['mailcode'] ? $typeread['mailcode'] : 'forumnew'; $putmail = $typeread['putmail'] ? $typeread['putmail'] : $this->CON['admine_mail']; $this->forumsendmail($mailcode, $insert_id, $putmail); } if ($typeread['issms'] && $this->CON['is_moblie']) { $messageArray = array('title' => $title); $mobile = $this->CON['moblie_number']; if ($typeread['smscode']) { $this->membersmssend($messageArray, $mobile, $typeread['smscode']); } } $this->callmessage($this->lng['forum_input_ok'], $linkURL, $this->lng['gobackurlbotton']); } if ($inputclass == 'reinput') { $upbid = intval($this->fun->accept('bid', 'P')); $reemail = $this->fun->accept('reemail', 'P'); $db_where = "bid={$upbid} AND isclass=1"; $db_set = "replynum=replynum+1,retime={$addtime}"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); $db_field = 'btid,upbid,adminid,userid,lng,title,content,username,email,qq,msn,address,tel,mobile,replynum,click,addtime,retime,isclass,istop,ipadd'; $db_values = "{$btid},{$upbid},0,{$userid},'{$lng}','{$title}','{$content}','{$username}','{$email}','{$qq}','{$msn}','{$address}','{$tel}','{$mobile}',0,0,{$addtime},0,{$isclass},0,'{$ipadd}'"; $this->db->query('INSERT INTO ' . $db_table . ' (' . $db_field . ') VALUES (' . $db_values . ')'); $this->fun->setcookie('ecisp_home_seccode', null); if ($typeread['ismail'] && $this->CON['is_email']) { if (preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $reemail)) { $this->forumsendmail('forumre', $upbid, $reemail); } } $this->callmessage($this->lng['forum_input_ok'], $linkURL, $this->lng['gobackurlbotton']); } }
function in_list() { parent::start_pagetemplate(); include_once admin_ROOT . 'public/class_pagebotton.php'; $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $page = $this->fun->accept('page', 'G'); $page = isset($page) ? intval($page) : 1; $pagesylte = 1; $pagemax = intval($this->CON['bbs_max_list']); $did = intval($this->fun->accept('did', 'G')); if (empty($did)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $readinfo = $this->get_documentview($did); if (!$readinfo['isclass'] || !$readinfo['ismess']) { exit("Information parameter error!"); } elseif ($readinfo['purview'] > 0) { parent::member_purview($readinfo['purview'], null, true); } $readinfo['link'] = $this->get_link('doc', $readinfo, admin_LNG); $this->pagetemplate->assign('read', $readinfo); $db_table = db_prefix . 'document_message'; $db_where = " WHERE isclass=1 AND did={$did}"; $countnum = $this->db_numrows($db_table, $db_where); if ($countnum > 0) { $numpage = ceil($countnum / $pagemax); } else { $numpage = 1; } $sql = "SELECT * FROM {$db_table} {$db_where} LIMIT 0,{$pagemax}"; $this->htmlpage = new PageBotton($sql, $pagemax, $page, $countnum, $numpage, $pagesylte, $this->CON['file_fileex'], 5, $this->lng['pagebotton'], $this->lng['gopageurl'], $this->CON['is_rewrite']); $sql = $this->htmlpage->PageSQL('dmid', 'down'); $rs = $this->db->query($sql); while ($rsList = $this->db->fetch_assoc($rs)) { $array[] = $rsList; } $this->pagetemplate->assign('pagetext', $this->htmlpage->PageStat($this->lng['pagetext'])); $this->pagetemplate->assign('pagebotton', $this->htmlpage->PageList()); $this->pagetemplate->assign('pagenu', $this->htmlpage->Bottonstyle(false)); $this->pagetemplate->assign('pagese', $this->htmlpage->pageSelect()); $this->pagetemplate->assign('pagevt', $this->htmlpage->Prevbotton()); $typeview = $this->get_type($readinfo['tid']); $current = !$typeview['upid'] ? $typeview['tid'] : $typeview['topid']; $this->pagetemplate->assign('array', $array); $this->pagetemplate->assign('path', 'article'); $this->pagetemplate->assign('current', $current); $this->pagetemplate->assign('did', $did); $link = $this->get_link('messlist', $read, $lng); $messform = $this->get_link('messform', $read, $lng); $ec_member_username = $this->member_cookieview('username'); if ($ec_member_username) { $reMem = $this->get_member($ec_member_username); $this->pagetemplate->assign('member', $reMem); } $this->pagetemplate->assign('seccodelink', $this->get_link('seccode')); $this->pagetemplate->assign('bbs_isseccode', $this->CON['bbs_isseccode']); $this->pagetemplate->assign('link', $link); $this->pagetemplate->assign('messform', $messform); $templatesDIR = $this->get_templatesdir('forum'); $templatefilename = $lng . '/' . $templatesDIR . '/message_list'; unset($array, $typeread, $readinfo, $LANPACK, $this->lng); $this->pagetemplate->display($templatefilename, 'message_list', false, '', admin_LNG); }
function in_zoom() { include_once admin_ROOT . 'public/ectemplates/ectemplates_image.php'; parent::start_pagetemplate(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $filename = $this->fun->accept('filename', 'G'); if (empty($filename)) { return false; } $w = intval($this->fun->accept('w', 'G')); $h = intval($this->fun->accept('h', 'G')); $width = empty($w) ? 200 : $w; $height = empty($h) ? 200 : $h; $iszoom = intval($this->fun->accept('iszoom', 'G')); $bgcolor = $this->fun->accept('bgcolor', 'G'); $bgcolor = empty($bgcolor) || !preg_match("/^#[a-zA-Z0-9]{3,6}\$/i", $bgcolor) ? !preg_match("/^#[a-zA-Z0-9]{3,6}\$/i", $this->CON['img_bgcolor']) ? '#ffffff' : $this->CON['img_bgcolor'] : $bgcolor; $picfile = admin_ROOT . $filename; $picfile = $this->picpath($picfile); if (!file_exists($picfile) && !is_file($picfile)) { return false; } $mime = $this->getMimeType($picfile); $imageinfo = getimagesize($picfile); if (!$imageinfo) { return false; } $newsfilepathname = $this->pagetemplate->cache_pic . $width . '_' . $height . '_' . md5($filename . $bgcolor) . '.' . $mime; if (!is_file($newsfilepathname)) { $imagescreat = new ectemplates_image(); $imagescreat->imagecreat($width, $height, $bgcolor, $picfile, $newsfilepathname, $iszoom); } $imgdata = fread(fopen($newsfilepathname, 'rb'), filesize($newsfilepathname)); header("content-type:{$imageinfo['mime']}"); echo $imgdata; }
function in_enquiryeditsave() { parent::start_pagetemplate(); parent::member_purview(0, $this->mlink['orderlist']); $eid = $this->fun->accept('eid', 'P'); if (empty($eid)) { $this->callmessage($this->lng['db_err'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); } $linkman = trim($this->fun->accept('linkman', 'P', true, true)); $sex = $this->fun->accept('sex', 'P'); $sex = empty($sex) ? 0 : $sex; $country = intval($this->fun->accept('cityone', 'P')); $country = empty($country) ? 0 : $country; $province = intval($this->fun->accept('citytwo', 'P')); $province = empty($province) ? 0 : $province; $city = intval($this->fun->accept('citythree', 'P')); $city = empty($city) ? 0 : $city; $district = intval($this->fun->accept('district', 'P')); $district = empty($district) ? 0 : $district; $address = trim($this->fun->accept('address', 'P', true, true)); $zipcode = trim($this->fun->accept('zipcode', 'P', true, true)); $tel = trim($this->fun->accept('tel', 'P', true, true)); $fax = trim($this->fun->accept('fax', 'P', true, true)); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); $content = trim($this->fun->accept('content', 'P', true, true)); $db_where = 'eid=' . $eid; $db_table = db_prefix . 'enquiry'; $db_set = "linkman='{$linkman}',sex={$sex},country={$country},province={$province},city={$city},district={$district},address='{$address}',\n\t\tzipcode='{$zipcode}',tel='{$tel}',fax='{$fax}',mobile='{$mobile}',content='{$content}'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); $this->callmessage($this->lng['enquiry_memberinfoedit_ok'], $_SERVER['HTTP_REFERER'], $this->lng['gobackurlbotton']); }
function in_save() { parent::start_pagetemplate(); parent::member_purview(); $lng = admin_LNG == 'big5' ? $this->CON['is_lancode'] : admin_LNG; $inputclass = $this->fun->accept('inputclass', 'R'); $upurl = $this->fun->accept('upurl', 'R'); $userid = intval($this->fun->accept('userid', 'P')); $username = $this->fun->accept('username', 'P'); if (empty($userid) || empty($username)) { $linkURL = $this->mlink['center']; $this->callmessage($this->lng['member_edit_ok'], $linkURL, $this->lng['gobackurlbotton']); } $email = trim($this->fun->accept('email', 'P')); $question = trim($this->fun->accept('question', 'P', true, true)); $answer = trim($this->fun->accept('answer', 'P', true, true)); $alias = trim($this->fun->accept('alias', 'P', true, true)); $sex = $this->fun->accept('sex', 'P'); $sex = empty($sex) ? 0 : $sex; $tel = trim($this->fun->accept('tel', 'P', true, true)); $mobile = trim($this->fun->accept('mobile', 'P', true, true)); $birthday = $this->fun->accept('birthday', 'P'); $birthday = empty($birthday) ? 0 : $this->fun->formatdate($birthday, 4); $country = intval($this->fun->accept('cityone', 'P')); $country = empty($country) ? 0 : $country; $province = intval($this->fun->accept('citytwo', 'P')); $province = empty($province) ? 0 : $province; $city = intval($this->fun->accept('citythree', 'P')); $city = empty($city) ? 0 : $city; $district = intval($this->fun->accept('district', 'P')); $district = empty($district) ? 0 : $district; $address = trim($this->fun->accept('address', 'P', true, true)); $zipcode = trim($this->fun->accept('zipcode', 'P', true, true)); $zipcode = empty($zipcode) ? 0 : $zipcode; $msn = trim($this->fun->accept('msn', 'P', true, true)); $qq = $this->fun->accept('qq', 'P'); $qq = empty($qq) ? 0 : $qq; $db_table = db_prefix . 'member'; $db_table2 = db_prefix . 'member_value'; $date = time(); $linkURL = $_SERVER['HTTP_REFERER']; if ($inputclass == 'editinfo') { $mvid = intval($this->fun->accept('mvid', 'P')); $modelatt = $this->get_memberatt_array($lng); if (is_array($modelatt)) { $modelarray = array(); foreach ($modelatt as $key => $value) { if ($value['inputtype'] == 'htmltext') { $value['accept'] = 'html'; } elseif ($value['inputtype'] == 'checkbox') { $value['accept'] = 'checkbox'; } elseif ($value['inputtype'] == 'string' || $value['inputtype'] == 'img' || $value['inputtype'] == 'addon' || $value['inputtype'] == 'video' || $value['inputtype'] == 'select' || $value['inputtype'] == 'radio' || $value['inputtype'] == 'selectinput') { $value['accept'] = 'text'; } elseif ($value['inputtype'] == 'editor' || $value['inputtype'] == 'text') { $value['accept'] = 'editor'; } elseif ($value['inputtype'] == 'int' || $value['inputtype'] == 'float' || $value['inputtype'] == 'decimal') { $value['accept'] = 'int'; } elseif ($value['inputtype'] == 'datetime') { $value['accept'] = 'data'; } $modelarray[] = $value; } $userinstall = null; $userinstalldb = null; foreach ($modelarray as $key => $value) { $userinstall .= $value['attrname'] . ','; if ($value['accept'] == 'int') { $valuestr = $this->fun->accept($value['attrname'], 'P'); $valuestr = empty($valuestr) ? 0 : $valuestr; $userinstalldb .= "{$valuestr},"; $userupdatedb .= $value['attrname'] . "={$valuestr},"; } elseif ($value['accept'] == 'html') { $valuestr = $this->fun->accept($value['attrname'], 'P'); $valuestr = empty($valuestr) ? '' : $this->fun->Text2Html($valuestr); $userinstalldb .= "'{$valuestr}',"; $userupdatedb .= $value['attrname'] . "='{$valuestr}',"; } elseif ($value['accept'] == 'editor' || $value['accept'] == 'text') { $valuestr = $this->fun->accept($value['attrname'], 'P'); $userinstalldb .= "'{$valuestr}',"; $userupdatedb .= $value['attrname'] . "='{$valuestr}',"; } elseif ($value['accept'] == 'data') { $valuestr = $this->fun->accept($value['attrname'], 'P'); $valuestr = empty($valuestr) ? 0 : strtotime($valuestr); $userinstalldb .= "{$valuestr},"; $userupdatedb .= $value['attrname'] . "={$valuestr},"; } elseif ($value['accept'] == 'checkbox') { $valuestr = $this->fun->accept($value['attrname'], 'P'); $valuestr = is_array($valuestr) ? implode(',', $valuestr) : ''; $userinstalldb .= "'{$valuestr}',"; $userupdatedb .= $value['attrname'] . "='{$valuestr}',"; } } } $db_where = 'userid=' . $userid; $db_set = "sex={$sex},birthday={$birthday},country={$country},province={$province},city={$city},district={$district},alias='{$alias}',\n\t\t\taddress='{$address}',zipcode={$zipcode},tel='{$tel}',mobile='{$mobile}',qq={$qq},msn='{$msn}'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); if ($userinstalldb) { if ($mvid) { $db_where = 'userid=' . $userid . ' AND mvid=' . $mvid; $db_values = substr($userupdatedb, 0, strlen($userupdatedb) - 1); $this->db->query('UPDATE ' . $db_table2 . ' SET ' . $db_values . ' WHERE ' . $db_where); } else { $db_field = $userinstall . 'userid'; $db_values = $userinstalldb . $userid; $this->db->query('INSERT INTO ' . $db_table2 . ' (' . $db_field . ') VALUES (' . $db_values . ')'); } } $linkURL = $this->mlink['center']; $this->callmessage($this->lng['member_edit_ok'], $linkURL, $this->lng['gobackurlbotton']); } if ($inputclass == 'editpassword') { if ($this->CON['mem_isucenter']) { include_once admin_ROOT . 'public/uc_client/client.php'; } $oldpassword = md5($this->fun->accept('oldpassword', 'P')); $password = md5($this->fun->accept('password', 'P')); $password_uc = $this->fun->accept('password', 'P'); $oldpassword_uc = $this->fun->accept('oldpassword', 'P'); $db_where = "userid= {$userid} AND username='******' AND password='******'"; $db_sql = "SELECT * FROM {$db_table} WHERE {$db_where}"; $rsMember = $this->db->fetch_first($db_sql); if (!$rsMember) { $linkURL = $this->mlink['memedit_password']; $this->callmessage($this->lng['password_input_err'], $linkURL, $this->lng['gobackbotton']); } else { $db_set = "password='******'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); if ($this->CON['mem_isucenter']) { $data = uc_get_user($username); if ($data) { list($uid2, $username2, $email2) = $data; uc_user_edit($username, $oldpassword_uc, $password_uc, $email2); } } $linkURL = $this->mlink['quit']; $this->callmessage($this->lng['password_ok'], $linkURL, $this->lng['out_botton']); } } if ($inputclass == 'editmail') { if ($this->CON['mem_isucenter']) { include_once admin_ROOT . 'public/uc_client/client.php'; } $linkURL = $this->mlink['memedit_email']; if (!preg_match("/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+\$/i", $email)) { $this->callmessage($this->lng['email_err'], $linkURL, $this->lng['gobackbotton']); } $password = md5($this->fun->accept('password', 'P')); $password_uc = $this->fun->accept('password', 'P'); $db_where = "userid= {$userid} AND username='******' AND password='******'"; $db_sql = "SELECT * FROM {$db_table} WHERE {$db_where}"; $rsMember = $this->db->fetch_first($db_sql); if (!$rsMember) { $this->callmessage($this->lng['password_input_err'], $linkURL, $this->lng['gobackbotton']); } else { $db_set = "email='{$email}'"; $this->db->query('UPDATE ' . $db_table . ' SET ' . $db_set . ' WHERE ' . $db_where); if ($this->CON['mem_isucenter']) { $data = uc_get_user($username); if ($data) { list($uid2, $username2, $email2) = $data; uc_user_edit($username, $password_uc, $password_uc, $email); } } $linkURL = $this->mlink['center']; $this->callmessage($this->lng['email_edit_ok'], $linkURL, $this->lng['gobackurlbotton']); } } }