Post by Gareth on Oct 25, 2010 22:52:41 GMT
Found this here:
support.proboards.com/index.cgi?board=codedatabase&action=display&thread=358390
support.proboards.com/index.cgi?board=codedatabase&action=display&thread=358390
Share On Any Social Network In Posts by SubDevo
Tested in IE, FF, Opera, Safari and Chrome
I got tired of all the separate "Share On Twitter", "Share On Facebook" etc. codes out there.
Here we have one small code that does them all...
This code allows you to put any number of "Share this post" on whatever social network(s) you wish!
It puts your selected network icons to the right of "Back to Top" in every post.
Be default, the code is set up with Twitter and Facebook since they are the most popular (for now lol). You may put them on the same line (if using only one or two) or on it's own line under the "Back to Top" link.
Same Line:
[img]http://i486.photobucket.com/albums/rr230/FridayFiles/Forum_Posts/SN2.png[/img]
Separate Line:
[img]http://i486.photobucket.com/albums/rr230/FridayFiles/Forum_Posts/SNall.png[/img]
Enjoy!!!
SubDevo
Variables:
var line=""; // Set to "<br />" to put icons on the next line.
By default, the code puts your icons on the same line.
If you wish to have them on their own line, set this to "<br />".
var sI=[
["Twitter","http://twitter.com/home?status=#A#&t=#T#","http://i44.tinypic.com/2cwwscm.png"],
["Facebook","http://www.facebook.com/sharer.php?u=#A#&t=#T#","http://i40.tinypic.com/x6mp2b.gif"] <---- NO COMMA
];
Add your required networks here. There is no need to edit these lines. Just copy/paste the networks you need from the list at the bottom of this post. Just make sure there is a comma after each entry and NO comma after the last entry in the list.
Location: Global Footer
<script type="text/javascript">
<!--
/* Share On Any Social Network In Posts by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* http://interoceandesigns.proboards.com or http://lsdp.proboards.com */
var line=""; // Set to "<br />" to put icons on the next line.
var sI=[
["Twitter","http://twitter.com/home?status=#A#&t=#T#","http://i44.tinypic.com/2cwwscm.png"],
["Facebook","http://www.facebook.com/sharer.php?u=#A#&t=#T#","http://i40.tinypic.com/x6mp2b.gif"]
];
var n=document.links; var d=""; var e=""; var f="";
if(location.href.match(/thread=/i)){
for(x=0;x<sI.length;x++){ f="Share Post On "+sI[x][0];
e+=' <a href="'+sI[x][1].replace(/#A#/g,escape(location.href)+"@@").replace(/#T#/g,escape(document.title))+
'" target="_blank"><img src="'+sI[x][2]+'" border="0" title="'+f+'" alt="'+f+'" /></a>';
}
for(x=0;x<n.length;x++){
if(n[x].innerHTML=="Link to Post"){ with(n[x].href){d=slice(lastIndexOf("=")+1);}
n[x].parentNode.parentNode.innerHTML+=line+e.replace(/@@/g,escape("#"+d));x++;
}}}
//-->
</script>
Social Networks List:
["Twitter","http://twitter.com/home?status=#A#&t=#T#","http://i44.tinypic.com/2cwwscm.png"],
["Facebook","http://www.facebook.com/sharer.php?u=#A#&t=#T#","http://i40.tinypic.com/x6mp2b.gif"],
["Delicious","http://delicious.com/post?url=#A#;title=#T#","http://i44.tinypic.com/2ngydl5.gif"],
["Reddit","http://reddit.com/submit?url=#A#;title=#T#","http://i40.tinypic.com/fkwls1.gif"],
["Digg","http://digg.com/submit?phase=2&url=#A#","http://i43.tinypic.com/25iaphc.gif"],
["Technorati","http://technorati.com/faves/?add=#A#","http://i43.tinypic.com/2hgqsuw.gif"],
["MySpace","http://www.myspace.com/Modules/PostTo/Pages/?u=#A#","http://i42.tinypic.com/illvnb.png"],
["Yahoo MyWeb","http://myweb2.search.yahoo.com/myresults/bookmarklet?u=#A#&t=#T#","http://i39.tinypic.com/97323m.jpg"],
["Google Bookmarks","http://www.google.com/bookmarks/mark?op=edit&bkmk=#A#&title=#T#", "http://i41.tinypic.com/rircdl.png"],
["Live","https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=#A#&title=#T#&top=1", "http://i42.tinypic.com/2r7lseg.png"],
["BlinkList","http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=#A#;Title=#T#", "http://i42.tinypic.com/jt9nie.png"],
["Furl","http://www.furl.net/storeIt.jsp?u=#A#;t=#T#","http://i43.tinypic.com/2j5yy6x.gif"],
["Mixx","http://www.mixx.com/submit?page_url=#A#","http://i44.tinypic.com/mwaxhe.png"],
["Gnolia","http://gnolia.com/bookmarklet/add?url=#A#;title=#T#","http://i39.tinypic.com/ih1g9h.png"],
["StumbleUpon","http://www.stumbleupon.com/submit?url=#A#&title=#T#","http://i40.tinypic.com/25tjodx.png"],
["Simpy","http://www.simpy.com/simpy/LinkAdd.do?url=#A#;title=#T#","http://i39.tinypic.com/2psggea.png"],
["Newsvine","http://www.newsvine.com/_tools/seed&save?url=#A#;title=#T#","http://i44.tinypic.com/o9r4ih.png"],
["Kirtsy","http://www.kirtsy.com/submit.php?url=#A#","http://i42.tinypic.com/2udukqq.png"],
["Fark","http://cgi.fark.com/cgi/fark/edit.pl?new_url=#A#;new_comment=#T#","http://i41.tinypic.com/2zirpld.png"]