function init() { if ($this->crcuarr) { return; } load_cache('currencys,crprojects,grouptypes'); global $db, $tblprefix, $curuser, $currencys, $crprojects, $grouptypes, $extract_mincount; $discount = array(); # $mincount = empty($extract_mincount) ? array() : array($extract_mincount); $mincount = array(isset($extract_mincount) ? $extract_mincount : 50); foreach ($grouptypes as $k => $v) { if (!$v['issystem'] && $curuser->info['grouptype' . $k]) { $usergroup = read_cache('usergroup', $k, $curuser->info['grouptype' . $k]); empty($usergroup[EX_DISCOUNT]) || ($discount[] = $usergroup[EX_DISCOUNT]); # empty($usergroup[EX_MINCOUNT]) || $mincount[] = $usergroup[EX_MINCOUNT]; } } # $discount = array(90);$mincount = array(10);#test code (empty($discount) || empty($mincount)) && mcmessage('no_extract_permission'); $this->crcuarr = array('ex' => array('cname' => lang('cashaccount'), 'unit' => lang('yuan'), 'count' => $curuser->info['currency0'], 'discount' => max($discount), 'mincount' => min($mincount))); foreach ($crprojects as $v) { $k = $curuser->info["currency{$v['scrid']}"]; if ($v['ecrid'] == 0 && $k) { $this->crcuarr[$v['scrid']] = array('cname' => $currencys[$v['scrid']]['cname'], 'unit' => $currencys[$v['scrid']]['unit'], 'count' => $k, 'discount' => round($v['ecurrency'] / $v['scurrency'], 4) * 100); } } }
function arc_mid($mid = 0, $matid = 0) { //从会员id读取档案资料 global $db, $tblprefix, $cotypes; if (!($mid = max(0, intval($mid)))) { return false; } $this->matid = max(0, intval($matid)); if (!($this->matid = max(0, intval($matid)))) { return false; } if (!($this->matype = read_cache('matype', $this->matid))) { return false; } $sqlstr = 'm.mchid,m.caid'; foreach ($cotypes as $k => $v) { $sqlstr .= ",m.ccid{$k}"; } if (!($this->archive = $db->fetch_one("SELECT ma.*,{$sqlstr} FROM {$tblprefix}members m LEFT JOIN {$tblprefix}marchives_{$this->matid} ma ON ma.mid=m.mid WHERE mid='{$mid}'"))) { $this->init(); return false; } if (!($this->maid = @$this->archive['maid'])) { $this->init(); return false; } arr_tag2atm($this->archive, 'ma'); return true; }
function field_votes($fname, $type, $id, $onlyvote = 1) { global $db, $tblprefix; $arr = array('archives' => array('fields', 'aid', 'chid'), 'members' => array('mfields', 'mid', 'mchid'), 'farchives' => array('ffields', 'aid', 'chid'), 'catalogs' => array('cafields', 'caid', ''), 'coclass' => array('ccfields', 'ccid', ''), 'offers' => array('ofields', 'cid', ''), 'replys' => array('rfields', 'cid', ''), 'comments' => array('cfields', 'cid', ''), 'mcfields' => array('mcomments', 'cid', ''), 'mrfields' => array('mreplys', 'cid', '')); if (!$fname || !$type || !$arr[$type][0] || !$id || !($item = $db->fetch_one("SELECT * FROM {$tblprefix}{$type} WHERE " . $arr[$type][1] . "='{$id}'", 'SILENT'))) { return array(); } $typeid = $arr[$type][2] ? $item[$arr[$type][2]] : ''; $fields = read_cache($arr[$type][0], $typeid); if (!($field = @$fields[$fname]) || $field['datatype'] != 'vote') { return array(); } $needadd = true; if ($type == 'archives' && !$field['mcommon']) { $tbl = $type . "_{$typeid}"; } elseif ($type == 'members') { $tbl = $type . ($field['mcommon'] ? '_sub' : "_{$typeid}"); } elseif ($type == 'farchives') { $tbl = $type . "_{$typeid}"; } else { $needadd = false; } if ($needadd && ($r = $db->fetch_one("SELECT * FROM {$tblprefix}{$tbl} WHERE " . $arr[$type][1] . "='{$id}'", 'SILENT'))) { $item += $r; } return empty($item[$fname]) || !($votes = @unserialize($item[$fname])) ? array() : ($onlyvote ? $votes : $item); }
function olc_cache_also_purchased($auto_expire = false, $refresh = false) { if ($refresh == true || !read_cache($cache_output, 'also_purchased-' . SESSION_LANGUAGE . '.cache' . $_GET['products_id'], $auto_expire)) { ob_start(); include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS; $cache_output = ob_get_contents(); ob_end_clean(); write_cache($cache_output, 'also_purchased-' . SESSION_LANGUAGE . '.cache' . $_GET['products_id']); } return $cache_output; }
function olc_cache_manufacturers_box($auto_expire = false, $refresh = false) { if ($refresh == true || !read_cache($cache_output, 'manufacturers_box-' . SESSION_LANGUAGE . '.cache' . $_GET['manufacturers_id'], $auto_expire)) { ob_start(); include box_code_script_path('manufacturers.php'); $cache_output = ob_get_contents(); ob_end_clean(); write_cache($cache_output, 'manufacturers_box-' . SESSION_LANGUAGE . '.cache' . $_GET['manufacturers_id']); } return $cache_output; }
function olc_cache_categories_box($auto_expire = false, $refresh = false) { global $cPath, $foo, $id, $categories_string; if ($refresh == true || !read_cache($cache_output, 'categories_box-' . SESSION_LANGUAGE . '.cache' . $cPath, $auto_expire)) { ob_start(); include box_code_script_path('categories.php'); $cache_output = ob_get_contents(); ob_end_clean(); write_cache($cache_output, 'categories_box-' . SESSION_LANGUAGE . '.cache' . $cPath); } return $cache_output; }
function cu_fields_deal($cuid = 0, $varpre = 'archivenew', &$oldarr) { global ${$varpre}, $currencys, $commus, $enablestock, $useredits, $curuser; if (!$cuid || !($commu = read_cache('commu', $cuid))) { return ''; } $freeupdate = empty($oldarr['checked']) || empty($useredits) || $curuser->check_allow('freeupdatecheck'); if ($commu['cclass'] == 'answer') { if (isset(${$varpre}['question'])) { if ($freeupdate || in_array('question', $useredits)) { ${$varpre}['question'] = trim(${$varpre}['question']); if (empty(${$varpre}['question'])) { return lang('questcontnotn'); } } } if (isset(${$varpre}['currency'])) { if ($freeupdate || in_array('currency', $useredits)) { if (empty($commu['setting']['crid']) || empty($currencys[$commu['setting']['crid']])) { return lang('choose_reward_cutype'); } if (isset($oldarr['crid']) && $commu['setting']['crid'] != $oldarr['crid']) { return lang('rewcurtychdomoarc'); } ${$varpre}['crid'] = $commu['setting']['crid']; ${$varpre}['currency'] = max(0, intval(${$varpre}['currency'])); if (!empty($oldarr['checked']) && isset($oldarr['currency']) && ${$varpre}['currency'] < $oldarr['currency']) { return lang('dontredrewcur'); } if (!empty($commu['setting']['mini']) && ${$varpre}['currency'] < $commu['setting']['mini']) { return lang('recusmmiva'); } if (!empty($commu['setting']['max']) && ${$varpre}['currency'] > $commu['setting']['max']) { ${$varpre}['currency'] = $commu['setting']['max']; } } } } elseif ($commu['cclass'] == 'purchase') { if (isset(${$varpre}['price'])) { if ($freeupdate || in_array('price', $useredits)) { ${$varpre}['price'] = max(0, round(${$varpre}['price'], 2)); } } if (isset(${$varpre}['storage'])) { if ($freeupdate || in_array('storage', $useredits)) { $enablestock && (${$varpre}['storage'] = max(0, intval(${$varpre}['storage']))); } } } return ''; }
function unyaml($file) { static $yaml = false; if ($_SERVER['HTTP_HOST'] != 'localhost:8000') { if (cache_exists($file)) { return read_cache($file); } } if (!$yaml) { $yaml = new sfYamlParser(); } $data = $yaml->parse(file_get_contents($file)); $data = fix_comments($data); write_cache($file, $data); return $data; }
function get_db_cache($sql, &$var, $filename, $refresh = false) { $var = array(); // check for the refresh flag and try to the data if ($refresh == true || !read_cache($var, $filename)) { // Didn' get cache so go to the database. // $conn = mysql_connect("localhost", "apachecon", "apachecon"); $res = xtc_db_query($sql); // if ($err = mysql_error()) trigger_error($err, E_USER_ERROR); // loop through the results and add them to an array while ($rec = xtc_db_fetch_array($res)) { $var[] = $rec; } // write the data to the file write_cache($var, $filename); } }
function arc_allowstatic(&$archive) { //文档页是否允许静态 global $catalogs, $cotypes, $permissions, $vcps; if (empty($archive['checked'])) { return false; } if (!empty($vcps['sale'][$archive['salecp']])) { return false; } if ($archive['rpmid'] > 0) { return false; } $pmids = array(); $catalog = read_cache('catalog', $archive['caid'], '', $archive['sid']); if (!empty($catalog['taxcp']) && !empty($vcps['tax'][$catalog['taxcp']])) { return false; } if (!empty($catalog['rpmid']) && $archive['rpmid'] == -1) { $pmids[] = $catalog['rpmid']; } foreach ($cotypes as $coid => $cotype) { //任务一个类目都可以否决生成静态 $ccids = array_filter(explode(',', $archive["ccid{$coid}"])); foreach ($ccids as $ccid) { $coclass = read_cache('coclass', $coid, $ccid); if (!empty($coclass['taxcp']) && !empty($vcps['tax'][$coclass['taxcp']])) { return false; } if (!empty($cotype['permission']) && !empty($coclass['rpmid']) && $archive['rpmid'] == -1) { $pmids[] = $coclass['rpmid']; } } } unset($catalog, $coclass); if (!$pmids) { return true; } $vpmids = array(); foreach ($permissions as $k => $v) { if (in_array($k, $pmids) && $v['aread']) { $vpmids[] = $k; } } return $vpmids ? false : true; }
function read($cid = 0, $cclass = 'offer') { global $db, $tblprefix, $ofields, $rfields, $cfields; if (!in_array($cclass, array('offer', 'reply', 'comment'))) { return $this->err_no(1); } if (!$cid) { return $this->err_no(1); } if ($this->info) { return 0; } if (!($this->info = $db->fetch_one("SELECT cu.*,cu.createdate AS ucreatedate,a.sid,a.createdate,a.caid,a.chid,a.customurl,a.subject FROM {$tblprefix}" . $cclass . "s cu LEFT JOIN {$tblprefix}archives a ON a.aid=cu.aid WHERE cu.cid='{$cid}'"))) { return $this->err_no(1); //指定的交互记录不存在 } $this->cid = $cid; $this->cclass = $cclass; if (!($this->aid = $this->info['aid'])) { return $this->err_no(2); } //文档主体不存在 $channel = read_cache('channel', $this->info['chid']); if (!$channel[$cclass] || !($this->commu = read_cache('commu', $channel[$cclass]))) { return $this->err_no(3); } //当前文档指定的交互设置不存在 cu_checkend($this->info, $cclass); $this->citems = empty($this->commu['setting']['citems']) ? array() : explode(',', $this->commu['setting']['citems']); $this->useredits = empty($this->commu['setting']['useredits']) ? array() : explode(',', $this->commu['setting']['useredits']); $fvar = substr($cclass, 0, 1) . 'fields'; global ${$fvar}; foreach (${$fvar} as $k => $v) { if (in_array($k, $this->citems)) { $this->fields[$k] = $v; if ($v['isfunc']) { $this->func = 1; } } } if ($this->commu['func']) { $this->func = 1; } unset($channel, $v); return 0; }
function arcid($aid) { global $db, $tblprefix, $fcatalogs, $fchannels; $aid = max(0, intval($aid)); if (!$aid) { return false; } if (!($this->archive = $db->fetch_one("SELECT * FROM {$tblprefix}farchives WHERE aid='{$aid}'"))) { $this->init(); return false; } $this->aid = $this->archive['aid']; $this->channel = $fchannels[$this->archive['chid']]; $this->catalog = read_cache('fcatalog', $this->archive['fcaid']); if ($archive = $db->fetch_one("SELECT * FROM {$tblprefix}farchives_" . $this->archive['chid'] . " WHERE aid='" . $this->aid . "'")) { $this->archive = array_merge($this->archive, $archive); unset($archive); } arr_tag2atm($this->archive, 'f'); $this->archive['catalog'] = $fcatalogs[$this->archive['fcaid']]['title']; $this->archive['channle'] = $this->channel['cname']; return true; }
function tep_cache_also_purchased($auto_expire = false, $refresh = false) { global $_GET, $language, $languages_id; $cache_output = ''; if (isset($_GET['products_id']) && is_numeric($_GET['products_id'])) { if ($refresh == true || !read_cache($cache_output, 'also_purchased-' . $language . '.cache' . $_GET['products_id'], $auto_expire)) { ob_start(); include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS; $cache_output = ob_get_contents(); ob_end_clean(); write_cache($cache_output, 'also_purchased-' . $language . '.cache' . $_GET['products_id']); } } return $cache_output; }
include_once M_ROOT . "./include/fields.cls.php"; include_once M_ROOT . "./include/upload.cls.php"; include_once M_ROOT . "./include/marcedit.cls.php"; $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . rawurlencode($forward); $maid = empty($maid) ? 0 : max(0, intval($maid)); $matid = empty($matid) ? 0 : max(0, intval($matid)); $aedit = new cls_marcedit(); $aedit->set_id($maid, $matid, 0); if (!$aedit->maid) { mcmessage('choosemarchive'); } if ($aedit->archive['mid'] != $memberid) { mcmessage('selectyoumarc'); } $fields = read_cache('mafields', $matid); if (!submitcheck('bmarchive')) { $a_field = new cls_field(); $submitstr = ''; tabheader($aedit->matype['cname'] . ' - ' . lang('contentsetting'), 'marchive', "?matid={$matid}&maid={$maid}&action=marchive{$param_suffix}{$forwardstr}", 2, 1, 1, 1); foreach ($fields as $k => $field) { if ($field['available'] && !$field['isadmin'] && !$field['isfunc']) { $a_field->init(); $a_field->field = $field; $a_field->oldvalue = isset($aedit->archive[$k]) ? $aedit->archive[$k] : ''; $a_field->trfield('marchivenew', '', 'ma', $matid); $submitstr .= $a_field->submitstr; } } unset($a_field); tabfooter('bmarchive');
function deal_search($fpre = '') { //$fpre为查询字串中的表别名,如a.,c.,m.等 if (!$this->field['available'] || !$this->field['issearch']) { return; } $fn = $this->field['ename']; global ${$fn}, ${$fn . 'str'}, ${$fn . 'from'}, ${$fn . 'to'}, ${$fn . '_0'}, ${$fn . '_1'}, ${$fn . 'diff'}; if ($this->field['datatype'] == 'select') { if ($this->field['issearch'] == '1') { if (${$fn} != '') { $this->searchstr = $fpre . $fn . "='" . ${$fn} . "'"; $this->filterstr = $fn . "=" . rawurlencode(stripslashes(${$fn})); } } else { if (!empty(${$fn})) { ${$fn . 'str'} = implode("\t", ${$fn}); } elseif (!empty(${$fn . 'str'})) { ${$fn} = explode("\t", ${$fn . 'str'}); } else { ${$fn . 'str'} = ''; } if (${$fn . 'str'} != '') { $this->searchstr = $fpre . $fn . " " . multi_str(${$fn}); $this->filterstr = $fn . "str=" . rawurlencode(stripslashes(${$fn . 'str'})); } } } elseif ($this->field['datatype'] == 'mselect') { if ($this->field['issearch'] == '1') { if (${$fn} != '') { $this->searchstr = $fpre . $fn . " LIKE '%" . str_replace(array(' ', '*'), '%', addcslashes(${$fn}, '%_')) . "%'"; $this->filterstr = $fn . "=" . rawurlencode(stripslashes(${$fn})); } } else { if (!empty(${$fn})) { ${$fn . 'str'} = implode("\t", ${$fn}); } elseif (!empty(${$fn . 'str'})) { ${$fn} = explode("\t", ${$fn . 'str'}); } else { ${$fn . 'str'} = ''; } if (${$fn . 'str'} != '') { foreach (${$fn} as $v) { $this->searchstr .= ($this->searchstr ? ' OR ' : '') . $fpre . $fn . " LIKE '%" . str_replace(array(' ', '*'), '%', addcslashes($v, '%_')) . "%'"; } $this->searchstr = '(' . $this->searchstr . ')'; $this->filterstr = $fn . "str=" . rawurlencode(stripslashes(${$fn . 'str'})); } } } elseif ($this->field['datatype'] == 'text') { ${$fn} = empty(${$fn}) ? '' : cutstr(trim(${$fn}), 20, ''); if (${$fn} != '') { $this->searchstr = $this->field['issearch'] == 1 ? $fpre . $fn . "='" . ${$fn} . "'" : $fpre . $fn . " LIKE '%" . str_replace(array(' ', '*'), '%', addcslashes(${$fn}, '%_')) . "%'"; $this->filterstr = $fn . "=" . rawurlencode(stripslashes(${$fn})); } } elseif ($this->field['datatype'] == 'cacc') { if (${$fn} = empty(${$fn}) ? 0 : max(0, intval(${$fn}))) { $arr = $this->field['length'] ? read_cache('coclasses', $this->field['length']) : read_cache('acatalogs'); $this->searchstr = caccsql($fpre . $fn, $this->field['issearch'] == 1 ? array(${$fn}) : cnsonids(${$fn}, $arr), $this->field['max']); $this->filterstr = $fn . "=" . ${$fn}; } } elseif ($this->field['datatype'] == 'map') { if (${$fn . 'diff'} = empty(${$fn . 'diff'}) ? 0 : abs(${$fn . 'diff'})) { $this->searchstr = mapsql(${$fn . '_0'}, ${$fn . '_1'}, ${$fn . 'diff'}, $this->field['issearch'], $fpre . $fn); $this->filterstr = $fn . '_0=' . ${$fn . '_0'} . '&' . $fn . '_1=' . ${$fn . '_1'} . '&' . $fn . 'diff=' . ${$fn . 'diff'}; } } elseif (in_array($this->field['datatype'], array('int', 'float', 'date'))) { if ($this->field['issearch'] == '1') { ${$fn} = trim(${$fn}); if ($this->field['datatype'] == 'date' && !isdate(${$fn}) || in_array($this->field['datatype'], array('int', 'float')) && !is_numeric(${$fn})) { ${$fn} = ''; } if (${$fn} != '') { $this->field['datatype'] == 'int' && (${$fn} = intval(${$fn})); $this->field['datatype'] == 'float' && (${$fn} = floatval(${$fn})); $this->searchstr = $this->field['datatype'] == 'date' ? $fpre . $fn . "='" . strtotime(${$fn}) . "'" : $fpre . $fn . "='" . ${$fn} . "'"; $this->filterstr = $fn . "=" . rawurlencode(${$fn}); } } else { ${$fn . 'from'} = trim(${$fn . 'from'}); if ($this->field['datatype'] == 'date' && !isdate(${$fn . 'from'}) || in_array($this->field['datatype'], array('int', 'float')) && !is_numeric(${$fn . 'from'})) { ${$fn . 'from'} = ''; } if (${$fn . 'from'} != '') { $this->field['datatype'] == 'int' && (${$fn . 'from'} = intval(${$fn . 'from'})); $this->field['datatype'] == 'float' && (${$fn . 'from'} = floatval(${$fn . 'from'})); $this->searchstr = $this->field['datatype'] == 'date' ? $fpre . $fn . ">='" . strtotime(${$fn . 'from'}) . "'" : $fpre . $fn . ">='" . ${$fn . 'from'} . "'"; $this->filterstr = $fn . "from=" . rawurlencode(${$fn . 'from'}); } ${$fn . 'to'} = trim(${$fn . 'to'}); if ($this->field['datatype'] == 'date' && !isdate(${$fn . 'to'}) || in_array($this->field['datatype'], array('int', 'float')) && !is_numeric(${$fn . 'to'})) { ${$fn . 'to'} = ''; } if (${$fn . 'to'} != '') { $this->field['datatype'] == 'int' && (${$fn . 'to'} = intval(${$fn . 'to'})); $this->field['datatype'] == 'float' && (${$fn . 'to'} = floatval(${$fn . 'to'})); $this->searchstr .= ($this->searchstr ? " AND " : "") . $fpre . $fn . "<'" . ($this->field['datatype'] == 'date' ? strtotime(${$fn . 'to'}) : ${$fn . 'to'}) . "'"; $this->filterstr .= ($this->filterstr ? '&' : '') . $fn . "to=" . rawurlencode(${$fn . 'to'}); } } } return; }
<?php //本页面只是修改回复资料 !defined('M_COM') && exit('No Permission'); load_cache('currencys,mrfields,mchannels'); include_once M_ROOT . "./include/fields.cls.php"; include_once M_ROOT . "./include/upload.cls.php"; include_once M_ROOT . "./include/mcuedit.cls.php"; $cid = empty($cid) ? 0 : max(0, intval($cid)); $cuid = $db->result_one("SELECT cuid FROM {$tblprefix}mreplys WHERE cid='{$cid}'"); if (!$cuid || !($mcommu = read_cache('mcommu', $cuid))) { mcmessage('setcommuitem'); } if (empty($mcommu['umdetail'])) { $catalogs =& $acatalogs; $amode = empty($amode) ? 0 : 1; $uedit = new cls_mcuedit(); if ($errno = $uedit->read($cid, 'reply')) { if ($errno == 1) { mcmessage('choosereply'); } if ($errno == 2) { mcmessage('choosereplyobject'); } if ($errno == 3) { mcmessage('setcommuitem'); } } if ($amode) { if ($uedit->info['mid'] != $memberid) { mcmessage('yntrap');
function follow_notpl($mode, $url, $player) { global $players, $player_width, $player_height; if ($mode == 'down') { down_url($url); } else { $item = array('url' => $url); load_cache('players'); $plid = empty($player) ? 0 : $player; if (!$plid) { $ext = strtolower(mextension($url)); foreach ($players as $k => $player) { if ($player['available'] && $player['ptype'] == $mode && in_array($ext, array_filter(explode(',', $player['exts'])))) { $plid = $k; break; } } } !$plid && message(lang('noplayer')); $player = read_cache('player', $plid); $item['width'] = empty($player_width) ? '100%' : $player_width; $item['height'] = empty($player_height) ? '100%' : $player_height; $_content = sqlstr_replace($player['template'], $item); mexit($_content); } }
//是否启动前导页 $pretpl = $arc->channel['pretpl']; if (!arc_allow($arc->archive, 'aread')) { //分析权限,如果有备用页,则进入备用页。 if (!$pretpl) { message('noarchbrowspermis'); } $ispre = 1; } if ($crids = $arc->arc_crids()) { //需要对当前用户扣值 $cridstr = ''; foreach ($crids['total'] as $k => $v) { $cridstr .= ($cridstr ? ',' : '') . abs($v) . $currencys[$k]['unit'] . $currencys[$k]['cname']; } $commu = read_cache('commu', 8); if (!empty($commu['setting']['autoarc'])) { //不自动扣值的情况:如有前导页,进前导页,否则提示出订阅链接,选择是否订阅 if (!$pretpl) { message('purarcwantpaycur' . $cridstr . "<br><br><a href=\"tools/subscribe.php?aid={$aid}\">>>" . lang('subscribe') . "</a>"); } $ispre = 1; } else { //自动扣值,当前会员扣值及向出售者支付积分 if (!$curuser->crids_enough($crids['total'])) { message(lang('subarcwantpaycur') . $cridstr . lang('younosubsarchivewantenoughcur')); } $curuser->updatecrids($crids['total'], 0, lang('subscribearchive')); $curuser->payrecord($arc->aid, 0, $cridstr, 1); if (!empty($crids['sale'])) { $actuser = new cls_userinfo();
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); aheader(); backallow('member') || amessage('no_apermission'); $backamember = backallow('amember'); if ($action == 'mreportsedit') { //分析页面设置 $nauid = empty($nauid) ? 0 : $nauid; $u_checked = -1; if ($nauid && ($u_url = read_cache('aurl', $nauid))) { $u_tplname = $u_url['tplname']; $u_onlyview = empty($u_url['onlyview']) ? 0 : 1; $vars = array('filters', 'lists', 'operates'); foreach ($grouptypes as $k => $v) { $vars[] = 'ugids' . $k; } foreach ($vars as $var) { if (!empty($u_url['setting'][$var])) { ${'u_' . $var} = explode(',', $u_url['setting'][$var]); } } } // empty($u_lists) && $u_lists = array('edit', 'usergroup', 'reportor', 'reporttime'); // empty($u_filters) && $u_filters = array('check', 'ugid1', 'date'); $mchid = empty($mchid) ? 0 : max(0, intval($mchid)); $page = !empty($page) ? max(1, intval($page)) : 1; submitcheck('bfilter') && ($page = 1); $viewdetail = empty($viewdetail) ? 0 : 1;
$cy_arr[] = lang('admin'); } trcategory($cy_arr); $itemstr = ''; while ($row = $db->fetch_array($query)) { $channel = read_cache('channel', $row['chid']); $selectstr = "<input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$row['aid']}]\" value=\"{$row['aid']}\">"; $row['arcurl'] = view_arcurl($row); $subjectstr = ($row['thumb'] ? lang('imged') : '') . " <a href={$row['arcurl']} target=\"_blank\">" . mhtmlspecialchars($row['subject']) . "</a>"; $catalogstr = @$catalogs[$row['caid']]['title']; $uclassstr = $row['ucid'] ? $ucidsarr[$row['ucid']] : '-'; $channelstr = @$channel['cname']; foreach ($cotypes as $k => $v) { ${'ccid' . $k . 'str'} = ''; if (!$v['self_reg'] && in_array('ccid' . $k, $u_lists) && $row['ccid' . $k]) { $coclasses = read_cache('coclasses', $k); ${'ccid' . $k . 'str'} = cnstitle($row['ccid' . $k], $v['asmode'], $coclasses); ///////////// } } $checkstr = $row['checked'] ? 'Y' : '-'; $validstr = !$row['enddate'] || $row['enddate'] > $timestamp ? 'Y' : '-'; $clicksstr = $row['clicks']; $commentsstr = $row['comments']; $replysstr = $row['replys']; $offersstr = $row['offers']; $ordersstr = $row['orders']; $ordersumstr = $row['ordersum']; $favoritesstr = $row['favorites']; $praisesstr = $row['praises']; $debasesstr = $row['debases'];
mexit(template('vote', $temparr)); } } else { include_once M_ROOT . 'include/vote.fun.php'; empty($vopids) && message('choosevoteoption', M_REFERER); $fname = empty($fname) ? '' : strip_tags(trim($fname)); //字段名称 $tbl = $type = empty($type) ? 'archives' : strip_tags(trim($type)); $id = empty($id) ? 0 : max(0, intval($id)); //记录id if (!($item = field_votes($fname, $type, $id, 0)) || !($votes = @unserialize($item[$fname]))) { message('choosevoteitem', M_REFERER); } $arr = array('archives' => array('fields', 'aid', 'chid'), 'members' => array('mfields', 'mid', 'mchid'), 'farchives' => array('ffields', 'aid', 'chid'), 'catalogs' => array('cafields', 'caid', ''), 'coclass' => array('ccfields', 'ccid', ''), 'offers' => array('ofields', 'cid', ''), 'replys' => array('rfields', 'cid', ''), 'comments' => array('cfields', 'cid', ''), 'mcfields' => array('mcomments', 'cid', ''), 'mrfields' => array('mreplys', 'cid', '')); $typeid = $arr[$type][2] ? $item[$arr[$type][2]] : ''; $fields = read_cache($arr[$type][0], $typeid); if (!($field = @$fields[$fname]) || $field['datatype'] != 'vote') { message('choosevoteitem'); } if ($type == 'archives' && !$field['mcommon']) { $tbl = $type . "_{$typeid}"; } elseif ($type == 'members') { $tbl = $type . ($field['mcommon'] ? '_sub' : "_{$typeid}"); } elseif ($type == 'farchives') { $tbl = $type . "_{$typeid}"; } if ($field['nohtml'] && !$memberid) { message('nousernooperatepermis', M_REFERER); } if ($field['mode'] || $field['length']) { if (empty($m_cookie['voted_' . $type . $id . '_' . $fname . '_timelimit'])) {
cache2file($cmsinfos, 'cmsinfos'); } $archivestr = $memberstr = ''; foreach ($tblarr as $k => $v) { $var = in_array($k, array('archive', 'comment', 'reply', 'answer', 'orders', 'offer')) ? 'archivestr' : 'memberstr'; ${$var} .= '<tr><td class="bgc_E7F5FE fB">' . lang($k) . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['ck'] . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['nock'] . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['m'] . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['w'] . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['d3'] . '</td><td class="bgc_FFFFFF">' . @$cmsinfos[$k]['d1'] . '</td></tr>'; } $lic_str = empty($cmsinfos['lic_str']) ? lang('lic_uk') . ' <a href="http://www.08cms.com" target="_blank" class="cRed">' . lang('lic_by') . '</a>' : lang('lic_no') . $cmsinfos['lic_str'] . '<a href="http://www.08cms.com" target="_blank" class="cRed">' . lang('lic_ck') . '</a>'; $cmsinfos['server'] = PHP_OS . '/PHP ' . PHP_VERSION; $cmsinfos['safe_mode'] = @ini_get('safe_mode') ? 'ON' : 'OFF'; $cmsinfos['max_upload'] = @ini_get('upload_max_filesize') ? @ini_get('upload_max_filesize') : 'Disabled'; $cmsinfos['allow_url_fopen'] = @ini_get('allow_url_fopen') ? "YES" : "NO"; $cmsinfos['gdpic'] = function_exists("imagealphablending") && function_exists("imagecreatefromjpeg") && function_exists("ImageJpeg") ? 'YES' : 'NO'; $cmsinfos['servertime'] = date("Y-m-d H:i"); $gid = $curuser->info['grouptype2']; $group = read_cache('usergroups', 2); $group = $gid && isset($group[$gid]) ? $group[$gid]['cname'] : lang('unknow'); function show_tip($key) { if (@(include M_ROOT . './dynamic/aguides/' . $key . '.php')) { echo $aguide; } } $registeropenstr = $registerclosed ? lang('closed') : lang('enable'); $mspaceopenstr = $mspacedisabled ? lang('closed') : lang('enable'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php
<?php include_once dirname(dirname(__FILE__)) . '/include/general.inc.php'; include_once M_ROOT . './include/common.fun.php'; $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . rawurlencode($forward); if (!($mcommu = read_cache('mcommu', 3))) { message('setmemcommitem'); } if (empty($mcommu['ucadd'])) { $mid = empty($mid) ? 0 : max(0, intval($mid)); if (!$mid) { message('chooseflinkofmember'); } $actuser = new cls_userinfo(); $actuser->activeuser($mid); if (!$actuser->info['mid']) { message('chooseflinkofmember'); } if (!$curuser->pmbypmids('cuadd', $mcommu['setting']['apmid'])) { message('younoflinkpermis'); } $fieldsarr = empty($mcommu['setting']['fields']) ? array() : explode(',', $mcommu['setting']['fields']); if (!submitcheck('newcommu')) { if (!empty($mcommu['setting']['norepeat']) && ($cid = $db->result_one("SELECT cid FROM {$tblprefix}mflinks WHERE mid='{$mid}' AND fromid='{$memberid}' ORDER BY cid"))) { message('dorepeataddflink'); } if (empty($mcommu['addtpl']) || !($template = load_tpl($mcommu['addtpl']))) { load_cache('mlangs,mlfields'); include_once M_ROOT . "./include/fields.cls.php"; include_once M_ROOT . "./include/cheader.inc.php";
function relate_cncid($coid, $ccid, $level = 0, $sid = 0, $mode = 0) { //查找是否有某类系的及与变动id有关的单层结构 if (!$ccid) { return false; } $cncfgs = read_cache('cnconfigs', '', '', $sid); $level++; $cncid = 0; foreach ($cncfgs as $k => $v) { if (!empty($v['configs'][$coid]) && count($v['configs']) == 1 && in_array($v['configs'][$coid]['mode'], array(-1, 0, $level))) { $cncid = $k; if ($v['configs'][$coid]['mode'] == -1) { modify_cnconfig($v, $coid, array($ccid), $mode ? 1 : 2); } break; } } return $cncid; }
} adminlog(lang('update_catas_cnode')); amessage('ccnodeupdatefinish', "?entry={$entry}&action={$action}{$param_suffix}"); } } elseif ($action == 'cnconfigdetail' && $cncid) { $iscopy = empty($iscopy) ? 0 : 1; $cnconfig =& $cnconfigs[$cncid]; $configs =& $cnconfig['configs']; if (!submitcheck('bcnconfigdetail')) { tabheader(lang('edit') . lang('cncfg'), 'cnconfigdetail', "?entry={$entry}&action={$action}" . ($iscopy ? '&iscopy=1' : '') . "{$param_suffix}&cncid={$cncid}"); trbasic(lang('config_name'), 'cnconfignew[cname]', $cnconfig['cname'] . ($iscopy ? '-' . lang('copy0') : '')); $modearr = array(0 => lang('allcoclass'), 1 => lang('all_topic_catas'), 2 => lang('all_1_catas'), 3 => lang('all_2_catas'), 4 => lang('all_3_catas'), -1 => lang('handpoint')); $nomodearr = array(0 => lang('nosetting'), 1 => lang('handpoint')); $i = 1; foreach ($configs as $k => $v) { $arr = $k ? read_cache('coclasses', $k) : $catalogs; foreach ($arr as $x => $y) { $arr[$x] = $y['title'] . '(' . $y['level'] . ')'; } $cname = $k ? $cotypes[$k]['cname'] : lang('catalog'); sourcemodule("{$i}." . lang('incbelow') . $cname . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"configsnew[{$k}][son]\" value=\"1\"" . (empty($v['son']) ? "" : " checked") . ">" . lang('include_son'), "configsnew[{$k}][mode]", $modearr, empty($v['mode']) ? 0 : $v['mode'], -1, "configsnew[{$k}][ids][]", $arr, empty($v['ids']) ? array() : explode(',', $v['ids']), '25%', 1, '', 1); sourcemodule("{$i}." . lang('nobelow') . $cname . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"configsnew[{$k}][noson]\" value=\"1\"" . (empty($v['noson']) ? "" : " checked") . ">" . lang('include_son'), "configsnew[{$k}][nomode]", $nomodearr, empty($v['noids']) ? 0 : 1, 1, "configsnew[{$k}][noids][]", $arr, empty($v['noids']) ? array() : explode(',', $v['noids']), '25%', 1, '', 1); $i++; } tabfooter(); tabheader(lang('cncfgtpl')); foreach (array('tpls', 'wtpls', 'urls', 'statics', 'periods') as $var) { ${$var . 'arr'} = explode(',', $cnconfig[$var]); } $modearr = array(0 => lang('tplsmode0'), 1 => lang('tplsmode1'), 2 => lang('tplsmode2')); for ($i = 0; $i <= $cn_max_addno; $i++) {
$actuser->basedeal('answer', 0, 1, 1); $actuser->init(); } $db->query("DELETE FROM {$tblprefix}answers WHERE cid " . multi_str($selectid), 'UNBUFFERED'); adminlog(lang('answersetsucceed'), lang('answersetsucceed')); amessage('contentsetsucceed', "?entry=inarchive&action=answers&aid={$aid}{$param_suffix}&page={$page}{$filterstr}"); } } else { include M_ROOT . $u_tplname; } } elseif ($action == 'purchases') { echo '1111111111111111111111111111111'; } elseif ($action == 'reports') { //分析页面设置 $niuid = empty($niuid) ? 0 : $niuid; if ($niuid && ($u_url = read_cache('inurl', $niuid))) { $u_tplname = $u_url['tplname']; $u_onlyview = empty($u_url['onlyview']) ? 0 : 1; foreach (array('lists') as $var) { if (!empty($u_url['setting'][$var])) { ${'u_' . $var} = explode(',', $u_url['setting'][$var]); } } } empty($u_lists) && ($u_lists = array('mname', 'adddate', 'edit')); if (empty($u_tplname) || !empty($u_onlyview)) { $page = !empty($page) ? max(1, intval($page)) : 1; submitcheck('bfilter') && ($page = 1); $keyword = empty($keyword) ? '' : $keyword; $wheresql = "a.aid='{$aid}'"; $fromsql = "FROM {$tblprefix}reports cu LEFT JOIN {$tblprefix}archives a ON a.aid=cu.aid";
$c_upload->saveuptotal(1); adminlog(lang('detail_edit_member')); amessage('membermodifyfinish', M_REFERER); } } elseif ($action == 'grouptype' && $mid) { if (!submitcheck('bmemberdetail')) { $a_field = new cls_field(); $submitstr = ''; tabheader(lang('usergroup_msg') . ' : [' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=grouptype&mid={$mid}", 4, 1, 1); foreach ($grouptypes as $gtid => $grouptype) { if ($grouptype['mode'] < 2 && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($backamember || $gtid != 2)) { $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? '' : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']); $ugidsarr = array('0' => lang('release_usergroup')) + ugidsarr($grouptype['gtid'], $mchid); echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\"><select style=\"vertical-align: middle;\" name=\"minfosnew[grouptype" . $gtid . "]\">" . makeoption($ugidsarr, $actuser->info['grouptype' . $gtid]) . "</select></td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\"><input type=\"text\" size=\"20\" id=\"minfosnew[grouptype" . $gtid . "date]\" name=\"minfosnew[grouptype" . $gtid . "date]\" value=\"" . $actuser->info['grouptype' . $gtid . 'date'] . "\" onclick=\"ShowCalendar(this.id);\"></td>\n" . "</tr>"; } else { $usergroups = read_cache('usergroups', $gtid); $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? lang('noend') : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']); echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\">" . (!$actuser->info['grouptype' . $gtid] ? lang('notbelong_usergroup') : $usergroups[$actuser->info['grouptype' . $gtid]]['cname']) . "</td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\">" . $actuser->info['grouptype' . $gtid . 'date'] . "</td>\n" . "</tr>"; } } tabfooter('bmemberdetail'); check_submit_func($submitstr); a_guide('memberdetail'); } else { foreach ($grouptypes as $gtid => $grouptype) { if ($grouptype['mode'] < 2 && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($gtid != 2 || $backamember)) { $minfosnew['grouptype' . $gtid . 'date'] = !$minfosnew['grouptype' . $gtid] || !isdate($minfosnew['grouptype' . $gtid . 'date']) ? '0' : strtotime($minfosnew['grouptype' . $gtid . 'date']); $actuser->handgrouptype($gtid, $minfosnew['grouptype' . $gtid], $minfosnew['grouptype' . $gtid . 'date']); } } $actuser->updatedb();
$transtr .= "&barcsedit=1"; $transtr .= "&fromid={$fromid}"; amessage('operating', "?entry=reports&action=reportsedit&page={$page}{$param_suffix}{$filterstr}{$transtr}{$parastr}&dealstr={$dealstr}", $pages, $npage, "<a href=\"?entry=reports&action=reportsedit&page={$page}{$param_suffix}{$filterstr}\">", '</a>'); } } adminlog(lang('reportsetsucceed'), lang('reportsetsucceed')); amessage('contentsetsucceed', "?entry=reports&action=reportsedit{$param_suffix}&page={$page}{$filterstr}"); } } elseif ($action == 'reportdetail') { load_cache('bfields,ucotypes'); $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . rawurlencode($forward); if (!($report = $db->fetch_one("SELECT * FROM {$tblprefix}reports WHERE cid='{$cid}'"))) { amessage('choosereport'); } $commu = read_cache('commu', $report['cuid']); //$fieldsarr = empty($commu['setting']['fields']) ? array() : explode(',',$commu['setting']['fields']); $citems = empty($commu['setting']['citems']) ? array() : explode(',', $commu['setting']['citems']); $aedit = new cls_arcedit(); $aedit->set_aid($report['aid']); $aedit->detail_data(); if (!submitcheck('newcommu')) { tabheader($commu['cname'] . ' - ' . lang('based_msg'), 'commudetail', "?entry=reports&action=reportdetail&cid={$cid}{$param_suffix}{$forwardstr}", 2, 1, 1); $archive = $db->fetch_one("SELECT * FROM {$tblprefix}archives WHERE aid='{$report['aid']}'"); trbasic(lang('lookrelatedsource'), '', "<a href=\"" . view_arcurl($aedit->archive) . "\" target=\"_blank\">>> " . $aedit->archive['subject'] . "</a>", ''); trbasic(lang('add_time'), '', date('Y-m-d H:i', $report['createdate']), ''); tabfooter(); $a_field = new cls_field(); tabheader($commu['cname'] . ' - ' . lang('submitmessage')); $submitstr = ''; foreach ($ucotypes as $k => $v) {
$cy_arr[] = lang('stock'); } $cy_arr[] = lang('price'); $cy_arr[] = lang('admin'); trcategory($cy_arr); $itemstr = ''; while ($row = $db->fetch_array($query)) { cu_checkend($row, 'offer'); $selectstr = "<input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$row['cid']}]\" value=\"{$row['cid']}\">"; $subjectstr = "<a href=\"" . view_arcurl($row) . "\" target=\"_blank\">" . mhtmlspecialchars($row['asubject']) . "</a>"; $catalogstr = @$catalogs[$row['caid']]['title']; $uclassstr = $row['ucid'] ? $ucidsarr[$row['ucid']] : '-'; $channelstr = @$channels[$row['chid']]['cname']; foreach ($ucotypes as $k => $v) { if (in_array('uccid' . $k, $u_lists) && $v['cclass'] == 'offer') { $ucoclasses = read_cache('ucoclasses', $k); ${'uccid' . $k . 'str'} = @$ucoclasses[$row['uccid' . $k]]['title']; } } $checkstr = $row['checked'] ? 'Y' : '-'; $validstr = !$row['enddate'] || $row['enddate'] > $timestamp ? 'Y' : '-'; $adddatestr = $row['ucreatedate'] ? date('Y-m-d', $row['ucreatedate']) : '-'; $updatedatestr = $row['updatedate'] ? date('Y-m-d', $row['updatedate']) : '-'; $refreshdatestr = $row['refreshdate'] ? date('Y-m-d', $row['refreshdate']) : '-'; $enddatestr = $row['enddate'] ? date('Y-m-d', $row['enddate']) : '-'; $storagestr = "<input type=\"text\" size=\"4\" name=\"itemsnew[" . $row['cid'] . "][storage]\" value=\"{$row['storage']}\">"; $opricestr = "<input type=\"text\" size=\"4\" name=\"itemsnew[" . $row['cid'] . "][oprice]\" value=\"{$row['oprice']}\">"; $adminstr = ''; if (empty($u_imuids)) { $adminstr .= "<a href=\"?action=offer&cid={$row['cid']}\" onclick=\"return floatwin('open_inarchive',this)\">" . lang('edit') . "</a> "; } else {
} } } unset($a_field); $oldarr = array(); $cu_ret = cu_fields_deal($channel['cuid'], 'archiveadd', $oldarr); $cu_ret && mcmessage($cu_ret, axaction(2, M_REFERER)); if (isset($archiveadd['keywords'])) { $archiveadd['keywords'] = keywords($archiveadd['keywords']); } $fields['author']['available'] && ($archiveadd['author'] = empty($archiveadd['author']) ? $curuser->info['mname'] : $archiveadd['author']); if ($fields['abstract']['available'] && !$fields['abstract']['isadmin'] && $channel['autoabstract'] && empty($archiveadd['abstract']) && isset($archiveadd[$channel['autoabstract']])) { $archiveadd['abstract'] = autoabstract($archiveadd[$channel['autoabstract']]); } if ($fields['thumb']['available'] && !$fields['thumb']['isadmin'] && $channel['autothumb'] && empty($archiveadd['thumb']) && isset($archiveadd[$channel['autothumb']])) { $field = read_cache('field', $chid, 'thumb'); $archiveadd['thumb'] = $c_upload->thumb_pick(stripslashes($archiveadd[$channel['autothumb']]), $fields[$channel['autothumb']]['datatype'], $fields['thumb']['rpid']); } if ($channel['autosize'] && !empty($archiveadd[$channel['autosize']])) { $archiveadd['atmsize'] = atm_size(stripslashes($archiveadd[$channel['autosize']]), $fields[$channel['autosize']]['datatype'], $channel['autosizemode']); $sqlmain .= ",atmsize='" . $archiveadd['atmsize'] . "'"; } if ($channel['autobyte'] && isset($archiveadd[$channel['autobyte']])) { $archiveadd['bytenum'] = atm_byte(stripslashes($archiveadd[$channel['autobyte']]), $fields[$channel['autobyte']]['datatype']); $sqlmain .= ",bytenum='" . $archiveadd['bytenum'] . "'"; } $sqlsub = $sqlcustom = ''; foreach ($fields as $k => $v) { if ($v['available'] && !$v['isadmin'] && !$v['isfunc'] && !in_array($k, $additems)) { $a_field->field = $v; if ($curuser->pmbypmids('field', $v['pmid'])) {