Exemplo n.º 1
0
<?php

require_once 'includes/phpbb.php';
PhpBB::init(array('template' => false, 'check_sid' => true));
require_once 'includes/openkore.php';
validate();
$topic = new Topic($_GET['t']);
$task = $_GET['task'];
authenticate($topic);
switch ($task) {
    case 'to_support':
        $forum_id = PhpBB::findForumId(OConstants::SUPPORT_FORUM_NAME);
        if (is_null($forum_id)) {
            message_die(GENERAL_ERROR, "Cannot find forum ID for '" . OConstants::SUPPORT_FORUM_NAME . "'.");
        }
        $msg = "[b][color=Olive]Dear user,\n\n" . "You have posted your message in the wrong forum section. Your message is a support request. " . "That is why it should have been posted in the section " . "[url=http://forums.openkore.com/viewforum.php?f={$forum_id}]'" . OConstants::SUPPORT_FORUM_NAME . "'[/url].\n" . "Please remember to post in the correct forum section next time. That will keep our forum " . "clean, for the sake of all users.\n\n" . "Thank you for your understanding,\n" . "[i]- The OpenKore community[/i][/color][/b]";
        $topic->moveTopic($forum_id);
        $post_id = $topic->addReply($msg);
        header("Location: viewtopic.php?p={$post_id}#{$post_id}");
        break;
    case 'rtfm':
        $msg = "[b][color=Olive]Dear user,\n\n" . "Your answer to your problem can be found in the " . "[url=http://www.openkore.com/wiki/index.php/Support]documentation[/url] " . "or the [url=http://forums.openkore.com/viewforum.php?f=16]FAQ forum[/url].\n";
        if (!empty($_GET['hint'])) {
            $msg .= "Here is a hint: [i]" . $_GET['hint'] . "[/i]\n";
        }
        $msg .= "\n" . "We spent [i]a lot[/i] of time on writing documentation, for the sake of our users. " . "Many questions are already answered in our documentation and FAQ. " . "Please do not let our effort be in waste, and please read the documentation/FAQ " . "before asking a question on this forum.\n\n" . "Thank you for your understanding,\n" . "[i]- The OpenKore community[/i][/color][/b]";
        $post_id = $topic->addReply($msg);
        $topic->lockTopic();
        header("Location: viewtopic.php?p={$post_id}#{$post_id}");
        break;
    case 'violation':
Exemplo n.º 2
0
<?php

if (empty($_GET['q'])) {
    require_once 'includes/phpbb.php';
    PhpBB::init(array('template' => true, 'title' => 'Search forum'));
    $template->set_filenames(array('body' => 'newsearch.tpl'));
    $template->pparse('body');
    PhpBB::finalize();
} else {
    header("Location: http://www.google.com/search?as_q=" . urlencode($_GET['q']) . "&hl=en&hs=nsk&num=10&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=openkore.com&as_rights=&safe=off");
}
Exemplo n.º 3
0
<?php

require_once 'includes/phpbb.php';
PhpBB::init(array('title' => 'User logs', 'admin' => true));
if (!empty($_GET['type']) && $_GET['type'] == 'Username') {
    $sql = "SELECT * FROM userlogs WHERE INSTR(username, '" . mysql_escape_string($_GET['search']) . "') ORDER BY last_time DESC LIMIT 20";
} else {
    if (!empty($_GET['type']) && $_GET['type'] == 'IP') {
        $sql = "SELECT * FROM userlogs WHERE INSTR(ip, '" . mysql_escape_string($_GET['search']) . "') ORDER BY last_time DESC LIMIT 20";
    } else {
        $sql = "SELECT * FROM userlogs ORDER BY last_time DESC LIMIT 20";
        $normal = 1;
    }
}
$result = $db->sql_query($sql);
if (!$result) {
    message_die(GENERAL_MESSAGE, "Cannot query database.", 'Error', __LINE__, __FILE__, $sql);
}
$num = 0;
while ($row = $db->sql_fetchrow($result)) {
    if ($num % 2 == 0) {
        $class = 'row1';
    } else {
        $class = 'row2';
    }
    $data .= "<tr class=\"{$class}\">\n";
    $data .= "\t<td><a href=\"profile.php?mode=viewprofile&u={$row['user_id']}\">{$row['username']}</a></td>\n";
    $data .= "\t<td>{$row['ip']}</td>\n";
    $data .= "\t<td>" . strftime("%B %e, %Y %r", $row[last_time]) . "</td>\n";
    $data .= "</tr>\n";
    $num++;