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 - Twitter - Tweet Button in SHOWTHREAD (https://vborg.vbsupport.ru/showthread.php?t=248569)

ceho 09-23-2010 04:25 PM

I installed it on a customized 4.0.7 using the I Like button and it works perfect, thank you very much.

However, it looks I am a bit slow tonight ;-), is it possible to have the twitter button and cound left to the FB button? I am a bit confused with the code, maybe you can help me?

Thanks a lot!

BirdOPrey5 09-23-2010 04:52 PM

Although it's counter-intuitive if you just swap the code location with the facebook like button the Tweet button will be to the left of the FB button.

Use this as a replacement instead of the original directions:

Code:

{vb:raw fblikebutton}<div id="fb_likeframe" style="border: none; overflow: hidden; height: 27px; width: 95px; vertical-align: text-bottom; padding-top:1px;"><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></div>

ceho 09-23-2010 06:30 PM

That was too easy ;-). Thank you very much and I will consider your advice for sure!

Tony_FPM 09-23-2010 09:24 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2087821)
That's weird but this should fix it...

Edit your headinclude template:

Find:
Code:

                <meta name="description" content="{vb:raw vboptions.description}" />
</vb:if>

Below it Add:
Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">
<link rel="canonical" href="http://www.example.com/forum/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
</vb:if>

Make sure you change http://www.example.com/forum/ to the URL to your own forums, whatever is before "showthread.php..." when you are viewing a thread. (In the example given it would be: http://www.baghdad4ever.net/vb/)

This will include a canonical link on your threads (and only threads) which over-rides the URL passed to Twitter, with hopefully, the right one now...

If this doesn't work please give me a link to your forums so I can see what is up...

Done but still not working. Now i get http://www.freakpyromaniacs.com/foru...uot-16-09-2010 when i click the link in the tweet and it is missing again a / ....http://www.freakpyromaniacs.com/forum/forum.phpshow/thread.php?28916-Bunker-met-vuurwerk-in-Duitsland-quot-ontploft-quot-16-09-2010

Help me please...

This is my template code
PHP Code:

<meta http-equiv="Content-Type" content="text/html; charset={vb:stylevar charset}" />
<
meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" />
<
base href="{vb:raw vboptions.bburl}/" /><!--[if IE]></base><![endif]-->
<
meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" />

<
vb:if condition="$show['threadinfo']">

<
vb:elseif condition="$show['foruminfo']" />
        <
meta name="keywords" content="{vb:raw foruminfo.title_clean}, {vb:raw vboptions.keywords}" />
        <
meta name="description" content="<vb:if condition="$pagenumber 1">{vb:rawphrase page_x, {vb:raw pagenumber}}-</vb:if>{vb:raw foruminfo.description_clean}" />
<
vb:else />
        <
meta name="keywords" content="{vb:raw vboptions.keywords}" />
        <
meta name="description" content="{vb:raw vboptions.description}" />
</
vb:if>
<
vb:if condition="THIS_SCRIPT == 'showthread'">
<
link rel="canonical" href="http://www.freakpyromaniacs.com/forum/forum.php{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
</
vb:if>

<
vb:if condition="$show['fb_opengraph']">
    {
vb:raw facebook_opengraph}
</
vb:if>

<
script type="text/javascript" src="{vb:stylevar yuipath}/yuiloader-dom-event/yuiloader-dom-event.js?v={vb:raw vboptions.simpleversion}"></script>
<
script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"></script>
<
script type="text/javascript">
<!--
    var 
SESSIONURL "{vb:raw session.sessionurl_js}";
    var 
SECURITYTOKEN "{vb:raw bbuserinfo.securitytoken}";
    var 
IMGDIR_MISC "{vb:stylevar imgdir_misc}";
    var 
IMGDIR_BUTTON "{vb:stylevar imgdir_button}";
    var 
vb_disable_ajax parseInt("{vb:raw vboptions.disable_ajax}"10);
    var 
SIMPLEVERSION "{vb:raw vboptions.simpleversion}";
    var 
BBURL "{vb:raw vboptions.bburl}";
    var 
LOGGEDIN = {vb:raw bbuserinfo.userid} > true false;
    var 
THIS_SCRIPT "{vb:raw this_script}";
        var 
RELPATH "{vb:raw relpath}";
// -->
</script>
<
script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-core.js?v={vb:raw vboptions.simpleversion}"></script>
{
vb:raw template_hook.headinclude_javascript}

<
vb:if condition="$vboptions['externalrss']">
    <
link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2" />
    <
vb:if condition="$show['foruminfo'] OR $show['threadinfo']">
        <
link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} - {vb:raw foruminfo.title_clean} - {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2&amp;forumids={vb:raw foruminfo.forumid}" />
    </
vb:if>
</
vb:if>

<
vb:if condition="$vboptions['storecssasfile']">
    {
vb:cssfile main-rollup.css}
        {
vb:raw template_hook.custom_css_links}
<
vb:else />
    {
vb:cssfile bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}}
</
vb:if>
{
vb:raw template_hook.headinclude_css


BirdOPrey5 09-23-2010 09:50 PM

^^^^

Your issue is with the line:

HTML Code:

<link rel="canonical" href="http://www.freakpyromaniacs.com/forum/forum.php{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
Change it to:

HTML Code:

<link rel="canonical" href="http://www.freakpyromaniacs.com/forum/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
and you should be set. :up:

You had an extra "forum.php" in that line...

Tony_FPM 09-23-2010 10:48 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2102460)
^^^^

Your issue is with the line:

HTML Code:

<link rel="canonical" href="http://www.freakpyromaniacs.com/forum/forum.php{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
Change it to:

HTML Code:

<link rel="canonical" href="http://www.freakpyromaniacs.com/forum/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}" />
and you should be set. :up:

You had an extra "forum.php" in that line...

Thanks. It works now! :)

swiftor 09-26-2010 08:12 PM

1 Attachment(s)
You didn't mention this working for blogs, but I tried anyway in the blog_show_entry template, and it appears on two separate lines. Any chance of instructing on how to make it look nicer on one line?

Attachment 122351

BirdOPrey5 09-26-2010 10:09 PM

I don't have the vB4 Suite so I can't test out too much. I downloaded a copy of your blog and played with some settings- if you completely remove the <div> tag around the Twitter code then both buttons show up on the same line, but the twitter button is a few pixels higher than the Facebook button. I haven't figured out a way to correct this without using a div tag, if I had a suite license I would try some more but if you play with it hopefully you can figure it out.

Also I noticed you didn't put your Twitter username into the code, your username is still set to "YOUR_TWITTER_USERNAME."

swiftor 09-27-2010 02:40 AM

thanks for that!

subvertbeats 09-27-2010 11:29 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2101791)
Understood. Is this problem currently affecting you personally? (Just trying to prioritize things.)

Hi Joe

Id be hard pressed to say that with any confidence.
Basically, I just dont know if its affecting us. I think it might be but can't say for sure.

All the best,


All times are GMT. The time now is 07:29 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.01174 seconds
  • Memory Usage 1,790KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_html_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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