Facebook Share
  • HI I try to see in google and in sourceforge but I not see any addon for share articles of campsite in facebook or public comments in the articles in the seam time is public in facebook

    I not Joomla have the component myapi are there any plugins or addon for campsite with similar features?

  • 13 Comments sorted by
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hi,

    you can try Facebook app "Simplaris Blogcast" instead. This Facebook application allows you to add RSS items to your Facebook profile, displaying the headline and lead sentence, lead paragraph, or a set number of characters... http://apps.facebook.com/flogblog/
  • I am looking in that but I like more no use external applications get also private info.

    I solve the Button Share in the Article Like that:

    1.- Open Template Editor

    2.- If you use the Classic template open this folder

    3.- Edit article.tpl

    4.- You go to see:
    Quote:
    {{ $campsite->article->Body }}
    </p>
    </div><!-- .articlecontent -->

    This code end in line 26 Go to line 27 and press Enter for add a new blank line

    5.- Add in this line number 27 the next code:
    Quote:
    <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>


    6.- SAVE

    7.- Now is working SHare in Articles you can see a example in http://www.elistas.org

    8.- The next stage I go to make is add facebook comments in Article. I upgrade soon
    Shocked

  • Hi Jacob,

    I used a similar method when we added the "Recommend" button on the Netgazeti site:

    http://netgazeti.ge/GE/24/News/2325/

    I just added the following code to the article.tpl template (the site is also based on the Classic templates with different graphics):

                           
                <!-- FACEBOOK LIKE BUTTON-->
                <iframe src="http://www.facebook.com/plugins/like.php?href={{ url|escape:"url" }}&amp;layout=standard&amp;show_faces=true&amp;width=400&amp;action=recommend&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:400px; height:px"></iframe>
              </div><!-- .articlecontent -->
              


    I don't know if this will help, but it might...
    Douglas Arellanes
    Director of Innovation
    Sourcefabric, o.p.s.

    Find a way or make one.
  • UHm This is the code for like Button.

    This code I add after my code I post before possible is interest for you
    but you need to get APi and Secret ID from a new facebook aplication

    The code allow to the user post comments of your article
    you can see also in my web

    Quote:
    <script src=
    " http://static.ak.connect.facebook.com/js/api_lib/v0.4/Featur eLoader.js.php"
    type="text/javascript"></script>

    <script type="text/javascript">
    FB.init("here you put the secrect key you have in facebook aplication");
    </script>
    <fb:comments></fb:comments>


    You need to add also the file I add here in your root of campsite
  • Vote Up0Vote Down Sava TatićSava Tatić
    Posts: 113Member, Administrator, Sourcefabric Team
    Thanks for this Jacob. It should make it to our documentation together with
    Doug's "like" button.

    Sava

    On Tuesday, September 07, 2010 19:19:56 Jacob wrote:
    > UHm This is the code for like Button.
    >
    > This code I add after my code I post before possible is interest for you
    > but you need to get APi and Secret ID from a new facebook aplication
    >
    > The code allow to the user post comments of your article
    > you can see also in my web
    >
    > Quote:<script src=
    > " http://static.ak.connect.facebook.com/js/api_lib/v0.4/Featur
    > eLoader.js.php" type="text/javascript"></script>
    >
    > <script type="text/javascript">
    > FB.init("here you put the secrect key you have in facebook aplication");
    > </script>
    > <fb:comments></fb:comments>
    >
    >
    >
    >
    > To participate in the discussion, go here:
    > http://forum.sourcefabric.org/index.php?t=rview&frm_id=1 1

    --
    Sava Tatić
    Managing Director, Sourcefabric o.p.s.
    sava.tatic@sourcefabric.org

    Salvátorská 10
    110 00 Praha 1, Czech Republic
    +420 2 22 36 25 40
    Skype: tictactatic

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • I go to post after the code for get the numbers of user like you campsite aplication and is also in facebook. You see that in the footer of my web

    The problem with the code give the other user is because is not connect with the api of facebook you never have idea how many user like any of your article.

    I go to see also to look for the correct code for that and post here
    Shocked
  • HO to add box with the people like your web

    1.- You need to have a facebook aplication with api ,key, secret and ID Number Go to http://www.facebook.com/developers/apps.php

    2.- Go to campsite and edit the template classic or template you use

    3.- go to /tpl and edit footer.tpl

    4.- go to line 25 you see Quote:
    </div><!-- id="footerlinksinner" -->

    5.- go to next line 26 and press enter for add a new line
    6.- include or paste that in the line 26
    Quote:
    <iframe src="http://www.facebook.com/plugins/likebox.php?id=HERE YOU PUT ID NUMBER NORMALLY IS 16 DIGITS LONG&amp;width=640&amp;connections=10&amp;stream =false&amp;header=false&amp;height=255 " scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:740px; height:255px;" allowTransparency="true"></iframe>


    aND NOW SURE YOU CAN SEE THE PEOPLE LIKE YOUR APLICATION IN FACEBOOK AND IS ALSO IN YOUR FACEBOOK APLICATION

    REMEMBER WHEN YOU HAVE A MINIMUM OF 10 USERS A MONTH YOU NEED TO TO MAKE PUBLIC YOUR APLICATION IN FACEBOOK AND SURE YOU GET MORE VISITS AND MORE MEMBERS


    The next code I go to public is HOW TO MAKE CAMPSITE open in one IFRAME in FACEBOOK

  • Hi Jacob,

    This is really cool! I'm looking forward to seeing the next step (the IFRAME). Could you possibly tell us more about the process of applying and registering a Facebook app? Also, I'm assuming that the comments are then sent only to Facebook; have you thought of a way to have the comments made available both on the Campsite site and then on FB too?

    doug
    Douglas Arellanes
    Director of Innovation
    Sourcefabric, o.p.s.

    Find a way or make one.
  • The comments you can see in the campsite site if you are already login in facebook. For that I believe I need to make login in campsite using facebook. I go to see teh IFrame in this week and at the end the login system for login in both sides

    You can see advance in http://apps.facebook.com/rssread/
  • The new Facebook API has already spread over the application developers and if you're like me, you've already got your hands dirty to see how this new thing works. If you have tried to follow the documentation to authorize/get session in your canvas application, it is likely you have already hit roadblocks. Well, I am no savior but I have glued together a few clues and got it working for myself.

    I am assuming that you have already created your application by following the Getting Started
    See pictures 1 and 2

    Step 1: Get the new SDK

    Download the new SDK from github http://github.com/facebook/php-sdk/ . We will only need the facebook.php file from the src folder. In our project directory, let's create a folder called "flib" and put the file there.

    Step 2: A configuration file

    Let's now create a configuration file to store our facebook configuration. Let's name it fconfig.php. Here goes the source:
    <?php

    Quote:
    define("FACEBOOK_APP_ID", '1yourface_id');
    define("FACEBOOK_API_KEY", 'your api key');
    define("FACEBOOK_SECRET_KEY", ' your secrect key');
    define("FACEBOOK_CANVAS_URL", 'http://apps.facebook.com/THE FOLDER YOU SETUP IN FACEBOOK/');


    If you use php 5.3 change the " for '
    Step 3: Application Main Page

    This file will be the main entry point to our facebook application. It just instantiates the facebook object, sets the configuration and checks for a valid session. If it does not find a valid session, it redirects to the login page. For first time visitors, it will be the authorization page. On later requests, the operation will occur in the background without any user interaction.
    Quote:
    <?php

    include_once 'flib/facebook.php';
    include_once 'fconfig.php';

    $facebook = new Facebook(array(
    'appId' => FACEBOOK_APP_ID,
    'secret' => FACEBOOK_SECRET_KEY,
    'cookie' => true,
    'domain' => 'phpfour.com'
    ));

    $session = $facebook->getSession();

    if (!$session) {

    $url = $facebook->getLoginUrl(array(
    'canvas' => 1,
    'fbconnect' => 0
    ));

    echo "<script type='text/javascript'>top.location.href = '$url';</script>";

    } else {

    try {

    $uid = $facebook->getUser();
    $me = $facebook->api('/me');

    $updated = date("l, F j, Y", strtotime($me['updated_time']));

    echo "Hello " . $me['name'] . "<br />";
    echo "You last updated your profile on " . $updated;

    } catch (FacebookApiException $e) {

    echo "Error:" . print_r($e, true);

    }
    }

    I call this file main.php
    You might be wondering it's pretty straight-forward, so what's the catch ? Well, to be honest, the documentation does not have the "canvas" parameter mentioned anywhere which does the primary magic here. Also, if you do not use the javascript trick, then you end up with an authorization dialog with full facebook UI within the iframe itself (picture3).

    You can get all the files in the file .gz
    Remember make the configuration for your facebook and make all the files user and group www-data in case you use Ubuntu


  • The file with all the files remember change the configuration any ideas Welcome
    Embarrassed
  • Now please any cooperation The code for publish automatic any time you make one article is
    Quote:
    require_once "../facebook.php";
    $facebook = new Facebook("API Key", "API Secret");
    try{
    $facebook->api_client->stream_publish("INSERT_STATUS_HERE ", null, null, null, "PAGEIDXXXXX");
    }catch(Exception $o ){
    print_r($o);
    }

    Any idea the correct modification of the file Article for insert that code. I try few but not work
  • Edit the file classes/Article.php, go to line 1320 in method
    Article::setWorkflowStatus():

    1317 if (!parent::setProperty('Published', $p_value)) {
    1318 return false;
    1319 }
    1320
    1321 CampCache::singleton()->clear('user');

    Insert the following code at line 1320:

    if ($p_value == 'Y') {
    // insert facebook publish code here
    }

    Mugur Rus
    Senior Software Developer, Sourcefabric
    mugur.rus@sourcefabric.org

    Cluj-Napoca, Romania
    +40 (0)720 528408
    Skype: mugur_rus

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric


    On Fri, Sep 10, 2010 at 1:26 PM, Jacob
    <campsite-dev@lists.sourcefabric.org>wrote:

    > Now please any cooperation The code for publish automatic any time you
    > make one article is
    > Quote:
    >
    > require_once "../facebook.php";
    > $facebook = new Facebook("API Key", "API Secret");
    > try{
    > $facebook->api_client->stream_publish("INSERT_STATUS_HERE ", null, null,
    > null, "PAGEIDXXXXX");
    > }catch(Exception $o ){
    > print_r($o);
    > }
    >
    >
    > Any idea the correct modification of the file Article for insert that code.
    > I try few but not work
    >