Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
3.2k views
in Q2A Core by
edited by
by
What do you mean tweet button?
by
i think he means retweet or like a "bookmark this" thing to post a link and the title on  twitter - just a guess :P
by
you are right Dakota..any idea how to put it?

3 Answers

+3 votes
by
edited by
 
Best answer
------------Edit---------

I've figured this out and have gotten it to work on my site, follow these instructions carefully.

----------
in your css theme file add:
#twitter {float:right; margin-top:-54px; margin-right:10px;}
----------

----------
in your css file edit (or similar) :  .qa-q-view-main {float:left; width:600px;}
and replace it with:  .qa-q-view-main {float:left; width:585px;}
----------

----------
in qa-includes/qa-theme-base.php add:  $this->output('<div id="twitter"><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div>');
on a new line directly after: case 'question':
----------

Thats it, comment here if u have any other questions
by
edited by
thanks....!
its works great!!!
with this, i also can add facebook share.. horeey!!!
by
Great job, it worked perfectly. I only wish the Twitter website was faster loading. You can see this mod in action at http://www.askagamer.com
by
Where I should insert the could in version 1.3?
by
I'm having the same problem here. Case 'question' isn't in 1.3. Where's the similar place to put it?
+1 vote
by
edited by
Dakota is on the right track but there is a better way.

bottom of qa-style.css add:

#twitter {float:right; margin-top:-54px; margin-right:10px;}

qa-theme-base.php find:

case 'question':

Add after:

$this->output('<div id="twitter"><a class="retweet vert self" href=""></a></div>');

In Admin area:
In Custom tags in <HEAD> section of every page:

Add:

<script src="../../js/retweet.js"></script>

Ensure that the path is correct. We have QandA in its own folder, 1 up from root path. In root we have js folder.

Now you need to download this file :
http://ejohn.org/blog/retweet/

Follow the instructions and voila, fixed.

To see it in action:
http://www.sporttipsworld.com/tips/questions

Click on one of the questions ;) the bit.ly url handles the link.

Have fun. Incidentally, we only downloaded this a few minutes ago, and so far very impressed. Hats off to gidgreen.

Blue
by
"Dakota is on the right track but there is a better way."

That is a matter of preference ^.^

Just glancing at the code it seems as everything in the custom head section will now be over there on the side, which in my opinion is inefficient.
by
No problems :) no skin off my nose. Perhaps you should check the code out "closer" ;)
+1 vote
by

Select the buttons and style you want on a site like www.addthis.com and copy sharing the code.

Use Q2A advanced theme editing (see more on that here: http://www.question2answer.org/themes.php#advanced ) to override the q_view_main function and paste the AddThis code to produce something like this: 

--------------------------------------------------------------------------------------------------

 

function q_view_main($q_view)
{
$this->output('<DIV CLASS="qa-q-view-main">');
 
$this->output('
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d971b0a058477f1"></script>
<!-- AddThis Button END -->
');
 
$this->q_view_content($q_view);
$this->q_view_follows($q_view);
$this->post_tags($q_view, 'qa-q-view');
$this->post_avatar($q_view, 'qa-q-view');
$this->post_meta($q_view, 'qa-q-view');
$this->q_view_buttons($q_view);
$this->c_list(@$q_view['c_list'], 'qa-q-view');
$this->form(@$q_view['a_form']);
$this->c_list(@$q_view['a_form']['c_list'], 'qa-a-item');
$this->form(@$q_view['c_form']);
 
$this->output('</DIV> <!-- END qa-q-view-main -->');
}
--------------------------------------------------------------------------------------------------
 
See the Tweet and FB buttons at work here: http://answers.techzim.co.zw/
by
Even better, override q_view_content($q_view) in your advanced theme, output the extra bit, and then call through to the inherited class using qa_html_theme_base::q_view_content($q_view) - that way it's much more likely for this to work in future versions. Or even better, look out for the develope preview of Q2A 1.4, and make a widget plugin...
by
Thank you :)
...