Poke instead

in
Subscribe to Poke instead 4 posts, 2 voices



<x51> User
FirefoxWindows

First.. this is very useful. Thank you!!

I'd like to suggest an enhancement. I think you should try replacing the Poke link rather than the send message link. The send message link is useful to have. I wouldn't want to lose that. I personally think the Poke link is useless... I know I wouldn't miss it. Another option is not to REPLACE the message link, but ADD the mafia wars profile link just below it.

Just some suggestions..

Thanks again for sharing this.

 
<x51> User
FirefoxWindows

I made the following changes to replace the poke link instead, it seems to work.
I kept the user ID retrieval on the Message link because it was easier, and reliable.

Add a new var line
var poke = document.getElementById("profile_action_poke");

Replace "sendmsg" with "poke" for the 4 lines that modify the link.

Here is the entire block with changes:


                        //Get the Message element
                        var poke = document.getElementById("profile_action_poke");
                        var sendMsg = document.getElementById("profile_action_send_message");
                        if(sendMsg)
                        {
                                try
                                {
					var MsgStr = sendMsg.toString();
                                	var fStart = MsgStr.indexOf("?id=");  //Get the FB profile ID start point

					var userID = MsgStr.slice(fStart+4);
					if(!isNaN(parseInt(userID)))
					{
                                        	//set the onclick event to open Mafia Wars in a new window/tab
                                        	//following line is broken
                                        	sendMsg.setAttribute("onclick","");   //setting onclick to blank until mafia wars fix found
                                  
                                        	//set the href to open Mob Wars in the current window
                                        	poke.setAttribute("href", MobProfile + userID);
                                        	//changes the Msg link
                                        	poke.innerHTML = "Goto Mafia Profile";
                                        	poke.setAttribute("ID", "MafiaProfile");
                                        	poke.setAttribute("REL", "");
                                        }

 
SwissJ Script's Author
FirefoxWindows

That's actually what the original script did. The reason I changed it is because I found far more profiles had the "Send Messge" link than the "Poke" link. I guess I could give people a choice using a variable. Some profiles don't have any links at all and I'm trying to figure out how to enable a "Goto Mafia profile" link for those, just haven't had time yet.

But thanks for the suggestion, I'll implement that in the next version, as soon as time allows ;)

 
SwissJ Script's Author
FirefoxWindows

I'm thinking about maybe using the "Report/Block" person link to get the ID and then add my own new link and not replace anything, that would be better. Anyway, as soon as I get to it ;)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel