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)

BirdOPrey5 08-23-2010 08:35 PM

If you go to your template editor and edit your showthread template...

Then copy and paste the "top" part of the file here I can look through it and suggest a location you could put the code.

If you could copy and paste everything in showthread above:
Code:

<li><a href="poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
                                        </vb:if>
                                </ul>
                        </li>


Alucard^ 08-24-2010 10:16 AM

If i am not wrong this is the code that you want:

PHP Code:

{vb:stylevar htmldoctype}
<
html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<
head>
    {
vb:raw headinclude}
    <
vb:if condition="$threadinfo['keywords']"><meta name="keywords" content="{vb:raw threadinfo.keywords}" /></vb:if>
    <
meta name="description" content="{vb:raw thread.meta_description}" />

    <
title>{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
    <
link rel="canonical" href="{vb:raw thread_url}" />
    <
vb:if condition="$show['reputation']">
    <
script type="text/javascript" src="clientscript/vbulletin-ajax-reputation.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
script type="text/javascript" src="clientscript/vbulletin_textedit.js?v={vb:raw vboptions.simpleversion}"></script>
    <
script type="text/javascript" src="clientscript/vbulletin_post_loader.js?v={vb:raw vboptions.simpleversion}"></script>
    <
vb:if condition="$show['threadrating']">
    <
script type="text/javascript" src="clientscript/vbulletin_ajax_threadrate.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
vb:if condition="$show['multiquote_global']">
    <
script type="text/javascript" src="clientscript/vbulletin_multi_quote.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
vb:if condition="$show['quickedit']">
    <
script type="text/javascript" src="clientscript/vbulletin-editor.js?v={vb:raw vboptions.simpleversion}"></script>
    <
script type="text/javascript" src="clientscript/vbulletin_quick_edit.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
vb:if condition="$show['quickreply']">
    <
script type="text/javascript" src="clientscript/vbulletin_quick_reply.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
vb:if condition="$show['manage_tag']">
    <
script type="text/javascript" src="clientscript/vbulletin_ajax_taglist.js?v={vb:raw vboptions.simpleversion}"></script>
    <
script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>
    <
vb:if condition="$show['lightbox']">
        <
script type="text/javascript" src="clientscript/vbulletin_lightbox.js?v={vb:raw vboptions.simpleversion}"></script>
    </
vb:if>

    <
vb:if condition="$vboptions['storecssasfile']">
        {
vb:cssfile showthread-rollup.css}
    <
vb:else />
        {
vb:cssfile postlist.css,showthread.css,postbit.css,attachment.css,poll.css,lightbox.css}
    </
vb:if>

{
vb:raw headinclude_bottom}
</
head>

<
body<vb:if condition="$onload"onload="{vb:raw onload}"</vb:if>>

{
vb:raw header}
{
vb:raw navbar}
{
vb:raw template_hook.showthread_above_posts}
{
vb:raw poll}

    <
div id="above_postlist" class="above_postlist">
        <
vb:if condition="$show['largereplybutton']">
            <
a href="newreply.php?{vb:raw session.sessionurl}p={vb:raw LASTPOSTID}&amp;noquote=1" 
class="newcontent_textcontrol" id="newreplylink_top"><vb:if condition="$show['closethread']"><span>+</span> {vb:rawphrase reply_to_thread}<vb:else />{vb:rawphrase closed_thread}</vb:if></a>
            <
img style="display:none" id="progress_newreplylink_top" src="{vb:stylevar imgdir_misc}/progress.gif"  alt="" />
        </
vb:if>

        <
div id="pagination_top" class="pagination_top">

<
vb:if condition="!in_array($GLOBALS[forumid], array(191, 192, 217, 114, 216))">
<
div align="right" style="height:27px;">
<
a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Compartir</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</
script>
<
a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="nvnetgroup">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</
div>
</
vb:if>


        <
vb:if condition="$pagenav">
            {
vb:raw pagenav}
        </
vb:if>
            <
div id="postpagestats_above" class="postpagestats">
                {
vb:rawphrase showing_results_x_to_y_of_z, {vb:raw pagenumbers.first}, {vb:raw pagenumbers.last}, {vb:raw totalposts}}
            </
div>
        </
div>
    </
div>
<
div id="pagetitle" class="pagetitle">
    <
h1>
        {
vb:rawphrase thread}: <span class="threadtitle"><a href="{vb:raw thread_url}" title="{vb:rawphrase reload_this_page}">{vb:raw threadinfo.title}</a></span>
        <
vb:if condition="$show['fb_likebutton']">
            {
vb:raw fblikebutton}
        </
vb:if>
    </
h1>
</
div>
    <
div id="thread_controls" class="thread_controls">
        <
div>

        <
ul id="postlist_popups" class="postlist_popups popupgroup">

            <
vb:if condition="$show['firstunreadlink']">
            <
li class="popupmenu"><h6><class="firstunread" href="{vb:raw firstunread}">{vb:rawphrase view_first_unread} </a></h6></li>
            </
vb:if>
            <
li class="popupmenu" id="threadtools">
                <
h6><class="popupctrl" href="javascript://">{vb:rawphrase thread_tools}</a></h6>
                <
ul class="popupbody popuphover">
                    <
li><a href="printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}<vb:if condition="$perpage">&amp;pp={vb:raw perpage}</vb:if><vb:if condition="$pagenumber">&amp;page={vb:raw pagenumber}</vb:if>" accesskey="3" 
                        
rel="nofollow">{vb:rawphrase show_printable_version}</a></li>
                    <
li><a href="sendmessage.php?{vb:raw session.sessionurl}do=sendtofriend&amp;t={vb:raw threadid}"
                        
rel="nofollow">{vb:rawphrase email_this_page}&hellip;</a></li>
                    <
li>
                        <
vb:if condition="$show['subscribed']">
                            <
a href="subscription.php?{vb:raw session.sessionurl}do=removesubscription&amp;t={vb:raw threadid}" 
                                
rel="nofollow">{vb:rawphrase unsubscribe_from_this_thread}</a>
                        <
vb:else />
                            <
a href="subscription.php?{vb:raw session.sessionurl}do=addsubscription&amp;t={vb:raw threadid}" 
                                
rel="nofollow">{vb:rawphrase subscribe_to_this_thread}&hellip;</a>
                        </
vb:if>                    
                    </
li>
                    <
vb:if condition="$show['addpoll']"

Thanks.

BirdOPrey5 08-24-2010 01:14 PM

I would have preferred the code before you inserted the Twitter code but let's try this:

Find:
Code:

<vb:if condition="!in_array($GLOBALS[forumid], array(191, 192, 217, 114, 216))">
<div align="right" style="height:27px;">
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Compartir</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</script>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="nvnetgroup">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>
</vb:if>

and change it to:
Code:

<vb:if condition="!in_array($GLOBALS[forumid], array(191, 192, 217, 114, 216))">
<div align="right" style="height:27px;">
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Compartir</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</script></div>
<div align="right">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="nvnetgroup">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>
</vb:if>

See what that does...

Alucard^ 08-25-2010 01:33 AM

Well... i solved the problem with this: http://sharethis.com/publishers/get-button-code?style=6

Using this code:

PHP Code:

<vb:if condition="!in_array($GLOBALS[forumid], array(191, 192, 217, 114, 216))">
<
div style="text-align: right; margin-bottom: 10px;">
<
span class="st_twitter_hcount" displayText="Tweet"></span><span class="st_facebook_hcount" displayText="Share"></span>
</
div>
</
vb:if> 

And this on the headinclude:

PHP Code:

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'dfba2cb0-5585-44ea-9c02-ab4120cee202'});</script

And work perfect, but now i have another strange problem... see this:

http://www.webpagescreenshot.info/im...01053134am.png

When i add that code of the headinclude (the scripts) appear something at the right of thanks button.

You know how to solve?

Thanks and sry for posting here but is something "related" and maybe you know what is the problem.

BirdOPrey5 08-25-2010 01:51 AM

Sorry, I have no clue about that. :(

Veer 08-25-2010 09:09 PM

Installed.

Code:

http://www.forum.com/threads/90953
I tried it by clicking on tweet and it is missing a SLASH in thread url.

Any help?

BirdOPrey5 08-25-2010 10:59 PM

Quote:

Originally Posted by Veer (Post 2089538)
Installed.

Code:

http://www.forum.com/threads/90953
I tried it by clicking on tweet and it is missing a SLASH in thread url.

Any help?

See post #42 for a solution to that issue. :up:

zelnik 08-26-2010 09:50 AM

Well I thought I had it working but the counter seems to mess up?!

When I tweet something the counter will say "1" hit refresh and it will go back to "0" and each and every time after still "0" Any ideas?

BirdOPrey5 08-26-2010 02:29 PM

Quote:

Originally Posted by zelnik (Post 2089777)
Well I thought I had it working but the counter seems to mess up?!

When I tweet something the counter will say "1" hit refresh and it will go back to "0" and each and every time after still "0" Any ideas?

Hmmm... I'd imagine the issue is because before your URL is submitted Twitter 'thinks' you're on the wrong page (without the slash) so when it checks its records it sees no one has 'tweeted' that URL so the count is Zero... When you hit Tweet you actually send a link to a different (albeit correct) URL so it doesn't get counted to the right page.

Understand?

I will keep trying to figure out why you're having the initial issue since that would solve everything, but in the mean time you can display the Tweet button without the counter so it doesn't throw people off... in your code replace:

data-count="horizontal" with data-count="none"

zelnik 08-26-2010 04:52 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2089870)
Hmmm... I'd imagine the issue is because before your URL is submitted Twitter 'thinks' you're on the wrong page (without the slash) so when it checks its records it sees no one has 'tweeted' that URL so the count is Zero... When you hit Tweet you actually send a link to a different (albeit correct) URL so it doesn't get counted to the right page.

Understand?

I will keep trying to figure out why you're having the initial issue since that would solve everything, but in the mean time you can display the Tweet button without the counter so it doesn't throw people off... in your code replace:

data-count="horizontal" with data-count="none"

Perhaps it's something to do with vbseo?

BTW: when you click the number (which is 0 most of the time) it does take you to the tweeted link on Twitter.com


All times are GMT. The time now is 12:01 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.03874 seconds
  • Memory Usage 1,860KB
  • 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_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