The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Submit to Twitter, Facebook and Digg Details »» | |||||||||||||||||||||||||||
I have been adding these as I go and decided to share, I am sure there are other versions out there but this is how I do it. See screenshot for example of where it goes and how it looks. Keeping up with the latest in social networking keeps traffic flowing to your site.
This can all be added at once or you may add only the one's you want. Additionally, this will probably work in any version of vB. In the SHOWTHREAD template find: Code:
<td class="vbmenu_control" id="threadtools" nowrap="nowrap"> Code:
<!-- Facebook Share --> <if condition="in_array($forum['forumid'], array(1,2))"> <else /> <td class="vbmenu_control" id="facebook" nowrap="nowrap"> <script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none; } </style> <a href="http://www.facebook.com/share.php?u=<url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a> </td> </if> <!-- / Facebook Share --> <!-- Twitter Share --> <if condition="in_array($forum['forumid'], array(1,2))"> <else /> <td class="vbmenu_control" id="twitter" nowrap="nowrap"> <script type="text/javascript"> var twtTitle = document.title; var twtUrl = location.href; var maxLength = 140 - (twtUrl.length + 1); if (twtTitle.length > maxLength) { twtTitle = twtTitle.substr(0, (maxLength - 3))+'...'; } var twtLink = 'http://twitter.com/home?status='+encodeURIComponent(twtTitle + ' ' + twtUrl); document.write('<a href="'+twtLink+'" target="_blank"'+'><img src="images/tweet.png" border="0" alt="Tweet This!" /'+'><'+'/a>'); </script> </div> </if> <!-- / Twitter Share --> <!-- Digg Share --> <if condition="in_array($forum['forumid'], array(1,2))"> <else /> <td class="vbmenu_control" id="digg" nowrap="nowrap"> <script type="text/javascript"> digg_url = 'http://www.YOURSITE.com/showthread.php?t=$thread[threadid]'; digg_title = "$threadinfo[title]"; <!-- Change color below to match your forum --> digg_bgcolor = '#FFFFFF'; digg_skin = 'compact'; digg_window = 'new'; </script> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script> </td> </if> <!-- / Digg Share --> enter the forum id's of the forums where you do not want it to show <if condition="in_array($forum['forumid'], array(1,2))"> You will also see that in the digg section there is an option to change the background color and you will need to add your site URL. The tweet image is attached, upload to your forum and change the path in the "Twitter Share" section. Update: This has also been updated to vB4 Beta 3 here https://vborg.vbsupport.ru/showthread.php?t=228610 Screenshots
Show Your Support
|
Comments |
#22
|
||||
|
||||
using this code for the menu, it's not showing the words "Submit to Twitter"....
Code:
<!-- social networking menu --> <div class="vbmenu_popup" id="share_menu" style="display:none"> <table cellpadding="4" cellspacing="1" border="0"> <tr> <td class="thead">Share<a name="goto_share"></a></td> </tr> <tr> <td class="vbmenu_option" title="nohilite"><script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top left; }</style><a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank" class="fb_share_link">Share on Facebook</a></td> </tr> <tr> <td class="vbmenu_option" title="nohilite"><img class="inlineimg" src="images/misc/twitter.jpg" alt="Submit to Twitter" /> <script type="text/javascript"> var twtTitle = document.title; var twtUrl = location.href; var maxLength = 140 - (twtUrl.length + 1); if (twtTitle.length > maxLength) { twtTitle = twtTitle.substr(0, (maxLength - 3))+'...'; } var twtLink = 'http://twitter.com/home?status='+encodeURIComponent(twtTitle + ' ' + twtUrl); document.write('<a href="'+twtLink+'" target="_blank"'+'><'+'/a>'); </script> </td> </tr> </table> </div> <!-- / social networking menu --> tks. (plus where is it getting the image for FaceBook, it's showing images from my forums like avatars :} |
#23
|
||||
|
||||
Quote:
It's grabbing the images from Facebook and Digg directly from their sites, the image for Twitter needs to be uploaded to your forum. |
#24
|
||||
|
||||
Quote:
|
#25
|
||||
|
||||
Quote:
As for Facebook taking images from the thread, it does that by default but you can check no image and it will ignore it. |
#26
|
||||
|
||||
Quote:
|
#27
|
|||
|
|||
Great mode. Thank you very much - sending good karma your way!
|
#28
|
|||
|
|||
Can the url automatically be shortened using one of the services that does that - I've seen a mod for wordpress that does that. I'd definitely want to use this then.
|
#29
|
||||
|
||||
Are you referring to the Twitter section? It changes the URL automatically upon submission.
For example, when I click the twitter button in this link http://www.politicalgroove.com/news/...es-u-turn.html the it grabs the post title and the URL and looks like this (in the box before you submit): north korean ship does a u-turn - PoliticalGroove Forums http://www.politicalgroove.com/news/...es-u-turn.html Then after you submit, it automatically changes the URL to shorten it, like this: http://bit.ly/OH0tU |
#30
|
|||
|
|||
oh nice
|
#31
|
||||
|
||||
Nice mod, using the second one. Scrapped the digg button & kept Facebook & Twitter, works like a charm after some modification to images.
Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|