6
3

I would like OSQA to include share or "Like" buttons for Twitter and Facebook. At least in the question pages.

I think this would help OSQA sites to gain users.

asked 10 Nov '10, 10:57

Oscar's gravatar image

Oscar ♦
2.1k376169
accept rate: 27%


I dont think so its should be a part of OSQA. But you can easily add it. Check out the right bar in http://www.pakanswers.com. Adding it to question items and answer should be pretty straight forward.

Get FB code from here.

code look like following.

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmeta.osqa.net%2Fanswers%2F5691%2Fedit%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

update sidebar

alt text

topsidebar code goes like this

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like id='fb_like' href="http://www.pakanswers.com" width=220 ></fb:like>

<script type='text/javascript'>
var sUrl = window.location;
document.getElementById('fb_like').setAttribute('href', sUrl);
</script>

<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</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="pakanswers">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

<script src="http://www.stumbleupon.com/hostedbadge.php?s=1"></script>
<br>
###[Login / Register][2]

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('search', '1');
  google.setOnLoadCallback(function() {
    google.search.CustomSearchControl.attachAutoCompletion(
      'xxxxxxxxxx',
      document.getElementById('q'),
      'cse-search-box');
  });
</script>
<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="xxxxxx" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" id="q" autocomplete="off" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>

[1]: http://www.pakanswers.com/upfiles/register_.png
[2]: http://www.pakanswers.com/account/signin/95

and i also added

<meta property="og:image" content="thumbnail_image" />

in base_content with correct url of a image so that while sharing on facebook it should have some pic as thumbnail as shown in following pic.

alt text

link

answered 11 Nov '10, 02:22

affan's gravatar image

affan
2311714
accept rate: 0%

edited 20 Nov '10, 13:34

1

@oscar i have updated my site to add google adsense/search + tweet and StumbleUpon buttons in sidebar. So user can share any url in my site on facebook, tweeter and stumbleupon.

(20 Nov '10, 13:21) affan
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×144
×40
×24
×6
×5

Asked: 10 Nov '10, 10:57

Seen: 1,864 times

Last updated: 20 Nov '10, 13:34

powered by OSQA