mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Merge pull request #1752 from rica-carv/rica-carv-patch-quickreply
Pull to solve missing pagination & quickreply shortcode #1751
This commit is contained in:
@@ -473,6 +473,10 @@ $i = $thread->page;
|
|||||||
//---- Moved upwards, to enclose $tVars...
|
//---- Moved upwards, to enclose $tVars...
|
||||||
//---- $sc = e107::getScBatch('view', 'forum');
|
//---- $sc = e107::getScBatch('view', 'forum');
|
||||||
|
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
// $sc->setVars($thread->threadInfo);
|
||||||
|
//--->$forend = $tp->simpleParse($FORUMEND, $tVars);
|
||||||
|
$forend = $tp->parseTemplate($FORUMEND, true, $sc);
|
||||||
|
|
||||||
|
|
||||||
foreach ($postList as $c => $postInfo)
|
foreach ($postList as $c => $postInfo)
|
||||||
@@ -538,6 +542,7 @@ foreach ($postList as $c => $postInfo)
|
|||||||
}
|
}
|
||||||
unset($loop_uid);
|
unset($loop_uid);
|
||||||
|
|
||||||
|
/*---->
|
||||||
if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread->threadInfo['thread_active'])
|
if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread->threadInfo['thread_active'])
|
||||||
{
|
{
|
||||||
//XXX Show only on the last page??
|
//XXX Show only on the last page??
|
||||||
@@ -578,11 +583,14 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
|
|||||||
$tVars->QUICKREPLY = $forum_quickreply;
|
$tVars->QUICKREPLY = $forum_quickreply;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
<----*/
|
||||||
|
|
||||||
|
/*--->
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$forend = $tp->simpleParse($FORUMEND, $tVars);
|
$sc->setVars($thread->threadInfo);
|
||||||
|
//--->$forend = $tp->simpleParse($FORUMEND, $tVars);
|
||||||
|
$forend = $tp->parseTemplate($FORUMEND, true, $sc);
|
||||||
|
<---*/
|
||||||
$forumstring = $forstr . $forthr . vartrue($forrep) . $forend;
|
$forumstring = $forstr . $forthr . vartrue($forrep) . $forend;
|
||||||
|
|
||||||
//If last post came after USERLV and not yet marked as read, mark the thread id as read
|
//If last post came after USERLV and not yet marked as read, mark the thread id as read
|
||||||
@@ -899,7 +907,7 @@ class e107ForumThread
|
|||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$frm = e107::getForm();
|
//Orphan $frm variable???? $frm = e107::getForm();
|
||||||
|
|
||||||
if (empty($_GET['f']))
|
if (empty($_GET['f']))
|
||||||
{
|
{
|
||||||
|
@@ -885,5 +885,51 @@ function sc_message()
|
|||||||
return $thread->message;
|
return $thread->message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sc_quickreply()
|
||||||
|
{
|
||||||
|
global $forum, $forum_quickreply;
|
||||||
|
|
||||||
|
if ($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
||||||
|
{
|
||||||
|
//XXX Show only on the last page??
|
||||||
|
if (!vartrue($forum_quickreply))
|
||||||
|
{
|
||||||
|
$ajaxInsert = ($thread->pages == $thread->page || $thread->pages == 0) ? 1 : 0;
|
||||||
|
// $ajaxInsert = 1;
|
||||||
|
// echo "AJAX-INSERT=".$ajaxInsert ."(".$thread->pages." vs ".$thread->page.")";
|
||||||
|
//Orphan $frm variable???? $frm = e107::getForm();
|
||||||
|
|
||||||
|
$urlParms = array('f'=>'rp','id'=>$this->var['thread_id'], 'post'=>$this->var['thread_id']);
|
||||||
|
$url = e107::url('forum','post', null, array('query'=>$urlParms));; // ."?f=rp&id=".$thread->threadInfo['thread_id']."&post=".$thread->threadInfo['thread_id'];
|
||||||
|
|
||||||
|
return "
|
||||||
|
<form action='" . $url . "' method='post'>
|
||||||
|
<div class='form-group'>
|
||||||
|
<textarea cols='80' placeholder='".LAN_FORUM_2007."' rows='4' id='forum-quickreply-text' class='tbox input-xxlarge form-control' name='post' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
|
||||||
|
</div>
|
||||||
|
<div class='center text-center form-group'>
|
||||||
|
<input type='submit' data-token='".e_TOKEN."' data-forum-insert='".$ajaxInsert."' data-forum-post='".$this->var['thread_forum_id']."' data-forum-thread='".$this->var['thread_id']."' data-forum-action='quickreply' name='reply' value='".LAN_FORUM_2006. "' class='btn btn-success button' />
|
||||||
|
<input type='hidden' name='thread_id' value='".$this->var['thread_id']."' />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>";
|
||||||
|
|
||||||
|
if(E107_DEBUG_LEVEL > 0)
|
||||||
|
{
|
||||||
|
// echo "<div class='alert alert-info'>Thread id: ".$threadId."</div>";
|
||||||
|
// print_a($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Preview should be reserved for the full 'Post reply' page. <input type='submit' name='fpreview' value='" . Preview . "' />
|
||||||
|
}
|
||||||
|
//---- else
|
||||||
|
//---- {
|
||||||
|
return $forum_quickreply;
|
||||||
|
//---- }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user