示例#1
0
function StyleForm($action, $style)
{
    global $session;
    print '<form method="post" action="style.php">
  <table width="100%" border="0" cellspacing="1" cellpadding="3">
    <tr>
      <td>Stylename</td>
      <td width="1">&nbsp; </td>
      <td>
        <input class="tbinput" type="text" name="style[stylename]" value="' . htmlspecialchars($style[stylename]) . '">
      </td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><b>Layout</b><br>
        <font size="1">The general layout of this style.</font></td>
    </tr>
    <tr>
      <td>Template set</td>
      <td width="1">
        &nbsp;
      </td>
      <td>
        <select class="tbinput" name="style[styletemplate]" size="1">';
    $a_templateset = get_templatesetarray();
    while (list(, $file) = each($a_templateset)) {
        print '<option value="' . $file . '"' . ($file == $style['styletemplate'] ? ' selected' : '') . '>' . $file . '</option>';
    }
    print '
        </select>
      </td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><b>Main (Background)</b><br>
        <font size="1">This applies to the background of your forum, i.e. the copyright notice and some notes above and under tables.</font></td>
    </tr>
    <tr>
      <td>Background color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[colorbg] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[colorbg]" size="9" maxlength="7" value="' . $style[colorbg] . '">
      </td>
    </tr>
    <tr>
      <td>Background text color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[colorbgfont] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[colorbgfont]" size="9" maxlength="7" value="' . $style[colorbgfont] . '">
      </td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><b>Table Headers / Footers</b><br>
        <font size="1">These settings are used for the &quot;header&quot; and &quot;footer&quot; rows in tables.</font></td>
    </tr>
    <tr>
      <td>Background color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[color4] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[color4]" size="9" maxlength="7" value="' . $style[color4] . '">
      </td>
    </tr>
    <tr>
      <td>Text color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[col_he_fo_font] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[col_he_fo_font]" size="9" maxlength="7" value="' . $style[col_he_fo_font] . '">
      </td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><b>Tables</b><br>
        <font size="1">The main part of your forum, all tables. i.e. threads, posts, private messages, ...</font></td>
    </tr>
    <tr>
      <td>Text color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[color1] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[color1]" size="9" maxlength="7" value="' . $style[color1] . '">
      </td>
    </tr>
    <tr>
      <td>Cell background color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[CellA] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[CellA]" size="9" maxlength="7" value="' . $style[CellA] . '">
      </td>
    </tr>
    <tr>
      <td>Alternative cell background color</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[CellB] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[CellB]" size="9" maxlength="7" value="' . $style[CellB] . '">
      </td>
    </tr>
    <tr>
      <td>Table bordercolor<br>
        <font size="1">The color between the cells</font></td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[border_col] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[border_col]" size="9" maxlength="7" value="' . $style[border_col] . '">
      </td>
    </tr>
    <tr>
      <td>Error color<br>
        <font size="1">Used for error messages and important notes
</font>      </td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[color_err] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[color_err]" size="9" maxlength="7" value="' . $style[color_err] . '">
      </td>
    </tr>
    <tr>
      <td>Link</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[col_link] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[col_link]" size="9" maxlength="7" value="' . $style[col_link] . '">
      </td>
    </tr>
    <tr>
      <td>Link (visited)</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[col_link_v] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[col_link_v]" size="9" maxlength="7" value="' . $style[col_link_v] . '">
      </td>
    </tr>
    <tr>
      <td>Link hover</td>
      <td width="1">
        <table width="64" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
          <tr>
            <td bgcolor="' . $style[col_link_hover] . '">&nbsp;</td>
          </tr>
        </table>
      </td>
      <td>
        <input class="tbinput" type="text" name="style[col_link_hover]" size="9" maxlength="7" value="' . $style[col_link_hover] . '">
      </td>
    </tr>
    <tr>
      <td>Default font</td>
      <td width="1">&nbsp;</td>
      <td>
        <input class="tbinput" type="text" name="style[stdfont]" value="' . EditboxEncode($style[stdfont]) . '">
      </td>
    </tr>
    <tr>
      <td>Board image-path</td>
      <td width="1">&nbsp;</td>
      <td>
        <input class="tbinput" type="text" name="style[boardimage]" value="' . $style[boardimage] . '">
      </td>
    </tr>
<!--
    <tr>
      <td>"New Topic"-image-path</td>
      <td width="1">&nbsp;</td>
      <td>
        <input class="tbinput" type="text" name="style[newtopicimage]" value="' . $style[newtopicimage] . '">
      </td>
    </tr>
-->
    <tr>
      <td>Public style?<br>
        <font size="1">Allow Users to select this style in their profile?</font></td>
      <td width="1">&nbsp;</td>
      <td>
        <input type="radio" name="style[styleispublic]" value="1"' . ($style['styleispublic'] == 1 ? ' checked' : '') . '>
        Yes
        <input type="radio" name="style[styleispublic]" value="0"' . ($style['styleispublic'] == 0 ? ' checked' : '') . '>
        No
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td width="1">&nbsp;</td>
      <td>
        <input type="hidden" name="style[styleid]" value="' . $style[styleid] . '">
        <input type="hidden" name="action" value="' . $action . '">
        <input type="hidden" name="session" value="' . $session . '">
        <input type="submit" name="Abschicken" value="Submit">
      </td>
    </tr>
  </table>
</form>';
}
示例#2
0
    } elseif (!$dir) {
        print 'no template-directory specified!';
    } else {
        if (!file_exists('../templates/' . $dir . '/' . $name)) {
            print 'template ' . $name . '.html does not exist!';
        } else {
            if (!WriteAccess('../templates/' . $dir . '/' . $name)) {
                print "can't edit file '{$name}.html': no write permission (set chmod 666 or 777)";
            } else {
                $t_data = @implode("", @file('../templates/' . $dir . '/' . $name));
                while (list($k, $v) = each($a_replace)) {
                    $t_data = str_replace($k, $v, $t_data);
                }
                print '<b>Edit Template: "' . $name . '"</b><br><br>';
                print '<form action="t-editor.php" method="post">
<textarea wrap="OFF" name="t_data" class="htmlsource" cols="100" rows="32">' . EditboxEncode($t_data) . '</textarea><br><br><br>
<input type="hidden" name="action" value="UpdateTemplate">
<input type="hidden" name="name" value="' . $name . '">
<input type="hidden" name="dir" value="' . $dir . '">
<input type="hidden" name="session" value="' . $session . '">
<input type="submit" name="Submit" value="Update Template">
</form>';
                print '<b>available inserts:</b><br> {font} / {/font} - default font<br>
                    {sfont} / {/sfont} - small font<br>
                    {bgcolor} - body background color<br>
                    {bgfontcolor} - body background font color<br>
                    {textcolor} - text color within tables<br>
                    {cellbg} - cell background color<br>
                    {altcellbg} - 2nd cell bg color<br>
                    {tableheaderbg} - table header and footer background<br>
                    {he_fo_color} - font color for table headers and footers<br>
示例#3
0
}
function EditboxEncode($string)
{
    $string = str_replace('&', '&amp;', $string);
    $string = str_replace('"', '&quot;', $string);
    $string = str_replace('<', '&lt;', $string);
    $string = str_replace('>', '&gt;', $string);
    return $string;
}
$Tframe = new Template("templates/" . $style['styletemplate'] . "/frame.html");
$Tprofile = new Template("templates/" . $style['styletemplate'] . "/profile.html");
$r_user = thwb_query("SELECT userid, username, userhomepage, userlocation, usericq, useraim, usermsn,\n    useroccupation, userinterests, usersignature,\n    userhideemail, userhidesig, userinvisible, usernoding,\n    styleid, useremail, useravatar, userbday\n    FROM " . $pref . "user WHERE userid='{$g_user['userid']}'");
$user = mysql_fetch_array($r_user);
$user['userhomepage'] = EditboxEncode($user['userhomepage']);
$user['userlocation'] = EditboxEncode($user['userlocation']);
$user['useroccupation'] = EditboxEncode($user['useroccupation']);
$user['useraim'] = htmlspecialchars($user['useraim']);
$user['usermsn'] = htmlspecialchars($user['usermsn']);
$avatarselect = '';
$AVATRAPRE = '';
$AVATRAOP = '';
$AVATRAROW = '';
if ($config['useravatar'] != 0 && $user['useravatar'] != 'notallowed') {
    $Tavatarrow = new Template("templates/" . $style['styletemplate'] . "/avatarrow.html");
    $Tavatarpre = new Template("templates/" . $style['styletemplate'] . "/avatarpre.html");
    $Tavatarop = new Template("templates/" . $style['styletemplate'] . "/avatarop.html");
    if ($config['useravatar'] == 3) {
        $q_avatar = thwb_query("SELECT avatarurl FROM " . $pref . "avatar WHERE avatarurl='" . addslashes($user['useravatar']) . "'");
        if ($a_avatar = mysql_fetch_array($q_avatar)) {
            if ($a_avatar['avatarurl'] == $user['useravatar']) {
                $isinstal = true;