MyBB Community Forums
[For 1.6] ProfileComments - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [For 1.6] ProfileComments (/thread-51431.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45


RE: ProfileComments - dikaproductions - 2011-05-25

Okay. Thanks for the Support.
I will disable the BBCode Editor.
But why the Comment-Edit does not works with my js?


RE: ProfileComments - Omar G. - 2011-05-25

Maybe adding a option to disallow users to comment on their own profile, some users are... stupids ? (>__>).


RE: ProfileComments - Aquilez - 2011-05-25

(2011-05-25, 06:39 AM)dikaproductions Wrote: Okay. Thanks for the Support.
I will disable the BBCode Editor.
But why the Comment-Edit does not works with my js?

Ohhh, sorry. I misunderstand your first post.

When you edit a comment, it will never show the BBCode Editor, even if it's active.
Reason?
The BBCode editor dosn't work when you have more than one instance on the same page.

To fix it, I need to change the "edit comment" page (only show the edit comment box, and not show the "New Comment" one).
But I didn't found any solution I like yet.


RE: ProfileComments - dikaproductions - 2011-05-25

Hmm, no, that is not, what i mean.

When i would like edit a post or answer, it does not work with my Tab-JS.
I can't click on "answer" and i can not edit the post ;-)


RE: ProfileComments - Aquilez - 2011-05-25

Ahh, that.

It dosn't work because the TabJS is creating the tabs when you click on them, causing the "observe" prototype method to... fail.

I found a solution, but you will need to modify the comments.js and the reiter.js file every time they are updated.
http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/



I didn't test this code, but it should work.

In reiter.js find:
	openTab: function(tab)
	{
		if(!tab)
		{
			tab = this.defaultTab;
		}
		if(!this.tabs.get(tab) || this.tab == tab)
		{
			return;
		}
		$("tab_"+this.tab).className = "inact";
		$("tab_"+tab).className = "act";
		$("tab_desc").update($(tab+"_desc").innerHTML);
		this.tab = tab;
	}

Replace with:

	openTab: function(tab)
	{
		if(!tab)
		{
			tab = this.defaultTab;
		}
		if(!this.tabs.get(tab) || this.tab == tab)
		{
			return;
		}
		$("tab_"+this.tab).className = "inact";
		$("tab_"+tab).className = "act";
		$("tab_desc").update($(tab+"_desc").innerHTML);
		document.fire('comments:observe');
		this.tab = tab;
	}

In comments.js find:
Event.observe(window, 'load', function() {
	$$("a.reply").each(function(a)
	{
		a.observe('click', function(c) {
			var username = $(this).readAttribute('username');
			var uid = $(this).readAttribute('userid');
			$('reply_to_profile').value = uid;

			if(editorloaded == 1)
			{
				clickableEditor.performInsert('[b]' + username + '[/b], ', '', true, false);
			}
			else
			{
				$('message').value += '[b]' + username + '[/b], ';
			}

			$('replyingto').update(replying_message.replace('{1}', username)).show();

			$('linkcancel').observe('click', function(c) {
				$('replyingto').hide();
				$('reply_to_profile').value = 'default';
				Event.stop(c);
			});

			Event.stop(c);
		});
	});

	$$("a.delete_link").each(function(a)
	{
		a.observe('click', function(c) {
			if(!confirm(confirm_delete_message))
			{
				Event.stop(c);
			}
		});
	});

});

Replace with:
Event.observe('comments:observe', function() {
	$$("a.reply").each(function(a)
	{
		a.observe('click', function(c) {
			var username = $(this).readAttribute('username');
			var uid = $(this).readAttribute('userid');
			$('reply_to_profile').value = uid;

			if(editorloaded == 1)
			{
				clickableEditor.performInsert('[b]' + username + '[/b], ', '', true, false);
			}
			else
			{
				$('message').value += '[b]' + username + '[/b], ';
			}

			$('replyingto').update(replying_message.replace('{1}', username)).show();

			$('linkcancel').observe('click', function(c) {
				$('replyingto').hide();
				$('reply_to_profile').value = 'default';
				Event.stop(c);
			});

			Event.stop(c);
		});
	});

	$$("a.delete_link").each(function(a)
	{
		a.observe('click', function(c) {
			if(!confirm(confirm_delete_message))
			{
				Event.stop(c);
			}
		});
	});

});

Event.observe(window, 'load', function (event) {
	document.fire('comments:observe');
});



RE: ProfileComments - dikaproductions - 2011-05-25

It still doesnt work.
I have also put the comments.js in the header, but it was pointless.
I dont know what the problem is...


RE: ProfileComments - xHannes007 - 2011-05-28

Hello, is it possible that you can change the code so that only admins and moderators can see the profile comments? I would be very happy about it.

Greetings,
Hannes Smile


RE: ProfileComments - alv4 - 2011-05-29

Aquilez Any comments about this?
http://community.mybb.com/thread-51431-post-680173.html#pid680173


RE: ProfileComments - Aquilez - 2011-05-29

@alv4, I have plans to do it, however I don't have an ETA for a new version.

@dikaproductions I will try to fix that when I have some free time.


RE: ProfileComments - dikaproductions - 2011-05-29

Thank you Smile