Thread Rating:
  • 12 Vote(s) - 4.08 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.6] MentionMe 2.3.3 (for MyAlerts 1.05)
#11
http://community.mybb.com/thread-95808.html

If you follow that tutorial, it wouldn't be hard to change the code to work with this plugin.
[retired]
#12
(2012-12-24, 05:20 AM)Wildcard Wrote: http://community.mybb.com/thread-95808.html

If you follow that tutorial, it wouldn't be hard to change the code to work with this plugin.

That tutorial for spoiler button. Spoiler button dont have pop-up window. I looked that topic already. I need code for to add editor.js.
#13
To add a codebutton to the editor for this plugin, use the following patches.



In editor.js, find:

  1. {type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors}

    and change it to this:

    {type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors},
    {type: 'button', name: 'mention', insert: 'mention', image: 'mention.gif', title: 'Mention'}

  2. then find:

    case "video":
    this.insertVideo(extra);
    break;

    and change it to this:

    case "video":
    this.insertVideo(extra);
    break;
    case "mention":
    this.insertMention();
    break;

  3. Then find this:

    insertMyCode: function(code, extra)

    and change it to this:

    insertMention: function()
        {
    	selectedText = this.getSelectedText($(this.textarea));
            
            if(!selectedText)
            {
                text = prompt("Enter a username to mention.", "");
            }
            else
            {
                text = selectedText;
            }
    		
    	if(text)
            {
                this.performInsert("@\""+text+"\"", "", true, false);
            }	
        },
    insertMyCode: function(code, extra)

  4. Upload a 22x23 transparent background GIF to jscripts/editor_themes/default/images and name it mention.gif

    [Image: mention_zpseb2db2ce.gif]

That should do it.

EDIT:

I am attaching three exported patches (for those who use the Patches plugin)

EDIT AGAIN:

I have included these patches as part of the optional files in version 1.5.


EDIT AGAIN, AGAIN:

I've removed the patch from this post and the installation package as it is no longer necessary.

MentionMe can now insert a code button automatically and can be controlled with a simple setting since 2.1
[retired]
#14

(2012-12-24, 06:26 AM)Wildcard Wrote: To add a codebutton to the editor for this plugin, use the following patches.



In editor.js, find:

  1. {type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors}

    and change it to this:

    {type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors},
    {type: 'button', name: 'mention', insert: 'mention', image: 'mention.gif', title: 'Mention'}

  2. then find:

    case "video":
    this.insertVideo(extra);
    break;

    and change it to this:

    case "video":
    this.insertVideo(extra);
    break;
    case "mention":
    this.insertMention();
    break;

  3. Then find this:

    insertMyCode: function(code, extra)

    and change it to this:

    insertMention: function()
        {
    	selectedText = this.getSelectedText($(this.textarea));
            
            if(!selectedText)
            {
                text = prompt("Enter a username to mention.", "");
            }
            else
            {
                text = selectedText;
            }
    		
    	if(text)
            {
                this.performInsert("@\""+text+"\"", "", true, false);
            }	
        },
    insertMyCode: function(code, extra)

  4. Upload a 22x23 transparent background GIF to jscripts/editor_themes/default/images and name it mention.gif

    [Image: mention_zpseb2db2ce.gif]

That should do it.

EDIT:

I am attaching three exported patches (for those who use the Patches plugin)
Thank you so much!
#15
Looks good Wildcard! Nice work with this - I was going to look into doing something similar eventually Wink
#16
very good...
thanks...
installed...
#17
does this plugin will have a conflict here? http://community.mybb.com/thread-131176.html
#18
(2012-12-24, 12:06 PM)euantor Wrote: Looks good Wildcard! Nice work with this - I was going to look into doing something similar eventually Wink

That means a lot, Euan. Smile

I would appreciate any advice you might have or check the project out on GitHub. Smile

(2012-12-24, 12:35 PM)martec Wrote: very good...
thanks...
installed...

Great! Smile

Would you link me to your board that is using it please?

(2012-12-24, 01:17 PM)why so serious? Wrote: does this plugin will have a conflict here? http://community.mybb.com/thread-131176.html

euanator made MyAlerts extensible in such a way that if both Shade and I have followed the integration techniques provided there should be absolutely no conflicts.

However, if you find a conflict (or any other bug) please report it.

https://github.com/WildcardSearch/MentionMe
[retired]
#19
One thing I have noticed after browsing your code is how the _is_installed() function works. Users can clear the admin log via the ACP so your current check could easily return false even when it is installed.

The way you update user settings could also cause a timeout on boards with large amounts of users too. I still need to find a better way of handling settings so that's kind of my fault.
#20
(2012-12-24, 04:27 PM)euantor Wrote: One thing I have noticed after browsing your code is how the _is_installed() function works. Users can clear the admin log via the ACP so your current check could easily return false even when it is installed.

I never considered that.

Would it be better to use this?

function mention_is_installed ()
{
	global $cache, $plugins;
	
	$pluginlist = $cache->read("plugins");
	
	return in_array('mention', $pluginlist['active']);
}

EDIT:

No, that doesn't work correctly. I will keep trying.

(2012-12-24, 04:27 PM)euantor Wrote: The way you update user settings could also cause a timeout on boards with large amounts of users too. I still need to find a better way of handling settings so that's kind of my fault.

What is it that I am doing wrong?

Please let me know if there is a better way and I will implement the changes.

Thanks for all you help Smile
[retired]


Forum Jump:


Users browsing this thread: 32 Guest(s)