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
  #2  
Old 06-25-2009, 05:16 PM
saadessa saadessa is offline
 
Join Date: Jan 2008
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice
thank you
Reply With Quote
  #3  
Old 06-25-2009, 06:34 PM
Itchy Nips's Avatar
Itchy Nips Itchy Nips is offline
 
Join Date: Jun 2009
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks! One question though: what do you mean by "forumid" ?
sorry for the lack of knowledge...i'm still learning a lot of this stuff
Reply With Quote
  #4  
Old 06-25-2009, 06:46 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Itchy Nips View Post
thanks! One question though: what do you mean by "forumid" ?
sorry for the lack of knowledge...i'm still learning a lot of this stuff
No problem.

Each forum has a forumid number associated with it. To see which number is associated with which forum go to your Admin CP Forums & Moderators > Forum Manager and click on any forum, on the very top title bar it will give the forumid number.

If you want it visible in all forums you can simply remove the numbers, for example change:

<if condition="in_array($forum['forumid'], array(1,2))">

to

<if condition="in_array($forum['forumid'], array())">
Reply With Quote
  #5  
Old 06-25-2009, 07:14 PM
Chimpie's Avatar
Chimpie Chimpie is offline
 
Join Date: Nov 2007
Location: Sarasota, Florida
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working perfectly! Awesome mod.

Want to take it a step further? Why not make it a drop down box instead of a row of buttons.

Maybe a button or the text Share and you when you click on it a drop down box appears with all the different choices.

Thoughts?
Reply With Quote
  #6  
Old 06-25-2009, 07:23 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chimpie View Post
Installed and working perfectly! Awesome mod.

Want to take it a step further? Why not make it a drop down box instead of a row of buttons.

Maybe a button or the text Share and you when you click on it a drop down box appears with all the different choices.

Thoughts?
Thanks.

I thought about that, it wouldn't be hard but I wanted them easily noticeable.
Reply With Quote
  #7  
Old 06-25-2009, 07:51 PM
Chimpie's Avatar
Chimpie Chimpie is offline
 
Join Date: Nov 2007
Location: Sarasota, Florida
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

True. Maybe make a second mod or add on to this one for those who want a drop box instead?

Or PM me with it?
Reply With Quote
  #8  
Old 06-25-2009, 08:14 PM
F0xy's Avatar
F0xy F0xy is offline
 
Join Date: Mar 2008
Location: Ireland
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chimpie View Post
True. Maybe make a second mod or add on to this one for those who want a drop box instead?

Or PM me with it?
like this
https://vborg.vbsupport.ru/showthread.php?t=187190
Reply With Quote
  #9  
Old 06-25-2009, 08:51 PM
Chimpie's Avatar
Chimpie Chimpie is offline
 
Join Date: Nov 2007
Location: Sarasota, Florida
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That looks tacky (to me). I think something as simple as what you have, but with a drop down box with the different icons.
Reply With Quote
  #10  
Old 06-25-2009, 09:07 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chimpie View Post
True. Maybe make a second mod or add on to this one for those who want a drop box instead?

Or PM me with it?
Okay, I've put this together for you but check out the screenshot to see what it looks like. The reason for the formatting is because the javascript automatically puts the icons where you see them.

Knowing this, if you want to add it here's what you do...

In the showthread template find:
Code:
<td class="vbmenu_control" id="threadtools" nowrap="nowrap">

Add this above it:
Code:
<!-- social networking menu setup -->
<if condition="in_array($forum['forumid'], array(1,2))">
<else />
	<td class="vbmenu_control" id="share" nowrap="nowrap">
		<a href="$show[nojs_link]#goto_share"<if condition="is_browser('ie')"> accesskey="3"</if>>Share</a>
		<if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("share"); </script></if>
	</td>
</if>
<!-- social networking menu setup -->

Find:
Code:
<!-- thread tools menu -->

Add this above it:
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/twitter_icon.gif" 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"'+'><img src="images/tweet.png"  border="0" alt="Tweet This!" /'+'><'+'/a>');
    </script>
    </td>
	</tr>
	<tr>
		<td class="vbmenu_option" title="nohilite"><img class="inlineimg" src="images/digg_icon.gif" alt="Submit to Digg" /> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></td>
	</tr>
	</table>
</div>
<!-- / social networking menu -->
Attached Images
File Type: jpg networking-dropdown.jpg (93.3 KB, 0 views)
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:00 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.05195 seconds
  • Memory Usage 2,339KB
  • Queries Executed 24 (?)
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
  • (6)bbcode_code
  • (4)bbcode_quote
  • (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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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