function ACP_MessageBox($message, $links = array()) { //SetNoUseCache(); global $cfg, $color; $urls = array(); if (count($links) == 0) { $urls[0] = array('返回', 'JavaScript:history.back(-1)'); } else { foreach ($links as $lnk) { $u = "index.php?mode={$lnk['1']}"; $flag = false; foreach ($lnk as $k => $v) { if (!is_string($k)) { continue; } if ($flag) { $u .= "&{$k}={$v}"; } else { $u .= "?{$k}={$v}"; $flag = true; } } $urls[] = array($lnk[0], $u); } } $fixurl = ''; foreach ($urls as $url) { $fixurl .= "[<a href=\"{$url['1']}\">{$url['0']}</a>]<br />"; } //$helplink = "[<a href=\"index.php\" >帮助</a>]"; $helplink = ''; ACP_ShowHeader('提示信息', $urls[0][1]); eval('echo "' . LoadTemplate('msgbox') . '";'); ACP_ShowFooter(); }
function MessageBox($message, $links = array(), $helpid = '') { SetNoUseCache(); global $cfg, $color, $str; $urls = array(); if (count($links) == 0) { $urls[0] = array($str['go_back'], 'JavaScript:history.back(-1)'); } else { foreach ($links as $lnk) { $u = "{$lnk['1']}.php"; $flag = false; foreach ($lnk as $k => $v) { if (!is_string($k)) { continue; } if ($flag) { $u .= "&{$k}={$v}"; } else { $u .= "?{$k}={$v}"; $flag = true; } } $urls[] = array($lnk[0], $u); } } $fixurl = ''; foreach ($urls as $url) { $fixurl .= "[<a href=\"{$url['1']}\">{$url['0']}</a>]<br />"; } $helplink = $helpid == '' ? '' : "[<a href=\"help.html#{$helpid}\" target=\"_blank\" >{$str['help']}</a>]"; ShowHeader('<img src="./images/info.gif" /> ' . $str['general_msg'], $urls[0][1]); eval('echo "' . LoadTemplate('msgbox') . '";'); ShowFooter(); }
$confirm_text = $row[0] ? "您确定要删除{$dateline}天没登陆且对局少于{$gameline}的会员吗?(符合条件的账号数:{$row['0']}) [<a href=\"index.php?mode=m_man&action=batch_del2&dateline={$dateline}&gameline={$gameline}\">确定</a>] [<a href=\"JavaScript:history.back(-1)\">取消</a>]<br />" : "没有符合条件的账号 [<a href=\"JavaScript:history.back(-1)\">返回</a>]"; $warning_text = ''; if ($row[0]) { if ($dateline < 30) { $warning_text .= '建议日期改到30天以上. '; } if ($gameline > 50) { $warning_text .= '建议对局数改小一些. '; } //if($postline>50) $warning_text.='建议对发贴数改小一些. '; if ($warning_text != '') { $warning_text = HLtxt($warning_text); } } ACP_ShowHeader('确认批量删除会员'); eval('echo "' . LoadTemplate('m_batch_del1') . '";'); ACP_ShowFooter(); break; case 'batch_del2': if (!isset($dateline, $gameline)) { ACP_MessageBox($str['act_err']); } $dateline = intval($dateline); $gameline = intval($gameline); //$postline=intval($postline); if ($dateline <= 0 || $gameline < 0) { ACP_MessageBox('输入超出范围'); } $dateline2 = time() - $dateline * 86400; //滤掉掉管理员 $admins = explode('|', $cfg['admins']);
function _SendEmail($s_to, $s_subj, $a_values, $b_use_template) { global $aPHPVERSION, $SPECIAL_VALUES, $FROM_USER; // // need PHP 4.0.5 for the preg_replace_callback function // if (!IsPHPAtLeast("4.0.5")) { SendAlert(GetMessage(MSG_PHP_AUTORESP, array("PHPVERS" => implode(".", $aPHPVERSION)))); return false; } $a_headers = array(); $s_mail_text = ""; $s_from_addr = GetAROption("FromAddr"); if (!isset($s_from_addr)) { $s_from_addr = ""; if (isset($FROM_USER) && !empty($FROM_USER)) { if ($FROM_USER != "NONE") { $s_from_addr = $FROM_USER; } } else { global $SERVER; $s_from_addr = "FormMail@" . $SERVER; } } else { $s_from_addr = UnMangle($s_from_addr); } if (!empty($s_from_addr)) { $a_headers['From'] = SafeHeader($s_from_addr); } $s_type = ""; if ($b_use_template) { if (IsAROptionSet('PlainTemplate')) { $s_type .= "PlainTemplate "; $s_template = GetAROption("PlainTemplate"); if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) { return false; } FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines"); $s_mail_text = implode(BODY_LF, $a_lines); } if (IsAROptionSet("HTMLTemplate")) { $s_type .= "HTMLTemplate "; if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) { return false; } FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes"); } } else { global $TEMPLATEURL, $TEMPLATEDIR; if (IsAROptionSet('PlainFile')) { $s_type .= "PlainFile "; // // load the plain text file from the templates area // if (empty($TEMPLATEDIR) && empty($TEMPLATEURL)) { SendAlert(GetMessage(MSG_TEMPLATES)); return false; } $s_file = GetAROption("PlainFile"); if (($a_lines = LoadTemplate($s_file, $TEMPLATEDIR, $TEMPLATEURL, true)) === false) { return false; } $s_mail_text = implode(BODY_LF, $a_lines); FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines"); } if (IsAROptionSet("HTMLFile")) { $s_type .= "HTMLFile "; if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) { return false; } FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes"); } } if (strlen($s_mail_text) == 0) { SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type)); } FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes"); return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers); }
function _SendEmail($s_to, $s_subj, $a_values, $b_use_template) { global $SPECIAL_VALUES; $a_headers = array(); $s_mail_text = ""; $s_from_addr = GetAROption("FromAddr"); if (!isset($s_from_addr)) { $s_from_addr = ""; if (!Settings::isEmpty('FROM_USER')) { if (Settings::get('FROM_USER') != "NONE") { $s_from_addr = Settings::get('FROM_USER'); } } else { global $SERVER; $s_from_addr = "FormMail@" . $SERVER; } } else { $s_from_addr = UnMangle($s_from_addr); } if (!empty($s_from_addr)) { $a_headers['From'] = SafeHeader($s_from_addr); } $s_type = ""; if ($b_use_template) { if (IsAROptionSet('PlainTemplate')) { $s_type .= "PlainTemplate "; $s_template = GetAROption("PlainTemplate"); if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) { return false; } FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines"); $s_mail_text = implode(Settings::get('BODY_LF'), $a_lines); } if (IsAROptionSet("HTMLTemplate")) { $s_type .= "HTMLTemplate "; if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) { return false; } FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes"); } } else { if (IsAROptionSet('PlainFile')) { $s_type .= "PlainFile "; // // load the plain text file from the templates area // if (Settings::isEmpty('TEMPLATEDIR') && Settings::isEmpty('TEMPLATEURL')) { SendAlert(GetMessage(MSG_TEMPLATES)); return false; } $s_file = GetAROption("PlainFile"); if (($a_lines = LoadTemplate($s_file, Settings::get('TEMPLATEDIR'), Settings::get('TEMPLATEURL'), true)) === false) { return false; } $s_mail_text = implode(Settings::get('BODY_LF'), $a_lines); FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines"); } if (IsAROptionSet("HTMLFile")) { $s_type .= "HTMLFile "; if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) { return false; } FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes"); } } if (strlen($s_mail_text) == 0) { SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type)); } FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes"); return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers); }
$m_website = $mdata['u_website'] == '' ? '无' : "<a href=\"{$mdata['u_website']}\" target=\"_blank\">{$mdata['u_website']}</a>"; $m_avatar = MakeBBAvatar($mdata['u_avatar']); //$m_grade= MakeBBGrade($mdata); $m_tout = GetBBTout($mdata) . '%'; $m_rate = $mdata['g_w'] + $mdata['g_d'] + $mdata['g_l'] == 0 ? 0 : round($mdata['g_w'] * 100 / ($mdata['g_w'] + $mdata['g_d'] + $mdata['g_l']), 1); $m_rate .= '%'; $mdata['reg_date'] = TimeToDate($mdata['reg_date']); $mdata['last_visit'] = TimeToDate($mdata['last_visit']); $buttons = ''; $encodename = urlencode($mdata['u_name']); if ($udata['is_member'] && !IsSameName($name, $udata['u_name'])) { $buttons .= MakeBBButton("room_new.php?byname={$encodename}", '搜索新局'); $buttons .= MakeBBButton("g_search.php?action=list&search_all_user=0&u_name={$encodename}", '搜索棋局'); $buttons .= MakeBBButton("pm_new.php?action=new1&sendto={$encodename}", '发送消息', 500, 220); $buttons .= MakeBBButton("pm_new.php?action=invite1&sendto={$encodename}", '邀请下棋', 500, 220); if (!In_Names($mdata['u_name'], $udata['friends'])) { $buttons .= MakeBBButton("m_fb.php?action=f_add&tname={$encodename}", '加为好友'); } if (!In_Names($mdata['u_name'], $udata['blacklist'])) { $buttons .= MakeBBButton("m_fb.php?action=b_add&tname={$encodename}", '加入黑名单'); } } $m_rec = "{$mdata['g_w']}胜{$mdata['g_d']}平{$mdata['g_l']}负"; if ($mdata['u_bio'] == '') { $mdata['u_bio'] = '(空)'; } else { $mdata['u_bio'] = BBCoding($mdata['u_bio']); } ShowHeader('会员信息'); eval('echo "' . LoadTemplate('m_view') . '";'); ShowFooter();
switch ($gdata['host_color']) { case 0: $gcolor = '<img src="./images/white.gif">'; break; case 1: $gcolor = '<img src="./images/black.gif">'; break; default: $gcolor = '随机'; } $skillmin = $udata['skill'] - $gdata['skill_range']; $skillmax = $udata['skill'] + $gdata['skill_range']; $greq = $gdata['skill_range'] == -1 ? '' : "({$skillmin}-{$skillmax}) "; $greq .= $gdata['tout_max'] >= 100 ? '' : "{$gdata['tout_max']}%"; if ($greq == '') { $greq = '-'; } $gtimelimit = Time2HMS($gdata['add_time']); if ($gdata['step_time']) { $gtimelimit .= '<br />' . Time2HMS($gdata['step_time']); } eval("\$nglist .= \"{$game_cell} \";"); $gnum++; } } if ($gnum == 0) { $nglist = "<tr bgcolor=\"{$color['cell']}\"><td colspan=\"8\">(空)</td></tr>"; } ShowHeader('<img src="./images/renju_new.gif" /> 我的新桌'); eval('echo "' . LoadTemplate('room_mynew') . '";'); ShowFooter();
// GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA// // ***** END LICENSE BLOCK ***** //////////////////////////////////////////////////////////////////////////////// require dirname(__FILE__) . '/sdk/sdk.php'; ///////////////////////////////////////////////////////////// // Chargement des informations de la page $strPage = GetCurrentPage(); // Chargement du contenu wiki pour cette page $strWikiContent = GetWikiContent($strPage); // On ajoute du contenu supplémentaire pour certaines pages comme la liste ou les changements $strModifiedWikiContent = $strWikiContent . GetSpecialContent($strPage); // Rendu wiki $strHtmlContent = Render($strModifiedWikiContent); ///////////////////////////////////////////////////////////// // Chargement du template $strContent = LoadTemplate('wiki'); // Les premiers remplacements sont en fonction du fichier de config $astrReplacements = BuildStandardReplacements(); // Ajoute les remplacements « runtime » AddReplacement($astrReplacements, 'Page.Name', htmlspecialchars($strPage)); AddReplacement($astrReplacements, 'Page.Wiki', $strWikiContent); AddReplacement($astrReplacements, 'Page.Html', $strHtmlContent); // Applique les remplacements $strContent = ReplaceAll($strContent, $astrReplacements); ///////////////////////////////////////////////////////////// WriteXhtmlHeader(); echo $strContent;
//{ $pos = $x + $y * 15 + 1; $num = $stones[$pos]; $html_board .= "<td width=\"{$sitewidth}\">"; if ($num >= 1 && $num <= 225) { $et = $num == $mcount ? '_f' : ''; $html_board .= $stones[$pos] % 2 == 0 ? "<img id=\"stone{$num}\" src=\"{$rmdir}/white{$et}.gif\">" : "<img id=\"stone{$num}\" src=\"{$rmdir}/black{$et}.gif\">"; } elseif ($num == 230) { $html_board .= $myside == 0 ? "<a href=\"JavaScript:PosClicked({$pos})\"><img id=\"stone230\" src=\"{$rmdir}/5a.gif\"></a>" : "<img id=\"stone230\" src=\"{$rmdir}/5a.gif\">"; } elseif ($num == 231) { $html_board .= $myside == 0 ? "<a href=\"JavaScript:PosClicked({$pos})\"><img id=\"stone231\" src=\"{$rmdir}/5b.gif\"></a>" : "<img id=\"stone231\" src=\"{$rmdir}/5b.gif\">"; } elseif ($canmove && !($myside == 0 && $gdata['step5'] == 2)) { $html_board .= "<a href=\"JavaScript:PosClicked({$pos})\"><img src=\"{$rmdir}/air.gif\"></a>"; } else { $html_board .= "<img src=\"{$rmdir}/air.gif\">"; } $html_board .= "</td>\n"; //} //else $html_board .= $x==0||$y==0? "<td width=\"{$sitewidth}\"> </td>" :'<td></td>'; } $html_board .= '</tr>'; } //$html_board .= "<tr height=\"{$sitewidth}\" ><td colspan=\"17\"></td></tr></table>"; $html_board .= "</table>"; eval('echo "' . LoadTemplate('board_html') . '";'); } else { $pos5a = $gdata['pos5_a']; $pos5b = $gdata['pos5_b']; eval('echo "' . LoadTemplate('board_java') . '";'); } ShowFooter();
$lks[0] = HLTxt('积分'); break; } //上榜人数 $sql = "SELECT COUNT(*) FROM {$cfg['tb_members']}"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row($result); $pageinfo = MakePageBar("ranking.php?orderby={$orderby}", $row[0], $cfg['mperpage'], $page); $sql = "SELECT * FROM {$cfg['tb_members']} ORDER BY {$order} LIMIT {$pageinfo['start']},{$cfg['mperpage']}"; $result = RenDB_Query($sql); $mlist = ''; $mnum = 0; if (RenDB_Num_Rows($result) > 0) { $member_cell = LoadTemplate('m_cell'); while ($mdata = RenDB_Fetch_Array($result)) { $morder = $pageinfo['start'] + $mnum + 1; $mname = MemberLink($mdata['u_name']); $mgrade = $mdata['skill']; $mrate = $mdata['g_w'] + $mdata['g_d'] + $mdata['g_l'] == 0 ? 0 : round($mdata['g_w'] * 100 / ($mdata['g_w'] + $mdata['g_d'] + $mdata['g_l']), 1); $mrate .= '%'; $minfo = "{$mdata['g_w']}胜{$mdata['g_d']}平{$mdata['g_l']}负"; $mregtime = TimeToDate($mdata['reg_date']); eval("\$mlist .= \"{$member_cell}\";"); $mnum++; } } else { $glist = "<tr><td colspan=\"7\">(空)</td></tr>"; } ShowHeader('<img src="./images/ranking.gif" /> 用户排名'); eval('echo "' . LoadTemplate("ranking") . '";'); ShowFooter();
} if (!$first) { $onlines .= ', '; } $onlines .= MemberLink($row['fake_name']); $first = false; } if ($guestcount > 0) { if (!$first) { $onlines .= ', '; } $onlines .= "Guest x {$guestcount}</td>"; } //删除旧的在线记录 $sql = "DELETE FROM {$cfg['tb_onlines']} WHERE o_time<={$o_deadline} OR o_time>'" . time() . "'"; RenDB_Query($sql, true); //在线纪录 require_once './cache/onlinerec.php'; if ($onlcount > $maxonline[0]) { $maxonline[0] = $onlcount; $buf = "<?php \$maxonline=array({$onlcount},{$nowtime}); ?>"; $fr = @fopen('./cache/onlinerec.php', 'w'); @flock($fr, LOCK_EX); @fwrite($fr, $buf); @fclose($fr); WriteBBLog("在线人数记录: {$onlcount}"); } $maxonline[1] = TimeToDate($maxonline[1]); ShowHeader('<img src="./images/home.gif" /> ' . $str['main_page']); eval('echo "' . LoadTemplate('main') . '";'); ShowFooter();
function DoProcessTemplate($s_dir, $s_url, $s_template, &$a_lines, $a_values, $s_missing, $s_subs_func) { global $aSubstituteErrors, $aSubstituteValues, $sSubstituteMissing; if (($a_template_lines = LoadTemplate($s_template, $s_dir, $s_url, true)) === false) { return false; } $b_ok = true; // // initialize the errors list // $aSubstituteErrors = array(); // // initialize the values // $aSubstituteValues = $a_values; $sSubstituteMissing = $s_missing; foreach ($a_template_lines as $s_line) { // // search for words in these forms: // $word // ${word:options} // where word begins with an alphabetic character and // consists of alphanumeric and underscore // $a_lines[] = preg_replace_callback('/\\$[a-z][a-z0-9_]*|\\$\\{[a-z][a-z0-9_]*(:[^\\}]*)*\\}/i', $s_subs_func, $s_line); } // SendAlert("Error count=".count($aSubstituteErrors)); if (count($aSubstituteErrors) != 0) { SendAlert(GetMessage(MSG_TEMPLATE_ERRORS, array("NAME" => $s_template)) . implode("\n", $aSubstituteErrors)); $b_ok = false; } global $FMCTemplProc; // // note that it's possible for an old version of FormMail Computation // module to get loaded which doesn't provide FMCTemplProc // if ($b_ok && ADVANCED_TEMPLATES && isset($FMCTemplProc)) { $a_mesgs = array(); /*foreach ($a_lines as $i_lno=>$s_line) if (strpos($s_line,"\n") !== false) SendAlert("Line $i_lno has a newline");*/ set_time_limit(60); if (($m_result = $FMCTemplProc->Process(implode("\n", $a_lines), $a_mesgs)) === false) { $s_msgs = "\n"; foreach ($a_mesgs as $a_msg) { $s_msgs .= "Line " . $a_msg["LINE"]; $s_msgs .= ", position " . $a_msg["CHAR"] . ": "; $s_msgs .= $a_msg["MSG"] . "\n"; } Error("fmadvtemplates", GetMessage(MSG_TEMPL_PROC, array("ERRORS" => $s_msgs)), false, false); $b_ok = false; } else { /*foreach ($m_result as $i_lno=>$s_line) if (($nn = substr_count($s_line,"\n")) > 1) SendAlert("Result line $i_lno has $nn newlines");*/ // // strip the new lines // $a_lines = explode("\n", implode("", $m_result)); } $a_alerts = $FMCTemplProc->GetAlerts(); if (count($a_alerts) > 0) { SendAlert(GetMessage(MSG_TEMPL_ALERT, array("ALERTS" => implode("\n", $a_alerts)))); } $a_debug = $FMCTemplProc->GetDebug(); if (count($a_debug) > 0) { SendAlert(GetMessage(MSG_TEMPL_DEBUG, array("DEBUG" => implode("\n", $a_debug)))); } } return $b_ok; }
<?php require_once './include/common.php'; ShowHeader('<img src="./images/help.gif" /> 帮助文档'); eval("echo \"" . LoadTemplate("help") . "\";"); ShowFooter();
/*case 'add': $sql="INSERT INTO `$cfg[tb_competitions]` SET cp_name='(新的比赛)' "; $result = RenDB_Query($sql); if( RenDB_Insert_id()) { ACP_WriteLog("添加比赛 ID:".RenDB_Insert_id()); Header("Location: index.php?mode=cp_man"); exit(); } ACP_MessageBox('添加失败'); break; */ case 'new1': $str_nowtime = date('H:i:s m/d/Y', $nowtime); ACP_ShowHeader('新建比赛'); eval('echo "' . LoadTemplate('cp_form') . '";'); ACP_ShowFooter(); break; case 'new2': if (!isset($cp_name, $description, $group_player, $timestep, $timeadd, $startdate, $rules)) { ACP_MessageBox($str['act_err']); } $rules = intval($rules); if ($rules < 0 || $rules > 2) { ACP_MessageBox('规则不正确'); } if ($timestep < 0) { $timestep = 0; } if (($timestep > 21600 || $timestep < 1440) && $timestep != 0) { ACP_MessageBox('每步限时应该在1天-15天之间');
// Enregistrement de la page Save($strPage, $strWikiContent); // Redirection vers l'affichage de la page header('Location: ' . GetScriptURI('Wiki') . FileNameEncode($strPage)); exit; } else { // En mode standard // Chargement du contenu wiki pour cette page $strWikiContent = GetWikiContent($strPage); } } // On ajoute du contenu supplémentaire pour certaines pages comme la liste ou les changements $strModifiedWikiContent = $strWikiContent . GetSpecialContent($strPage); // Rendu wiki $strHtmlContent = Render($strModifiedWikiContent); // On doit retirer les caractères non xhtml pour le contenu wiki qui sera édité $strWikiContent = xhtmlspecialchars($strWikiContent); //////////////////////////////////////////////////////////// // Chargement du template $strContent = LoadTemplate('edit'); // Les premiers remplacements sont en fonction du fichier de config $astrReplacements = BuildStandardReplacements(); // Ajoute les remplacements « runtime » AddReplacement($astrReplacements, 'Page.Name', htmlspecialchars($strPage)); AddReplacement($astrReplacements, 'Page.Wiki', $strWikiContent); AddReplacement($astrReplacements, 'Page.Html', $strHtmlContent); // Applique les remplacements $strContent = ReplaceAll($strContent, $astrReplacements); //////////////////////////////////////////////////////////// WriteXhtmlHeader(); echo $strContent;
<?php if (!defined('RBB_ADMINCP')) { die('Fatal error.'); } SetNoUseCache(); if (!isset($action)) { $action = 'list'; } if (!in_array($action, array('list', 'rebuild_cache', 'optimize', 'pm_batch_del'))) { ACP_MessageBox($str['act_err']); } switch ($action) { case 'list': ACP_ShowHeader('实用工具'); eval('echo "' . LoadTemplate('tools') . '";'); ACP_ShowFooter(); break; case 'rebuild_cache': require_once '../include/cache_func.php'; Rebuild_Global_Cache(true); ACP_WriteLog('刷新系统缓存'); ACP_MessageBox('系统缓存刷新完毕'); break; case 'optimize': $sql = "OPTIMIZE TABLE {$cfg['tb_members']},{$cfg['tb_pms']},{$cfg['tb_newgames']},{$cfg['tb_games']},{$cfg['tb_onlines']},{$cfg['tb_banips']},{$cfg['tb_settings']},{$cfg['tb_chats']},{$cfg['tb_competitions']},{$cfg['tb_groups']},{$cfg['tb_players']}"; RenDB_Query($sql, true); ACP_WriteLog('整理数据库'); ACP_MessageBox("数据库整理完毕"); break; case 'pm_batch_del':
while ($set = RenDB_Fetch_Array($result)) { //$slist.='<form action="index.php" method="post">'; $slist .= '<form action="index.php?mode=all_set&action=update&set_id=' . $set['set_id'] . '" method="post">'; $crsfix = 3 - $crsfix; $cr = $color["cell{$crsfix}"]; $slist .= "<tr bgcolor=\"{$cr}\">"; $slist .= "<td><a name=\"set_{$set['set_id']}\">{$set['set_note']}</a></td>"; $slist .= "<td><input type=\"text\" size=\"50\" maxlength=\"1024\" name=\"set_value\" value=\"{$set['set_value']}\"></td>"; $slist .= "<td><input type=\"submit\" value=\"更改\"></td>"; $slist .= '</tr>'; //$slist.='<input type="hidden" name="mode" value="all_set">'; //$slist.='<input type="hidden" name="action" value="update">'; //$slist.='<input type="hidden" name="set_id" value="'.$set['set_id'].'">'; $slist .= "</form>\n"; } ACP_ShowHeader('参数设置'); eval('echo "' . LoadTemplate('all_set') . '";'); ACP_ShowFooter(); break; case 'update': if (!isset($set_id, $set_value)) { ACP_MessageBox($str['act_err']); } $set_value = trim($set_value); $sql = "UPDATE {$cfg['tb_settings']} SET set_value='{$set_value}' WHERE set_id='{$set_id}' LIMIT 1"; RenDB_Query($sql, true); ACP_WriteLog("更改设置 ID:{$set_id} 值:{$set_value}"); Header("Location: index.php?mode=all_set&/#set_{$set_id}"); exit; break; }
case 5: $order = 'g_d DESC'; $lks[5] = HLTxt('Draw'); break; case 6: $order = 'g_l DESC'; $lks[6] = HLTxt('Lost'); break; default: $order = 'points DESC'; $lks[0] = HLTxt('Pts'); break; } $sql = "SELECT * FROM `{$cfg['tb_players']}` WHERE group_id='{$group_id}' ORDER BY {$order}"; $result = RenDB_Query($sql); $pllist = ''; $plnum = 0; if (RenDB_Num_Rows($result) > 0) { $pl_cell = LoadTemplate('player_cell'); while ($pldata = RenDB_Fetch_Array($result)) { $plnum++; $u_name = MemberLink($pldata['u_name']); eval("\$pllist.=\"{$pl_cell}\";"); } } else { $pllist = "<tr bgcolor=\"{$color['cell']}\"><td clospan=\"5\">({$str['empty']})</td></tr>"; } //echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 ); ShowHeader($str['cp_view']); eval('echo "' . LoadTemplate('group_view') . '";'); ShowFooter();
$pmfrom .= ' (' . HLTxt('系统消息') . ')'; $message = BBCoding($pmdata['message'], true); } else { $pmfrom = $outbox ? 'To:' . MemberLink($pmdata['sendto']) : 'From:' . MemberLink($pmdata['comefrom']); $message = BBCoding($pmdata['message'], false); } //if( $pmnum > $cfg['maxpm'] ) // $message = "<del>$message</del>"; eval("\$pmlist .= \"{$pm_cell} \";"); } /* if( $pmnum > $cfg['maxpm'] ) { $sql ="DELETE FROM {$cfg['tb_pms']} WHERE sendto='{$udata['u_name']}' AND pmid<'{$endid}'"; RenDB_Query($sql,true) ; }*/ } if ($pmnum == 0) { $pmlist = "<tr bgcolor=\"{$color['cell']}\"><td>(空)</td></tr>"; } $pmnew = MakeBBButton('pm_new.php?&action=new1', '发消息', 550, 250); if ($udata['have_new_pm']) { $sql = "UPDATE {$cfg['tb_pms']} SET `isnew` = 0 WHERE `sendto`='{$udata['u_name']}'"; RenDB_Query($sql, true); $sql = "UPDATE {$cfg['tb_members']} SET have_new_pm=0 WHERE u_name='{$udata['u_name']}' LIMIT 1"; RenDB_Query($sql, true); $udata['have_new_pm'] = 0; } ShowHeader('<img src="./images/pm.gif" /> 我的消息'); eval("echo \"" . LoadTemplate("pm_view") . "\";"); ShowFooter();
MessageBox("您的新桌已经到了上限({$cfg['maxnewgame']})"); } /* $sql="SELECT COUNT(*) FROM $cfg[tb_games] WHERE b_name='$udata[u_name]' OR w_name='$udata[u_name]'"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row( $result ); echo $row[0]; if( $row[0] >= $cfg['maxgame'] ) MessageBox("您进行中的的棋局已经到了上限($cfg[maxgame])"); */ $greate = $cfg['maxnewgame'] - $row[0]; $gnumoption = ''; for ($i = 2; $i <= $greate; $i++) { $gnumoption .= "<option value={$i}>{$i}</option>"; } ShowHeader('<img src="./images/renju_new.gif" /> 创建新局'); eval("echo \"" . LoadTemplate("g_form") . "\";"); ShowFooter(); break; case 'new2': if (!isset($timeadd, $timestep, $skill_range, $rules, $gcreate, $maxtout, $hostcolor)) { ErrorBox($str['act_err']); } $sql = "SELECT COUNT(*) FROM {$cfg['tb_newgames']} WHERE host_name='{$udata['u_name']}'"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row($result); if ($row[0] >= $cfg['maxnewgame']) { MessageBox("您的新桌已经到了上限({$cfg['maxnewgame']})"); } /* $sql="SELECT COUNT(*) FROM $cfg[tb_games] WHERE b_name='$udata[u_name]' OR w_name='$udata[u_name]'"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row( $result );
$row = RenDB_Fetch_Array( $result ); if($row['u_id']<1) MessageBox( '发送失败' ); //generate checkcode for new pass $passcheck=md5(uniqid(rand(),true)); $newpass=substr(md5(uniqid(rand(),true)),0,8); //$newpass=uniqid(rand(),true); //write into database $sql = "UPDATE `$cfg[tb_members]` SET new_pass='******', new_pass_check='$passcheck' WHERE u_id='$row[u_id]' LIMIT 1"; RenDB_Query($sql,true); $nowtime=TimeToDate($nowtime,true); //send email eval('$mail_msg= "'.LoadTemplate('email_send_pass').'";'); //echo $mail_msg; //die($cfg['email_subject'].$mail_msg); if(mail($u_email,$cfg['email_subject'],$mail_msg, "From: $cfg[rbb_email]" )) { MessageBox('新的密码已经发到您的邮箱,请查收'); } else { MessageBox('发送失败'); } break; case 'confirm_pass': SetNoUseCache();
switch ($action) { case 'show': $ban_ips = ''; $sql = "SELECT * FROM `{$cfg['tb_banips']}` ORDER BY ban_time DESC"; $result = RenDB_Query($sql); while ($row = RenDB_Fetch_Array($result)) { $row['ban_time'] = TimeToDate($row['ban_time'], true); $ban_ips .= "<option value=\"{$row['ban_ip']}\">{$row['ban_time']} | {$row['ban_ip']} | {$row['ban_reason']}</option>"; } if ($ban_ips != '') { $ban_ips = "<select style=\"width: 90%\" name=\"ban_ip\">{$ban_ips}</select> <input type=\"submit\" value=\"解禁\" >"; } else { $ban_ips = '目前没有IP被屏蔽'; } ACP_ShowHeader('屏蔽IP'); eval('echo "' . LoadTemplate('ip_man') . '";'); ACP_ShowFooter(); break; case 'ban': if (!isset($ban_ip, $ban_reason)) { ACP_MessageBox($str['act_err']); } $ban_ip = trim($ban_ip); if (!eregi('^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.(\\*|[0-9]{1,3})$', $ban_ip)) { ACP_MessageBox('IP格式不正确'); } $mycell = explode('.', $userip); //检查是不是自己的IP $cell = explode('.', $ban_ip); if ($cell[3] == '*') { if ($mycell[0] == $cell[0] && $mycell[1] == $cell[1] && $mycell[2] == $cell[2]) {
foreach($onlines as $n2) if(IsSameName($n,$n2)) { $this_name='<b>'.$this_name.'</b>'; break; } $b_list.=$this_name."[<a href=\"m_fb.php?action=b_del&tname=$n\">删</a>] "; } } else $b_list='(空)'; $addbox="<input type=text size=20 maxlength=12 name=\"tname\"> <input type=\"submit\" value=\"添加\">"; $add_box_f=strlen($udata['friends']) >= $cfg['max_friends']?'您的好友列表已满': $addbox; $add_box_b=strlen($udata['blacklist']) >= $cfg['max_blacklist']?'您的黑名单已满': $addbox; ShowHeader('<img src="./images/profile.gif" /> 我的好友'); eval ('echo "'.LoadTemplate('m_fb').'";'); ShowFooter(); break; case 'f_add': if(!IsMember($tname)) ErrorBox('用户不存在'); if(IsSameName($tname,$udata['u_name'])) MessageBox('不能加自己'); if(strlen($udata['friends']) >= $cfg['max_friends']) MessageBox('您的好友列表已经满了'); if(In_Names($tname,$udata['friends'])) MessageBox('该用户已经在好友列表中了'); if(In_Names($tname,$udata['blacklist'])) { //从黑名单中删除 $blacklist=explode('|',$udata['blacklist']); foreach($blacklist as $k=>$n) { if(IsSameName($tname,$n))
} $gblack = '<a href="m_view.php?&name=' . urlencode($gdata['b_name']) . "\">{$gblack}</a>"; $gwhite = '<a href="m_view.php?&name=' . urlencode($gdata['w_name']) . "\">{$gwhite}</a>"; if ($gturn == '') { $gturn = '-'; } else { $gturn = '<a href="m_view.php?&name=' . urlencode($gdata['turn_name']) . "\">{$gturn}</a>"; } if ($turnside != -1) { if ($undos[!$myside]) { $gturn .= HLTxt('(悔)'); } if ($draws[!$myside]) { $gturn .= HLTxt('(和)', 1); } } $gopening = $gdata['rules'] <= 1 ? $openingname[$gdata['opening']] : '-'; eval("\$glist .= \"{$game_cell} \";"); $gnum++; } } if ($gnum == 0) { $glist = "<tr bgcolor=\"{$color['cell']}\"><td colspan=\"8\">没找到</td></tr>"; } //echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 ); ShowHeader('<img src="./images/renju.gif" /> 搜索棋局'); eval('echo "' . LoadTemplate('g_search_result') . '";'); ShowFooter(); } break; }
<?php require_once './include/common.php'; if (!isset($_GET['action']) || !in_array($_GET['action'], array('show', 'login', 'logout'))) { ErrorBox($str['act_err']); } switch ($_GET['action']) { case 'show': ShowHeader("<img src=\"./images/stan0.gif\" /> 用户登陆"); eval('echo "' . LoadTemplate('login_form') . '";'); ShowFooter(); break; case 'login': if (!isset($_POST['log_name'], $_POST['log_pass'])) { ErrorBox($str['act_err']); } $log_pass = $_POST['log_pass']; $log_name = trim($_POST['log_name']); //删除旧的在线记录 $sql = "DELETE FROM {$cfg['tb_onlines']} WHERE o_time<={$o_deadline} OR o_time>'" . time() . "'"; RenDB_Query($sql, true); $row['u_id'] = 0; $sql = "SELECT u_id,ban_before FROM {$cfg['tb_members']} WHERE u_name='{$log_name}' AND u_pass=MD5('{$log_pass}') LIMIT 1"; $result = RenDB_Query($sql); if (RenDB_Num_Rows($result)) { $row = RenDB_Fetch_Array($result); } if (!$row['u_id']) { WriteBBLog("密码错误 IP:{$userip} 用户名:'{$log_name}'", 'wrongpass'); MessageBox('账号或密码无效'); }
function ProcessTemplate($s_template, &$a_lines, $a_values, $s_missing = NULL, $s_subs_func = 'SubstituteValue') { global $aSubstituteErrors, $aSubstituteValues, $sSubstituteMissing; if (($a_template_lines = LoadTemplate($s_template, true)) === false) { return false; } $b_ok = true; // // initialize the errors list // $aSubstituteErrors = array(); // // initialize the values // $aSubstituteValues = $a_values; $sSubstituteMissing = $s_missing; foreach ($a_template_lines as $s_line) { // // search for words in this form: // $word // where word begins with an alphabetic character and // consists of alphanumeric and underscore // $a_lines[] = preg_replace_callback('/\\$([a-z][a-z0-9_]*)/i', $s_subs_func, $s_line); } // SendAlert("Error count=".count($aSubstituteErrors)); if (count($aSubstituteErrors) != 0) { SendAlert(GetMessage(MSG_TEMPLATE_ERRORS, array("NAME" => $s_template)) . implode("\n", $aSubstituteErrors)); $b_ok = false; } return $b_ok; }
} } //在线会员 $sql = "SELECT * FROM {$cfg['tb_onlines']} WHERE o_time>{$o_deadline}"; $result = RenDB_Query($sql); while ($row = RenDB_Fetch_Array($result)) { if ($row['u_stand'] == 0) { //游客 continue; } if (In_names($row['fake_name'], $udata['friends']) || IsSameName($row['fake_name'], $udata['u_name'])) { continue; } $contact_options .= "<option style=\"color:999999#\" value=\"{$row['fake_name']}\" >{$row['fake_name']}</option>"; } eval("echo \"" . LoadTemplate("pm_form_invite") . "\";"); exit; break; case 'new2': $message = BBInputFilter($message, 10); $message = CSubStr($message, 0, $cfg['maxmsg']); if ($message == '') { SimplyBox('请填写内容'); } case 'invite2': if ($sendto == '') { SimplyBox('请填写收件人'); } if (IsSameName($sendto, $udata['u_name'])) { SimplyBox('不能给自己发消息'); }
$page = intval($page); $sql = "SELECT COUNT(*) FROM `{$cfg['tb_competitions']}`"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row($result); $pageinfo = MakePageBar("cp_list.php?", $row[0], $cfg['gperpage'], $page); $sql = "SELECT * FROM `{$cfg['tb_competitions']}` ORDER BY cp_id DESC LIMIT {$pageinfo['start']},{$cfg['gperpage']}"; $result = RenDB_Query($sql); $cplist = ''; if (RenDB_Num_Rows($result) > 0) { while ($cpdata = RenDB_Fetch_Array($result)) { $cplist .= "<tr bgcolor=\"{$color['cell']}\"><td>"; if (!file_exists("./cpdata/{$cpdata['cp_id']}.html")) { $cplist .= $cpdata['cp_name']; } else { $cplist .= "<a href=\"cp_view.php?cp_id={$cpdata['cp_id']}\">{$cpdata['cp_name']}</a>"; } $cplist .= ' ' . TimeToDate($cpdata['starttime']); if ($cpdata['endtime']) { $cplist .= ' - ' . TimeToDate($cpdata['endtime']); } $cplist .= '<hr />'; $cplist .= $cpdata['description']; $cplist .= "</td></tr>"; } } else { $cplist = "<tr bgcolor=\"{$color['cell']}\"><td>(空)</td></tr>"; } //echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 ); ShowHeader('<img src="./images/renju.gif" /> ' . $str['cp_view']); eval('echo "' . LoadTemplate('cp_list') . '";'); ShowFooter();