Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
673 views
in Q2A Core by
How to share post to social network ?

example facebook.com, digg.com ....

please help me!

3 Answers

0 votes
by
edited by

I only can help with the facebook share button:

The simplest way is to use the facebook share button, the advantage is, that it looks nicer on the facebook stream and You need very little code.

It is not longer recommended, so You as well could use the Like button. But there You would have some more code to let the button know, which page You are sharing.

Here an example for the share button:

1) Build an advanced theme

http://www.question2answer.org/advanced.php

Chapter: Creating an advanced theme for Question2Answer

2) Add for example the function 

 

function q_view_main($q_view)
{
$this->output('<DIV CLASS="qa-q-view-main">');
 
$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 -->');
}

 

3) Add somewhere inside this function the share button from:

http://developers.facebook.com/docs/share

Code:

$this->output('<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>');

Done

I hope this helps to start with sharing.

You can provide othere features as You can see on the mentioned facebook developer site.

Rgds

monk333

0 votes
by
The simplest way you can do is that using 3rd tools like http://www.facebook.com/RSS.Graffiti to pull your RSS feed and put it onto your fb wall :D

Of course, you can also put a Like button on each post by using Addthis.com so that visiter can get your post on their wall.
+1 vote
by

1. Register at AddThis which is an incredibly popular service for adding sharing buttons to your site. (You don't actually need to register to use it but you can track clicks etc if you do.)

2. Grab your code and paste it into the appropriate place on your site. You can either use the built-in areas under Admin>Layout, or an advanced theme to put it anywhere you like.

...