function if_siteclosed($sid) { global $cmsclosed, $subsites, $cmsclosedreason, $wap_status; $closed = empty($sid) ? $cmsclosed : $subsites[$sid]['closed']; $closed && message(empty($cmsclosedreason) ? wap_lang('wap_defaultclosedreason') : mnl2br($cmsclosedreason)); $wap_status || message('wap_close'); }
function if_siteclosed($sid) { global $cmsclosed, $subsites, $cmsclosedreason; $closed = empty($sid) ? $cmsclosed : $subsites[$sid]['closed']; if ($closed) { message(empty($cmsclosedreason) ? lang('defaultclosedreason') : mnl2br($cmsclosedreason)); } }
<?php include_once dirname(dirname(__FILE__)) . '/include/general.inc.php'; include_once M_ROOT . './include/common.fun.php'; include_once M_ROOT . './include/parse.fun.php'; $cmsclosed && message(empty($cmsclosedreason) ? lang('defaultclosedreason') : mnl2br($cmsclosedreason)); $mspacedisabled && message(lang('mspacedisabled')); parse_str(un_virtual($_SERVER['QUERY_STRING'])); $mid = empty($mid) ? 0 : max(0, intval($mid)); $mcaid = empty($mcaid) ? 0 : max(0, intval($mcaid)); $ucid = empty($ucid) ? 0 : max(0, intval($ucid)); $page = empty($page) ? 1 : max(1, intval($page)); $addno = empty($addno) ? 0 : 1; include_once M_ROOT . './include/mparse.fun.php'; $temparr = array('mid' => $mid, 'mcaid' => $mcaid, 'ucid' => $ucid); $cnstr = ($mcaid ? "mcaid={$mcaid}" : '') . ($ucid ? "&ucid={$ucid}" : ''); if ($cachemscircle && (!$mslistcachenum || $page <= $mslistcachenum)) { $cachefile = htmlcac_dir('ms', 'm' . $mid % 100, 1) . cac_namepre($mid, $cnstr) . '_' . $page . '.php'; if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cachemscircle * 60) { mexit(read_htmlcac($cachefile)); } } $_da = array_merge($_da, mcn_parse($temparr)); $tplname = mcn_tpl($temparr, $addno); if (!$tplname) { message('definereltem'); } $_mp = array(); $_mp['durlpre'] = $_da['indexurl' . ($addno ? $addno : '')] . '&page={$page}'; $_mp['static'] = 0; $_mp['nowpage'] = max(1, intval($page));
$fuser = $pm['msgfrom']; break; } } if ($fuser) { $str = ''; foreach ($days as $k => $v) { $str .= ' ' . ($day == $k ? $v : "<a href=\"?action=pmbox&box={$box}&page={$page}&fid={$fid}&day={$k}\">{$v}</a>"); } tabheader(lang('fupmrecord', $fuser) . $str . ($fuser ? " >><a href=\"?action=pmsend&box={$box}&page={$page}&tonames=" . rawurlencode($pm['msgfrom']) . "\">" . lang('reply') . "</a>" : '')); tabfooter(); } tabheader(lang('pmcontent')); $pm = end($ucpm); if ($fuser == $pm['msgfrom']) { array_pop($ucpm); $fuser ? trbasic(lang('senduser'), '', ($pm['new'] ? '[<b style="color:red">new</b>]' : '') . $fuser, '') : trbasic(lang('pmtitle'), '', ($pm['msgtoid'] && $pm['new'] ? '[<b style="color:red">new</b>]' : '') . ($pm['subject'] ? $pm['subject'] : lang('syspm')), ''); trbasic(lang('sendtime'), '', date("{$dateformat} {$timeformat}", $pm['dateline']), ''); $fuser && trbasic(lang('pmtitle'), '', mhtmlspecialchars($pm['subject']), ''); trbasic(lang('pmcontent'), '', mnl2br(mhtmlspecialchars($pm['message'])), ''); } if (!empty($ucpm)) { echo '<tr><td class="item2" colspan="2"><b>' . lang('historypm') . '</b></td></tr>'; foreach ($ucpm as $pm) { echo '<tr><td class="item2" colspan="2">' . ($fuser == $pm['msgfrom'] ? ($pm['new'] ? '[<b style="color:red">new</b>]' : '') . lang('onformsay', $pm['msgfrom'], date("{$dateformat} {$timeformat}", $pm['dateline'])) : lang('onyousay', date("{$dateformat} {$timeformat}", $pm['dateline']))) . '</td></tr>' . '<tr><td class="item2" colspan="2">' . ($pm['subject'] ? '<b>' . mhtmlspecialchars($pm['subject']) . '</b><br />' : '') . mnl2br(mhtmlspecialchars($pm['message'])) . '</td></tr>'; } } tabfooter(); echo "<input class=\"button\" type=\"submit\" name=\"\" value=\"" . lang('goback') . "\" onclick=\"redirect('?action=pmbox&box={$box}&page={$page}')\">\n"; } mcfooter();
tabheader(lang('consultbasemessage'), 'fconsult', "?action=fconsult&aid={$aid}{$forwardstr}", 2, 1, 0, 1); trbasic(lang('consulttitle'), '', $fcatalog['title'] . ' - ' . $aedit->archive['subject'] . " <a href=\"?action=farchive&aid=" . $aedit->archive['aid'] . "\" onclick=\"return floatwin('open_consult',this)\">>>" . lang('detail') . "</a>", ''); trbasic(lang('addtime'), '', date("{$dateformat} {$timeformat}", $aedit->archive['createdate']), ''); trbasic(lang('qstate'), '', @$qstatearr[$aedit->archive['qstate']], ''); tabfooter(); tabheader(lang('consultcommulist')); $query = $db->query("SELECT * FROM {$tblprefix}consults WHERE aid='{$aid}' ORDER BY cid"); while ($item = $db->fetch_array($query)) { $cid = $item['cid']; trbasic('<b>' . $item['mname'] . '</b> ' . (empty($item['reply']) ? lang('consult') : lang('reply')) . ' :<br>' . date("{$dateformat} {$timeformat}", $item['createdate']), '', '<br>' . $item['content'] . '<br> ', ''); } tabfooter(); if ($aedit->archive['qstate'] != 'close') { tabheader(lang('continueconsult'), 'fconsultadd', '?action=consult&aid=' . $aid . '&forward=' . rawurlencode($forward)); trbasic(lang('consultcontent'), 'contentadd', '', 'btextarea'); tabfooter('bfconsultadd'); } else { tabheader(lang('continueconsult')); trbasic(lang('consultcontent'), '', lang('overconsult'), ''); tabfooter(); } } else { $aedit->archive['qstate'] == 'close' && mcmessage('thconiteclo', axaction(2, M_REFERER)); $contentadd = empty($contentadd) ? '' : trim($contentadd); empty($contentadd) && mcmessage('datamissing', axaction(2, M_REFERER)); $fcatalog['culength'] && ($contentadd = cutstr($contentadd, $fcatalog['culength'])); $contentadd = mnl2br(mhtmlspecialchars($contentadd)); $db->query("INSERT INTO {$tblprefix}consults SET\n\t\t\t\t aid='{$aid}', \n\t\t\t\t content='{$contentadd}', \n\t\t\t\t mid='{$memberid}', \n\t\t\t\t mname='" . $curuser->info['mname'] . "', \n\t\t\t\t createdate='{$timestamp}'\n\t\t\t\t "); $db->query("UPDATE {$tblprefix}farchives SET qstate='new',updatedate='{$timestamp}' WHERE aid='{$aid}'"); mcmessage('addconsultsucceed', axaction(6, "?action=fconsult&aid={$aid}")); }
header("Content-type: application/xml"); echo "<?xml version=\"1.0\" encoding=\"{$mcharset}\"?>\n<root><![CDATA["; echo $message; echo ']]></root>'; die; } else { include_once M_ROOT . './include/parse.fun.php'; include_once M_ROOT . "./include/upload.cls.php"; include_once M_ROOT . "./include/fields.cls.php"; if (empty($forward)) { $forward = empty($enable_pptout) || $pptout_file != 'phpwind' ? M_REFERER : $cms_abs; } $forwardstr = "forward=" . urlencode($forward); if_siteclosed($sid); $memberid && message('dorepeatregist', '', "<a href=\"login.php?action=logout\">" . lang('logout') . "</a>"); $registerclosed && message(empty($regclosedreason) ? 'defaultregclosedreason' : mnl2br($regclosedreason)); $mchid = empty($mchid) ? 1 : max(1, intval($mchid)); if (!($mchannel = $mchannels[$mchid])) { message('choosememchann'); } if (!submitcheck('register')) { if ($enable_pptin && !empty($pptin_url) && $pptin_register) { $url = $pptin_url . $pptin_register; $url .= (strpos($url, '?') ? '&' : '?') . "{$getval}=" . rawurlencode($forward); header('location:' . $url); exit; } if (!($tplname = @$mchannel['addtpl'])) { //系统自带的的模板 include_once M_ROOT . './include/cheader.inc.php'; load_cache('mtconfigs');
trbasic(lang('casarrtim'), '', $item['receivedate'] ? date("{$dateformat} {$timeformat}", $item['receivedate']) : '-', ''); trbasic(lang('currsavtime'), '', $item['transdate'] ? date("{$dateformat} {$timeformat}", $item['transdate']) : '-', ''); trbasic(lang('contaname'), 'itemnew[truename]', $item['truename']); trbasic(lang('contatelep'), 'itemnew[telephone]', $item['telephone']); trbasic(lang('contactemail'), 'itemnew[email]', $item['email']); trbasic(lang('remark'), 'itemnew[remark]', br2nl($item['remark']), 'textarea'); trspecial(lang('paywarrant') . " [" . "<a href=\"" . $item['warrant'] . "\" target=\"_blank\">" . lang('bigimage') . "</a>" . "]", 'itemnew[warrant]', $item['warrant'], 'image'); if ($item['transdate']) { tabfooter(); echo "<input class=\"button\" type=\"submit\" name=\"\" value=\"" . lang('goback') . "\" onclick=\"history.go(-1);\">"; } else { tabfooter('bpaydetail', lang('modify')); } a_guide('paydetail'); } else { include_once M_ROOT . "./include/upload.cls.php"; $itemnew['amount'] = max(0, round(floatval($itemnew['amount']), 2)); empty($itemnew['amount']) && amessage('inppayamo', M_REFERER); $itemnew['truename'] = trim(strip_tags($itemnew['truename'])); $itemnew['telephone'] = trim(strip_tags($itemnew['telephone'])); $itemnew['email'] = trim(strip_tags($itemnew['email'])); $itemnew['remark'] = mnl2br(mhtmlspecialchars($itemnew['remark'])); $c_upload = new cls_upload(); $itemnew['warrant'] = upload_s($itemnew['warrant'], $item['warrant'], 'image'); $c_upload->closure(1, $pid, 'pays'); $c_upload->saveuptotal(1); unset($c_upload); $db->query("UPDATE {$tblprefix}pays SET\n\t\t\t\t\t amount='{$itemnew['amount']}',\n\t\t\t\t\t truename='{$itemnew['truename']}',\n\t\t\t\t\t telephone='{$itemnew['telephone']}',\n\t\t\t\t\t email='{$itemnew['email']}',\n\t\t\t\t\t remark='{$itemnew['remark']}',\n\t\t\t\t\t warrant='{$itemnew['warrant']}' \n\t\t\t\t\t WHERE pid='{$pid}'\n\t\t\t\t\t "); amessage('paymesmodfin', $forward); } }
function pre_deal() { $this->temparr['limits'] = empty($this->tag['limits']) ? 10 : $this->tag['limits']; switch ($this->tclass) { case 'archives': global $db, $tblprefix; if ($sqlstr = arc_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } } break; case 'marchives': global $db, $tblprefix; if ($sqlstr = marc_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } } break; case 'alarchives': //辑内文档列表 global $db, $tblprefix; if ($sqlstr = alarc_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } } break; case 'functions': //自定函数列表 global $templatedir; @(include_once M_ROOT . "./template/{$templatedir}/function/utags.fun.php"); $this->temparr['nowpage'] = $this->nowpage; $this->items = functions_arr($this->tag, $this->temparr, $this->tmode); break; case 'relates': //相关文档列表 global $db, $tblprefix; if ($sqlstr = rel_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } } break; case 'farchives': //附属信息列表 global $db, $tblprefix, $m_thumb; if ($sqlstr = farc_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($row = $db->fetch_array($query)) { $row['arcurl'] = view_farcurl($row['aid'], $row['arcurl']); arr_tag2atm($row, 'f'); $this->items[] = $row; } } break; case 'commus': //交互记录列表 global $db, $tblprefix, $commus, $fields, $curuser; if ($sqlstr = cu_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($row = $db->fetch_array($query)) { $this->items[] = $row; } } break; case 'mcommus': //交互记录列表 global $db, $tblprefix, $mcommus, $fields, $curuser; if ($sqlstr = mcu_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($row = $db->fetch_array($query)) { $this->items[] = $row; } } break; case 'members': //会员列表 global $db, $tblprefix; if ($sqlstr = mem_sqlstr($this->tag, $this->temparr, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($row = $db->fetch_array($query)) { $this->items[] = $row; } } $this->no_ctag = 1; break; case 'searchs': //搜索文档列表 global $db, $tblprefix, $timestamp; $sqlstr = empty($this->tag['detail']) || empty($this->temparr['chid']) ? "SELECT a.* " : "SELECT a.*,c.*"; $validstr = !empty($this->tag['validperiod']) ? " AND (a.enddate='0' OR a.enddate>'{$timestamp}')" : ''; //有效期分析 $sqlstr .= $this->temparr['sqlstr'] . $validstr . ' ' . $this->temparr['orderstr'] . " LIMIT " . ($this->nowpage - 1) * $this->temparr['limits'] . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } break; case 'masearchs': //搜索文档列表 global $db, $tblprefix, $timestamp, $coyptes; $sqlstr = 'ma.*,m.mchid,m.caid'; foreach ($cotypes as $k => $v) { $sqlstr .= ",m.ccid{$k}"; } $sqlstr .= $this->temparr['sqlstr'] . " LIMIT " . ($this->nowpage - 1) * $this->temparr['limits'] . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($archive = $db->fetch_array($query)) { $this->items[] = $archive; } break; case 'msearchs': //搜索文档列表 global $db, $tblprefix; if ($this->tmode == 'c') { //可以引用$timestamp及其它公用参数 $sqlstr = "SELECT m.*,s.* "; $this->tag['sqlstr'] = stripslashes(str_replace('{$tblprefix}', $tblprefix, $this->tag['sqlstr'])); $this->tag['sqlstr'] = sqlstr_replace($this->tag['sqlstr'], $this->temparr); } else { $sqlstr = empty($this->tag['detail']) || empty($this->temparr['mchid']) ? "SELECT m.*,s.* " : "SELECT m.*,s.*,c.*"; } $sqlstr .= ($this->tmode == 'p' ? $this->temparr['sqlstr'] : $this->tag['sqlstr']) . " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($row = $db->fetch_array($query)) { $this->items[] = $row; } break; case 'outinfos': //自由调用列表 $this->items = outinfos_arr($this->tag, $this->temparr, $this->tmode, $this->nowpage); break; case 'catalogs': //类目列表//只需要先取出id global $acatalogs, $cotypes, $sid; $nsid = empty($this->tag['nsid']) ? 0 : intval($this->tag['nsid']); if (!$nsid) { $nsid = isset($temparr['nsid']) ? $temparr['nsid'] : $sid; //当前子站需要分析是否有传下来的id,否则认为是全局id } elseif ($nsid == -1) { $nsid = 0; } if ($nsid == -2) { $ncatalogs =& $acatalogs; $nsid = $sid; //为没有栏目因素的节点 } else { $ncatalogs = read_cache('catalogs', '', '', $nsid); } if ($this->tag['listby'] == 'ca') { $caids = array(); if (empty($this->tag['casource'])) { foreach ($ncatalogs as $k => $v) { if (empty($v['level'])) { $caids[] = $k; } } } elseif ($this->tag['casource'] == 1) { if (!empty($this->tag['caids'])) { $tcaids = explode(',', $this->tag['caids']); foreach ($tcaids as $k) { if (isset($ncatalogs[$k])) { $caids[] = $k; } } } } elseif ($this->tag['casource'] == 2) { //激活栏目的子栏目 if (!empty($this->temparr['caid'])) { foreach ($ncatalogs as $k => $v) { if ($v['pid'] == $this->temparr['caid']) { $caids[] = $k; } } } } elseif ($this->tag['casource'] == 3) { if (!empty($this->temparr['caid'])) { foreach ($ncatalogs as $k => $v) { if ($v['pid'] == $ncatalogs[$this->temparr['caid']]['pid']) { $caids[] = $k; } } } } elseif ($this->tag['casource'] == 4) { foreach ($ncatalogs as $k => $v) { if ($v['level'] == 1) { $caids[] = $k; } } } elseif ($this->tag['casource'] == 5) { foreach ($ncatalogs as $k => $v) { if ($v['level'] == 2) { $caids[] = $k; } } } if (!empty($this->tag['orderstr']) && $caids) { $dorder = array(); foreach ($caids as $k) { $catalog = read_cache('catalog', $k, '', $ncatalogs[$k]['sid']); if (!isset($catalog[$this->tag['orderstr']])) { break; } $dorder[] = $catalog[$this->tag['orderstr']]; } if ($dorder) { array_multisort($dorder, empty($this->tag['asc']) ? SORT_DESC : SORT_ASC, $caids); } } foreach ($caids as $k) { if ($this->temparr['limits'] > count($this->items)) { $this->items[] = array('caid' => $k, 'sid' => $ncatalogs[$k]['sid']); } } } else { $coid = str_replace('co', '', $this->tag['listby']); if (!($coclasses = read_cache('coclasses', $coid))) { return; } $ccids = array(); if (empty($this->tag['cosource' . $coid])) { foreach ($coclasses as $k => $v) { if (empty($v['level'])) { $ccids[] = $k; } } } elseif ($this->tag['cosource' . $coid] == 1 && !empty($this->tag['ccids' . $coid])) { $tccids = explode(',', $this->tag['ccids' . $coid]); foreach ($tccids as $k) { if (isset($coclasses[$k])) { $ccids[] = $k; } } } elseif ($this->tag['cosource' . $coid] == 2 && !empty($this->temparr['ccid' . $coid])) { foreach ($coclasses as $k => $v) { if ($v['pid'] == $this->temparr['ccid' . $coid]) { $ccids[] = $k; } } } elseif ($this->tag['cosource' . $coid] == 3 && !empty($this->temparr['ccid' . $coid])) { foreach ($coclasses as $k => $v) { if ($v['pid'] == $coclasses[$this->temparr['ccid' . $coid]]['pid']) { $ccids[] = $k; } } } elseif ($this->tag['cosource' . $coid] == 4) { foreach ($coclasses as $k => $v) { if ($v['level'] == 1) { $ccids[] = $k; } } } elseif ($this->tag['cosource' . $coid] == 5) { foreach ($coclasses as $k => $v) { if ($v['level'] == 2) { $ccids[] = $k; } } } if (!empty($this->tag['orderstr']) && $ccids) { $dorder = array(); foreach ($ccids as $k) { $coclass = read_cache('coclass', $coid, $k); if (!isset($coclass[$this->tag['orderstr']])) { break; } $dorder[] = $coclass[$this->tag['orderstr']]; } if ($dorder) { array_multisort($dorder, empty($this->tag['asc']) ? SORT_DESC : SORT_ASC, $ccids); } } foreach ($ccids as $k) { if ($this->temparr['limits'] > count($this->items)) { $this->items[] = array('ccid' => $k, 'sid' => $nsid); } } } unset($ncatalogs, $coclasses, $catalog, $coclass); break; case 'mcatalogs': //会员空间的类目列表 global $mcatalogs, $uclasses; //这里的空间栏目必须首先是当前所用模板方案的有效栏目 if ($this->tag['listby'] == 'ca') { //全部栏目 $caids = array(); if (empty($this->tag['casource'])) { foreach ($mcatalogs as $k => $v) { $this->items[] = $v; } } elseif ($this->tag['casource'] == 1) { //指定栏目 if (!empty($this->tag['caids'])) { $caids = explode(',', $this->tag['caids']); foreach ($mcatalogs as $k => $v) { if (in_array($k, $caids)) { $this->items[] = $v; } } } } } elseif ($this->tag['listby'] == 'uc') { if (!empty($this->temparr['mcaid'])) { //一定必须是激活栏目下的分类 foreach ($uclasses as $k => $v) { if ($v['mcaid'] == $this->temparr['mcaid']) { $this->items[] = $v; } } } } break; case 'vote': //投票模块 global $db, $tblprefix, $timestamp; $this->no_ctag = 1; $vid = empty($this->tag['vid']) ? empty($this->temparr['vid']) ? 0 : $this->temparr['vid'] : $this->tag['vid']; if (!$vid) { $this->ret_null = 1; return; } if (!($vote = $db->fetch_one("SELECT * FROM {$tblprefix}votes WHERE vid='{$vid}' AND checked=1 AND (enddate=0 OR enddate>{$timestamp})"))) { $this->ret_null = 1; return; } $vote['content'] = mnl2br($vote['content']); foreach (array('vid', 'subject', 'content', 'totalnum', 'enddate', 'mid', 'mname', 'createdate') as $var) { $this->temparr[$var] = $vote[$var]; } $query = $db->query("SELECT * FROM {$tblprefix}voptions WHERE vid='{$vid}' ORDER BY vieworder,vopid"); while ($item = $db->fetch_array($query)) { $item['input'] = !$vote['ismulti'] ? "<input type=\"radio\" value=\"" . $item['vopid'] . "\" name=\"vopids[]\">" : "<input type=\"checkbox\" value=\"" . $item['vopid'] . "\" name=\"vopids[]\">"; $item['percent'] = $vote['totalnum'] ? @round($item['votenum'] / $vote['totalnum'], 3) : 0; $item['percent'] = $item['percent'] * 100 . '%'; $this->items[] = $item; } unset($vote, $item); break; case 'votes': //投票列表 global $db, $tblprefix; if ($sqlstr = v_sqlstr($this->tag, $this->tmode)) { $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits']; $query = $db->query($sqlstr); while ($item = $db->fetch_array($query)) { $this->items[] = $item; } } break; case 'images': //有分页 $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), ($this->nowpage - 1) * $this->temparr['limits'], $this->temparr['limits']); if (!empty($tempfiles)) { foreach ($tempfiles as $k => $v) { $v['fid'] = $k; $v['url'] = view_atmurl($v['remote']); $this->items[] = $v; } } unset($tempfiles, $v); $this->no_ctag = 1; break; case 'files': $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']); if (!empty($tempfiles)) { foreach ($tempfiles as $k => $v) { $item = array(); $item['fid'] = $k; $item['url'] = view_atmurl($v['remote']); $item['title'] = $v['title']; !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']); $item['tname'] = $this->tag['tname']; $this->items[] = $item; } } unset($tempfiles, $v, $item); $this->no_ctag = 1; break; case 'medias': $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']); if (!empty($tempfiles)) { foreach ($tempfiles as $k => $v) { $item = array(); $item['fid'] = $k; $item['url'] = view_atmurl($v['remote']); $item['title'] = $v['title']; $item['player'] = empty($v['player']) ? 0 : $v['player']; !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']); $item['tname'] = $this->tag['tname']; $this->items[] = $item; } } unset($tempfiles, $v, $item); $this->no_ctag = 1; break; case 'flashs': $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']); if (!empty($tempfiles)) { foreach ($tempfiles as $k => $v) { $item = array(); $item['fid'] = $k; $item['url'] = view_atmurl($v['remote']); $item['title'] = $v['title']; $item['player'] = empty($v['player']) ? 0 : $v['player']; !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']); $item['tname'] = $this->tag['tname']; $this->items[] = $item; } } unset($tempfiles, $v, $item); $this->no_ctag = 1; break; case 'arcfee': $temps = fee_arr($this->tag, $this->temparr); empty($temps) && ($this->ret_null = 1); foreach ($temps as $k => $v) { $this->items[] = $v; } unset($temps, $v); $this->no_ctag = 1; break; case 'keywords': global $uwordlinks; load_cache('uwordlinks'); if (empty($uwordlinks)) { return; } $temps = @marray_slice($uwordlinks, 0, $this->temparr['limits']); foreach ($temps['swords'] as $k => $v) { $this->items[] = array('word' => $v, 'wordlink' => $temps['rwords'][$k]); } unset($temps, $k, $v); $this->no_ctag = 1; break; case 'subsites': global $subsites, $cmsname; if (empty($this->tag['source']) || $this->tag['source'] == 2 && is_array($this->tag['sids']) && in_array('0', $this->tag['sids'])) { $this->items[] = array('sid' => 0, 'siteurl' => view_siteurl(0), 'sitename' => $cmsname); } $i = 1; foreach ($subsites as $k => $v) { if ($i > $this->temparr['limits']) { break; } if ($this->tag['source'] < 2 || $this->tag['source'] == 2 && in_array($k, explode(',', $this->tag['sids']))) { $this->items[] = array('sid' => $k, 'siteurl' => view_siteurl($k), 'sitename' => $v['sitename']); $i++; } } break; case 'channels': global $channels; if (empty($channels) || !empty($this->tag['chsource']) && empty($this->tag['chids'])) { return; } $i = 1; foreach ($channels as $k => $v) { if ($i > $this->temparr['limits']) { break; } if (empty($this->tag['chsource']) || !empty($this->tag['chsource']) && in_array($k, explode(',', $this->tag['chids']))) { $this->items[] = array('chid' => $k, 'title' => $v['cname']); $i++; } } break; case 'mchannels': global $mchannels; if (empty($mchannels) || !empty($this->tag['chsource']) && empty($this->tag['chids'])) { return; } $i = 1; foreach ($mchannels as $k => $v) { if ($i > $this->temparr['limits']) { break; } if (empty($this->tag['chsource']) || !empty($this->tag['chsource']) && in_array($k, explode(',', $this->tag['chids']))) { $this->items[] = array('mchid' => $k, 'title' => $v['cname']); $i++; } } break; } }
$pmid = $pm['pmid']; $pm['viewed'] = empty($pm['viewed']) ? 'Y' : '-'; $pm['pmdate'] = date($dateformat, $pm['pmdate']); $itempm .= "<tr><td align=\"center\" class=\"item1\" width=\"40\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[{$pmid}]\" value=\"{$pmid}\">\n" . "<td class=\"item2\">" . mhtmlspecialchars($pm['title']) . "</td>\n" . "<td class=\"item\" width=\"120\">{$pm['fromuser']}</td>\n" . "<td class=\"item\" width=\"40\">{$pm['viewed']}</td>\n" . "<td class=\"item\" width=\"80\">{$pm['pmdate']}</td>\n" . "<td class=\"item\" width=\"40\"><a href=\"?action=pmbox&pmid={$pmid}&page={$page}\">" . lang('look') . "</a></td></tr>\n"; } $pmcount = $db->result_one("SELECT count(*) FROM {$tblprefix}pms {$wheresql}"); $multi = multi($pmcount, $mrowpp, $page, "?action=pmbox"); tabheader(lang('pmlist'), 'pmsedit', "?action=pmbox&page={$page}", 6); trcategory(array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" class=\"category\" onclick=\"checkall(this.form, 'delete', 'chkall')\">" . lang('del'), lang('title'), lang('senduser'), lang('noread'), lang('senddate'), lang('content'))); echo $itempm; tabfooter(); echo $multi; echo "<input class=\"button\" type=\"submit\" name=\"bpmbox\" value=\"" . lang('delete') . "\">" . "</form>\n"; } else { empty($delete) && mcmessage('choosedeltem', "?action=pmbox&page={$page}"); $pmidstr = "pmid " . multi_str($delete); $db->query("DELETE FROM {$tblprefix}pms WHERE {$pmidstr}", 'UNBUFFERED'); mcmessage('pmdelfinish', "?action=pmbox&page={$page}"); } } else { $pm = $db->fetch_one("SELECT * FROM {$tblprefix}pms WHERE toid={$memberid} AND pmid=" . $pmid); empty($pm) && mcmessage('pointpm', "?action=pmbox&page={$page}"); tabheader(lang('pmcontentsetting')); trbasic(lang('pmtitle'), '', mhtmlspecialchars($pm['title']), ''); trbasic(lang('senduser'), '', $pm['fromuser'] . " >><a href=\"?action=pmsend&tonames=" . rawurlencode($pm['fromuser']) . "\">" . lang('nreply') . "</a>", ''); trbasic(lang('sendtime'), '', date("{$dateformat} {$timeformat}", $pm['pmdate']), ''); trbasic(lang('pmcontent'), '', '<br>' . mnl2br(mhtmlspecialchars($pm['content'])) . '<br> ', ''); tabfooter(); $query = $db->query("UPDATE {$tblprefix}pms SET viewed='1' WHERE pmid=" . $pmid); echo "<input class=\"button\" type=\"submit\" name=\"\" value=\"" . lang('goback') . "\" onclick=\"redirect('" . "?action=pmbox&page={$page}" . "')\">\n"; }
function redeal_content($fname, &$content) { //对不同类型的字段作一个再处理及限制 if ($content == '') { return; } empty($this->fields) && $this->gather_fields(); if (!($field = $this->fields[$fname])) { return; } if (in_array($field['datatype'], array('htmltext', 'text', 'select', 'mselect'))) { $content = trim($content); } elseif (in_array($field['datatype'], array('int', 'date'))) { $content = intval($content); } elseif ($field['datatype'] == 'float') { $content = floatval($content); } elseif ($field['datatype'] == 'multitext') { $content = mnl2br(trim($content)); } }
include M_ROOT . $u_tplname; } } elseif ($action == 'answerdetail') { $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . rawurlencode($forward); if (!($answer = $db->fetch_one("SELECT * FROM {$tblprefix}answers WHERE cid='{$cid}'"))) { amessage('chooseanswer'); } $commu = read_cache('commu', $answer['cuid']); $aedit = new cls_arcedit(); $aedit->set_aid($answer['aid']); $aedit->detail_data(); if (!submitcheck('banswerdetail')) { tabheader(lang('edit_answer'), 'answerdetail', "?entry=answers&action=answerdetail&cid={$cid}{$param_suffix}{$forwardstr}"); trbasic(lang('question_state'), '', $aedit->archive['closed'] || $aedit->archive['finishdate'] < $timestamp ? lang('question_closed') : lang('question_noclose'), ''); trbasic(lang('look_question'), '', "<a href=\"" . view_arcurl($aedit->archive) . "\" target=\"_blank\">>>" . mhtmlspecialchars($aedit->archive['subject']) . "</a>", ''); trbasic(lang('answer_content'), 'answernew[answer]', br2nl($answer['answer']), 'btextarea'); tabfooter('banswerdetail'); a_guide('answerdetail'); } else { ($aedit->archive['closed'] || $aedit->archive['finishdate'] < $timestamp) && amessage('questionclosed', axaction(2, M_REFERER)); $answernew['answer'] = empty($answernew['answer']) ? '' : trim($answernew['answer']); empty($answernew['answer']) && amessage('inputanswercontent', axaction(2, M_REFERER)); !empty($commu['setting']['minlength']) && strlen($answernew['answer']) < $commu['setting']['minlength'] && amessage('answerovermin', axaction(2, M_REFERER)); !empty($commu['setting']['maxlength']) && ($answernew['answer'] = cutstr($answernew['answer'], $commu['setting']['maxlength'])); $answernew['answer'] = mnl2br(mhtmlspecialchars($answernew['answer'])); $db->query("UPDATE {$tblprefix}answers SET answer='{$answernew['answer']}' WHERE cid='{$cid}'"); adminlog(lang('answer_content_edit'), lang('edit_answer_content')); amessage('updatesucceed', axaction(10, $forward), $commu['cname']); } }