$result['time'] = date('Y-m-d', $result['dateline']); $noticelist[] = $result; } $seo_title = $lang['noticelistpage'] . ' - ' . $seo_title; $theurl = "store.php?id={$shop['itemid']}&action=notice"; } else { //公告詳情 $notice = $_BCACHE->getiteminfo('notice', $_GET['xid'], $_GET['id']); $notice['message'] = bbcode2html($notice['message']); if (!$notice) { showmessage('not_found_msg', 'index.php'); } $allowreply = $shop['allowreply'] && $notice['allowreply'] ? 1 : 0; $notice['time'] = date('Y-m-d', $notice['dateline']); //更新統計數 $isupdate = freshcookie($action, $notice['itemid']); if ($isupdate || !$_G['setting']['updateview']) { updateviewnum($action, $notice['itemid']); } if (!empty($notice['jumpurl'])) { $notice['jumpurl'] = str_replace('&', '&', $notice['jumpurl']); header("Location:{$notice['jumpurl']}"); exit; } //評論 $listcount = $notice['replynum']; $_G['setting']['viewspace_pernum'] = intval($_G['setting']['viewspace_pernum']); $type = 'notice'; $seo_title = $notice['subject'] . ' - ' . $seo_title; $seo_description = str_replace(array(' ', "\r", "\n", '\'', '"'), '', cutstr(trim(strip_tags($notice['message'])), 200)); }
} else { $consume = $_BCACHE->getiteminfo('consume', $_GET['xid'], $_GET['id']); $consume['message'] = bbcode2html($consume['message']); if (!$consume) { showmessage('not_found_msg', 'index.php'); } $allowreply = $shop['allowreply'] && $consume['allowreply'] ? 1 : 0; if ($_GET['do'] == 'print') { DB::query('UPDATE ' . tname('consumeitems') . ' SET downnum=downnum+1 WHERE itemid=\'' . $_GET['xid'] . '\''); echo '<body onload="window.print()"><img src="' . $consume['subjectimage'] . '"></body>'; exit; } //更新統計數 $isupdate = freshcookie($action, $consume['itemid']); if ($isupdate || !$_G['setting']['updateview']) { updateviewnum($action, $consume['itemid']); } $consume['time'] = date('Y-m-d H:i', $consume['dateline']); $consume['starttime'] = date('Y-m-d', $consume['validity_start']); $consume['endtime'] = date('Y-m-d', $consume['validity_end']); //評論 $listcount = $consume['replynum']; $_G['setting']['viewspace_pernum'] = intval($_G['setting']['viewspace_pernum']); $type = 'consume'; if ($_G['setting']['urltype'] == 3) { $consumeurl = B_URL . "/store-{$shop['itemid']}-consume-{$consume['itemid']}.html"; } else { $consumeurl = B_URL . "/store.php?id={$shop['itemid']}&action=consume&xid={$consume['itemid']}"; } $seo_title = $consume['subject'] . ' - ' . $seo_title; $seo_description = str_replace(array(' ', "\r", "\n", '\'', '"'), '', cutstr(trim(strip_tags($consume['message'])), 200));
} } else { $groupbuyattr = loadClass('attr')->get_groupby_user_attr(); $allowreply = $shop['allowreply'] && $groupbuy['allowreply'] ? 1 : 0; $groupbuy['groupbuytime'] = date('Y-m-d', $groupbuy['validity_end']); $groupbuy['groupbuydiscount'] = round($groupbuy['groupbuypriceo'] / $groupbuy['groupbuyprice'], 2) * 10; $groupbuy['groupbuysave'] = round($groupbuy['groupbuyprice'] - $groupbuy['groupbuypriceo']); $groupbuy['surplusnum'] = !empty($groupbuy['groupbuymaxnum']) ? $groupbuy['groupbuymaxnum'] - $groupbuy['buyingnum'] : $lang['groupbuy_notrestricted']; $groupbuy['groupbuypriceo'] = round($groupbuy['groupbuypriceo']); $groupbuy['groupbuyprice'] = round($groupbuy['groupbuyprice']); $relatedarr = array(); $relatedarr = getrelatedinfo('groupbuy', $groupbuy['itemid'], $shop['itemid']); //更新統計數 $isupdate = freshcookie($action, $groupbuy['itemid']); if ($isupdate || !$_G['setting']['updateview']) { updateviewnum($action, $groupbuy['itemid']); } //評論 $listcount = $groupbuy['replynum']; $_G['setting']['viewspace_pernum'] = intval($_G['setting']['viewspace_pernum']); $type = 'groupbuy'; $my_join_info = loadClass('groupbuy')->get_my_join_info($_G['uid'], $groupbuy['itemid']); if ($my_join_info) { $already_joined = true; } else { $already_joined = false; } $groupbuy_is_on = true; if ($groupbuy['validity_end'] < $_G['timestamp'] || $groupbuy['grade'] < 3 || $groupbuy['close'] == 1) { $groupbuy_is_on = false; }
$result['time'] = date('Y-m-d', $result['dateline']); $result['thumb'] = str_replace('static/image/nophoto.gif', 'static/image/noimg.gif', $result['thumb']); $result['message'] = trim(strip_tags($result['message'])); $result['intro'] = cutstr($result['intro'], 130, true); $goodlist[] = $result; } $seo_title = $lang['goodlist'] . ' - ' . $seo_title; $theurl = "store.php?id={$shop['itemid']}&action=good"; } else { //商品詳情 $good = $_BCACHE->getiteminfo('good', $_GET['xid'], $_GET['id']); $good['message'] = bbcode2html($good['message']); if (!$good) { showmessage('not_found_msg', 'index.php'); } $allowreply = $shop['allowreply'] && $good['allowreply'] ? 1 : 0; $good['time'] = date('Y-m-d H:i', $good['dateline']); $relatedarr = array(); $relatedarr = getrelatedinfo('good', $good['itemid'], $shop['itemid']); //更新統計數 $isupdate = freshcookie($action, $good['itemid']); if ($isupdate || !$_G['setting']['updateview']) { updateviewnum($action, $good['itemid']); } //評論 $listcount = $good['replynum']; $_G['setting']['viewspace_pernum'] = intval($_G['setting']['viewspace_pernum']); $type = 'good'; $seo_title = $good['subject'] . ' - ' . $seo_title; $seo_description = str_replace(array(' ', "\r", "\n", '\'', '"'), '', cutstr(trim(strip_tags($good['message'])), 200)); }
$query = $_SGLOBAL['db']->query('SELECT i.* FROM ' . tname('spaceitems') . ' i WHERE i.itemid=\'' . $itemid . '\' AND type=\'news\''); $news = $_SGLOBAL['db']->fetch_array($query); } if (empty($news)) { showmessage('not_found', S_URL); } if ($news['folder'] != 1) { $_SCONFIG['htmlviewnews'] = 0; if ($_SGLOBAL['supe_uid'] != $news['uid'] && $_SGLOBAL['group']['groupid'] != 1) { showmessage('not_view'); } } //更新统计数 $isupdate = freshcookie($itemid); if ($isupdate || !$_SCONFIG['updateview']) { updateviewnum($itemid); } $query = $_SGLOBAL['db']->query('SELECT f.*, ff.name AS upname FROM ' . tname('categories') . ' f LEFT JOIN ' . tname('categories') . ' ff ON ff.catid=f.upid WHERE f.catid=\'' . $news['catid'] . '\''); $thecat = $_SGLOBAL['db']->fetch_array($query); $listcount = $_SGLOBAL['db']->result($_SGLOBAL['db']->query('SELECT COUNT(*) FROM ' . tname('spacenews') . ' WHERE itemid=\'' . $itemid . '\''), 0); if ($page > $listcount) { $_SHTML['page'] = $page = 1; } $start = $page - 1; $query = $_SGLOBAL['db']->query('SELECT ii.* FROM ' . tname('spacenews') . ' ii WHERE ii.itemid=\'' . $itemid . '\' ORDER BY ii.pageorder, ii.nid LIMIT ' . $start . ', 1'); if ($msg = $_SGLOBAL['db']->fetch_array($query)) { $news = array_merge($news, $msg); } else { updatetable('spaceitems', array('folder' => 3), array('itemid' => $itemid)); } if (!empty($news['newsurl'])) {