Results 1 to 12 of 12
Like Tree3Likes
  • 1 Post By A.Chakery
  • 2 Post By Andrés Durán Hewitt

Facebook / Twitter / Digg Share button scripts

This is a discussion on Facebook / Twitter / Digg Share button scripts within the Member Articles forums, part of the Focus on Members category; you can use these codes in any template you want.(exp: Showthread) I hope You like it. Regards, Ali.Ch. //============// ----Facebook---- ...

  1. #1
    Senior Member A.Chakery's Avatar
    Real Name
    Ali Chakery
    Join Date
    Jan 2008
    Posts
    772
    Liked
    54 times

    Facebook / Twitter / Digg Share button scripts


    you can use these codes in any template you want.(exp: Showthread)

    I hope You like it.
    Regards,
    Ali.Ch.

    //============//
    ----Facebook----
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
    <if 
    condition="in_array($forum['forumid'], array(1,2))">
    <else />
    <
    a name="fb_share" type="box_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>
    </if>
    <!-- / Facebook Share Button --> 
    Preview : Name:  FB-above.jpg
Views: 10789
Size:  5.2 KB


    Style 2 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
    <if 
    condition="in_array($forum['forumid'], array(1,2))">
    <else />
    <
    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>
    </if>
    <!-- / Facebook Share Button --> 
    Preview : fb-inline.jpg



    Style 3 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
     <if 
    condition="in_array($forum['forumid'], array(1,2))">
     <else />
     <
    a name="fb_share" type="button" 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>
     </if>
     <!-- / Facebook Share Button --> 
    Preview : Name:  FB-simple.jpg
Views: 15868
Size:  3.0 KB

    //============//
    -----Twitter-----
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Tweet Button -->
    <if 
    condition="in_array($forum['forumid'], array(1,2))">
    <else />
    <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </if>
    <!-- / Tweet Button --> 
    Preview : Name:  tweetn.png
Views: 8082
Size:  645 Bytes


    Style 2 :
    --------

    PHP Code:
    <!-- Tweet Button -->
    <if 
    condition="in_array($forum['forumid'], array(1,2))">
    <else />
    <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </if>
    <!-- / Tweet Button --> 
    Preview : tweeth.png

    Style 3 :
    --------

    PHP Code:
    <!-- Tweet Button -->
     <if 
    condition="in_array($forum['forumid'], array(1,2))">
     <else />
     <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
     </if>
     <!-- / Tweet Button --> 
    Preview : Name:  tweetv.png
Views: 8167
Size:  1.6 KB



    //============//
    -------Digg-------
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Digg share button -->
      <if 
    condition="in_array($forum['forumid'], array(1,2))">
      <else />
      <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggCompact"></a>
    </if>
      <!-- / Digg Share Button --> 
    Preview : Name:  dbcompact.png
Views: 8016
Size:  2.4 KB


    Style 2 :
    --------

    PHP Code:
    <!-- Digg share button -->
       <if 
    condition="in_array($forum['forumid'], array(1,2))">
       <else />
       <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggMedium"></a></if>
       <!-- / Digg Share Button --> 
    Preview : Name:  dbmedium.png
Views: 7950
Size:  2.5 KB



    Style 3 :
    --------

    PHP Code:
    <!-- Digg share button -->
        <if 
    condition="in_array($forum['forumid'], array(1,2))">
        <else />
        <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggWide"></a>
    </if>
    <!-- / Digg Share Button --> 
    Preview : Name:  dbwide.png
Views: 7964
Size:  4.1 KB


    ==================================
    Here is the example of using these codes :

    Goto : Admincp > Styles & Templates > Style Manager > Your Style > Edit Templates > Showthreads

    Now you have several options to implant these codes ,

    I've implanted these after below line in a Shadow Box :

    HTML Code:
    <a name="poststop" id="poststop"></a>
    But you can implant it anywhere you want.

    OR,

    in your favorite text editor like notepad++

    Put this :
    HTML Code:
    <td class="vbmenu_control" id="facebook" nowrap="nowrap">
    below line after
    HTML Code:
    <if condition="in_array($forum['forumid'], array(1,2))">
    <else />
    and add this
    HTML Code:
    </td>
    before this :
    HTML Code:
    </if>

    and put the prepared code after below line in your showthread template.

    HTML Code:
    <td class="vbmenu_control" id="threadtools" nowrap="nowrap">
    =================================
    Sources : Digg.com/Facebook.com/Twitter.com

  2. #2
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello Ali,

    Thank you for sharing , but I would suggest you explaining a bit more (specially for non-technical users) how the template conditional works:

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

    And also you are missing an </if> close tag in the last one Digg style.

    Thank you again for contribution.
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  3. #3
    Senior Member A.Chakery's Avatar
    Real Name
    Ali Chakery
    Join Date
    Jan 2008
    Posts
    772
    Liked
    54 times
    Quote Originally Posted by Andrés Durán Hewitt View Post
    Hello Ali,

    Thank you for sharing , but I would suggest you explaining a bit more (specially for non-technical users) how the template conditional works:

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

    And also you are missing an </if> close tag in the last one Digg style.

    Thank you again for contribution.
    Thanks for the suggestion Andreas , U R Right.

    More descriptions added to the first post.

    Regards.

  4. #4
    Junior Member
    Real Name
    Sherayba
    Join Date
    Oct 2010
    Location
    Mumbai,India
    Posts
    4
    Liked
    0 times
    Thanks for information.Really helpful stuff.

  5. #5
    Senior Member A.Chakery's Avatar
    Real Name
    Ali Chakery
    Join Date
    Jan 2008
    Posts
    772
    Liked
    54 times
    Quote Originally Posted by sherayba View Post
    Thanks for information.Really helpful stuff.
    You are welcome , Do you have a vBulletin powered Community ?

    Regards.

  6. #6
    Junior Member
    Real Name
    Jamii Media
    Join Date
    Sep 2008
    Posts
    10
    Liked
    0 times
    Am getting this error:

    Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3391

    The following error occurred when attempting to evaluate this template:
    %1$s
    This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
    What do I do?

  7. #7
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello Jamii,

    You are likely skipping an </if> closing tag. Also please keep in mind that this article is designed to work with vBulletin 3, so if your site is powered by vBulletin 4, you'll need to update and customize the above supplied example codes to match your style/syntax.
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  8. #8
    Junior Member
    Real Name
    Jamii Media
    Join Date
    Sep 2008
    Posts
    10
    Liked
    0 times
    Quote Originally Posted by Andrés Durán Hewitt View Post
    Hello Jamii,

    You are likely skipping an </if> closing tag. Also please keep in mind that this article is designed to work with vBulletin 3, so if your site is powered by vBulletin 4, you'll need to update and customize the above supplied example codes to match your style/syntax.
    Ooops!

    Am on vB 4...

    Thanks André, can I have codes for vB 4?

  9. #9
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Sure


    //============//
    ----Facebook----
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
    <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
    <
    vb:else />
    <
    a name="fb_share" type="box_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>
    </vb:if>
    <!-- / Facebook Share Button --> 
    Preview : Name:  FB-above.jpg
Views: 10789
Size:  5.2 KB


    Style 2 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
    <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
    <
    vb:else />
    <
    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>
    </vb:if>
    <!-- / Facebook Share Button --> 
    Preview : Click image for larger version. 

Name:	FB-inline.jpg 
Views:	513 
Size:	3.9 KB 
ID:	7624



    Style 3 :
    --------

    PHP Code:
    <!-- Facebook Share Button -->
     <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
     <
    vb:else />
     <
    a name="fb_share" type="button" 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>
     </vb:if>
     <!-- / Facebook Share Button --> 
    Preview : Name:  FB-simple.jpg
Views: 15868
Size:  3.0 KB

    //============//
    -----Twitter-----
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Tweet Button -->
    <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
    <
    vb:else />
    <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </vb:if>
    <!-- / Tweet Button --> 
    Preview : Name:  tweetn.png
Views: 8082
Size:  645 Bytes


    Style 2 :
    --------

    PHP Code:
    <!-- Tweet Button -->
    <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
    <
    vb:else />
    <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </vb:if>
    <!-- / Tweet Button --> 
    Preview : Click image for larger version. 

Name:	tweeth.png 
Views:	320 
Size:	1.3 KB 
ID:	7621

    Style 3 :
    --------

    PHP Code:
    <!-- Tweet Button -->
     <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
     <
    vb:else />
     <
    a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="YOUR-TWITTER-USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
     </vb:if>
     <!-- / Tweet Button --> 
    Preview : Name:  tweetv.png
Views: 8167
Size:  1.6 KB



    //============//
    -------Digg-------
    //============//

    Style 1 :
    --------

    PHP Code:
    <!-- Digg share button -->
      <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
      <
    vb:else />
      <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggCompact"></a>
    </vb:if>
      <!-- / Digg Share Button --> 
    Preview : Name:  dbcompact.png
Views: 8016
Size:  2.4 KB


    Style 2 :
    --------

    PHP Code:
    <!-- Digg share button -->
       <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
       <
    vb:else />
       <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggMedium"></a></vb:if>
       <!-- / Digg Share Button --> 
    Preview : Name:  dbmedium.png
Views: 7950
Size:  2.5 KB



    Style 3 :
    --------

    PHP Code:
    <!-- Digg share button -->
        <
    vb:if condition="in_array($GLOBALS['forumid'], array(1,2))">
        <
    vb:else />
        <
    script type="text/javascript">
    (function() {
    var 
    document.createElement('SCRIPT'), s1 document.getElementsByTagName('SCRIPT')[0];
    s.type 'text/javascript';
    s.async true;
    s.src 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(ss1);
    })();
    </script>
    <a class="DiggThisButton DiggWide"></a>
    </vb:if>
    <!-- / Digg Share Button --> 
    Preview : Name:  dbwide.png
Views: 7964
Size:  4.1 KB
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  10. #10
    Junior Member
    Real Name
    Jamii Media
    Join Date
    Sep 2008
    Posts
    10
    Liked
    0 times
    Again,

    Thanks Andrés, this' what I was missing out.

    BUT, I've tried to add FB-Share next to Twitter button seems in vain

    See:

    twitter-alone-why.pngfb-button-here.png

    Edit:

    Reference - HERE

  11. #11
    Senior Member A.Chakery's Avatar
    Real Name
    Ali Chakery
    Join Date
    Jan 2008
    Posts
    772
    Liked
    54 times
    Thanks so Much Andreas for vb:4 codes. Would you please add your codes to the first post as vb4 codes or something like that.

    Regards.

  12. #12
    Senior Member A.Chakery's Avatar
    Real Name
    Ali Chakery
    Join Date
    Jan 2008
    Posts
    772
    Liked
    54 times
    If you want only Facebook and Twitter buttons please try to use this one :

    Valid XHTML Facebook/Twitter buttons Just for vBSEO Users

    Note : Its for vb3.x, (Andreas please help him to make it work with vb:4 if the <a> tag is different in vb4.)

Similar Threads

  1. Replies: 2
    Last Post: 09-29-2010, 02:37 PM
  2. vBulletin 4.x Facebook Like button vanishes
    By Neal in forum Troubleshooting
    Replies: 1
    Last Post: 09-23-2010, 01:02 AM
  3. Facebook-Button SHOWTHREAD
    By Cybeth in forum Deutsch
    Replies: 1
    Last Post: 08-14-2010, 01:19 PM
  4. Facebook Share Help why wont this code work!! (vbseo?)
    By Vodkaholic in forum General Discussion
    Replies: 12
    Last Post: 08-01-2010, 01:07 AM
  5. Facebook Like Button
    By hcmagix in forum Deutsch
    Replies: 1
    Last Post: 05-18-2010, 12:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •