if you use sceditor and want multimention
need add code below in jquery.sceditor.mybb.helper.js
If you use css button...
in mentionme_postbit_button
and mention_thread_multi.js replace all with code below
you need customize this button using CSS.
something like code below
image here and here --> put in images folder
if you use classic postbit open postbit_classic and find
and add after
to common user (not moderator) return error below
if i remove "{$unviewable_forums}" of line 558 of mention.php, not return error, but not return any mention...
if i remove too line 561 ~ 564, work to common user too...
Edit:
I undestand now why this error...
consult of database is "simple_select" but in line 542 has t.fid... need remove "t."
and consult database not has "visible" colunm consult...
but line 561 request this... "$mentioned_post['visible'] == 0"
need add code below in jquery.sceditor.mybb.helper.js
MentionMe.multiMentionedLoaded = function(request)
{
var message, editor;
if(request.responseText.match(/<error>(.*)<\/error>/))
{
message = request.responseText.match(/<error>(.*)<\/error>/);
if(this.spinner)
{
this.spinner.destroy();
this.spinner = '';
}
alert('There was an error fetching the posts.\n\n'+(message[1] || "An unknown error occurred."));
}
else if(request.responseText)
{
editor = jQuery("#message, #signature").data("sceditor");
if(editor)
editor.insert(request.responseText);
}
MentionMe.clearMultiMentioned();
$('quickreply_multi_mention').hide();
$('mentioned_ids').value = 'all';
if(this.spinner)
{
this.spinner.destroy();
this.spinner = '';
}
};
If you use css button...
in mentionme_postbit_button
<a href="{$js}" style="display: none;" id="multi_mention_link_{$post['pid']}" title="{$lang->mention_title}" class="postbit_multimention"><span id="multi_mention_{$post['pid']}">{$lang->mention_title}</span></a>
<script type="text/javascript">
$('multi_mention_link_{$post['pid']}').style.display = '';
</script>
and mention_thread_multi.js replace all with code below
/*
* Plugin Name: MentionMe for MyBB 1.6.x
* Copyright 2014 WildcardSearch
* http://www.rantcentralforums.com
*
* this file contains a class for the multi-mention functionality in mention.php
*/
var MentionMe = {
init: function()
{
var mentioned = Cookie.get("multi_mention");
if(mentioned)
{
var post_ids = mentioned.split("|");
post_ids.each(function(post_id) {
if($("multi_mention_"+post_id))
{
element = $("multi_mention_"+post_id).up('a');
element.addClassName('postbit_multimention_on');
}
});
if($('quickreply_multi_mention'))
{
$('quickreply_multi_mention').show();
}
}
return true;
},
multiMention: function(pid)
{
var new_post_ids = new Array();
var mentioned = Cookie.get("multi_mention");
var is_new = true;
if(mentioned)
{
var post_ids = mentioned.split("|");
post_ids.each(function(post_id) {
if(post_id != pid && post_id != '')
{
new_post_ids[new_post_ids.length] = post_id;
}
else if(post_id == pid)
{
is_new = false;
}
});
}
element = $("multi_mention_"+pid).up('a');
if(is_new == true)
{
element.addClassName('postbit_multimention_on');
new_post_ids[new_post_ids.length] = pid;
}
else
{
element.removeClassName('postbit_multimention_on');
}
if($('quickreply_multi_mention'))
{
if(new_post_ids.length > 0)
{
$('quickreply_multi_mention').show();
}
else
{
$('quickreply_multi_mention').hide();
}
}
Cookie.set("multi_mention", new_post_ids.join("|"));
},
loadMultiMentioned: function()
{
if(use_xmlhttprequest == 1)
{
this.spinner = new ActivityIndicator("body", {image: imagepath + "/spinner_big.gif"});
new Ajax.Request('xmlhttp.php?action=get_multi_mentioned&load_all=1', {method: 'get', onComplete: function(request) {MentionMe.multiMentionedLoaded(request); }});
return false;
}
else
{
return true;
}
},
multiMentionedLoaded: function(request)
{
if(request.responseText.match(/<error>(.*)<\/error>/))
{
message = request.responseText.match(/<error>(.*)<\/error>/);
if(!message[1])
{
message[1] = "An unknown error occurred.";
}
if(this.spinner)
{
this.spinner.destroy();
this.spinner = '';
}
alert('There was an error fetching the posts.\n\n'+message[1]);
}
else if(request.responseText)
{
var id = 'message';
if(typeof clickableEditor != 'undefined')
{
id = clickableEditor.textarea;
}
if($(id).value)
{
$(id).value += "\n";
}
$(id).value += request.responseText;
}
MentionMe.clearMultiMentioned();
$('quickreply_multi_mention').hide();
$('mentioned_ids').value = 'all';
if(this.spinner)
{
this.spinner.destroy();
this.spinner = '';
}
$(id).focus();
},
clearMultiMentioned: function()
{
$('quickreply_multi_mention').hide();
var mentioned = Cookie.get("multi_mention");
if(mentioned)
{
var post_ids = mentioned.split("|");
post_ids.each(function(post_id) {
if($("multi_mention_"+post_id))
{
element = $("multi_mention_"+post_id).up('a');
element.removeClassName('postbit_multimention_on');
}
});
}
Cookie.unset('multi_mention');
}
};
Event.observe(document, 'dom:loaded', MentionMe.init);
you need customize this button using CSS.
something like code below
a.postbit_multimention span {
background:url(images/mention_add.png) no-repeat !important;
}
a.postbit_multimention_on span {
background:url(images/mention_remove.png) no-repeat !important;
}
image here and here --> put in images folder
if you use classic postbit open postbit_classic and find
{$post['button_multiquote']}
and add after
{$post['button_mention']}
to common user (not moderator) return error below
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Fórum Minna Suki! - Internal Error</title>
<style type="text/css">body{background:#efefef;color:#000;font-family:Verdana;font-size:12px;text-align:center;line-height:1.4;}a:link{color:#026CB1;text-decoration:none;}a:visited{color:#026CB1;text-decoration:none;}a:hover,a:active{color:#000;text-decoration:underline;}#container{width:600px;padding:20px;background:#fff;border:1px solid #e4e4e4;margin:100px auto;text-align:left;}h1{margin:0;background:url(/xmlhttp.php?action=mybb_logo) no-repeat;height:82px;width:248px;}#content{border:1px solid #B60101;background:#fff;}h2{font-size:12px;padding:4px;background:#B60101;color:#fff;margin:0;}.invisible{display:none;}#error{padding:6px;}#footer{font-size:11px;border-top:1px solid #ccc;padding-top:10px;}dt{font-weight:bold;}</style>
</head>
<body>
<div id="container">
<div id="logo">
<h1><a href="http://mybb.com/" title="MyBulletinBoard"><span class="invisible">MyBB</span></a></h1>
</div>
<div id="content">
<h2>MyBB SQL Error</h2>
<div id="error">
<p>MyBB has experienced an internal SQL error and cannot continue.</p><dl>
<dt>SQL Error:</dt>
<dd>1054 - Unknown column 't.fid' in 'where clause'</dd>
<dt>Query:</dt>
<dd>SELECT username FROM xxxxxx_posts WHERE pid IN (275551) AND t.fid NOT IN ('41') ORDER BY dateline</dd>
</dl>
<p id="footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p>
</div>
</div>
</div>
</body>
</html>
if i remove "{$unviewable_forums}" of line 558 of mention.php, not return error, but not return any mention...
if i remove too line 561 ~ 564, work to common user too...
Edit:
I undestand now why this error...
consult of database is "simple_select" but in line 542 has t.fid... need remove "t."
and consult database not has "visible" colunm consult...
but line 561 request this... "$mentioned_post['visible'] == 0"