1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Fixes #1290, Fixes #1279 Forum backward compatibility issues.

This commit is contained in:
Cameron
2016-01-13 18:07:05 -08:00
parent d396bf8dc9
commit 7a564f639d
10 changed files with 120 additions and 43 deletions

View File

@@ -28,9 +28,11 @@ $sql->db_Mark_Time('(Header Top)');
e107::js('core', 'bootstrap/js/bootstrap-tooltip.js','jquery');
e107::css('core', 'bootstrap/css/tooltip.css','jquery');
if(deftrue('BOOTSTRAP'))
{
e107::js('core', 'bootstrap-notify/js/bootstrap-notify.js','jquery');
e107::css('core', 'bootstrap-notify/css/bootstrap-notify.css','jquery');
}
// ------------------
@@ -182,6 +184,10 @@ if (/*!defined("PREVIEWTHEME") && */! (isset($no_core_css) && $no_core_css !==tr
$e_js->otherCSS('{e_WEB_CSS}e107.css');
}
if(!deftrue('BOOTSTRAP'))
{
$e_js->otherCSS('{e_WEB_CSS}backcompat.css');
}
// re-initalize in case globals are destroyed from $e_headers includes

View File

@@ -26,6 +26,20 @@ if (!$e107->isInstalled('forum'))
e107::lan('forum', "front", true);
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); // using English_front.php now
if(!deftrue('BOOTSTRAP'))
{
$bcDefs = array(
'FORLAN_11' => 'LAN_FORUM_0039',
'FORLAN_12' => 'LAN_FORUM_0040',
'FORLAN_18' => 'LAN_FORUM_0041',
);
e107::getLanguage()->bcDefs($bcDefs);
}
require_once(e_PLUGIN.'forum/forum_class.php');
$forum = new e107forum;

View File

@@ -57,8 +57,9 @@ $(document).ready(function()
var alertType = 'info';
}
// http://nijikokun.github.io/bootstrap-notify/
// fix - only if there
if(jQuery().notify) {
$('#uiAlert').notify({
type: alertType,
@@ -66,6 +67,12 @@ $(document).ready(function()
fadeOut: { enabled: true, delay: 3000 }
}).show();
}
else
{
alert(d.msg);
location.reload();
return;
}
// alert(d.msg);
@@ -126,6 +133,9 @@ e107::css('forum','forum.css');
e107::lan('forum','English_front');
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php');
if(!defined('IMAGE_new') && !defined('IMAGE_e'))
{
@@ -155,6 +165,14 @@ class e107forum
public function __construct($update= false)
{
if (!empty($_POST['fjsubmit']) && !empty($_POST['forumjump']))
{
$url = e107::getParser()->filter($_POST['forumjump'],'url');
e107::getRedirect()->go($_POST['forumjump']);
exit;
}
$this->e107 = e107::getInstance();
$tp = e107::getParser();
$this->userViewed = array();

View File

@@ -92,11 +92,11 @@ class forum_post_handler
function checkForumJump()
{
if(isset($_POST['fjsubmit']))
/*if(isset($_POST['fjsubmit']))
{
$this->redirect(e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), '', 'full=1&encode=0'));
exit;
}
}*/
if (!e_QUERY || empty($_GET['id']))
{

View File

@@ -22,15 +22,34 @@ if (!$e107->isInstalled('forum'))
}
e107::lan('forum', "front", true);
//include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php'); // now uses English_front.php
if(!deftrue('BOOTSTRAP'))
{
$bcDefs = array(
'FORLAN_11' => 'LAN_FORUM_0039',
'FORLAN_12' => 'LAN_FORUM_0040',
'FORLAN_13' => 'LAN_FORUM_0040',
'FORLAN_14' => 'LAN_FORUM_0040',
'FORLAN_16' => 'LAN_FORUM_1012',
'FORLAN_17' => 'LAN_FORUM_1013',
'FORLAN_18' => 'LAN_FORUM_1014',
'LAN_435' => 'LAN_DELETE',
'LAN_401' => 'LAN_FORUM_4011',
'LAN_398' => 'LAN_FORUM_4012',
'LAN_399' => 'LAN_FORUM_4013',
'LAN_400' => 'LAN_FORUM_4014',
'LAN_402' => 'LAN_FORUM_5019',
);
e107::getLanguage()->bcDefs($bcDefs);
}
define('NAVIGATION_ACTIVE','forum');
if (isset($_POST['fjsubmit']))
{
// TODO - load from DB and find forum_name
header('location:'.e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), '', 'full=1&encode=0'));
exit;
}
if (!e_QUERY && empty($_GET))
{
@@ -606,7 +625,7 @@ function parse_thread($thread_info)
<input type='image' ".IMAGE_admin_delete." name='deleteThread_{$threadId}' value='thread_action' onclick=\"return confirm_({$threadId})\" />
".($thread_info['thread_sticky'] == 1 ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_stick." name='stick_{$threadId}' value='thread_action' /> ")."
".($thread_info['thread_active'] ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_unlock." name='unlock_{$threadId}' value='thread_action' /> "). "
<a href='".$moveUrl."'>".IMAGE_admin_move.'</a>
<a class='e-tip' title=\"".LAN_FORUM_5019."\" href='".$moveUrl."'>".IMAGE_admin_move.'</a>
</div></form>
';
@@ -738,7 +757,7 @@ function forumjump()
$text = "<form method='post' action='".e_SELF."'><p>".LAN_FORUM_1017.": <select name='forumjump' class='tbox'>";
foreach($jumpList as $key => $val)
{
$text .= "\n<option value='".e107::url('forum','forum',$val)."'>".$val['forum_name']."</option>";
$text .= "\n<option value='".e107::url('forum','forum',$val, 'full')."'>".$val['forum_name']."</option>";
}
$text .= "</select> <input class='btn btn-default button' type='submit' name='fjsubmit' value='".LAN_GO."' /></form>";
return $text;

View File

@@ -16,34 +16,44 @@ if(!defined('e107_INIT'))
}
e107::lan('forum', "front", true);
if(!deftrue('BOOTSTRAP'))
{
$bcDefs = array(
'LAN_413' => 'LAN_FORUM_2046',
'LAN_400' => 'LAN_EDIT',
'LAN_401' => 'LAN_FORUM_2041',
'LAN_406' => 'LAN_EDIT',
'LAN_435' => 'LAN_DELETE',
'LAN_397' => 'LAN_FORUM_2044',
'LAN_398' => 'LAN_FORUM_4007'
);
e107::getLanguage()->bcDefs($bcDefs);
}
define('NAVIGATION_ACTIVE','forum');
$e107 = e107::getInstance();
$tp = e107::getParser();
$ns = e107::getRender();
if (!$e107->isInstalled('forum'))
if (!e107::isInstalled('forum'))
{
header('Location: '.e_BASE.'index.php');
exit;
}
if (isset($_POST['fjsubmit']))
{
header('location:' . e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), 'full=1&encode=0'));
exit;
}
$highlight_search = isset($_POST['highlight_search']);
if (!e_QUERY)
{
// var_dump(e_QUERY);
// exit;
//No parameters given, redirect to forum home
$url = e107::url('forum','index','full');
e107::getRedirect()->go($url);
// header('Location:' . e107::getUrl()->create('forum/forum/main', array(), 'full=1&encode=0'));
exit;
}
@@ -242,7 +252,8 @@ if ($forum->prefs->get('track') && USER)
{
$img = ($thread->threadInfo['track_userid'] ? IMAGE_track : IMAGE_untrack);
$url = $e107->url->create('forum/thread/view', array('id' => $thread->threadId), 'encode=0'); // encoding could break AJAX call
$tVars->TRACK .= "
//FIXME
/*$tVars->TRACK .= "
<span id='forum-track-trigger-container'>
<a class='btn btn-default btn-sm btn-small' href='{$url}' id='forum-track-trigger'>{$img}</a>
</span>
@@ -260,7 +271,8 @@ if ($forum->prefs->get('track') && USER)
});
}, document, true);
</script>
";
";*/
}
@@ -444,7 +456,7 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
</div>
<div class='center text-center form-group'>
<input type='submit' data-token='".e_TOKEN."' data-forum-insert='".$ajaxInsert."' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$threadId."' data-forum-action='quickreply' name='reply' value='".LAN_FORUM_2006. "' class='btn btn-success button' />
<input type='hidden' name='thread_id' value='$thread_parent' />
<input type='hidden' name='thread_id' value='".$threadId."' />
</div>
</form>";
@@ -532,9 +544,12 @@ function showmodoptions()
$delId = $postInfo['post_id'];
}
$editQRY = array('f'=>'edit', 'id'=>$postInfo['post_thread'], 'post'=>$postInfo['post_id']);
$editURL = e107::url('forum','post','', array('query'=> $editQRY));
// $e107->url->create('forum/thread/edit', array('id' => $postInfo['post_id']))
$ret .= "
<div>
<a href='" . $e107->url->create('forum/thread/edit', array('id' => $postInfo['post_id']))."'>" . IMAGE_admin_edit . "</a>
<a class='e-tip' href='" . $editURL."' title=\"".LAN_EDIT."\">" . IMAGE_admin_edit . "</a>
<input type='image' " . IMAGE_admin_delete . " name='delete{$type}_{$delId}' value='thread_action' onclick=\"return confirm_('{$type}', {$postInfo['post_forum']}, {$postInfo['post_thread']}, '{$postInfo['user_name']}')\" />
<input type='hidden' name='mod' value='1'/>
";
@@ -545,7 +560,7 @@ function showmodoptions()
}
else
{
$ret .= "<a href='" . $e107->url->create('forum/thread/split', array('id' => $postInfo['post_id']))."'>" . IMAGE_admin_split . '</a>';
$ret .= "<a href='" . $e107->url->create('forum/thread/split', array('id' => $postInfo['post_id']))."'>" . defset('IMAGE_admin_split') . '</a>';
}
$ret .= "

View File

@@ -207,7 +207,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
{
if($this->postInfo['user_name'])
{
return "<a href='".$this->e107->url->create('user/profile/view', array('name' => $this->postInfo['user_name'], 'id' => $this->postInfo['post_user']))."'>{$this->postInfo['user_name']}</a>";
return "<a href='".e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['user_name'], 'id' => $this->postInfo['post_user']))."'>{$this->postInfo['user_name']}</a>";
}
else
{
@@ -315,7 +315,10 @@ class plugin_forum_view_shortcodes extends e_shortcode
{
if (USER && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active'])
{
return "<a href='".$this->e107->url->create('forum/thread/edit', array('id' => $this->postInfo['post_id']))."'>".IMAGE_edit.'</a> ';
$qry = array('f'=>'edit', 'id'=>$this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']);
$editURL = e107::url('forum','post', null, array('query'=> $qry));
return "<a class='e-tip' href='".$editURL."' title=\"".LAN_EDIT."\">".IMAGE_edit.'</a> ';
}
}
@@ -323,18 +326,21 @@ class plugin_forum_view_shortcodes extends e_shortcode
{
if($this->forum->checkperm($this->postInfo['post_forum'], 'post'))
{
return "<a href='".$this->e107->url->create('forum/thread/quote', array('id' => $this->postInfo['post_id']))."'>".IMAGE_quote.'</a> ';
// return "<a href='".$this->e107->url->create('forum/thread/quote', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id'] ))."'>".IMAGE_quote.'</a> ';
$qry = array('f'=>'quote', 'id'=>$this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']);
$quoteURL = e107::url('forum','post', null, array('query'=> $qry));
return "<a class='e-tip' href='".$quoteURL."' title=\"".LAN_FORUM_2041."\">".IMAGE_quote.'</a> ';
}
}
function sc_reportimg()
{
global $page;
if (USER) {
// $actionUrl= $this->e107->url->create('forum/thread/report', "id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}");
$actionUrl = e107::url('forum','post')."?f=report&amp;id=".$this->data['thread_id']."&amp;post=".$this->data['post_id'];
return "<a href='".$actionUrl."'>".IMAGE_report.'</a> ';
if (USER)
{
$qry = array('f'=>'report', 'id'=>$this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']);
$reportURL = e107::url('forum','post', null, array('query'=> $qry));
return "<a class='e-tip' href='".$reportURL."' title=\"".LAN_FORUM_2046."\">".IMAGE_report.'</a> ';
}
}
@@ -421,8 +427,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
{
if($parm == 'link')
{
$e107 = e107::getInstance();
$url = $e107->url->create('user/profile/view', array('name' => $this->postInfo['edit_name'], 'id' => $this->postInfo['post_edit_user']));
$url = e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['edit_name'], 'id' => $this->postInfo['post_edit_user']));
return "<a href='{$url}'>{$this->postInfo['edit_name']}</a>";
}
return $this->postInfo['edit_name'];

View File

View File

@@ -438,7 +438,7 @@ $(document).ready(function()
// Tooltips for bbarea.
$(".bbcode_buttons").tooltip({placement: 'top',opacity: 1.0, fade: true,html: true, container:'body'});
$(".bbcode_buttons, a.e-tip").tooltip({placement: 'top',opacity: 1.0, fade: true,html: true, container:'body'});
// $("a.e-tip").tipsy({gravity: 'w',opacity: 1.0, fade: true,html: true});
// var tabs = $('#tab-container').clone(true);
// $('#htmlEditor').append(tabs);

View File

@@ -2761,5 +2761,5 @@ function sendInfo(handler, container, form) {
* Core Auto-load
*/
$w('autoExternalLinks autoNoHistory autoHide toggleObserver toggleManyObserver scrollToObserver executeAutoSubmit').each( function(f) {
e107.runOnLoad(e107Helper[f], null, true);
// e107.runOnLoad(e107Helper[f], null, true);
});