예제 #1
0
 private static function getSuggestionClient()
 {
     $client = new RingsideApiClients(Config::$api_key, Config::$secret);
     $uid = $client->require_login();
     $delegate = $client->api_client;
     $obj = new ReflectionObject($delegate);
     $suggestionClient = new SuggestionClient($delegate);
     return $suggestionClient;
 }
예제 #2
0
파일: index.php 프로젝트: jkinner/ringside
 * 
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 ******************************************************************************/
include_once 'CommentsUtils.php';
require_once 'ringside/web/config/RingsideWebConfig.php';
require_once 'ringside/api/clients/RingsideApiClients.php';
$ringside = new RingsideApiClients(RingsideSocialConfig::$apiKey, RingsideSocialConfig::$secretKey);
$ringside->require_login();
$uid = $ringside->get_loggedin_user();
$utils = new CommentsUtils();
if ($utils->hasAddParams()) {
    $callbackurl = isset($_GET['callbackurl']) ? $_GET['callbackurl'] : '';
    $returnurl = $_SERVER['HTTP_REFERER'];
    if (!$utils->isAuthorized()) {
        echo "<fb:redirect url='{$returnurl}' />";
    } else {
        $result = $ringside->api_client->comments_add($_GET['xid'], $_GET['text'], $_GET['aid']);
        if (!$utils->selfReferred() && !empty($callbackurl)) {
            echo "<fb:redirect url='{$callbackurl}' />";
        } else {
            if (!$utils->selfReferred() && !empty($returnurl)) {
                echo "<fb:redirect url='{$returnurl}' />";
            } else {
예제 #3
0
파일: index.php 프로젝트: jkinner/ringside
<div class="">Search your friends:
<form onsubmit="" method="post"><input type="hidden" id="view"
	name="view" value="search" /> <input type="search" id="query"
	name="query" value="" /></form>
</div>
<BR>
<BR>
<div><fb:tabs>
	<fb:tab-item href='friends.php' title='Everyone' selected='true' />
	<fb:tab-item href='friends.php?view=add_friend' title='Add Friend' />
	<fb:tab-item href='friends.php?view=view_invites' title='View Invites' />
</fb:tabs></div>
<?php 
require_once 'ringside/api/clients/RingsideApiClients.php';
$client = new RingsideApiClients(RingsideSocialConfig::$apiKey, RingsideSocialConfig::$secretKey);
$uid = $client->require_login();
//$user_name = $client->api_client->users_getInfo($uid, "first_name");
$url = $client->get_openfb_url();
$view = null;
isset($_REQUEST['view']) ? $view = $_REQUEST['view'] : ($view = null);
if ($view == null || $view == 'everyone') {
    // If it's not a view, check the action
    if (isset($_REQUEST['action'])) {
        $error = '';
        $message = '';
        $action = $_REQUEST['action'];
        if ($action == 'add_friend') {
            if (isset($_REQUEST['email']) && !empty($_REQUEST['email'])) {
                $next = isset($_REQUEST['next']) ? $_REQUEST['next'] : '/friends.php?view=view_invites';
                $domain_info = $client->api_client->admin_getDomainProperties(array('url'), null, $_REQUEST['fb_sig_nid']);
                $domain_url = $domain_info['url'];
예제 #4
0
파일: index.php 프로젝트: jkinner/ringside
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 ******************************************************************************/
// Include the ringside client libraries
require_once 'config.php';
// Get the ringside client
$ringsideClient = new RingsideApiClients(Config::$api_key, Config::$secret);
$ringsideClient->require_frame();
// Make sure the user is logged in and get the UID
$userid = $ringsideClient->require_login();
// Instantiate the rest client, this is for the ratings api in extension apps
$rest = new RingsideRestClient($ringsideClient->api_client);
$name = $rest->delegate->users_getInfo($userid, "first_name");
// Show the dashboard
?>
<fb:dashboard>
	<fb:action href="index.php?action=list">View Suggestions</fb:action>
	<fb:create-button href="index.php?action=add">Create a Suggestion</fb:create-button>
</fb:dashboard>
<?php 
// Say hi to the user, but let's use an fbml tag, just as another example of using fbml
// instead of html
echo '<fb:explanation><fb:message>Suggestions Demo Application</fb:message>Welcome ' . $name[0]['first_name'] . '</fb:explanation>';
// Control what template we load
// Templates are just php files with fbml/html in them.  We use php so we can perform variable substitution
예제 #5
0
파일: index.php 프로젝트: jkinner/ringside
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 ******************************************************************************/
require_once('ringside/core/client/RingsideRestClient.php');
require_once('config.php');

$server_url = "http://api.facebook.com/restserver.php";
$web_url = 'http://www.facebook.com';
try {
require_once('ringside/api/clients/RingsideApiClients.php');
$fb = new RingsideApiClients($api_key, $secret, $web_url, $server_url);
$ringside = new RingsideRestClient($fb->api_client);

$loggedinuser = $fb->require_login();
$fb->api_client->friends_get();

	$ringside->items_setInfo('testitem', RingsideRestClient::$server_url, 'http://'.$_SERVER['HTTP_HOST']);
	$item = $ringside->items_getInfo('testitem');
	if ($item) {
?>Test Passed<?
$ringside->items_remove('testitem');
	} else {
?>Test FAILED<?
	}
} catch ( Exception $e ) {
?>Test EXCEPTION<br><pre><?php
echo $e->getMessage()."\n";
echo $e->getTraceAsString();
}
예제 #6
0
파일: index.php 프로젝트: jkinner/ringside
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 ******************************************************************************/
// Include the ringside client libraries
include_once 'ringside/api/clients/RingsideApiClients.php';
include_once 'ringside/api/clients/SuggestionClient.php';
include_once 'ringside/api/clients/RingsideRestClient.php';
// Control your configuration via this config file
include_once 'config.php';
// Get the ringside client
RingsideApiClientsConfig::$webUrl = Config::$ringsideWeb;
RingsideApiClientsConfig::$serverUrl = Config::$ringsideApi;
$ringside = new RingsideApiClients(Config::$api_key, Config::$secret);
//// Make sure the user is logged in and get the UID
// TODO: Probably don't need this in the app.  Let the framework figure this out
// suggestions can be anonymous
$userid = $ringside->require_login();
// Show the add and the dashboard.
if ((isset($_REQUEST['existingtopic']) || isset($_REQUEST['newtopic'])) && isset($_REQUEST['suggestion'])) {
    $ownerid = 0;
    $topic = '';
    $suggestion = $_REQUEST['suggestion'];
    // Topics are messed up for new topics
    if (isset($_REQUEST['existingtopic']) && $_REQUEST['existingtopic'] != 'none') {
        $str = $_REQUEST['existingtopic'];
        // comes in the form ownerid:topic
        $pos = strpos($str, ':');
        if ($pos) {
            $ownerid = substr($str, 0, $pos);
            $topic = substr($str, $pos + 1, strlen($str));
        } else {
            throw new Exception("Invalid existing topic syntax: {$str}");