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

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

Category: Show Thread Enhancements - Version: 4.0.0 Beta 3 Rating:
Released: 11-21-2009 Last Update: Never Installs: 148
Template Edits
Re-useable Code  
No support by the author.

This is an update to vB4.0 Beta 3 of my Submit to Twitter and FB mod https://vborg.vbsupport.ru/showthread.php?t=217117

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. At the moment it cannot be turned off for specific forums, I still have to work out the conditional changes for vb4 so it will appear in all forums for now.

In the SHOWTHREAD template find:
Code:
<li class="popupmenu nohovermenu" id="threadtools">
Add this ABOVE:
Code:
			<!-- Begin Share FB -->
			<li class="popupmenu nohovermenu" id="sharefb">
				<h6><a class="popupctrl" href="javascript://">Share</a></h6>
				<ul class="popupbody popuphover">
					<!-- Facebook Share -->
          <li>
          <a name="fb_share" type="icon_link" href="http://www.facebook.com/sharer.php">Facebook</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
          </li>
          <!-- / Facebook Share -->
					<li>
          <!-- Twitter Share -->
          <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"'+'>Tweet This!<'+'/a>');
          </script>
          <!-- / Twitter Share -->
          </li>
				</ul>
			</li>
      <!-- End Share FB -->

Screenshots

File Type: jpg fb_mod.jpg (18.4 KB, 0 views)

Show Your Support

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

Comments
  #2  
Old 11-22-2009, 02:41 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Facebook it shows the icon is there a way you can update this to show a twitter icon?
Reply With Quote
  #3  
Old 11-22-2009, 02:57 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 Charlie98902 View Post
Facebook it shows the icon is there a way you can update this to show a twitter icon?
Sure, first find an image that you would like to use, here some suggestions http://images.google.com/images?as_q...fe=off&as_st=y then change the code to what I have below, notice where I have highlighted the image and path in red, change those accordingly.

Code:
			<!-- Begin Share FB -->
			<li class="popupmenu nohovermenu" id="sharefb">
				<h6><a class="popupctrl" href="javascript://">Share</a></h6>
				<ul class="popupbody popuphover">
					<!-- Facebook Share -->
          <li>
          <a name="fb_share" type="icon_link" href="http://www.facebook.com/sharer.php">Facebook</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
          </li>
          <!-- / Facebook Share -->
					<li>
          <!-- Twitter Share -->
          <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>
          <!-- / Twitter Share -->
          </li>
				</ul>
			</li>
      <!-- End Share FB -->
Reply With Quote
  #4  
Old 11-22-2009, 03:04 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you. Tagging for gold release as there is a lot of bugs still in the beta.
Reply With Quote
  #5  
Old 11-22-2009, 03:07 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice mod, thanks for updating it

ps.. does the facebook share button show the # of "shares"? it would be neat of it would show # of tweets as well, like the tweetme button

thanks again
Reply With Quote
  #6  
Old 11-22-2009, 03:53 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 Loco.M View Post
nice mod, thanks for updating it

ps.. does the facebook share button show the # of "shares"? it would be neat of it would show # of tweets as well, like the tweetme button

thanks again
Sure, all you have to do is change the code (all of it) to this:

Code:
<!-- Begin Share FB -->
<li class="popupmenu nohovermenu" id="sharefb">
<h6><a class="popupctrl" href="javascript://">Share</a></h6>
<ul class="popupbody popuphover">
<!-- Facebook Share -->
<li>
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</li>
<!-- / Facebook Share -->
<li>
<!-- Twitter Share -->
<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>
<!-- / Twitter Share -->
</li>
</ul>
</li>
<!-- End Share FB -->
Additionally, you can go here to see where I grabbed that part of the code it gives you a few options http://www.facebook.com/facebook-widgets/share.php
Reply With Quote
  #7  
Old 11-23-2009, 03:28 PM
SİMAR's Avatar
SİMAR SİMAR is offline
 
Join Date: Jun 2009
Location: Germany~Offenburg
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #8  
Old 11-27-2009, 08:48 AM
maximutt maximutt is offline
 
Join Date: Nov 2007
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to implement this as two separate buttons in the lower postbit? Perhaps beside the "Promote To Article" & "Blog This Post" buttons?
Reply With Quote
  #9  
Old 12-06-2009, 04:54 AM
cmor cmor is offline
 
Join Date: Dec 2009
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, I have a brand new install of the latest release. Only found one instance " <li class="popupmenu nohovermenu" id="threadtools"> " of in the vbulletin-style.xml file. Is this where the mod should be inserted?

TIA
Reply With Quote
  #10  
Old 12-06-2009, 01:14 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 cmor View Post
Hi, I have a brand new install of the latest release. Only found one instance " <li class="popupmenu nohovermenu" id="threadtools"> " of in the vbulletin-style.xml file. Is this where the mod should be inserted?

TIA
It should only be installed in the SHOWTHREAD template after you install vb (or any new style).
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 03:25 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.07091 seconds
  • Memory Usage 2,328KB
  • 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
  • (4)bbcode_code
  • (3)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
  • (1)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