Example #1
0
                 if (trim($v) != '') {
                     $at_mgc[trim($v)] = trim($v);
                 }
             }
         }
         $nmgc = $g_name = htmlspecialchars(trim($_POST['mgc']), ENT_QUOTES);
         $at_mgc[trim($nmgc)] = trim($nmgc);
         $mgc_c = "<?php";
         foreach ($at_mgc as $v) {
             $mgc_c .= "\r\n\$a_mgc[]='" . $v . "';";
         }
         $mgc_c .= "\r\n//\$a_mgc[]='';\r\n//请自行添加敏感词,一行一个\r\n\r\n";
         writeText($mgc_file, $mgc_c);
         $e = 2;
     } elseif (isset($_POST['delmgc']) && $_POST['delmgc'] == 1) {
         writeText($mgc_file, "<?php\r\n//\$a_mgc[]='';\r\n//请自行添加敏感词,一行一个\r\n\r\n");
         $e = 3;
     }
     header('Location:./?m=setting&t=special' . (isset($e) ? '&e=' . $e : ''));
     exit;
 } else {
     $a_msg = array(1 => '设置已修改。', '敏感词已保存。', '敏感词过滤功能已关闭。');
     $is_disa = $config['open'] > 0 ? '' : ' disabled="disabled"';
     $content .= (isset($_GET['e']) && isset($a_msg[$_GET['e']]) ? '<div class="msg_v">' . $a_msg[$_GET['e']] . '</div>' : '') . '<div class="title">访客账号</div><div class="lcontent">基于某些特殊原因,部分主管部门或者相关机构可能会要求审查内容,在没有开放访问的情况下可以通过开启访客账号来提供给相关部门进行审查。<br/><br/>此功能只有在不开放访问时生效。<br/><br/>' . ($config['open'] > 0 ? '<form method="post" action="">' : '') . '<table><tr><td>访客账号:</td><td><input name="g_open" type="radio" value="1"' . ($config['g_open'] > 0 ? ' checked="checked"' : '') . ' rel="s_cbt" data-id="gline"' . $is_disa . ' />开启 <input name="g_open" type="radio" value="0"' . ($config['g_open'] == 0 ? ' checked="checked"' : '') . ' rel="h_cbt" data-id="gline"' . $is_disa . ' />关闭</td></tr><tbody id="gline"' . ($config['g_open'] > 0 ? '' : ' style="display: none;"') . '><tr><td>用户名:</td><td><input name="g_name" size="15" value="' . $config['g_name'] . '"' . $is_disa . '/>(不可以与现有用户的用户名一样)</td></tr><tr><td>密码:</td><td><input name="g_pwd" size="15" value="' . $config['g_pwd'] . '"' . $is_disa . '/></td></tr></tbody><tr><td colspan="2"><input type="submit" value="修改" class="button"' . $is_disa . ' /></td></tr></table>';
     if ($config['open'] > 0) {
         $content .= '</form>';
     }
     if ($config['g_vdate'] > 0) {
         $content .= '<br/>最后使用:' . date('Y-n-j H:i', $config['g_vdate']);
     }
     if ($config['g_vc'] > 0) {
Example #2
0
        unset($result);
        $username = trim($_POST['username']);
        $password = enc_p(trim($_POST['password']));
        $name = htmlspecialchars(trim($_POST['name']), ENT_QUOTES);
        $query = sprintf('insert into %s (username, password, name, power, regdate) values (%s, %s, %s, 9, %s)', $dbprefix . 'member', SQLString($username, 'text'), SQLString($password, 'text'), SQLString($name, 'text'), time());
        $result = mysql_query($query);
        echo '<li>写入新数据 ' . $dbprefix . 'member:<span style="font-weight:bold;color:#' . ($result == true ? '036;">成功' : 'f00;">失败') . '</span></li>';
        unset($query);
        unset($result);
        $query = sprintf('insert into %s (path, title, sfile) values (%s, %s, %s)', $dbprefix . 'skin', SQLString('blue', 'text'), SQLString('蓝色梦想', 'text'), SQLString('styles.css', 'text'));
        $result = mysql_query($query);
        echo '<li>写入新数据 ' . $dbprefix . 'skin:<span style="font-weight:bold;color:#' . ($result == true ? '036;">成功' : 'f00;">失败') . '</span></li>';
        unset($query);
        unset($result);
        echo '</ul><input type="button" value="完成" class="button" onclick="location.href=\'../\';"/></div>';
        writeText($l_file, time());
    } else {
        ?>
	<div class="title">第2步:配置信息</div>
	<div class="lcontent">
		<form method="post" onsubmit="if(document.form1.title.value=='' || document.form1.username.value=='' || document.form1.password.value=='' || document.form1.name.value==''){alert('请输入配置信息。');return false;}else if(document.form1.password.value!='' && document.form1.password.value!=document.form1.password2.value){alert('请确认密码。');return false;}" name="form1">
			<table>
				<tr><td>标题:</td><td><input name="title" size="32"/></td></tr>
				<tr><td colspan="2">管理员信息</td></tr>
				<tr><td>用户名:</td><td><input name="username" size="32"/></td></tr>
				<tr><td>姓名:</td><td><input name="name" size="32"/></td></tr>
				<tr><td>密码:</td><td><input type="password" name="password" size="32"/></td></tr>
				<tr><td>确认:</td><td><input type="password" name="password2" size="32"/></td></tr>
				<tr><td colspan="2"><input type="submit" value="下一步" class="button" /> <input type="reset" value="重置" class="button" /></td></tr>
			</table>
		</form>
Example #3
0
function writeEntry($handle, $url, $link_text)
{
    $entry = "<tocentry><ulink url=\"{$url}\">{$link_text}</ulink></tocentry>";
    writeText($handle, $entry);
}
Example #4
0
function writeEntry($handle, $term, $sections, $type)
{
    $sections = trim($sections, "\n,");
    $term = "<{$type}>{$term}</{$type}>";
    $entry = <<<ENTRY
<indexentry>
  <primaryie>{$term},
  {$sections}
 </primaryie>
</indexentry>

ENTRY;
    writeText($handle, $entry);
}
Example #5
0
                $e = 2;
                $is_inc = isset($_POST['file_t']) && $_POST['file_t'] == 1 ? 1 : 0;
                $f = 'setup/sql-' . time() . '.' . ($is_inc > 0 ? 'inc' : 'php');
                foreach ($q as $k => $v) {
                    unset($qt1);
                    foreach ($v as $kv => $qv) {
                        unset($qt0);
                        foreach ($qv as $qav) {
                            $qt0[] = "'" . str_replace(array("'", "\r", "\n"), array('<&#039;>', '<r>', '<n>'), $qav) . "'";
                        }
                        $qt1[] = $kv . "=>array(" . join(', ', $qt0) . ")";
                    }
                    $qt2[] = "'" . $k . "'=>array(\n\t\t" . join(",\n\t\t", $qt1) . "\n\t)";
                }
                $c = "<?php\n\$data=array(\n\t" . join(",\n\t", $qt2) . "\n);\n\r\n";
                writeText($f, $c);
            }
        }
        header('Location:./?m=setting&t=sql' . (isset($e) ? '&e=' . $e : '') . (isset($f) ? '&f=' . $f : '') . (isset($is_inc) && $is_inc > 0 ? '&inc=1' : ''));
        exit;
    } else {
        $a_msg[1] = '导入成功!';
        if (isset($_GET['f'])) {
            $a_msg[2] = '数据已备份到“' . htmlspecialchars($_GET['f'], ENT_QUOTES) . '”中' . (isset($_GET['inc']) && $_GET['inc'] == 1 ? ',<a href="' . htmlspecialchars($_GET['f'], ENT_QUOTES) . '">点击右键另存</a>' : '') . '。';
        }
        $js_c .= '
		$("#drform").submit(function(e){
			if(!confirm(\'确认要导入新数据?\')){
				e.preventDefault();
			}else if($("#drform input[type=\'submit\']").length>0){
				$("#drform input[type=\'submit\']").attr(\'disabled\', \'disabled\');
Example #6
0
function writeLine($line, &$status)
{
    $status->trace(TC_Util3, "writeLine: {$line}");
    $status->startParagraph();
    writeText($line, $status);
    echo " ";
}
Example #7
0
    }
    // Display Mount Info
    if ($configData['skills_disp_mount']) {
        foreach ($skillsData as $skill) {
            // Print only secondary skills where the name equals riding
            if ($skill['type'] == $roster->locale->wordings[$sig_char_locale]['secondary'] && $skill['name'] == $roster->locale->wordings[$sig_char_locale]['riding']) {
                $desc = $skill['name'];
                // Shorten long strings based on max length in config
                if (strlen($desc) > $configData['skills_desc_length_mount']) {
                    $desc = trim(substr($desc, 0, $configData['skills_desc_length_mount'])) . '.';
                }
                writeText($im, $configData['skills_font_size'], $configData['skills_desc_loc_x'], $pos['desc'], $configData['skills_font_color'], $configData['skills_font_name'], $desc, $configData['skills_align_desc'], $configData['skills_shadow']);
                // Print Skill level
                if ($configData['skills_disp_level']) {
                    // Just Print level
                    writeText($im, $configData['skills_font_size'], $configData['skills_level_loc_x'], $pos['level'], $configData['skills_font_color'], $configData['skills_font_name'], $skill['level'], $configData['skills_align_level'], $configData['skills_shadow']);
                }
                // Move the line position
                $pos['desc'] += $configData['skills_desc_linespace'];
                $pos['level'] += $configData['skills_level_linespace'];
            }
        }
    }
}
#--[ FINALIZE AND CLOSE ]--------------------------------------------------
// Set to output image by default
$make_image = 1;
// Save mode Web request over-ride
if (isset($sig_saveonly)) {
    $configData['save_only_mode'] = $sig_saveonly;
    $configData['save_images'] = $sig_saveonly;
function img_output($realmData, $err, $image_path, $font_path)
{
    global $roster;
    $vadj = 0;
    $serverfont = $font_path . $roster->config['rs_font_server'];
    $typefont = $font_path . $roster->config['rs_font_type'];
    $serverpopfont = $font_path . $roster->config['rs_font_pop'];
    // Get and combine base images, set colors
    $top = @imagecreatefrompng($image_path . strtolower($realmData['serverstatus']) . '.png');
    if (!$top) {
        return;
    }
    if ($roster->config['rs_display'] == 'full') {
        // Get with of the top image
        $topwidth = imagesx($top);
        // Make the bottom part
        $bottom = imagecreatefrompng($image_path . strtolower($err ? 'down' : $realmData['serverstatus']) . '2.png');
        // Create a new image
        $full = imagecreatetruecolor($topwidth, imagesy($top) + imagesy($bottom));
        // Turn off apha so we can get a clean boder to set to transparent
        imagealphablending($full, false);
        // Set the trans color
        $col = getColor('22ff22', $full);
        imagefilledrectangle($full, 0, 0, $topwidth, imagesy($top) + imagesy($bottom), $col);
        imagecopy($full, $top, 0, 0, 0, 0, $topwidth, imagesy($top));
        imagecopy($full, $bottom, 0, imagesy($top), 0, 0, imagesx($bottom), imagesy($bottom));
        imagealphablending($full, true);
        $top = $full;
        // Ouput centered $server name
        $maxw = 62;
        $output = '';
        $box = imagettfbbox($roster->config['rs_size_server'], 0, $serverfont, $realmData['server_name']);
        $w = abs($box[0]) + abs($box[2]);
        if ($w > $maxw) {
            $i = $w;
            $t = strlen($realmData['server_name']);
            while ($i > $maxw) {
                $t--;
                $box = imagettfbbox($roster->config['rs_size_server'], 0, $serverfont, substr($realmData['server_name'], 0, $t));
                $i = abs($box[0]) + abs($box[2]);
            }
            $t = strrpos(substr($realmData['server_name'], 0, $t), ' ');
            $output[0] = substr($realmData['server_name'], 0, $t);
            $output[1] = ltrim(substr($realmData['server_name'], $t));
            $vadj = -6;
        } else {
            $output[0] = $realmData['server_name'];
        }
        $i = 0;
        foreach ($output as $value) {
            $box = imagettfbbox($roster->config['rs_size_server'], 0, $serverfont, $value);
            $w = abs($box[0]) + abs($box[2]);
            writeText($top, $roster->config['rs_size_server'], round(($topwidth - $w) / 2), 54 + $i * 8 + $vadj, $roster->config['rs_color_server'], $serverfont, $value, $roster->config['rs_color_shadow']);
            $i++;
        }
        unset($output);
        $vadj = 0;
        // Ouput centered $realmData['serverpop']
        if ($realmData['serverpop']) {
            $box = imagettfbbox($roster->config['rs_size_pop'], 0, $serverpopfont, $realmData['serverpop']);
            $w = abs($box[0]) + abs($box[2]);
            if ($w > $maxw) {
                $i = $w;
                $t = strlen($realmData['serverpop']);
                while ($i > $maxw) {
                    $t--;
                    $box = imagettfbbox($roster->config['rs_size_pop'], 0, $serverpopfont, substr($realmData['serverpop'], 0, $t));
                    $i = abs($box[0]) + abs($box[2]);
                }
                $t = strrpos(substr($realmData['serverpop'], 0, $t), ' ');
                $output[0] = substr($realmData['serverpop'], 0, $t);
                $output[1] = ltrim(substr($realmData['serverpop'], $t));
                $vadj = -4;
            } else {
                $output[0] = $realmData['serverpop'];
            }
            $i = 0;
            foreach ($output as $value) {
                $box = imagettfbbox($roster->config['rs_size_pop'], 0, $serverpopfont, $value);
                $w = abs($box[0]) + abs($box[2]);
                writeText($top, $roster->config['rs_size_pop'], round(($topwidth - $w) / 2), 73 + $i * 10 + $vadj, $realmData['serverpopcolor'], $serverpopfont, $value, $roster->config['rs_color_shadow']);
                $i++;
            }
        }
        // Ouput centered $realmData['servertype']
        if ($realmData['servertype'] && !$err) {
            $box = imagettfbbox($roster->config['rs_size_type'], 0, $typefont, $realmData['servertype']);
            $w = abs($box[0]) + abs($box[2]);
            writeText($top, $roster->config['rs_size_type'], round(($topwidth - $w) / 2), 88, $realmData['servertypecolor'], $typefont, $realmData['servertype'], $roster->config['rs_color_shadow']);
        }
    }
    header('Content-type: image/png');
    imagealphablending($top, false);
    imagesavealpha($top, true);
    imagepng($top);
    imagedestroy($top);
}
Example #9
0
function writeLine($line, &$status)
{
    $status->trace(TC_Util3, "writeLine: {$line} " . ($status->fPreformatted ? "T" : "F"));
    if ($status->fPreformatted) {
        echo htmlentities($line);
        echo "\n";
    } else {
        $status->startParagraph();
        writeText($line, $status);
        echo " ";
    }
}
Example #10
0
/**
 * 迷你同学录 (http://mini_class.piscdong.com/)
 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
require_once 'inc.php';
if (!file_exists($l_file)) {
    echo getstop();
    if (!file_exists($c_file)) {
        if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['hostname'] != '' && $_POST['database'] != '' && $_POST['username'] != '') {
            if (@mysql_connect($_POST['hostname'], $_POST['username'], $_POST['password'])) {
                if (mysql_select_db($_POST['database']) || mysql_query('CREATE DATABASE ' . $_POST['database'])) {
                    $c_content = "<?php\n\$hostname_conn='" . $_POST['hostname'] . "';\n\$database_conn='" . $_POST['database'] . "';\n\$username_conn='" . $_POST['username'] . "';\n\$password_conn='" . $_POST['password'] . "';\n\$dbprefix='" . $_POST['dbprefix'] . "';\n\$conn=mysql_connect(\$hostname_conn, \$username_conn, \$password_conn) or die('');\nmysql_select_db(\$database_conn, \$conn);" . (chksqlv() ? "\nmysql_query(\"SET NAMES 'utf8'\", \$conn);\n\$charset_conn=1;" : '') . "\n?>";
                    writeText($c_file, $c_content);
                } else {
                    $e = 1;
                }
            } else {
                $e = 2;
            }
            echo '<script type="text/javascript">' . (isset($e) ? 'location.href=\'?e=' . $e : 'location.href=\'mysql.php') . '\';</script>';
        } else {
            if (isset($_GET['e'])) {
                $msg = $_GET['e'] == 2 ? '无法连接数据库!' : '无法建立数据库!';
            }
            if (isset($msg)) {
                echo '<div class="msg_v">' . $msg . '</div>';
            }
            ?>