Esempio n. 1
0
 function command_parse()
 {
     global $DB, $Core, $Parse, $Security, $Base, $Style;
     if (!$Security->allowed()) {
         return;
     }
     $include = implode("/", module());
     if (file_exists("module/{$include}/main.php")) {
         $dir = "";
         foreach (module() as $module) {
             $dir .= "{$module}/";
             $shared = "module/{$dir}shared.php";
             if (file_exists($shared)) {
                 include $shared;
             }
         }
         require_once "module/{$include}/main.php";
         if (function_exists(command())) {
             eval(command() . "();");
         }
         if (file_exists("module/{$include}/.content/" . func() . ".php")) {
             if (!get('ajax') && !get('xml')) {
                 require_once "module/{$include}/.content/" . func() . ".php";
             }
         }
     } else {
         $Base = new Base();
         $Base->title("Invalid Module");
         $Base->Header();
         $Base->Footer();
     }
 }
Esempio n. 2
0
 function allowed()
 {
     global $_allowed_;
     if (!session('id')) {
         if (!in_array(implode("-", module()) . func(), $_allowed_)) {
             $Base = new Base();
             $Base->type(ERROR);
             $Base->title(ERROR_MUST_LOGIN);
             $Base->header();
             $Base->footer();
             return false;
         } else {
             return true;
         }
     } else {
         return true;
     }
 }
Esempio n. 3
0
function login_post()
{
    global $DB, $Security;
    if (!$Security->login(post('name'), post('pass'))) {
        $Base = new Base();
        $Base->type(ERROR);
        $Base->title(ERROR_AUTH);
        $Base->header();
        $Base->footer();
        return;
    } else {
        $to = false;
        if (isset($_SERVER['HTTP_REFERER'])) {
            $to = $_SERVER['HTTP_REFERER'];
        }
        if (substr($to, -12) == "/main/login/") {
            $to = "/";
        }
        return to_index($to);
    }
}
Esempio n. 4
0
}
if (!is_numeric($prefs['mincollapse'])) {
    $prefs['mincollapse'] = COLLAPSE_DEFAULT;
}
if (!isset($prefs['collapseopen'])) {
    $prefs['collapseopen'] = COLLAPSE_DEFAULT;
}
if (!is_numeric($prefs['collapseopen'])) {
    $prefs['collapseopen'] = COLLAPSE_OPEN_DEFAULT;
}
if ($prefs['collapseopen'] < 1) {
    $prefs['collapseopen'] = 1;
}
$Base = new Base();
$Base->type(EDIT);
$Base->title("Account Management: {$member['name']}");
$Base->header();
print "<div class=\"box clear\">\n";
$Form = new Form();
$Form->values(array_merge($member, $prefs));
$Form->header(url(), "post", FORM_SALT);
$Form->fieldset_open("Account Management");
$Form->add_text("name", "Name:");
$Form->add_text("postalcode", "Postal Code:");
$Form->fieldset_close();
$Form->fieldset_open("Password Management");
print "<div id=\"password\" style=\"display:none\">\n";
$Form->add_password("_current", "Current:");
$Form->add_password("_pass", "New:");
$Form->add_password("_pass_confirm", "Confirm:");
print "</div>\n";
Esempio n. 5
0
<?php

if (!isset($res)) {
    $Base = new Base();
    $Base->type(SEARCH);
    $Base->title("Search");
    $Base->header();
}
$Form = new Form();
$Form->ajax(false);
if (isset($_SESSION['search'])) {
    $Form->values($_SESSION['search']);
}
$Form->header("/search/", "post", FORM_SALT);
$Form->fieldset_open("Search Information");
$Form->add_text("search", "Search For:", 300);
$Form->add_select("_type", "Within:", "Choose", array("thread" => "Threads", "thread_post" => "Thread Posts", "message" => "Messages", "message_post" => "Message Posts"));
$Form->fieldset_close();
$Form->fieldset_open("Optional Fields");
print "<li>will return in a bit</li>\n";
/*
$Form->add_text("member","By Member:");
$Form->labels(false);
print "<li>\n";
print "  <label>Date Range:</label>\n";
$Form->add_date("start",false);
$Form->add_date("end",false);
print "</li>\n";
$Form->labels(true);
$Form->add_select("quickdate","Quick Ranges:","Choose",array("thisweek"=>"This Week","thismonth"=>"This Month","lastweek"=>"Last Week","lastmonth"=>"Last Month"),"onchange=\"quickrange($(this).val())\">");
*/
Esempio n. 6
0
<?php

if (session('id') || !REGISTRATION_OPEN) {
    return to_index();
}
$Base = new Base();
$Base->type(CREATE);
$Base->title("Create Account");
$Base->header();
print "<div class=\"box clear\">\n";
print LEGAL;
if (!REGISTRATION_PASSWORD && !session('authorized')) {
    $_SESSION['authorized'] = true;
}
if (REGISTRATION_PASSWORD && !session('authorized')) {
    $Form = new Form();
    $Form->header(url(0, -2) . "authorize/", "post", FORM_SALT);
    $Form->fieldset_open("Registration Authorization");
    $Form->add_password("password", "Password:"******"Authorize Me");
    $Form->footer();
}
if (session('authorized')) {
    $Form = new Form();
    $Form->header(url(), "post", FORM_SALT);
    $Form->fieldset_open("Create Account");
    $Form->add_text("account", "Name:", 150);
    $Form->add_text("secret", "Secret Word:", 150, false, "/><span class=\"small\">(to recover forgotten password)</span>");
    $Form->add_text("email_signup", "Email:", 200);
    $Form->add_text("email_confirm", "Email (confirm):", 200);
Esempio n. 7
0
}
.picker ul li
{
  list-style: none;
  margin-top: 8px;
}
</style>
<script type="text/javascript" src="/lib/colorpicker/prototype.js"></script>
<script type="text/javascript" src="/lib/colorpicker/colormethods.js"></script>
<script type="text/javascript" src="/lib/colorpicker/colorvaluepicker.js"></script>
<script type="text/javascript" src="/lib/colorpicker/slider.js"></script>
<script type="text/javascript" src="/lib/colorpicker/colorpicker.js"></script>
<?php 
$Base = new Base();
$Base->type(EDIT);
$Base->title("Color Theme Styler");
$Base->header();
?>
<div style="padding-top:25px;width:50%;float:left">
<div class="picker"><div id="cp1_ColorMap"></div></div>
<div class="picker"><div id="cp1_ColorBar"></div></div>
<div class="picker">
<div id="cp1_Preview" style="background-color:#fff;width:60px;height:60px;padding:0;margin:0;border:solid 1px #000;"><br/></div>
<ul>
  <li>
    <input type="radio" id="cp1_HueRadio" name="cp1_Mode" value="0" />
    <label for="cp1_HueRadio">H:</label>
    <input type="text" id="cp1_Hue" value="0" style="width: 40px;" /> &deg;
  </li>
  <li>
    <input type="radio" id="cp1_SaturationRadio" name="cp1_Mode" value="1" />
Esempio n. 8
0
<?php

$Base = new Base();
$Base->type(CREATE);
$Base->title("Create New Thread");
$Base->header();
$Form = new Form();
$Form->header(url(), "post", FORM_SALT);
$Form->account_login();
$Form->fieldset_open("Thread Details");
$Form->add_text("subject", "Subject:", 400, 200);
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "class=\"nodisable\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','thread',99999999);");
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
$Form->add_notnull("subject", "Please enter a subject.");
$Form->add_notnull("body", "Please enter a post body.");
$Form->footer_validate();
$Base->footer();
print BBCODE_GUIDE;
?>
<script type="text/javascript">
function completed(data)
{
  if(jQuery.trim(data) == "") window.location = '/';
  $('.submit').attr('disabled',false);
}
</script>
Esempio n. 9
0
<?php

$Base = new Base();
$Base->type(MISC);
$Base->title(TITLE_CHAT);
$Base->header();
?>
<div id="data" class="box clear" style="overflow:scroll;overflow-x:hidden;height:375px;">
Loading chat history...
</div>
<?php 
$Form = new Form();
$Form->labels(false);
$Form->header("/chat/speak/", "post", FORM_SALT);
$Form->fieldset_open("Chat Panel");
$Form->add_text("chat", false, 400, false, "onkeydown=\"return catch_enter(event)\"/>");
$Form->add_button("add", "say that shit", "speak();");
print "<br/>\n";
$Form->add_checkbox("stop", "pause scroll", "onclick=\"pause=pause?false:true\"/> pause scrolling");
$Form->fieldset_close();
$Form->footer();
$Base->footer();
?>
<script type="text/javascript">
var lasthash;
var pause = false;
function speak()
{
  var text = $('#chat').val();
  $('#add')[0].disabled = true;
  $.post("/chat/speak/",{msg:text},function(data)
Esempio n. 10
0
function status_get()
{
    global $DB, $Core, $Parse;
    if (!session('id')) {
        return;
    }
    $active = $Core->active_members();
    $posting = array_keys($Core->posting_members());
    $lurking = array_keys($Core->lurking_members());
    $chatting = array_keys($Core->chatting_members());
    $Base = new Base();
    $Base->type(MISC);
    $Base->title("Board Status");
    $Base->header();
    $output = "";
    $output .= "key:<br/>\n";
    $output .= "&nbsp;normal - viewing<br />";
    $output .= "&nbsp;<strong>bold</strong> - posting<br/>";
    $output .= "&nbsp;<u>underline</u> - lurking<br/>";
    $output .= "&nbsp;<strike>strikethrough</strike> - chatting<br/><br/>";
    print "<div class=\"box clear\">\n";
    $name_output = "";
    foreach ($active as $id => $name) {
        $name = $Core->member_link($name);
        if (in_array($id, $posting)) {
            $name = "<strong>{$name}</strong>";
        }
        if (in_array($id, $lurking)) {
            $name = "<span class=\"lurker\">{$name}</span>";
        }
        if (in_array($id, $chatting)) {
            $name = "<strike>{$name}</strike>";
        }
        $name_output .= "{$name}, ";
    }
    print $output;
    print substr($name_output, 0, -2);
    if (IGNORE_ENABLED && IGNORE_PUBLIC) {
        $DB->query("SELECT\r\n                  count(*) as num,\r\n                  m.name\r\n                FROM\r\n                  member_ignore mi\r\n                LEFT JOIN\r\n                  member m\r\n                ON\r\n                  m.id = mi.ignore_member_id\r\n                GROUP BY\r\n                  m.name\r\n                ORDER BY num DESC\r\n                LIMIT 25");
        print "<br/><br/><strong>top 25 ignored posters:</strong><br/><br/>";
        print "<ol style=\"padding-left:30px\">\n";
        while ($row = $DB->load_array()) {
            print "  <li>" . $Core->member_link($row['name']) . " ({$row['num']})</li>\n";
        }
        print "</ol>\n";
        $DB->query("SELECT\r\n                  count(*) as num,\r\n                  m.name\r\n                FROM\r\n                  member_ignore mi\r\n                LEFT JOIN\r\n                  member m\r\n                ON\r\n                  m.id = mi.member_id\r\n                GROUP BY\r\n                  m.name\r\n                ORDER BY num DESC\r\n                LIMIT 25");
        print "<br/><br/><strong>top 25 posters using ignore:</strong><br/><br/>";
        print "<ol style=\"padding-left:30px\">\n";
        while ($row = $DB->load_array()) {
            print "  <li>" . $Core->member_link($row['name']) . " ({$row['num']})</li>\n";
        }
        print "</ol>\n";
    }
    $DB->query("SELECT\r\n                count(*) as num,\r\n                (SELECT subject FROM thread WHERE id=f.thread_id) as subject,\r\n                f.thread_id as id\r\n              FROM\r\n                favorite f\r\n              GROUP BY\r\n                f.thread_id\r\n              ORDER BY num DESC\r\n              LIMIT 25");
    print "<br/><br/><strong>top 25 favorited threads:</strong><br/><br/>";
    print "<ol style=\"padding-left:30px\">\n";
    while ($row = $DB->load_array()) {
        print "  <li><a href=\"/thread/view/{$row['id']}/\">" . strip_tags($row['subject']) . "</a> ({$row['num']})</li>\n";
    }
    print "</ol>\n";
    print "</div>";
    $Base->footer();
}
Esempio n. 11
0
<?php

if (!id() || !session('admin')) {
    return to_index();
}
$Base = new Base();
$Base->type(EDIT);
$Base->title("Edit Post");
$Base->header();
$DB->query("SELECT thread_id,body FROM thread_post WHERE id=\$1", array(id()));
$data = $DB->load_array();
$Form = new Form();
$Form->values($data);
$Form->header(url(), "post", FORM_SALT);
$Form->fieldset_open("Edit");
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "id=\"submit\"/>");
$Form->footer();
$Form->header_validate();
$Form->add_notnull("body", "Please enter a post body.");
$Form->footer_validate();
$Base->footer();
?>
<script type="text/javascript">
function completed(data)
{
  if(jQuery.trim(data) == "") location.href='/thread/view/<?php 
print $data['thread_id'];
?>
/';
Esempio n. 12
0
<?php

if (session('id')) {
    return to_index();
}
$Base = new Base();
$Base->title("Forgotten Password");
$Base->type(CREATE);
$Base->header();
print "<div class=\"box clear\">\n";
print FORGOT_PASSWORD;
$Form = new Form();
$Form->ajax(false);
$Form->header(url(), "post", FORM_SALT);
$Form->fieldset_open("Reset Password");
$Form->add_text("email_signup", "Email Signup:");
$Form->fieldset_close();
$Form->add_submit("Send Reset Email");
$Form->footer();
$Form->header_validate();
$Form->add_notnull("email_signup", "Please enter an email address.");
$Form->footer_validate();
print "</div>";
$Base->footer();
Esempio n. 13
0
<?php

$Base = new Base();
$Base->type(CREATE);
$Base->title("Create New Message");
$Base->header();
$Form = new Form();
$Form->header(url(), "post", FORM_SALT);
$Form->account_login();
$Form->fieldset_open("Message Details");
$Form->labels(false);
print "<li>\n";
print "  <label>Recipients:</label>\n";
print "  <div id=\"m\" style=\"width:500px;float:left;line-height:1.8em;\"><span id=\"notice\" class=\"small\">(invalid names will be discarded)</span></div>\n";
print "</li>\n";
print "<li>\n";
print "  <label for=\"recipients\">Add Members:</label>\n";
$Form->add_hidden("message_members");
$Form->add_text("_recipients", false, 200, false, "onkeydown=\"return catch_enter(event)\"/>");
$Form->add_button("add", "Add", "check_member();", "tabindex=\"10\"/>");
print " <sup id=\"names\">add multiples with: name, name, name</sup>";
print "</li>\n";
$Form->labels(true);
$Form->add_text("subject", "Subject:", 400, 200);
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "class=\"nodisable\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','message',99999999);");
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
Esempio n. 14
0
<?php

function number($str)
{
    return str_replace(array("\$", ","), "", $str);
}
$Base = new Base();
$Base->type(MISC);
$Base->title("Donate");
$Base->header();
print "<div class=\"box clear\">\n";
if (FUNDRAISER_ID != -1) {
    $goal = $Core->fundraiser_goal();
    $total = $Core->fundraiser_total();
    if ($total != "\$0.00") {
        $percent = round(number($total) * 100 / number($goal), 2);
    } else {
        $percent = "0";
    }
    print "<h4>" . $Core->fundraiser_name() . " Status:</h4><br/>\n";
    print "<h4>{$total} <span class=\"smaller\">({$percent}%) of {$goal} raised.</span></h4><br/>\n";
}
print DONATION_TEXT;
print DONATION_BUTTON;
print "</div>\n";
$Base->footer();
Esempio n. 15
0
function listen_get()
{
    global $Security, $Core, $DB;
    if (cmd(3) != MD5(session_id())) {
        return to_index();
    }
    if (!($listen = $Core->idfromname(id()))) {
        $Base = new Base();
        $Base->type(ERROR);
        $Base->title(ERROR_MEMBER_NOTFOUND);
        $Base->header();
        $Base->footer();
        return;
    }
    if ($Security->is_admin($listen) || !session('id')) {
        return to_index();
    }
    if ($DB->query("DELETE FROM member_ignore WHERE member_id=\$1 AND ignore_member_id=\$2", array(session('id'), $listen))) {
        return to_index();
    } else {
        print "<h3>Something got f****d.</h3>\n";
    }
}
Esempio n. 16
0
require_once "class/Admin.php";
// search management
require_once "class/Plugin.php";
// plugins
$Security = new BoardSecurity();
$Core = new BoardCore();
$DB = new DB(DB, true);
$Parse = new BoardParse($_bbc_, $_rep_);
if (!session('id') && cookie('board')) {
    $Security->login_cookie();
}
$Style = new BoardStyle(session('id'));
if (!isset($commandline)) {
    ob_start();
    if (!$DB->db) {
        $Base = new Base();
        $Base->title("Dead database!");
        $Base->header();
        $Base->footer();
    } else {
        $Core->command_parse();
        if (get('ajax')) {
            $buffer = ob_get_contents();
            ob_end_clean();
            print $buffer;
            exit_clean();
        }
        $buffer = ob_get_contents();
        ob_end_clean();
    }
}