コード例 #1
0
ファイル: forum_viewtopic.php プロジェクト: armpit/e107
}
$gen = new convert();
if ($thread->message) {
    //$ns->tablerender('', $thread->message, array('forum_viewtopic', 'msg'));
    e107::getMessage()->add($thread->message);
}
//if (isset($thread->threadInfo['thread_options']['poll'])) //XXX Currently Failing - misconfigured thread-options.
//{
if (e107::isInstalled('poll')) {
    $_qry = 'SELECT * FROM `#polls` WHERE `poll_datestamp` = ' . $thread->threadId;
    if ($sql->gen($_qry)) {
        if (!defined('POLLCLASS')) {
            include_once e_PLUGIN . 'poll/poll_class.php';
        }
        $poll = new poll();
        $pollstr = "<div class='spacer'>" . $poll->render_poll($_qry, 'forum', 'query', true) . '</div>';
    }
}
//}
//Load forum templates
// FIXME - new template paths!
if (file_exists(THEME . 'forum_design.php')) {
    include_once THEME . 'forum_design.php';
}
if (!vartrue($FORUMSTART)) {
    if (file_exists(THEME . 'forum_viewtopic_template.php')) {
        require_once THEME . 'forum_viewtopic_template.php';
    } elseif (file_exists(THEME . 'templates/forum/forum_viewtopic_template.php')) {
        require_once THEME . 'templates/forum/forum_viewtopic_template.php';
    } elseif (file_exists(THEME . 'forum_template.php')) {
        require_once THEME . 'forum_template.php';
コード例 #2
0
ファイル: poll_menu.php プロジェクト: gitter-badger/e107
}
global $e107;
if (defined("POLLRENDERED")) {
    //	return;
}
if (!e107::isInstalled('poll')) {
    e107::redirect();
}
if (!defined("POLLCLASS")) {
    require e_PLUGIN . "poll/poll_class.php";
}
if (!isset($poll) || !is_object($poll)) {
    $poll = new poll();
}
if (!defined("POLL_1")) {
    /* if menu is being called from comments, lan files have to be included manually ... */
    include_lan(e_PLUGIN . "poll/languages/" . e_LANGUAGE . ".php");
}
if (empty($poll_to_show)) {
    $poll_to_show = ' AND p.`poll_vote_userclass`!=255';
    $pollType = 'menu';
    $pollMode = 'query';
} else {
    $poll_to_show = ' AND p.`poll_id`=' . $poll_to_show;
    $pollType = 'menu';
    $pollMode = 'results';
}
$query = "SELECT p.*, u.user_name FROM #polls AS p \nLEFT JOIN #user AS u ON p.poll_admin_id = u.user_id\nWHERE  p.poll_type=1{$poll_to_show}\nORDER BY p.poll_datestamp DESC LIMIT 0,1\n";
$poll->remove_poll_cookies();
$poll->render_poll($query, $pollType, $pollMode);
コード例 #3
0
ファイル: forum_post.php プロジェクト: JBeezygit/e107
 /**
  *
  */
 function renderPreview()
 {
     global $FORUM_PREVIEW;
     // BC v1.x
     $tp = e107::getParser();
     $ns = e107::getRender();
     $this->processAttachments();
     require_once HEADERF;
     if (USER) {
         $poster = USERNAME;
     } else {
         $poster = $_POST['anonname'] ? $_POST['anonname'] : LAN_ANONYMOUS;
     }
     $postdate = e107::getDate()->convert_date(time(), "forum");
     $tsubject = $tp->post_toHTML($_POST['subject'], true);
     $tpost = $tp->post_toHTML($_POST['post'], true);
     if ($_POST['poll_title'] != '' && check_class($this->forumObj->prefs->get('poll'))) {
         require_once e_PLUGIN . "poll/poll_class.php";
         $poll = new poll();
         $poll_text = $poll->render_poll($_POST, 'forum', 'notvoted', true);
     } else {
         $poll_text = false;
     }
     if (empty($FORUM_PREVIEW)) {
         if (deftrue('BOOTSTRAP')) {
             $FORUM_PREVIEW = e107::getTemplate('forum', 'forum_preview', 'item');
         } else {
             if (file_exists(THEME . "forum_preview_template.php")) {
                 require_once THEME . "forum_preview_template.php";
             } else {
                 require_once e_PLUGIN . "forum/templates/forum_preview_template.php";
             }
         }
     }
     $shortcodes = array('PREVIEW_DATE' => $postdate, 'PREVIEW_SUBJECT' => $tsubject, 'PREVIEW_POST' => $tpost);
     $text = $tp->simpleParse($FORUM_PREVIEW, $shortcodes);
     if ($poll_text) {
         $ns->tablerender($_POST['poll_title'], $poll_text);
     }
     $ns->tablerender(LAN_FORUM_3005, $text);
     /*
     		if ($this->action == 'edit')
     		{
     			if ($_POST['subject'])
     			{
     				$action = 'edit';
     			}
     			else
     			{
     				$action = 'rp';
     			}
     			$eaction = true;
     		}
     		else if($this->action == 'quote')
     		{
     			$action = 'rp';
     			$eaction = false;
     		}*/
 }
コード例 #4
0
ファイル: admin_config.php プロジェクト: notzen/e107
if (isset($_POST['submit'])) {
    if ($_POST['poll_title']) {
        define("POLLID", $_POST['poll_id']);
        $emessage->add($poll->submit_poll(), E_MESSAGE_SUCCESS);
        unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
    } else {
        $emessage->add(POLLAN_46, E_MESSAGE_SUCCESS);
    }
    $_GET['mode'] = 'list';
}
if (isset($_POST['preview'])) {
    // Can't have everyone voting if tracking method is user ID
    if ($_POST['pollUserclass'] == e_UC_PUBLIC && $_POST['storageMethod'] == 2) {
        $_POST['pollUserclass'] = e_UC_MEMBER;
    }
    $poll->render_poll($_POST, "preview");
}
if (varset($_POST['edit']) || varset($_GET['mode']) == 'create' && !varset($_POST['submit'])) {
    $_GET['mode'] = 'create';
    if ($_POST['edit']) {
        edit_poll();
        define("POLLACTION", 'edit');
    }
    $poll_total = $sql->db_Select("polls");
    $text = $poll->renderPollForm();
    $ns->tablerender(POLLAN_MENU_CAPTION . " :: " . POLLAN_2, $text);
}
if (isset($message)) {
    $emessage->add($message, E_MESSAGE_SUCCESS);
}
if (!varset($_POST['edit']) && ($_GET['mode'] == "list" || !$_GET['mode'])) {
コード例 #5
0
ファイル: forum_viewtopic.php プロジェクト: notzen/e107
        $message = forum_thread_moderate($_POST);
        $thread_info = $forum->thread_get($thread_id, $topic_from - 1, $pref['forum_postspage']);
    }
}
require_once HEADERF;
require_once e_HANDLER . "level_handler.php";
if ($message) {
    $ns->tablerender("", $message, array('forum_viewtopic', 'msg'));
}
if (stristr($thread_info['head']['thread_name'], "[" . LAN_430 . "]")) {
    if (!defined("POLLCLASS")) {
        require e_PLUGIN . "poll/poll_class.php";
    }
    $_qry = "SELECT * FROM #polls WHERE `poll_datestamp` = '{$thread_info['head']['thread_id']}'";
    $poll = new poll();
    $pollstr = "<div class='spacer'>" . $poll->render_poll($_qry, "forum", "query", TRUE) . "</div>";
}
//Load forum templates
if (!$FORUMSTART) {
    if (file_exists(THEME . "forum_viewtopic_template.php")) {
        require_once THEME . "forum_viewtopic_template.php";
    } else {
        if (file_exists(THEME . "forum_template.php")) {
            require_once THEME . "forum_template.php";
        } else {
            require_once e_PLUGIN . "forum/templates/forum_viewtopic_template.php";
        }
    }
}
$forum_info['forum_name'] = $tp->toHTML($forum_info['forum_name'], TRUE, 'USER_TITLE');
// get info for main thread -------------------------------------------------------------------------------------------------------------------------------------------------------------------
コード例 #6
0
ファイル: forum_post.php プロジェクト: notzen/e107
}
if (isset($_POST['fpreview'])) {
    process_upload();
    require_once HEADERF;
    if (USER) {
        $poster = USERNAME;
    } else {
        $poster = $_POST['anonname'] ? $_POST['anonname'] : LAN_311;
    }
    $postdate = $gen->convert_date(time(), "forum");
    $tsubject = $tp->post_toHTML($_POST['subject'], true);
    $tpost = $tp->post_toHTML($_POST['post'], true);
    if ($_POST['poll_title'] != '' && check_class($forum->prefs->get('forum_poll'))) {
        require_once e_PLUGIN . "poll/poll_class.php";
        $poll = new poll();
        $poll->render_poll($_POST, 'forum', 'notvoted');
    }
    if (!$FORUM_PREVIEW) {
        if (file_exists(THEME . "forum_preview_template.php")) {
            require_once THEME . "forum_preview_template.php";
        } else {
            require_once e_PLUGIN . "forum/templates/forum_preview_template.php";
        }
    }
    $text = $FORUM_PREVIEW;
    if ($poll_text) {
        $ns->tablerender($_POST['poll_title'], $poll_text);
    }
    $ns->tablerender(LAN_323, $text);
    $anonname = $tp->post_toHTML($_POST['anonname'], FALSE);
    $post = $tp->post_toForm($_POST['post']);