function get_groupby_user_attr() { $attr = array(); include_once B_ROOT . './source/function/cache.func.php'; //讀入緩存 $mname = 'shop'; $cacheinfo = getmodelinfoall('modelname', 'groupbuy'); if (!empty($cacheinfo['columns'])) { foreach ($cacheinfo['columns'] as $column) { if ($column['allowpost'] == 1 && preg_match('/^user_/', $column['fieldname'])) { $attr[] = $column; } } } return $attr; }
function block_model($paramarr) { global $_SGLOBAL, $_SGET; if (empty($paramarr['sql'])) { $sql = array(); $sql['select'] = 'SELECT i.*'; $sql['from'] = 'FROM ' . tname($paramarr['name'] . 'items') . ' i'; $sql['join'] = ''; //内容 if (!empty($paramarr['showdetail']) && empty($paramarr['notype'])) { $sql['select'] = 'SELECT ii.*, i.*'; $sql['join'] .= ' LEFT JOIN ' . tname($paramarr['name'] . 'message') . ' ii ON ii.itemid=i.itemid'; } $wherearr = array(); //where if (!empty($paramarr['itemid'])) { $paramarr['itemid'] = getdotstring($paramarr['itemid'], 'int'); if ($paramarr['itemid']) { $wherearr[] = 'i.itemid IN (' . $paramarr['itemid'] . ')'; } } else { //作者 if (!empty($paramarr['uid'])) { $paramarr['uid'] = getdotstring($paramarr['uid'], 'int'); if ($paramarr['uid']) { $wherearr[] = 'i.uid IN (' . $paramarr['uid'] . ')'; } } //分类 if (!empty($paramarr['catid'])) { $paramarr['catid'] = getdotstring($paramarr['catid'], 'int'); if ($paramarr['catid']) { $wherearr[] = 'i.catid IN (' . $paramarr['catid'] . ')'; } } //站点审核 if (!empty($paramarr['grade'])) { $paramarr['grade'] = getdotstring($paramarr['grade'], 'int'); if (!empty($paramarr['grade'])) { $wherearr[] = 'i.grade IN (' . $paramarr['grade'] . ')'; } } if (!empty($paramarr['haveattach'])) { $wherearr[] = 'i.subjectimage !=\'\''; } if (!empty($paramarr['dateline'])) { $paramarr['dateline'] = intval($paramarr['dateline']); if ($paramarr['dateline']) { $wherearr[] = 'i.dateline >= ' . ($_SGLOBAL['timestamp'] - $paramarr['dateline']); } } if (!empty($paramarr['lastpost'])) { $paramarr['lastpost'] = intval($paramarr['lastpost']); if ($paramarr['lastpost']) { $wherearr[] = 'i.lastpost >= ' . ($_SGLOBAL['timestamp'] - $paramarr['lastpost']); } } $scopequery = getscopequery('i', 'viewnum', $paramarr); if (!empty($scopequery)) { $wherearr[] = $scopequery; } $scopequery = getscopequery('i', 'replynum', $paramarr); if (!empty($scopequery)) { $wherearr[] = $scopequery; } } if (!empty($wherearr)) { $sql['where'] = 'WHERE ' . implode(' AND ', $wherearr); } //order if (!empty($paramarr['order'])) { $sql['order'] = 'ORDER BY ' . $paramarr['order']; } //limit if (!empty($paramarr['perpage'])) { $paramarr['perpage'] = intval($paramarr['perpage']); if (empty($paramarr['perpage'])) { $paramarr['perpage'] = 20; } if (empty($_SGET['page'])) { $_SGET['page'] = 1; } $_SGET['page'] = intval($_SGET['page']); if ($_SGET['page'] < 1) { $_SGET['page'] = 1; } $start = ($_SGET['page'] - 1) * $paramarr['perpage']; $sql['limit'] = 'LIMIT ' . $start . ',' . $paramarr['perpage']; } else { if (empty($paramarr['limit'])) { $sql['limit'] = 'LIMIT 0,1'; } else { $paramarr['limit'] = getdotstring($paramarr['limit'], 'int', true, array(), 1, false); if ($paramarr['limit']) { $sql['limit'] = 'LIMIT ' . $paramarr['limit']; } else { $sql['limit'] = 'LIMIT 0,1'; } } } //query $sqlstring = implode(' ', $sql); //multi $listcount = 1; if (!empty($paramarr['perpage'])) { $listcount = $_SGLOBAL['db']->result($_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname($paramarr['name'] . 'items') . ' i ' . $sql['where']), 0); if ($listcount) { $urlarr = $_SGET; unset($urlarr['page']); $theblockarr['multipage'] = multi($listcount, $paramarr['perpage'], $_SGET['page'], $urlarr, 0); } } } else { include_once S_ROOT . './function/block_sql.func.php'; list($sqlstring, $listcount) = runsql($paramarr); if (!empty($paramarr['perpage'])) { if ($listcount) { $urlarr = $_SGET; unset($urlarr['page']); $theblockarr['multipage'] = multi($listcount, $paramarr['perpage'], $_SGET['page'], $urlarr, 0); } } } if ($listcount) { //预处理 if (empty($paramarr['subjectdot'])) { $paramarr['subjectdot'] = 0; } if (!empty($paramarr['showcategory'])) { include_once S_ROOT . './function/model.func.php'; $cacheinfo = getmodelinfoall('modelname', $paramarr['name']); } $query = $_SGLOBAL['db']->query($sqlstring); $itemids = array(); while ($value = $_SGLOBAL['db']->fetch_array($query)) { //处理 $value['subjectall'] = $value['subject']; if (!empty($value['subject']) && !empty($paramarr['subjectlen'])) { $value['subject'] = cutstr($value['subject'], $paramarr['subjectlen'], $paramarr['subjectdot']); } //链接 $value['url'] = geturl('action/model/name/' . $paramarr['name'] . '/itemid/' . $value['itemid']); //内容处理 if (!empty($value['message']) && !empty($paramarr['messagelen'])) { $value['message'] = trim(strip_tags($value['message'])); $value['message'] = trim(cutstr($value['message'], $paramarr['messagelen'], $paramarr['messagedot'])); } //图片地址 if (!empty($value['subjectimage'])) { $value['subjectimage'] = A_URL . '/' . $value['subjectimage']; } else { $value['subjectimage'] = S_URL . '/images/base/nopic.gif'; } //分类名 if (!empty($cacheinfo['categoryarr'][$value['catid']])) { $value['catname'] = $cacheinfo['categoryarr'][$value['catid']]; } $theblockarr[$value['itemid']] = $value; } } return $theblockarr; }
<?php /* [SupeSite] (C) 2007-2009 Comsenz Inc. $Id: modelview.php 13359 2009-09-22 09:06:19Z zhaofei $ */ if (!defined('IN_SUPESITE')) { exit('Access Denied'); } include_once S_ROOT . './function/model.func.php'; $_SGET['name'] = !empty($_SGET['name']) ? trim($_SGET['name']) : ''; $channel = $_SGET['name']; if (!checkperm('allowview')) { showmessage('no_permission'); } $cacheinfo = getmodelinfoall('modelname', $_SGET['name']); if (empty($cacheinfo['models'])) { showmessage('visit_the_channel_does_not_exist', S_URL); } $modelsinfoarr = $cacheinfo['models']; $categories = $cacheinfo['categories']; $itemid = empty($_SGET['itemid']) ? 0 : intval($_SGET['itemid']); //导航 $channelsmore = array(); if (!empty($channels['menus']) && count($channels['menus']) > 12) { $channelsmore = $channels['menus']; for ($i = 0; $i < 12; $i++) { array_shift($channelsmore); } } $item = $gatherarr = $columnsallinfoarr = array();
foreach(array('itemid', 'nid', 'uid', 'catid', 'shopid', 'albumid', 'groupid', 'upid', 'displayorder', 'cmid') as $value) { //$_GET[$value] = $_POST[$value] = $_REQUEST[$value] = intval(!empty($_POST[$value])?$_POST[$value]:(!empty($_GET[$value])?$_GET[$value]:0)); } */ //載入語言包 include_once B_ROOT . './language/admin.lang.php'; $lang = array_merge($lang, $alang); //記錄log $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'action')); writelog(substr($BASESCRIPT, 0, -4) . 'log', implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['clientip'], $_REQUEST['action'], $extralog)))); if (!in_array($_GET['m'], $models)) { $_GET['m'] = 'shop'; } //讀入緩存 if (!in_array($_GET['m'], array('album', 'photo', 'brandlinks'))) { $cacheinfo = getmodelinfoall('modelname', $_GET['m']); $mname = $cacheinfo['models']['modelname']; $mid = $cacheinfo['models']['mid']; $categorylist = $_G['categorylist']; } else { $mname = $_GET['m']; } //審核等級對應關係 $_SGLOBAL['shopgrade'] = array(3 => $lang['grade_3'], 1 => $lang['grade_1'], 2 => $lang['grade_2'], 0 => $lang['grade_0'], 5 => $lang['grade_5']); if ($_GET['m'] != 'shop') { unset($_SGLOBAL['shopgrade'][4]); $_SGLOBAL['shopgrade'][3] = $lang['grade_3_other']; if (pkperm('isadmin')) { $_SGLOBAL['shopgrade'][5] = $lang['grade_5']; } elseif ($_G['myshopstatus'] == 'verified' && !$_SGLOBAL['panelinfo']['group']['verify' . $mname]) { $_SGLOBAL['shopgrade'][5] = $lang['grade_5'];
function changemodelfolder($modelname, $ids, $undel = 0) { global $_SGLOBAL, $_SCONFIG, $systemfieldarr; include_once S_ROOT . './include/model_field.inc.php'; $_GET['mid'] = empty($_GET['mid']) ? 0 : intval($_GET['mid']); if (is_array($ids)) { $ids = simplode($ids); } if ($undel == 1) { //还原 $columnsarr = $feedimg = $defaultarr = $setmessagesqlarr = $setmessagesqlnoitemidarr = array(); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('modelcolumns') . ' WHERE mid = \'' . $_GET['mid'] . '\''); while ($result = $_SGLOBAL['db']->fetch_array($query)) { $columnsarr[$result['fieldname']] = $result['isfixed']; if (empty($result['isfixed'])) { $defaultarr[$result['fieldname']] = $result['fielddefault']; } if ($result['formtype'] == 'img') { $feedimg[] = $result['fieldname']; } } foreach ($systemfieldarr as $tmpvalue) { $columnsarr[$tmpvalue['fieldname']] = $tmpvalue['isfixed']; if (empty($tmpvalue['isfixed'])) { $defaultarr[$tmpvalue['fieldname']] = $tmpvalue['fielddefault']; } } $idarr = explode(',', str_replace('\'', '', $ids)); $uids = getuids($idarr, 'modelfolders'); updatecredit('delnews', $uids); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('modelfolders') . ' i WHERE i.mid=\'' . $_GET['mid'] . '\' AND i.itemid IN (' . $ids . ')'); $i = $j = 0; $addfeed = array(); while ($result = $_SGLOBAL['db']->fetch_array($query)) { $data = $setitemssqlarr = array(); $data = unserialize($result['message']); $tmpdefaultarr = $defaultarr; if (empty($data['itemid'])) { $addfeed[$i] = $data; } unset($data['addfeed']); foreach ($data as $tmpkey => $tmpvalue) { if ($columnsarr[$tmpkey] == 1 || preg_match("/^click_/i", $tmpkey) || preg_match("/^attaches/i", $tmpkey)) { $setitemssqlarr[$tmpkey] = $tmpvalue; } else { $tmpdefaultarr[$tmpkey] = $tmpvalue; } } if (empty($data['itemid'])) { $setmessagesqlnoitemidarr[$j] = $tmpdefaultarr; } else { $setmessagesqlarr[$i] = $tmpdefaultarr; } if (empty($data['itemid'])) { $setmessagesqlnoitemidarr[$j]['itemid'] = $addfeed[$i]['itemid'] = inserttable($modelname . 'items', $setitemssqlarr, 1); $oldhash = getmodelhash($_GET['mid'], $result['itemid'], 'f'); $hash = getmodelhash($_GET['mid'], $setmessagesqlnoitemidarr[$j]['itemid']); $_SGLOBAL['db']->query('UPDATE ' . tname('attachments') . ' SET hash=\'' . $hash . '\' WHERE hash = \'' . $oldhash . '\''); $j++; } else { $setmessagesqlarr[$i]['itemid'] = $data['itemid']; inserttable($modelname . 'items', $setitemssqlarr); $i++; } } if (allowfeed()) { $cacheinfo = getmodelinfoall('modelname', $modelname); foreach ($addfeed as $feedvalue) { if (!empty($feedvalue['addfeed']) && !empty($feedvalue['uid'])) { $feed['uid'] = $feedvalue['uid']; $feed['username'] = $feedvalue['username']; $feed['icon'] = 'comment'; $feed['title_template'] = 'feed_model_title'; $feed['title_data'] = array('modelname' => '<a href="' . S_URL_ALL . '/m.php?name=' . $modelname . '">' . $cacheinfo['models']['modelalias'] . '</a>'); $feed['body_template'] = 'feed_model_message'; $feed['body_data'] = array('subject' => '<a href="' . geturl('action/model/name/' . $modelname . '/itemid/' . $feedvalue['itemid'], 1) . '">' . $feedvalue['subject'] . '</a>', 'message' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $feedvalue['message'])), 150)); if (!empty($feedvalue['subjectimage'])) { $feed['images'][] = array('url' => A_URL . '/' . $feedvalue['subjectimage'], 'link' => geturl('action/model/name/' . $modelname . '/itemid/' . $feedvalue['itemid'], 1)); } else { $feedbool = false; foreach ($feedimg as $feedimgvalue) { if (!empty($feedvalue[$feedimgvalue])) { $feed['images'][] = array('url' => A_URL . '/' . $feedvalue[$feedimgvalue], 'link' => geturl('action/model/name/' . $modelname . '/itemid/' . $feedvalue['itemid'], 1)); break; } } if (empty($feed['images'])) { $picurl = getmessagepic(stripslashes($feedvalue['message'])); if (!empty($picurl)) { $feed['images'][] = array('url' => $picurl, 'link' => geturl('action/model/name/' . $modelname . '/itemid/' . $feedvalue['itemid'], 1)); } } } postfeed($feed); } } } $insertvalue = $insertkey = $comma = $pre = ''; if (!empty($setmessagesqlarr)) { foreach ($setmessagesqlarr[0] as $tmpkey => $tmpvalue) { $insertkey .= $pre . $tmpkey; $pre = ','; } foreach ($setmessagesqlarr as $tmpvalue) { $insertvalue .= $comma . '(' . simplode($tmpvalue) . ')'; $comma = ','; } $_SGLOBAL['db']->query('INSERT INTO ' . tname($modelname . 'message') . ' (' . $insertkey . ') VALUES ' . $insertvalue); } $insertvalue = $insertkey = $comma = $pre = ''; if (!empty($setmessagesqlnoitemidarr)) { foreach ($setmessagesqlnoitemidarr[0] as $tmpkey => $tmpvalue) { $insertkey .= $pre . $tmpkey; $pre = ','; } foreach ($setmessagesqlnoitemidarr as $tmpvalue) { $insertvalue .= $comma . '(' . simplode($tmpvalue) . ')'; $comma = ','; } $_SGLOBAL['db']->query('INSERT INTO ' . tname($modelname . 'message') . ' (' . $insertkey . ') VALUES ' . $insertvalue); } $_SGLOBAL['db']->query("DELETE FROM " . tname('modelfolders') . " WHERE itemid IN ({$ids})"); } elseif ($undel == 2) { $_SGLOBAL['db']->query('UPDATE ' . tname('modelfolders') . ' SET folder=2 WHERE mid=\'' . $_GET['mid'] . '\' AND itemid IN (' . $ids . ')'); } elseif ($undel == 3) { $idarr = $itemid = array(); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('modelfolders') . ' i WHERE i.mid=\'' . $_GET['mid'] . '\' AND i.itemid IN (' . $ids . ')'); while ($result = $_SGLOBAL['db']->fetch_array($query)) { $data = array(); $data = saddslashes(unserialize($result['message'])); if (empty($data['itemid'])) { //待审箱的 $idarr[] = getmodelhash($_GET['mid'], $result['itemid'], 'f'); } else { //废件箱的 $idarr[] = getmodelhash($_GET['mid'], $data['itemid']); $itemid[] = $data['itemid']; } } if (!empty($data['itemid'])) { $itemid = simplode($itemid); $_SGLOBAL['db']->query("DELETE FROM " . tname($modelname . 'comments') . " WHERE itemid IN ({$itemid})"); $_SGLOBAL['db']->query("DELETE FROM " . tname($modelname . 'rates ') . " WHERE itemid IN ({$itemid})"); } $idarr = simplode($idarr); delattachments($idarr, 'IN'); $_SGLOBAL['db']->query("DELETE FROM " . tname('modelfolders') . " WHERE itemid IN ({$ids})"); } return true; }
$newchannel = $channel; } $postmenus[] = $key; } } } $channel = $nameid = empty($newchannel) ? $nameid : $newchannel; if (!checkperm('allowpost')) { showmessage('no_permission', S_URL . '/cp.php?ac=news'); } } if (empty($channels['menus'][$nameid])) { showmessage('visit_the_channel_does_not_exist'); } elseif ($channels['menus'][$nameid]['type'] == 'model') { include_once S_ROOT . './function/ebook.func.php'; $cacheinfo = getmodelinfoall('modelname', $nameid); } else { showmessage('', S_URL . '/cp.php?ac=news&op=add&type=' . $nameid, 0); } $do = empty($_GET['do']) ? 'me' : trim($_GET['do']); $itemid = empty($_GET['itemid']) ? 0 : intval($_GET['itemid']); $catid = empty($_GET['catid']) ? 0 : intval($_GET['catid']); $page = empty($_GET['page']) && intval($_GET['page']) < 1 ? 1 : intval($_GET['page']); $perpage = 20; $start = ($page - 1) * $perpage; $wheresql = $mpurlstr = ''; if (!empty($catid)) { $wheresql .= " AND catid='{$catid}' "; } if (submitcheck('postsubmit')) { if (!empty($_POST['itemid']) && empty($_SGLOBAL['supe_uid'])) {
} } $perpage = empty($_SCONFIG['commviewnum']) ? 50 : intval($_SCONFIG['commviewnum']); //显示条数 $page = empty($_SGET['page']) ? 0 : intval($_SGET['page']); $order = !empty($_SGET['order']) && in_array($_SGET['order'], array('1', '2', '3', '4')) ? intval($_SGET['order']) : 0; $page = $page < 1 ? 1 : $page; $start = ($page - 1) * $perpage; $itemid = empty($_SGET['itemid']) ? 0 : intval($_SGET['itemid']); $type = empty($_SGET['type']) ? 'news' : trim($_SGET['type']); if (!$itemid || empty($_SCONFIG['commstatus'])) { showmessage('not_found', S_URL); } if ($channels['menus'][$type]['type'] == 'model') { include_once S_ROOT . './function/model.func.php'; $cacheinfo = getmodelinfoall('modelname', $type); if (empty($cacheinfo['models'])) { showmessage('visit_the_channel_does_not_exist', S_URL); } $modelsinfoarr = $cacheinfo['models']; $categories = $cacheinfo['categories']; $query = $_SGLOBAL['db']->query('SELECT i.*, ii.* FROM ' . tname($type . 'items') . ' i, ' . tname($type . 'message') . ' ii WHERE i.itemid = ii.itemid AND i.itemid=\'' . $itemid . '\' AND i.allowreply=\'1\''); $ismodle = '1'; } else { $query = $_SGLOBAL['db']->query('SELECT i.*, ii.* FROM ' . tname('spaceitems') . ' i, ' . tname('spacenews') . ' ii WHERE i.itemid = ii.itemid AND i.itemid=\'' . $itemid . '\' AND i.allowreply=\'1\''); $ismodle = '0'; } if (!($item = $_SGLOBAL['db']->fetch_array($query))) { showmessage('not_found', S_URL); } $channel = $type = empty($item['type']) ? $type : $item['type'];
/* [SupeSite] (C) 2007-2009 Comsenz Inc. $Id: admin_modelfolders.php 13411 2009-10-22 03:13:01Z zhaofei $ */ if (!defined('IN_SUPESITE_ADMINCP')) { exit('Access Denied'); } include_once S_ROOT . './function/model.func.php'; $_GET['mid'] = postget('mid'); $_GET['mid'] = !empty($_GET['mid']) ? intval($_GET['mid']) : 0; $perpage = 20; //每页显示列表数目 $resultmodels = array(); if (!empty($_GET['mid'])) { $cacheinfo = getmodelinfoall('mid', $_GET['mid']); if (empty($cacheinfo['models'])) { showmessage('exists_module_error'); } $resultmodels = $cacheinfo['models']; } else { showmessage('exists_module_error'); } if (in_array($resultmodels['modelname'], $_SCONFIG['closechannels'])) { showmessage('usetype_no_open'); } //获取的变量初始化 $_SGET['page'] = intval(postget('page')); $_SGET['order'] = postget('order'); $_SGET['sc'] = postget('sc'); $_SGET['searchkey'] = stripsearchkey(postget('searchkey'));
case 7: $_POST['grade'] = '-1'; break; case 8: $_POST['grade'] = '-2'; break; case 9: $_POST['grade'] = '-3'; break; } } $actionurl = "?action-modeledit-name-" . $modelsinfoarr['modelname'] . "-mid-" . $modelsinfoarr['mid'] . "-catid-" . $catid . "-itemid-" . $itemid; $theurl = "?action-model-name-" . $modelsinfoarr['modelname'] . "-mid-" . $modelsinfoarr['mid'] . "-catid-" . $catid . "-itemid-" . $itemid; $tablename = tname($modelsinfoarr['modelname'] . 'items'); if (submitcheck('valuesubmit')) { $cacheinfo2 = getmodelinfoall('mid', $_POST['mid']); //echo '<PRE>'; //print_r($cacheinfo2); if (empty($cacheinfo2['models'])) { showmessage('exists_module_error'); } $itemid = intval($_POST['itemid']); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . $tablename . ' WHERE itemid=\'' . $itemid . '\''); $thevalue = $_SGLOBAL['db']->fetch_array($query); if (intval($thevalue['grade']) > 0 && $_SGLOBAL['member']['groupname']['rdm'] < 1) { showmessage('no_modify_checked_item'); } if (!(check_cate_perm($catid) || check_cate_director($catid) || $_SGLOBAL['supe_uid'] == $thevalue['uid'])) { showmessage('no_permission'); } $theurl = "?action-model-name-" . $modelsinfoarr['modelname'] . "-mid-" . $modelsinfoarr['mid'] . "-catid-" . $catid . "-itemid-" . $itemid;
/* [SupeSite] (C) 2007-2009 Comsenz Inc. $Id: site.php 10928 2009-01-06 05:13:03Z zhanglijun $ */ if (!defined('IN_SUPESITE')) { exit('Access Denied'); } if (!empty($_SGET['type'])) { $tplname = 'site_' . trim(str_replace(array('..', '/', '\\'), '', $_SGET['type'])); if ($_SGET['type'] == 'map') { include_once S_ROOT . './function/model.func.php'; $modelarr = array(); foreach ($channels['menus'] as $key => $val) { if ($val['type'] == 'model' && $val['status'] == 1) { $catlistarr = getmodelinfoall('modelname', $key); $modelarr[$key] = array('modelalias' => $catlistarr['models']['modelalias'], 'modelname' => $catlistarr['models']['modelname'], 'categories' => $catlistarr['categories']); } } $title = $lang['site_map']; } elseif ($_SGET['type'] == 'link') { $title = $lang['site_link']; } } else { header('Location: ' . S_URL); exit; } if (file_exists(S_ROOT . './templates/' . $_SCONFIG['template'] . '/' . $tplname . '.html.php')) { include template($tplname); } else { header('Location: ' . S_URL);
<?php /* [SupeSite] (C) 2007-2009 Comsenz Inc. $Id: admin_blocks_model.inc.php 11948 2009-04-15 06:38:46Z zhaofei $ */ if (!defined('IN_SUPESITE_ADMINCP')) { exit('Access Denied'); } include_once S_ROOT . './function/model.func.php'; $categories = array(); $catlistarr = getmodelinfoall('modelname', $_GET['modelname']); if (!empty($catlistarr)) { foreach ($catlistarr['categories'] as $key => $value) { $categories[$key]['name'] = $value; } } if (!isset($theblcokvalue['setitemid'])) { $theblcokvalue['setitemid'] = ''; } if ($theblcokvalue['setitemid'] == '1') { $divsetitemid1display = ''; $divsetitemid2display = 'none'; } else { $divsetitemid1display = 'none'; $divsetitemid2display = ''; } //multi if (!isset($theblcokvalue['showmultipage'])) { $theblcokvalue['showmultipage'] = 0; }
* This is NOT a freeware, use is subject to license terms * * $Id: attend.php 4452 2010-09-14 12:35:50Z fanshengshuai $ */ require_once './common.php'; if (!$_G['setting']['multipleshop']) { if (intval($_G['myshopid']) > 0) { showmessage($lang['oneowner_onshop'], "index.php"); } } $do = $_GET['do']; require_once B_ROOT . './uc_client/client.php'; include_once B_ROOT . './source/function/cache.func.php'; //讀入緩存 $mname = 'shop'; $cacheinfo = getmodelinfoall('modelname', $mname); $mid = $cacheinfo['models']['mid']; if ($do && $do == "register") { //第三步,提交數據,檢查填寫的基本信息 if (submitcheck('attendsubmit')) { $checkunits = array(array('subject', '2', '30', $lang['attend_subject_error']), array('address', '5', '30', $lang['attend_address_error'])); if (!empty($cacheinfo['columns'])) { foreach ($cacheinfo['columns'] as $column) { if ($column['allowpost'] == 1 && $column['allowshow'] == 1 && $column['formtype'] != 'img' && $column['isrequired'] == 1 && preg_match('/(^ext_)|(^applicant)/', $column['fieldname'])) { $errormessage = !empty($lang['attend_' . $column['fieldname'] . '_error']) ? $lang['attend_' . $column['fieldname'] . '_error'] : ($column['fieldminlength'] < $column['fieldlength'] ? $column['fieldtitle'] . $lang['is'] . $column['fieldminlength'] . '-' . $column['fieldlength'] . $lang['word'] : $column['fieldlength'] . $lang['word']); array_push($checkunits, array($column['fieldname'], $column['fieldminlength'], $column['fieldlength'], $errormessage)); } } } $checkresults = array(); foreach ($checkunits as $unit) {