vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Submit to Twitter and Facebook (https://vborg.vbsupport.ru/showthread.php?t=228610)

ericgtr 11-21-2009 10:00 PM

Submit to Twitter and Facebook
 
1 Attachment(s)
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 -->


Charlie98902 11-22-2009 02:41 PM

Facebook it shows the icon is there a way you can update this to show a twitter icon?

ericgtr 11-22-2009 02:57 PM

Quote:

Originally Posted by Charlie98902 (Post 1918910)
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 -->


Charlie98902 11-22-2009 03:04 PM

Thank you. Tagging for gold release as there is a lot of bugs still in the beta.

Brandon Sheley 11-22-2009 03:07 PM

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

ericgtr 11-22-2009 03:53 PM

Quote:

Originally Posted by Loco.M (Post 1918932)
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

SİMAR 11-23-2009 03:28 PM

thanks

maximutt 11-27-2009 08:48 AM

Is it possible to implement this as two separate buttons in the lower postbit? Perhaps beside the "Promote To Article" & "Blog This Post" buttons?

cmor 12-06-2009 04:54 AM

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

ericgtr 12-06-2009 01:14 PM

Quote:

Originally Posted by cmor (Post 1926124)
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).

Delilahs 12-15-2009 08:28 AM

It works with no problems on RC2

Bouncer222 12-26-2009 04:00 AM

Could you please tell me how to include the image for twitter? the small icon , like the one for facebook.

Thanks.

ericgtr 12-26-2009 01:29 PM

Quote:

Originally Posted by Bouncer222 (Post 1938411)
Could you please tell me how to include the image for twitter? the small icon , like the one for facebook.

Thanks.

Sure, have a look at this post https://vborg.vbsupport.ru/showpost....22&postcount=3 and please click install if you use this mod. :)

Bouncer222 12-26-2009 01:44 PM

The image showed up but now the text disappeared "Tweet This!" how do I make it appear?

ericgtr 12-26-2009 01:54 PM

Quote:

Originally Posted by Bouncer222 (Post 1938603)
The image showed up but now the text disappeared "Tweet This!" how do I make it appear?

Okay, give this a shot.. It should have both.

HTML 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!" /'+'>Tweet This!<'+'/a>');
          </script>
          <!-- / Twitter Share -->
          </li>
                                </ul>
                        </li>
      <!-- End Share FB -->


darkman 12-29-2009 06:09 PM

1 Attachment(s)
Quote:

Originally Posted by ericgtr (Post 1938608)
Okay, give this a shot.. It should have both.

HTML 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!" /'+'>Tweet This!<'+'/a>');
          </script>
          <!-- / Twitter Share -->
          </li>
                                </ul>
                        </li>
      <!-- End Share FB -->


Thanks for the help, but copying the above code and inserting it gave me this:

ericgtr 12-29-2009 10:06 PM

Quote:

Originally Posted by darkman (Post 1941740)
Thanks for the help, but copying the above code and inserting it gave me this:

Did you find a new image and add your /images directory? Please look at this post again https://vborg.vbsupport.ru/showpost....22&postcount=3

bleros 12-29-2009 11:28 PM

is this work for 3.8.4

ericgtr 12-30-2009 12:50 AM

Quote:

Originally Posted by bleros (Post 1941995)
is this work for 3.8.4

Sure, here you go https://vborg.vbsupport.ru/showthread.php?t=217117

darkman 12-30-2009 02:57 AM

Quote:

Originally Posted by ericgtr (Post 1941929)
Did you find a new image and add your /images directory? Please look at this post again https://vborg.vbsupport.ru/showpost....22&postcount=3

Never mind me...I'm an idiot. Thanks again :)

BlackJacket 12-30-2009 03:03 AM

Thanks for the great mod. I have a small request (I think it was mentioned before also)

Could this be posted at the bottom of the posts instead? Where the Edit, Reply, Reply with Quote, etc are?

Thanks again! :)

ericgtr 12-30-2009 03:33 AM

Quote:

Originally Posted by NittoMOD (Post 1942127)
Thanks for the great mod. I have a small request (I think it was mentioned before also)

Could this be posted at the bottom of the posts instead? Where the Edit, Reply, Reply with Quote, etc are?

Thanks again! :)

The code can be used anywhere in the thread I would guess and still work okay, for what you are talking about you would want to edit the postbit (or postbit_legacy) and place the code near those buttons.

Here is the core code you would want to use:
HTML Code:


<!-- Begin Facebook Share -->
<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>
<!-- End Facebook Share -->

<!-- Begin 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!" /'+'>Tweet This!<'+'/a>');
</script>
<!-- End Twitter Share -->


barcena 12-30-2009 03:34 AM

Sorry to ask but is this working for 4.0 gold? Im still confused w/ all the changes and I really need my Facebook and Twitter bookmarks back.

:)

ericgtr 12-30-2009 03:36 AM

Quote:

Originally Posted by barcena (Post 1942140)
Sorry to ask but is this working for 4.0 gold? Im still confused w/ all the changes and I really need my Facebook and Twitter bookmarks back.

:)

Yes, this specific one is the updated version for 4.0 and I am using it on Gold. :)

Big-Pete 12-30-2009 10:42 AM

Works ok for me on VB4 PL1 and VBSEO 3.5 RC1 :)

bleros 12-30-2009 08:05 PM

Quote:

Originally Posted by ericgtr (Post 1942065)

Thnx bro nice job keep it up

habanero68 01-04-2010 04:07 PM

hi. as I could fix it are next to each other. since they are one above the other.
thanks

captainron19 01-04-2010 06:59 PM

I hate to seem dumb but what exactly does this mod do? If someone clicks on the facebook link are you telling me it creates a link to that specific thread on their facbook wall?

ericgtr 01-04-2010 07:20 PM

Quote:

Originally Posted by habanero68 (Post 1947015)
hi. as I could fix it are next to each other. since they are one above the other.
thanks

It is designed to work like all of the other dropdown items in the menu but you can play with the layout if you like.
Quote:

Originally Posted by captainron19 (Post 1947147)
I hate to seem dumb but what exactly does this mod do? If someone clicks on the facebook link are you telling me it creates a link to that specific thread on their facbook wall?

Exactly, it will create a new facebook or Twitter entry containing the contents of the post.

habanero68 01-05-2010 03:04 AM

hello. and try to fix the position and I can not put it online. I want it next to each other. I can do.? or to do.
thanks


Code:

        <!-- Begin Share FB -->

            <li class="popupmenu nohovermenu" id="sharefb">
 <h6><a class="popupctrl" href="javascript://"><FONT COLOR="#FF0303"><B>COMPARTIR</B></FONT></a></h6>
                <ul class="popupbody popuphover">

                    <!-- Facebook Share -->
          <li>
<a name="fb_share" type="button" 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="http://i50.tinypic.com/f9imv_th.jpg"  border="0" alt="Tweet This!" /'+'><'+'/a>');
          </script>
          <!-- / Twitter Share -->
          </li>
                </ul>
            </li>
      <!-- End Share FB -->



https://vborg.vbsupport.ru/external/2010/01/126.jpg

captainron19 01-05-2010 05:48 PM

Great MOD - 1 question though. After I did a test and shared on FB it showed the number 1 on the thread near the FB icon but later when I went back to the thread it did not show any number at all but instead it re-appeared when i clicked on the FB Link

ericgtr 01-05-2010 06:09 PM

Quote:

Originally Posted by captainron19 (Post 1948062)
Great MOD - 1 question though. After I did a test and shared on FB it showed the number 1 on the thread near the FB icon but later when I went back to the thread it did not show any number at all but instead it re-appeared when i clicked on the FB Link

Interesting, did it still submit normally? I'm not sure why it would do that but as long as it submits I think it will be okay.

captainron19 01-05-2010 06:48 PM

Yes it did submit just fine

joseduddy 01-08-2010 11:46 PM

Nope
Not working for VB 4.0 Gold.

PS

Ok Got it to work...Thanks

hubie 01-09-2010 11:26 PM

Nice mod.

Is there any option to include short urls in twitter submit? (I mean bit.ly, tynurl, etc.).

Thanks.

ericgtr 01-10-2010 01:49 AM

Quote:

Originally Posted by hubie (Post 1951559)
Nice mod.

Is there any option to include short urls in twitter submit? (I mean bit.ly, tynurl, etc.).

Thanks.

By default it automatically shortens them on twitter.

hubie 01-11-2010 02:50 AM

Doesn't work for me. It shows only the large and complete urls. :confused:

ericgtr 01-11-2010 12:24 PM

Quote:

Originally Posted by hubie (Post 1952446)
Doesn't work for me. It shows only the large and complete urls. :confused:

Not sure why that is, I have this installed on several sites and many others have it working on their sites as well.

Ocean-Wonders 01-11-2010 10:24 PM

Great mod, thanks very much !

Big-Pete 01-13-2010 02:45 PM

Works fine on VB4.0.1 :up::D


All times are GMT. The time now is 02:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01497 seconds
  • Memory Usage 1,874KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_html_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete