vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Miscellaneous Hacks - AddThis Floating Horizontal Bar (https://vborg.vbsupport.ru/showthread.php?t=272720)

Lee G 10-23-2011 10:00 PM

AddThis Floating Horizontal Bar
 
1 Attachment(s)
This is a simple integration of the AddThis Floating Horizontal Bar

At present most share buttons are located in static places.
If you add one to the header, some one has gone down the page, they might not go back up and it the share button.
If you add a social media share button to the last post, you also have to find ways of integrating the buttons into your blogs, photo albums etc.

The new horizontal share bar is easy to install and makes sharing unobtrusive until the user begins scrolling down your page.
Appears on Scroll
The on-demand behavior of the horizontal bar boosts sharing because it appears as your visitors scroll down the page.


To see this bar in action, Im running it on my own forums
http://www.thespainforum.com/

Scroll down the page and it will suddenly appear at the top of the screen
Go back up and it auto hides
This means that if like me you have buttons in the header and the navigation bar are not covered at any time.

Instillation is two template edits

Header template

After
PHP Code:

<!-- /logo --> 

Add
PHP Code:

<div class="addthis_bar addthis_bar_medium">
    <
label>Share This Page:</label>
    <
div class="addthis_toolbox addthis_default_style addthis_32x32_style">
        <
span><class="addthis_button_preferred_1"></a></span>
        <
span><class="addthis_button_preferred_2"></a></span>
        <
span><class="addthis_button_preferred_3"></a></span>
        <
span><class="addthis_button_preferred_4"></a></span>
        <
span><class="addthis_button_compact"></a></span>
        <
span><class="addthis_counter addthis_bubble_style"></a></span>
    </
div>
</
div

At the very end of the footer template add this
PHP Code:

<script type="text/javascript">
var 
addthis_config = {
    
bar_show_below 150
}
</
script>
<
script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=[YOUR PROFILE ID HERE]"></script

If you want to track your clicks, you can register for a free account with AddThis and simply replace [YOUR PROFILE ID HERE] with your profile id

Further information and more layout options can be found on AddThis
http://www.addthis.com/labs/floating...ogin&lb=1#code

sulasno 10-25-2011 02:01 AM

tagged and thanks

I would assume this would also work for vB 4.X

Lee G 10-25-2011 08:29 AM

I dont see why it wont work on vb4, unfortunately I haven't got my vb4 test site running at present :o

You can set the bar to show earlier or later when the page is scrolled down by altering one number in the above code. Something I forgot to mention in the original integration

In the footer code, alter this line
PHP Code:

bar_show_below 150 

Edit the 150 to make it show earlier or later

LordVader 11-21-2011 10:56 PM

Spot On :)

And I can confirm it works flawlessly on (VB'408)

Exactly what I was looking for, looks great & its not in your face all the time, Perfect. :up:

Rated *****

Thanks

L.V :)


All times are GMT. The time now is 08:48 AM.

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.01156 seconds
  • Memory Usage 1,730KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete