Adding a "View Profile" link?

170 views
Skip to first unread message

Leviathan

unread,
Jan 6, 2015, 8:38:52 PM1/6/15
to ajax...@googlegroups.com
I run a mybb powered website at www.scribblehub.com. One of the most user-requested features is to add a "View profile" link in the dropdown menu on users profiles. Here is what I think it should do.

Get the Mybb user ID

Assign it to a variable.

Add replace the end of the view profile link with the variable.
(The "View profile link" is http://scribblehub.com/member.php?action=profile&uid=[USER ID HERE]
Put it in the dropdown menu.


Does anybody have any advice?

hcfwesker6991

unread,
Jan 7, 2015, 6:23:25 PM1/7/15
to
Did this for my site, which is SMF, but shouldn't be a problem, just changing the URL, as you have provided.  Thoyugh this will only work with your MyBB member IDs are integrated with the Ajax Chat Member IDs

chat/js/chat.js 

Look for this

+ '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/describe '

Add BEFORE 

+ '<li><a target="_blank" href="http://scribblehub.com/member.php?action=profile&uid='
+ userID
+ '">'
+ this.lang['userMenuProfileView']
+ '</a></li>'
 

then, you need to goto chat.js/lang/en.js

and add the following somewhere within the file

userMenuProfileView: 'View User Profile',


Leviathan

unread,
Jan 8, 2015, 1:43:57 AM1/8/15
to
 
Thank you so much for you reply. I have done as you asked, but unfortunately, when I attempt to click on a users name in the chatroom, I get the following error.

Error: Invalid DOM Syntax (DOM ID: ajaxChat_um_(This number varies with each user I click on.).

I have attached my Chat.js, along with my en.js. HAve I done something wrong, or is there something else I should do?


 
 
en.js
chat.js

ClubSyNXTremeTV

unread,
Jan 10, 2015, 6:47:02 AM1/10/15
to ajax...@googlegroups.com
change this block

	getUserNodeStringItems: function(encodedUserName, userID, isInline) {
		var menu;
		if(encodedUserName !== this.encodedUserName) {
			menu 	= '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/msg '
					+ encodedUserName
					+ ' \');">'
					+ this.lang['userMenuSendPrivateMessage']
					+ '</a></li>'
					+ '<li><a target="_blank" href="http://scribblehub.com/member.php?action=profile&uid='
					+ userID
					+ '">'
					+ this.lang['userMenuProfileView']
					+ '</a></li>'
					+ '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/describe '
					+ encodedUserName
					+ ' \');">'
					+ this.lang['userMenuDescribe']
					+ '</a></li>'
					+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query '
					+ encodedUserName
					+ '\');">'
					+ this.lang['userMenuOpenPrivateChannel']
					+ '</a></li>'
					+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query\');">'
					+ this.lang['userMenuClosePrivateChannel']
					+ '</a></li>'
					+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/ignore '
					+ encodedUserName
					+ '\');">'
					+ this.lang['userMenuIgnore']
					+ '</a></li>';

To this:

getUserNodeStringItems: function(encodedUserName, userID, isInline) { var menu; if(encodedUserName !== this.encodedUserName) { menu = '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/msg ' + encodedUserName + ' \');">' + this.lang['userMenuSendPrivateMessage'] + '</a></li>' + '<li><a target="_blank" href="http://scribblehub.com/member.php?action=profile&uid=' + userID + '">View Profile</a></li>' + '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/describe ' + encodedUserName + ' \');">' + this.lang['userMenuDescribe'] + '</a></li>' + '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query ' + encodedUserName + '\');">' + this.lang['userMenuOpenPrivateChannel'] + '</a></li>' + '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query\');">' + this.lang['userMenuClosePrivateChannel'] + '</a></li>' + '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/ignore ' + encodedUserName + '\');">' + this.lang['userMenuIgnore'] + '</a></li>';

Don't worry about the Eng file, you don't need it for this.

hcfwesker6991

unread,
Jan 11, 2015, 8:36:16 PM1/11/15
to
^ yeah, I considered hardcoding the language text, but perhaps he had members that use a different language, though he would have to modify all lang files lol.

Leviathan

unread,
Jan 12, 2015, 2:36:37 PM1/12/15
to ajax...@googlegroups.com
I will do that as soon as humanly possible, and get back to you, Syn. For some unknown reson, since yesterday, I have been unable to connect to my website, but everybody else can. My network is completely unable to connect to scribblehub.com.

Leviathan

unread,
Jan 14, 2015, 4:59:23 PM1/14/15
to ajax...@googlegroups.com




I get another invalid DOM syntax now every time I clock on a name in the Ajax chat. Can I fix this?

ClubSyNXTremeTV

unread,
Jan 14, 2015, 5:07:04 PM1/14/15
to ajax...@googlegroups.com
Did you remove whatever changes you made to your language file? The earlier suggested changes were not needed unless you plan on using more than one language for your chat.

Leviathan

unread,
Jan 14, 2015, 9:31:19 PM1/14/15
to ajax...@googlegroups.com


On Wednesday, January 14, 2015 at 4:07:04 PM UTC-6, ClubSyNXTremeTV wrote:
Did you remove whatever changes you made to your language file? The earlier suggested changes were not needed unless you plan on using more than one language for your chat.

Yes sir. I have enclosed my en.js, along with my chat.js, like before. If you have the time, could you look over them and make any necessary changes? I will do whatever I can to compensate you.
chat.js
en.js

jonnyboy

unread,
Jan 17, 2015, 10:31:49 PM1/17/15
to ajax...@googlegroups.com
Thanks, it works perfectly.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages