mirror of
https://github.com/e107inc/e107.git
synced 2025-08-20 05:11:42 +02:00
Nextprev support for bootstrap glyphs when bootstrap detected. (check for e_BOOTSTRAP === true)
Forum quickreply fully functional. LANs still need cleanup.
This commit is contained in:
@@ -24,6 +24,7 @@ $(document).ready(function()
|
||||
var thread = $(this).attr('data-forum-thread');
|
||||
var post = $(this).attr('data-forum-post');
|
||||
var text = $('#forum-quickreply-text').val();
|
||||
var insert = $(this).attr('data-forum-insert');
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +38,7 @@ $(document).ready(function()
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: script,
|
||||
data: { thread: thread, action: action, post: post, text: text },
|
||||
data: { thread: thread, action: action, post: post, text: text, insert:insert },
|
||||
success: function(data) {
|
||||
// alert(data);
|
||||
|
||||
@@ -81,8 +82,8 @@ EON;
|
||||
|
||||
e107::js('inline',$jscode,'jquery');
|
||||
|
||||
|
||||
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php');
|
||||
e107::lan('forum','lan_forum');
|
||||
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php');
|
||||
include_once(e_PLUGIN . 'forum/templates/forum_icons_template.php');
|
||||
|
||||
|
||||
@@ -134,41 +135,51 @@ class e107forum
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Handle the Ajax quick-reply.
|
||||
*/
|
||||
function ajaxQuickReply()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
if(varset($_POST['action']) == 'quickreply' && vartrue($_POST['text']))
|
||||
{
|
||||
|
||||
|
||||
$postInfo = array();
|
||||
$postInfo['post_ip'] = e107::getIPHandler()->getIP(FALSE);
|
||||
|
||||
if (USER)
|
||||
{
|
||||
$postInfo['post_user'] = USERID;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$postInfo['post_user_anon'] = $_POST['anonname'];
|
||||
}
|
||||
$postInfo['post_entry'] = $_POST['text'];
|
||||
$postInfo['post_forum'] = intval($_POST['post']);
|
||||
$postInfo['post_datestamp'] = time();
|
||||
$postInfo['post_thread'] = intval($_POST['thread']);
|
||||
|
||||
$postInfo['post_entry'] = $_POST['text'];
|
||||
$postInfo['post_forum'] = intval($_POST['post']);
|
||||
$postInfo['post_datestamp'] = time();
|
||||
$postInfo['post_thread'] = intval($_POST['thread']);
|
||||
|
||||
$this->postAdd($postInfo); // save it.
|
||||
|
||||
$postInfo['user_name'] = USERNAME;
|
||||
$postInfo['user_email'] = USEREMAIL;
|
||||
$postInfo['user_image'] = USERIMAGE;
|
||||
|
||||
$tmpl = e107::getTemplate('forum','forum_viewtopic','replies');
|
||||
$sc = e107::getScBatch('view', 'forum');
|
||||
$sc->setScVar('postInfo', $postInfo);
|
||||
|
||||
$ret['html'] = $tp->parseTemplate($tmpl, true, vartrue($forum_shortcodes)) . "\n";
|
||||
// $ret['html'] = "<tr><td>Help! I can't pass the template!</td><td colspan='2'>".$tp->toHtml($_POST['text'])."</td></tr>";
|
||||
|
||||
if($_POST['insert'] == 1)
|
||||
{
|
||||
$tmpl = e107::getTemplate('forum','forum_viewtopic','replies');
|
||||
$sc = e107::getScBatch('view', 'forum');
|
||||
$sc->setScVar('postInfo', $postInfo);
|
||||
$ret['html'] = $tp->parseTemplate($tmpl, true, vartrue($forum_shortcodes)) . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret['html'] = false;
|
||||
}
|
||||
|
||||
$ret['status'] = 'ok';
|
||||
$ret['msg'] = "Your post has been added";
|
||||
|
@@ -24,7 +24,7 @@ if (!$e107->isInstalled('forum'))
|
||||
exit;
|
||||
}
|
||||
|
||||
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php');
|
||||
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php');
|
||||
|
||||
if (isset($_POST['fjsubmit']))
|
||||
{
|
||||
|
@@ -224,7 +224,7 @@ if ($thread->pages > 1)
|
||||
{
|
||||
if(!$thread->page) $thread->page = 1;
|
||||
$url = rawurlencode(e107::getUrl()->create('forum/thread/view', array('name' => $thread->threadInfo['thread_name'], 'id' => $thread->threadId, 'page' => '[FROM]')));
|
||||
$parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=".$url."&caption=off";
|
||||
$parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=".$url."&caption=off&tmpl=default&navcount=4&glyphs=1";
|
||||
|
||||
//XXX FIXME - pull-down template not practical here. Can we force another?
|
||||
$tVars->GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
@@ -361,11 +361,13 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
|
||||
//XXX Show only on the last page??
|
||||
if (!vartrue($forum_quickreply))
|
||||
{
|
||||
$ajaxInsert = ($thread->pages == $thread->page) ? 1 : 0;
|
||||
|
||||
$tVars->QUICKREPLY = "
|
||||
<form action='" . $e107->url->create('forum/thread/reply', array('id' => $thread->threadId)) . "' method='post'>
|
||||
<textarea cols='80' placeholder=\"Post a quick reply\" rows='4' id='forum-quickreply-text' class='tbox input-xxlarge' name='post' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
|
||||
<div class='center'>
|
||||
<input type='submit' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$threadId."' data-forum-action='quickreply' name='reply' value='" . LAN_395 . "' class='btn btn-success button' />
|
||||
<input type='submit' data-forum-insert='".$ajaxInsert."' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$threadId."' data-forum-action='quickreply' name='reply' value='" . LAN_395 . "' class='btn btn-success button' />
|
||||
<input type='hidden' name='thread_id' value='$thread_parent' />
|
||||
</div>
|
||||
</form>";
|
||||
@@ -378,6 +380,8 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$forend = $tp->simpleParse($FORUMEND, $tVars);
|
||||
|
||||
$forumstring = $forstr . $forthr . vartrue($forrep) . $forend;
|
||||
@@ -388,16 +392,17 @@ if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->thread
|
||||
{
|
||||
$tst = $forum->threadMarkAsRead($thread->threadId);
|
||||
}
|
||||
|
||||
$mes = e107::getMessage();
|
||||
require_once (HEADERF);
|
||||
|
||||
|
||||
if ($forum->prefs->get('enclose'))
|
||||
{
|
||||
$ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main'));
|
||||
$ns->tablerender(LAN_01, $forumstring, $mes->render(). array('forum_viewtopic', 'main'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $forumstring;
|
||||
echo $mes->render() . $forumstring;
|
||||
}
|
||||
|
||||
// end -------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
if ( ! defined('e107_INIT')) { exit(); }
|
||||
|
||||
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php');
|
||||
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php');
|
||||
|
||||
// Thread info
|
||||
|
||||
|
Reference in New Issue
Block a user