} ?> href="<?php echo geturl("uid/{$_GET['uid']}/op/bbs"); ?> ">论坛</a> <?php } ?> </div> <?php if ($_GET['op'] == 'uchblog' && uchome_exists() && !in_array('uchblog', $_SCONFIG['closechannels'])) { block("uchblog", "uid/{$_GET['uid']}/order/dateline DESC/perpage/20/cachetime/3600/showdetail/1/messagelen/200/messagedot/1/cachename/infobody"); } elseif ($_GET['op'] == 'uchphoto' && uchome_exists() && !in_array('uchphoto', $_SCONFIG['closechannels'])) { block("uchphoto", "uid/{$_GET['uid']}/order/updatetime DESC/perpage/6/subjectlen/30/messagedot/0/cachetime/3600/cachename/infobody"); } elseif ($_GET['op'] == 'bbs' && discuz_exists() && !in_array('bbs', $_SCONFIG['closechannels'])) { block("bbsthread", "authorid/{$_GET['uid']}/order/dateline DESC/perpage/20/cachetime/3600/showdetail/1/messagelen/200/messagedot/1/cachename/infobody"); } else { block("spacenews", "uid/{$_GET['uid']}/order/i.dateline DESC/perpage/20/cachetime/3600/showdetail/1/messagelen/200/messagedot/1/cachename/infobody"); } ?> <?php if ($_GET['op'] == 'uchphoto') { ?> <div class="global_module user_photolist"> <div class="clearfix"> <?php if (is_array($_SBLOCK['infobody'])) { foreach ($_SBLOCK['infobody'] as $key => $value) { ?>
'; //LIST SHOW if (is_array($listarr) && $listarr) { echo label(array('type' => 'form-start', 'name' => 'listform', 'action' => $theurl)); echo label(array('type' => 'help', 'text' => $alang['help_crons'])); echo label(array('type' => 'table-start', 'class' => 'listtable')); echo '<tr">'; echo '<th>' . $alang['cron_name'] . '</th>'; echo '<th>' . $alang['cron_type'] . '</th>'; echo '<th>' . $alang['cron_available'] . '</th>'; echo '<th>' . $alang['cron_lastrun'] . '</th>'; echo '<th>' . $alang['cron_nextrun'] . '</th>'; echo '<th>' . $alang['space_op'] . '</th>'; echo '</tr>'; foreach ($listarr as $listvalue) { if (!discuz_exists() && ($listvalue['filename'] == 'updatebbsforums.php' || $listvalue['filename'] == 'updatebbscache.php')) { continue; } empty($class) ? $class = ' class="darkrow"' : ($class = ''); $listvalue['lastrun'] = sgmdate($listvalue['lastrun'], '', 0); $listvalue['nextrun'] = sgmdate($listvalue['nextrun'], '', 0); if (!$listvalue['available']) { $trbgcolor = '#CCCCCC'; $listvalue['nextrun'] = '-'; } echo '<tr' . $class . ' align="center">'; echo '<td align="left"><b>' . $listvalue['name'] . '</b></td>'; echo '<td>' . $alang['cron_type_' . $listvalue['type']] . '</td>'; echo '<td>' . $alang['cron_available_' . $listvalue['available']] . '</td>'; echo '<td>' . $listvalue['lastrun'] . '</td>'; echo '<td>' . $listvalue['nextrun'] . '</td>';
showmessage('set_info_is_empty'); } if ($_POST['sethave']) { if ($_POST['posttype'] == 'uchome') { if (uchome_exists()) { $datarr['setdbhost'] = $_SC['dbhost_uch']; $datarr['setdbname'] = $_SC['dbname_uch']; $datarr['setdbuser'] = $_SC['dbuser_uch']; $datarr['setdbpwd'] = $_SC['dbpw_uch']; $datarr['setdbpre'] = $_SC['tablepre_uch']; $datarr['setdbpconnect'] = $_SC['pconnect_uch']; } else { showmessage('not_uchome_exists'); } } elseif ($_POST['posttype'] == 'bbs') { if (discuz_exists()) { $datarr['setdbhost'] = $_SC['dbhost_bbs']; $datarr['setdbname'] = $_SC['dbname_bbs']; $datarr['setdbuser'] = $_SC['dbuser_bbs']; $datarr['setdbpwd'] = $_SC['dbpw_bbs']; $datarr['setdbpre'] = $_SC['tablepre_bbs']; $datarr['setdbpconnect'] = $_SC['pconnect_bbs']; } else { showmessage('not_discuz_exists'); } } } else { $_POST['setdbhost'] = trim($_POST['setdbhost']); $_POST['setdbname'] = trim($_POST['setdbname']); $_POST['setdbuser'] = trim($_POST['setdbuser']); $_POST['setdbpwd'] = trim($_POST['setdbpwd']);
} elseif (!empty($forum['password'])) { $jumptobbs = true; } elseif (!empty($forum['viewperm'])) { $viewpermarr = explode("\t", $forum['viewperm']); if (!in_array('7', $viewpermarr)) { $jumptobbs = true; } } elseif (!empty($forum['redirect'])) { $forumurl = $forum['redirect']; $jumptobbs = true; } if ($jumptobbs) { continue; } } } elseif ($arr[0] == 'forumdisply' && discuz_exists()) { $_SGET['fid'] = $arr[1]; //避免跳转 $fid = intval($_SGET['fid']); $forum = array(); if ($fid) { dbconnect(1); $query = $_SGLOBAL['db_bbs']->query("SELECT f.*, ff.* FROM " . tname('forums', 1) . " f LEFT JOIN " . tname('forumfields', 1) . " ff ON ff.fid=f.fid WHERE f.fid='{$fid}'"); $forum = $_SGLOBAL['db_bbs']->fetch_array($query); } if (empty($forum)) { continue; } $jumptobbs = false; if ($forum['status'] < 1) { $jumptobbs = true;
function updatebbsbbcode() { global $_SGLOBAL, $_DCACHE; if (discuz_exists()) { dbconnect(1); $_DCACHE['bbcodes'] = $_DCACHE['smilies'] = array(); $regexp = array(1 => "/\\[{bbtag}](.+?)\\[\\/{bbtag}\\]/is", 2 => "/\\[{bbtag}=(['\"]?)(.+?)(['\"]?)\\](.+?)\\[\\/{bbtag}\\]/is", 3 => "/\\[{bbtag}=(['\"]?)(.+?)(['\"]?),(['\"]?)(.+?)(['\"]?)\\](.+?)\\[\\/{bbtag}\\]/is"); $query = $_SGLOBAL['db_bbs']->query('SELECT * FROM ' . tname('bbcodes', 1) . ' WHERE available=\'1\''); while ($bbcode = $_SGLOBAL['db_bbs']->fetch_array($query)) { $search = str_replace('{bbtag}', $bbcode['tag'], $regexp[$bbcode['params']]); $bbcode['replacement'] = preg_replace("/([\r\n])/", '', $bbcode['replacement']); switch ($bbcode['params']) { case 2: $bbcode['replacement'] = str_replace('{1}', '\\2', $bbcode['replacement']); $bbcode['replacement'] = str_replace('{2}', '\\4', $bbcode['replacement']); break; case 3: $bbcode['replacement'] = str_replace('{1}', '\\2', $bbcode['replacement']); $bbcode['replacement'] = str_replace('{2}', '\\5', $bbcode['replacement']); $bbcode['replacement'] = str_replace('{3}', '\\7', $bbcode['replacement']); break; default: $bbcode['replacement'] = str_replace('{1}', '\\1', $bbcode['replacement']); break; } $replace = $bbcode['replacement']; for ($i = 0; $i < $bbcode['nest']; $i++) { $_DCACHE['bbcodes']['searcharray'][] = $search; $_DCACHE['bbcodes']['replacearray'][] = $replace; } } $_DCACHE['smilies'] = array('searcharray' => array(), 'replacearray' => array()); $query = $_SGLOBAL['db_bbs']->query('SELECT * FROM ' . tname('smilies', 1) . ' WHERE type=\'smiley\' ORDER BY LENGTH(code) DESC'); while ($smiley = $_SGLOBAL['db_bbs']->fetch_array($query)) { $_DCACHE['smilies']['searcharray'][] = '/' . preg_quote(shtmlspecialchars($smiley['code']), '/') . '/'; $_DCACHE['smilies']['replacearray'][] = $smiley['url']; $_DCACHE['smilies']['display'][] = array('code' => $smiley['code'], 'url' => $smiley['url']); } //make cache $cachefile = S_ROOT . './data/system/bbs_bbcodes.cache.php'; $cachetext = '$_DCACHE[\'bbcodes\']=' . arrayeval($_DCACHE['bbcodes']) . ";\r\n\r\n"; $cachetext .= '$_DCACHE[\'smilies\']=' . arrayeval($_DCACHE['smilies']) . ";\r\n\r\n"; writefile($cachefile, $cachetext, 'php'); } }
if (empty($_SCONFIG['closemessage'])) { $_SCONFIG['closemessage'] = $lang['site_close']; } $userinfo = empty($_SGLOBAL['supe_username']) ? '' : "{$lang['welcome']}, {$_SGLOBAL['supe_username']} <a href=\"" . S_URL . "/batch.login.php?action=logout\" style=\"color:#aaa;\">[{$lang[logout]}]</a><br/>"; showmessage("{$_SCONFIG['closemessage']}<br /><p style=\"font-size:12px;color:#aaa;\">{$userinfo}<a href=\"" . geturl("action/login") . "\" style=\"color:#aaa;\">{$lang['admin_login']}</a></p>"); } } $_SGLOBAL['maxpages'] = 500; //限制分页500 if (!empty($_SGET['page'])) { if ($_SGET['page'] > $_SGLOBAL['maxpages']) { $_SGET['page'] = $_SGLOBAL['maxpages']; } } //频道关闭隐藏 if ($_SGET['action'] == 'channel' && in_array($_SGET['name'], $_SCONFIG['closechannels']) || in_array($_SGET['action'], $_SCONFIG['closechannels']) || $_SGET['action'] == 'bbs' && !discuz_exists() || in_array($_SGET['action'], array('uchblog', 'uchimage', 'blogdetail', 'bloglist', 'imagedetail', 'imagelist')) && !uchome_exists()) { $_SGET['action'] = 'index'; } //关键字、描述、导航、标题 $keywordarr = $descriptionarr = $guidearr = $titlearr = array(); //自定义频道 if ($_SGET['action'] == 'channel') { $_SGET['name'] = empty($_SGET['name']) ? '' : trim(preg_replace("/[^a-z0-9\\-\\_]/i", '', trim($_SGET['name']))); if (!empty($_SGET['name'])) { if (!empty($_SCONFIG['hidechannels'][$_SGET['name']])) { $_SCONFIG['channel'][$_SGET['name']] = $_SCONFIG['hidechannels'][$_SGET['name']]; } $scriptfile = S_ROOT . './channel/channel_' . $_SGET['name'] . '.php'; if (file_exists($scriptfile)) { include_once $scriptfile; exit;
$query = $_SGLOBAL['db']->query('SELECT s.* FROM ' . tname('styles') . ' s WHERE s.tplid=\'' . $_GET['tplid'] . '\''); if ($thevalue = $_SGLOBAL['db']->fetch_array($query)) { } else { showmessage('style_none_exists'); } } elseif ($_GET['op'] == 'add') { //ONE ADD $thevalue = array('tplid' => '0', 'tpltype' => $tpltype, 'tplname' => '', 'tplnote' => '', 'tplfilepath' => ''); $addclass = ' class="active"'; } elseif ($_GET['op'] == 'delete') { //ONE DELETE $_GET['tplid'] = intval($_GET['tplid']); $_SGLOBAL['db']->query('DELETE FROM ' . tname('styles') . ' WHERE tplid=\'' . $_GET['tplid'] . '\''); showmessage('style_delete_success', $newurl); } if (!discuz_exists()) { foreach ($listarr as $tplk => $tplv) { if (substr($tplv['tpltype'], 0, 3) == 'bbs') { unset($listarr[$tplk]); } } } //MENU echo ' <table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td><h1>' . $alang['style_title'] . '</h1></td> <td class="actions"> <table summary="" cellpadding="0" cellspacing="0" border="0" align="right"> <tr> <td' . $viewclass . '><a href="' . $theurl . '" class="view">' . $alang['style_view_list'] . '</a></td>
showmessage('spacenews_no_popedom_add'); } //ONE ADD $thevalue = array('itemid' => 0, 'itemtypeid' => 0, 'catid' => $_SGET['catid'], 'type' => $type, 'subject' => '', 'dateline' => $_SGLOBAL['timestamp'], 'digest' => '0', 'top' => '0', 'allowreply' => '1', 'hash' => $hashstr, 'message' => '', 'tagname' => '', 'uploadarr' => array(), 'allowmax' => $allowmax, 'customfieldid' => 0, 'customfieldtext' => '', 'haveattach' => 0, 'replynum' => 0, 'tid' => 0, 'grade' => 0, 'picid' => 0, 'hottagarr' => array(), 'lasttagarr' => array()); $thevalue['newsurl'] = ''; $thevalue['nid'] = 0; $thevalue['newsfromurl'] = ''; $page = 1; $listcount = 1; $multipage = ''; //论坛导入 $tid = 0; if (!empty($_GET['tid'])) { $tid = intval($_GET['tid']); } if (!empty($tid) && discuz_exists()) { if ($_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query('SELECT itemid FROM ' . tname('spaceitems') . ' WHERE tid=\'' . $tid . '\' AND type=\'' . $type . '\' LIMIT 1'))) { showmessage('bbsimport_imported'); } include_once S_ROOT . './include/bbsimport.inc.php'; } } elseif ($_GET['op'] == 'view') { if (empty($_GET['page'])) { $_GET['page'] = 1; } $itemid = intval($_GET['itemid']); $query = $_SGLOBAL['db']->query('SELECT ii.*, i.* FROM ' . tname('postitems') . ' ii LEFT JOIN ' . tname('postmessages') . ' i ON i.itemid=ii.itemid WHERE ii.itemid=\'' . $itemid . '\''); $news = $_SGLOBAL['db']->fetch_array($query); $news['message'] = shtmlspecialchars($news['message']); $news['message'] = preg_replace("/<(\\/)*(p|br)(?:\\s*)(\\/)*>/", '<\\1\\2>', $news['message']); if (empty($news)) {