Example #1
0
    }
} elseif ($action == "UpdateTemplate") {
    if (!$name) {
        print 'no template specified!';
    } elseif (!$dir) {
        print 'no template-directory specified!';
    } else {
        $fp = fopen('../templates/' . $dir . '/' . $name, 'w');
        if (!$fp) {
            print 'unable to open template file "' . $name . '" for write access. check chmod! (should be 666 or 777)';
        } else {
            while (list($k, $v) = each($a_replace)) {
                $t_data = str_replace($v, $k, $t_data);
            }
            $t_data = str_replace("\r\n", "\n", $t_data);
            fwrite($fp, stripslashes(EditboxDecode($t_data)));
            fclose($fp);
            print 'template has been updated!<br>click <a href="t-editor.php?action=EditTemplate&name=' . $name . '&session=' . $session . '&dir=' . $dir . '">here</a> to continue.';
        }
    }
} elseif ($action == "ListTemplateSets") {
    print '<b>Templates Sets</b><br><br>';
    $path = "../templates";
    $tempdir = opendir($path);
    while ($tempsetdir = readdir($tempdir)) {
        if ($tempsetdir != ".." && $tempsetdir != "." && $tempsetdir != "mail" && (is_dir($path . "/" . $tempsetdir) && $tempsetdir != 'CVS' && $tempsetdir != 'css')) {
            print "[ <A HREF=\"t-editor.php?session=" . $session . "&action=ListTemplates&dir={$tempsetdir}\">{$tempsetdir}</A> ]<BR><BR>";
        }
    }
} elseif ($action == "ListTemplates") {
    if (!$dir) {
Example #2
0
if (isset($intavatar) && strchr($intavatar, '"')) {
    $intavatar = '';
}
if (isset($intavatar)) {
    $check_r = thwb_query("SELECT avatarid FROM " . $pref . "avatar WHERE avatarurl='" . addslashes($intavatar) . "'");
    if (mysql_num_rows($check_r) == 0) {
        $intavatar = '';
    }
}
if (!isset($g_user['useravatar'])) {
    $g_user['useravatar'] = '';
}
if (!isset($user['useravatar'])) {
    $user['useravatar'] = '';
} else {
    $user['useravatar'] = str_replace('"', '', EditboxDecode($user['useravatar']));
}
if ($g_user['useravatar'] == "notallowed") {
    $user['useravatar'] = "notallowed";
} elseif ($config['useravatar'] == 1) {
    if ($intavatar == "avatar/noavatar.png") {
        $user['useravatar'] = "";
    } else {
        $user['useravatar'] = $intavatar;
    }
} elseif ($config['useravatar'] == 2) {
    if ($user['useravatar']) {
        checksize($user['useravatar']);
    }
} elseif ($config['useravatar'] == 3) {
    if ($intavatar != "avatar/noavatar.png" && !$user['useravatar']) {
Example #3
0
SELECT
    boardid AS ID
FROM
    {$pref}board
WHERE
    boardid IN ({$boardIDs})
SQL
);
            $boardIDs = [];
            while ($board = mysql_fetch_object($r_boards)) {
                $boardIDs[] = $board->ID;
            }
            if (empty($boardIDs)) {
                print "The announcement needs to visible in at least one board.";
            } else {
                $title = addslashes(EditboxDecode($_POST['announcement-title']));
                $body = addslashes($_POST['announcement-body']);
                $boardIDs = ';' . implode(';', $boardIDs) . ';';
                query(<<<SQL
UPDATE
    {$pref}news
SET
    newstext  = '{$body}',
    newstopic = '{$title}',
    boardid   = '{$boardIDs}'
WHERE
    newsid = {$_GET['id']}
SQL
);
                print "Announcement saved.";
            }
Example #4
0
    if ($style['styleispublic'] != 1) {
        // the admin has decided that this style is not public.
        // in case it *was* public, make sure no one can use this style any longer
        query("UPDATE " . $pref . "user SET styleid=0 WHERE styleid={$style['styleid']}");
    }
    query("UPDATE " . $pref . "style SET\n        stylename='" . addslashes($style['stylename']) . "',\n        colorbg='{$style['colorbg']}',\n        colorbgfont='{$style['colorbgfont']}',\n        color1='{$style['color1']}',\n        CellA='{$style['CellA']}',\n        CellB='{$style['CellB']}',\n        color4='{$style['color4']}',\n        col_he_fo_font='{$style['col_he_fo_font']}',\n        border_col='{$style['border_col']}',\n        color_err='{$style['color_err']}',\n        col_link='{$style['col_link']}',\n        col_link_v='{$style['col_link_v']}',\n        col_link_hover='{$style['col_link_hover']}',\n        stdfont='" . addslashes($style['stdfont']) . "',\n        boardimage='{$style['boardimage']}',\n        newtopicimage='{$style['newtopicimage']}',\n        styleispublic='{$style['styleispublic']}',\n        styletemplate='{$style['styletemplate']}'\n        WHERE styleid={$style['styleid']}");
    writestyle($style['styleid']);
    print 'Style has been updated!<br>click <a href="style.php?action=EditStyle&styleid=' . $style['styleid'] . '&session=' . $session . '">here</a> to edit this style once again.';
} elseif ($action == "NewStyle") {
    print '<b>Create new style</b><br><br>';
    StyleForm("InsertStyle", array());
} elseif ($action == "InsertStyle") {
    $style['stdfont'] = EditboxDecode($style['stdfont']);
    $style['stdfontend'] = EditboxDecode($style['stdfontend']);
    $style['smallfont'] = EditboxDecode($style['smallfont']);
    $style['smallfontend'] = EditboxDecode($style['smallfontend']);
    query("INSERT INTO " . $pref . "style (\n            stylename,\n            colorbg,\n            colorbgfont,\n            color1,\n            CellA,\n            CellB,\n            col_he_fo_font,\n            color4,\n            border_col,\n            color_err,\n            col_link,\n            col_link_v,\n            col_link_hover,\n            stdfont,\n            boardimage,\n            newtopicimage,\n            styleispublic,\n            styletemplate\n        ) VALUES (\n            '" . addslashes($style['stylename']) . "',\n            '{$style['colorbg']}',\n            '{$style['colorbgfont']}',\n            '{$style['color1']}',\n            '{$style['CellA']}',\n            '{$style['CellB']}',\n            '{$style['col_he_fo_font']}',\n            '{$style['color4']}',\n            '{$style['border_col']}',\n            '{$style['color_err']}',\n            '{$style['col_link']}',\n            '{$style['col_link_v']}',\n            '{$style['col_link_hover']}',\n            '" . addslashes($style['stdfont']) . "',\n            '{$style['boardimage']}',\n            '{$style['newtopicimage']}',\n            '{$style['styleispublic']}',\n            '{$style['styletemplate']}'\n        )");
    print 'Style has been added!';
} elseif ($action == "DeleteStyle") {
    $r_board = query("SELECT boardname FROM " . $pref . "board WHERE styleid={$styleid}");
    $r_style = query("SELECT styleisdefault FROM " . $pref . "style WHERE styleid={$styleid}");
    $style = mysql_fetch_array($r_style);
    if (mysql_num_rows($r_board) > 0) {
        print 'Unable to delete style: this style is currently being used by the following board(s):<br><br><ul>';
        while ($board = mysql_fetch_array($r_board)) {
            print "<li><b>{$board['boardname']}</b></li>";
        }
        print '</ul>';
    } elseif ($style['styleisdefault'] == 1) {
        print 'Unable to delete style: you cannot delete the default style!';
    } else {