コード例 #1
0
             }
             break;
     }
 } else {
     // session required
     if (isset($_GET['userid'])) {
         $userid = $_GET['userid'];
     } else {
         $userid = 0;
     }
     if (isset($_GET['sessionKey'])) {
         $sessionKey = $_GET['sessionKey'];
     } else {
         $sessionKey = 'noSessionKey';
     }
     $app = setupAppFramework();
     if ($session->validateSession($userid, $sessionKey) !== false) {
         switch ($method) {
             case 'askPostAnswer':
                 if (isset($_GET['id'])) {
                     $id = $_GET['id'];
                     require_once PATH_FACEBOOK . "/classes/ask.class.php";
                     $askObj = new ask($db);
                     $askObj->setAppLink($app);
                     $code = $askObj->ajaxAskPostAnswer($userid, $id);
                 }
                 break;
             case 'fetchRewards':
                 if (isset($_GET['sort'])) {
                     $sort = $_GET['sort'];
                 } else {
コード例 #2
0
<?php

// verify email address
setupAppFramework();
if (isset($_GET['test'])) {
    require_once PATH_CORE . '/classes/remotefile.class.php';
    $rfObj = new remotePageProperty($_GET['url']);
    echo $rfObj->getPageTitle();
    $matches = $rfObj->getPageParagraphs();
    print_r($matches);
    require_once PATH_CORE . '/utilities/calais/opencalais.php';
    $oc = new OpenCalais($init['calais']);
    $entities = $oc->getEntities($matches);
    foreach ($entities as $idea) {
        echo $idea . "<br />";
    }
    exit;
    foreach ($entities as $type => $values) {
        echo "<b>" . $type . "</b>";
        echo "<ul>";
        foreach ($values as $entity) {
            echo "<li>" . $entity . "</li>";
        }
        echo "</ul>";
    }
    exit;
}
if (!isset($_GET['e']) and !isset($_GET['a'])) {
    $result = false;
    $app->facebook->redirect(URL_CANVAS . '?p=home&msgType=error&&msg=' . urlencode('There was a problem with your request.'));
} else {