Ejemplo n.º 1
0
<?php

include $addon['dir'] . 'inc/function.lib.php';
$functions = new forum();
if (isset($_POST['type']) && !empty($_POST['type'])) {
    $op = isset($_POST['op']) ? $_POST['op'] : '';
    $id = isset($_POST['id']) ? $_POST['id'] : $_GET['id'];
    switch ($_POST['type']) {
        case 'newTopic':
            createTopic();
            break;
        case 'unlock':
            processLock($id, 0);
            break;
        case 'lock':
            processLock($id, 1);
            break;
        default:
            break;
    }
}
function processLock($id, $mode)
{
    global $roster, $addon, $installer;
    $query = "UPDATE `" . $roster->db->table('forums', $addon['basename']) . "` SET `locked` = '{$mode}' WHERE `forum_id` = '" . $id . "';";
    $result = $roster->db->query($query);
    if (!$result) {
        $roster->set_message('Database Error: ' . $roster->db->error() . '<br />SQL: ' . $query);
    } else {
        if ($mode == 1) {
            $roster->set_message($roster->locale->act['f_lock']);
Ejemplo n.º 2
0
 include_once "board_functions.php";
 include_once "site_functions.php";
 if (!isset($_REQUEST['topic_id'])) {
     // user not coming from inside a topic [has no referral id]. user wants to create a topic
     if ($_SERVER['REQUEST_METHOD'] != 'POST') {
         // user hasn't submitted the form, so make one
         include_once "board_header.php";
         displayTopicForm('postmsg.php', '');
         include_once "footer.php";
     } else {
         // user posted topic, create it and post msg
         // create topic
         $subject = $_POST['subject'];
         $current_time = date('Y-m-d H:i:s');
         $topic_creator_id = $_SESSION['id'];
         createTopic($current_time, $topic_creator_id, $subject);
         // post message
         $topic_id = $conn->insert_id;
         // gets id of last inserted topic
         $post_content = $_POST['message'];
         postMsg($topic_id, $current_time, $topic_creator_id, $post_content);
         $conn->close();
         redirect("showmsg.php?topic_id={$topic_id}");
     }
 } else {
     //referred by topic id. no topic creation required
     if (!is_numeric($_REQUEST['topic_id'])) {
         giveError("Invalid Topic");
     } else {
         if (!isset($_POST['message'])) {
             //user hasn't submitted form.
Ejemplo n.º 3
0
Archivo: new.php Proyecto: rolwi/koala
             }
             closedir($dh);
         }
         // populate columns with default portlets
         switch (count($columns)) {
             case 1:
                 createHeadline($steam, $columns[1], $_POST["title"], $headline_version);
                 createMsg($steam, $columns[1], $msg_name[$language], $msg_version);
                 break;
             case 2:
                 createTopic($steam, $columns[1], $topic_name[$language], $topic_version);
                 createHeadline($steam, $columns[2], $_POST["title"], $headline_version);
                 createMsg($steam, $columns[2], $msg_name[$language], $msg_version);
                 break;
             case 3:
                 createTopic($steam, $columns[1], $topic_name[$language], $topic_version);
                 createHeadline($steam, $columns[2], $_POST["title"], $headline_version);
                 createMsg($steam, $columns[2], $msg_name[$language], $msg_version);
                 createAppointment($steam, $columns[3], $appointment_name[$language], $appointment_version);
                 break;
         }
         $steam->buffer_flush();
         break;
     default:
         break;
 }
 //close window on success and reload opener
 if ($portal !== false) {
     echo "<html><body onload='javascript:opener.top.location.reload();window.close();'></body></html";
     exit;
 }