Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Submit to Twitter, Facebook and Digg Details »»
Submit to Twitter, Facebook and Digg
Version: 1.00, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Category: End-User Options - Version: 3.8.x Rating:
Released: 06-24-2009 Last Update: Never Installs: 139
Template Edits
Re-useable Code Translations  
No support by the author.

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">
Paste this ABOVE:
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 -->
Note the bolded statements above, these are where you must make changes:

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

File Type: jpg networking.jpg (40.4 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 10-15-2010, 06:30 PM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know what causes the Digg button to be skewed in Firefox, as seen in this screenshot, and how to fix it?
Reply With Quote
  #93  
Old 10-18-2010, 11:05 AM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #94  
Old 05-06-2011, 07:31 PM
edie edie is offline
 
Join Date: Apr 2011
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this apply to adding a Twitter button to blog and article posts (like Facebook currently)
Is this for the latest VBulletin 4?

Thank you.
- Edith Williams
Reply With Quote
  #95  
Old 07-21-2011, 12:18 AM
pewa pewa is offline
 
Join Date: Feb 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really like this mod and currently using it for Facebook sharing.

Sometimes when you try to share a forum thread, and you for example clicked "show last post in thread", the Facebook link looks odd.

Example good link: http://www.url.com/forum/showthread.php?p=54575
Example bad link: http://www.url.com/forum/showthread.php?p=54575#post54575

Is there a way to get the mod to only take the basic url, and not the last part (#post54575)

Thanks!
Reply With Quote
  #96  
Old 09-01-2011, 09:31 PM
pewa pewa is offline
 
Join Date: Feb 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump..
Reply With Quote
  #97  
Old 10-01-2011, 07:31 AM
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Location: Worthing, UK
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody know how to add google+1 to this mod? Thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04459 seconds
  • Memory Usage 2,282KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete