Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2011, 08:43 AM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Addthis social buttons

I want to install some social icon buttons to my 3.8x forum. The code is from addthis.com.

How would I put it just to the left of the Thread Tools button at the top of each thread?

Thanks,

Jon
Reply With Quote
  #2  
Old 07-23-2011, 04:01 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you edit the SHOWTHREAD template (in the Show Thread Templates group), and search for "<!-- toolbar", a little below that you should find this code:

Code:
		</div>
	</td>
	<td class="vbmenu_control" id="threadtools" nowrap="nowrap">
		<a href="$show[nojs_link]#goto_threadtools"<if condition="is_browser('ie')"> accesskey="3"</if>>$vbphrase[thread_tools]</a>

You could add a table cell for your code, like:
Code:
		</div>
	</td>
          <td class="tcat">
// Some code here
          </td> 	
            <td class="vbmenu_control" id="threadtools" nowrap="nowrap">
		<a href="$show[nojs_link]#goto_threadtools"<if condition="is_browser('ie')"> accesskey="3"</if>>$vbphrase[thread_tools]</a>
Reply With Quote
  #3  
Old 07-25-2011, 08:32 AM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've tried adding it there, but the buttons go vertically rather than horizontally. The table cell is there and I have even tried adding a width="300" to the cell using this:

Code:
<td width="300" class="tcat">
However, that still doesn't solve it.

Any ideas on why I can't make the cell wider so the buttons go horizontally?

Edit: I found some code in another thread: https://vborg.vbsupport.ru/showthread.php?t=209507

I used this:

Code:
<td class="vbmenu_control" id="threadtools" nowrap="nowrap">
That lets the buttons go horizontal in IE but not Firefox.

Any ideas on why not?
Reply With Quote
  #4  
Old 07-25-2011, 11:03 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure, but try using style="white-space: nowrap;" in place of nowrap="nowrap".
Reply With Quote
  #5  
Old 07-25-2011, 11:41 AM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried changing it from:

Code:
<td class="vbmenu_control" id="addthis" nowrap="nowrap" width="150">

to

Code:
<td class="vbmenu_control" id="addthis" width="150" style="white-space: nowrap;">

That made it go vertical in both IE and Firefox, so still seeking a solution.
Reply With Quote
  #6  
Old 07-25-2011, 12:02 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try making sure there is no white space in between your buttons (I assume they are links, so take out spaces or newlines between </a> and the next <a ...), and if you need space somewhere use &nbsp; instead of an actual space.

I'm not an expert in the layout stuff (in case you haven't figure that out yet), but if it still doesn't work it might help if you could post the actual code you're adding.
Reply With Quote
  #7  
Old 07-25-2011, 12:08 PM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the code in full, with my specific id edited for security:


Code:
<td class="vbmenu_control" id="addthis" nowrap="nowrap" width="150">

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e2ada7534567c8"></script>
<!-- AddThis Button END -->


</td>
Reply With Quote
  #8  
Old 07-25-2011, 12:23 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, did you try this:

Code:
<td class="vbmenu_control" id="addthis" nowrap="nowrap" width="150">

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style "><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e2ada7534567c8"></script>
<!-- AddThis Button END -->


</td>

(I just took the all the line breaks out from between the <div> tags for that div).
Reply With Quote
  #9  
Old 07-26-2011, 09:28 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do this for my share buttons... the edit to the SHOWTHREAD template was a little more complicated than I first expected.

This is what I wound up with- my edits are in red.

Code:
	<td class="tcat" width="175">
		<div class="smallfont">
		<if condition="$show['firstunreadlink']">
			<a href="$firstunread"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[view_first_unread]" border="0" /></a>
			<a href="$firstunread"><strong>$vbphrase[view_first_unread]</strong></a>
		</if>
		&nbsp;
		</div>
        <img src="clear.gif" width="175" height="1" border="0" />
	</td>
        <td class="alt1" width="100%" align="right" padding="0" style="padding-top:0px; padding-bottom:0px; padding-right:0px; background: #869BBF url(/forums/images/gradients/gradient_tcat.gif) repeat-x top left;">
        
          SHARE BUTTON CODE HERE

        </td>
	<td class="vbmenu_control" id="threadtools" nowrap="nowrap">
		<a href="$show[nojs_link]#goto_threadtools"<if condition="is_browser('ie')"> accesskey="3"</if>>$vbphrase[thread_tools]</a>
Note: I used class "alt1" and added in the background because when I used class "tcat" I was getting display issues with the Digg button. If you're not using Digg you can maybe get away with this line:
Code:
<td class="tcat" width="100%" align="right" padding="0" style="padding-top:0px; padding-bottom:0px; padding-right:0px;">
Instead of the longer "alt1" line.
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 06:50 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.05633 seconds
  • Memory Usage 2,283KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete