* Copyright 2008 Ringside Networks, Inc., and individual contributors as indicated
 * by the @authors tag or express copyright attribution
 * statements applied by the authors.  All third-party contributions are
 * distributed under license by Ringside Networks, Inc.
 * 
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 * 
 * 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.
 ******************************************************************************/
class RingsideApiClientsConfig
{
    public static $webUrl = "";
    public static $serverUrl = "";
}
if (isset($_SERVER['SERVER_NAME'])) {
    $host = $_SERVER['SERVER_NAME'];
    $port = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : '80';
    RingsideApiClientsConfig::$webUrl = "http://{$host}:{$port}/";
    RingsideApiClientsConfig::$serverUrl = "http://{$host}:{$port}/restserver.php";
}
Example #2
0
 * 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';
require_once 'SuggestionUtils.php';
include_once 'ringside/api/clients/RingsideApiClients.php';
include_once 'ringside/api/clients/RingsideRestClient.php';
// Get the ringside client
RingsideApiClientsConfig::$serverUrl = Config::$ringsideApi;
RingsideApiClientsConfig::$webUrl = Config::$ringsideWeb;
$ringsideClient = new RingsideApiClients(Config::$api_key, Config::$secret);
// 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
Example #3
0
#
# $webUrl = The Web page url to return to an application
$webUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/web";
### Configuration for social ###
# RingsideSocial needs a connection the API server, even though they might be local
# their must be a Key/Secret required by Social to talk to the API engine.
# If the social layer gets deployed separately, also to make sure remote apps do not
# impersonate the RingsideSocial layer.
# We suggest adding in some random text right 6 to 8 characters long, such as 'sjd2jds';
#
$socialApiKey = 'Jkinner';
$socialSecretKey = 'Jkinner';
$socialRoot = '/social';
$socialUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/social";
### Configuration for web ###
# Every WEB/ThirdParty connecting must maintain a NETWORK key indicating which WEB is connecting.
# This is the default/internal web community packaged with Ringside
$networkKey = 'ringside-web';
# Web apps need to do redirects and other URL related activities, however it does not know how the
# calling web front end is setup.  This setting tells it how to construct absolute urls.
$webRoot = '/web';
### Configuration for web-apps ###
# Set the support email address to be used during installation.
$supportEmail = 'admin@localhost';
### Configuration for demo-apps ###
### Configuration for API client ###
require_once 'ringside/api/clients/RingsideApiClientsConfig.php';
RingsideApiClientsConfig::$serverUrl = $serverUrl;
RingsideApiClientsConfig::$webUrl = $webUrl;
RingsideApiClientsConfig::$socialUrl = $socialUrl;
Example #4
0
//    echo "Could not locate LocalSettings.php";
// }
// app settings
// Include the ringside client libraries
include_once 'clients/RingsideApiClients.php';
include_once 'clients/SuggestionClient.php';
include_once 'clients/RingsideRestClient.php';
class Config
{
    public static $api_key = '1882266fc526e79fbd51438f2fb17183';
    public static $secret = 'ccbfc51f8c517aaa91a2de4917c29713';
    // Configure Database
    public static $db_ip = 'localhost:3306';
    public static $db_name = 'ringside';
    public static $db_user = '******';
    public static $db_pass = '';
    public static $ringsideWeb = "web";
    public static $ringsideApi = "api";
}
$GLOBALS['facebook_config']['debug'] = 0;
# This is used for the client to give back appropriate URLS.
# $webUrl = The Web page url to return to an application
Config::$ringsideWeb = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/web";
# $serverUrl = The URL including rest endpoint for the REST SERVER to talk to.
# if this is not a full install or packaged install you might need to change $webRoot to the location
# of the API server.
Config::$ringsideApi = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/api/restserver.php";
RingsideApiClientsConfig::$webUrl = Config::$ringsideWeb;
RingsideApiClientsConfig::$serverUrl = Config::$ringsideApi;
$ringside = new RingsideApiClients(Config::$api_key, Config::$secret);
$user = $ringside->require_login();