コード例 #1
0
ファイル: tests.php プロジェクト: noahm/kontagent-php-sdk
 public function testStrippedKtArgsWithShortTagAndExtraTags()
 {
     $kt = new Kontagent(self::KT_HOST, self::KT_API_KEY);        
     $kt_url = 'http://apps.facebook.com/lih_test_lowlevelnew/?kt_type=partner&foo=bar';
     
     $short_tracking_code = $kt->gen_short_tracking_code();
     global $kt_short_tag;
     
     $r_url = $kt->stripped_kt_args($kt_url);
     
     $r_items_arry = parse_url($r_url);
     parse_str($r_items_arry['query'], $r_GET_arry);
     $this->assertEquals( isset($r_GET_arry['foo']), true,
                          "foo should still be there" );
     $this->assertEquals( isset($r_GET_arry['kt_sut']), true,
                          'kt_sut should be in the query str.');
 }
コード例 #2
0
        
        // If your user gets forwarded outside of facebook,
        // call $facebook->redirect([canvas url]) to forward your
        // user back. 
        // $facebook->redirect(FB_CANVAS_URL);
        break;
    }
    case 'inr':
    {
        error_log($_SERVER['HTTP_REFERER']);//xxx
        if(!$kt->get_send_msg_from_js()){
            $kt->track_invite_received($uid);
            // If it doesn't get rid of the the forward the kt_* parameters, except
            // for the kt_ut tag, after install, we'll get another inr message.
            $no_kt_param_url = $kt->stripped_kt_args($_SERVER['HTTP_REFERER']);
            $facebook->redirect($no_kt_param_url);
        }else{
            echo "<script>var kt_landing_str='".
                $kt->gen_tracking_invite_click_url($uid).
                "';</script>";
        }
        break;
    }
    case 'stream':
    {
        if(!$kt->get_send_msg_from_js()){
            $kt->track_stream_click($uid);
        }
        else
        {