Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

parseerror with jsconnect and vanilla 2.1|master branches

13»

Comments

  • ooops sorry, I missed the second page of the discussion !

    OMG... this worked perfectly. All those hours! maybe good to include this somewhere on the numerous vanilla tutorials. Thanks @Bleistivt for finding this, really made my day :pleased:

  • @hicham said:
    ooops sorry, I missed the second page of the discussion !

    OMG... this worked perfectly. All those hours! maybe good to include this somewhere on the numerous vanilla tutorials. Thanks @Bleistivt for finding this, really made my day :pleased:

    Where did you place header('content-type: application/javascript; charset=utf-8'); ?

  • BleistivtBleistivt Moderator

    @danytothetowers Preferably at the top of the file, after the <?php. Make sure there is no output or whitespace prior to that.

  • @Bleistivt said:
    @danytothetowers Preferably at the top of the file, after the <?php. Make sure there is no output or whitespace prior to that.

    I made this

    <?php
    header('Content-type: application/javascript; charset=utf-8');
    require_once dirname(FILE).'/functions.jsconnect.php';

    // 1. Get your client ID and secret here. These must match those in your jsConnect settings.
    $clientID = "xxx";
    $secret = "xxx";

    // 2. Grab the current user from your session management system or database here.
    $signedIn = true; // this is just a placeholder

    // YOUR CODE HERE.

    // 3. Fill in the user information in a way that Vanilla can understand.
    $user = array();

    if ($signedIn) {
    // CHANGE THESE FOUR LINES.
    $user['uniqueid'] = 'xxx';
    $user['name'] = 'xxx';
    $user['email'] = 'xxx';
    $user['photourl'] = '';
    }

    // 4. Generate the jsConnect string.

    // This should be true unless you are testing.
    // You can also use a hash name like md5, sha1 etc which must be the name as the connection settings in Vanilla.
    $secure = 'md5';
    WriteJsConnect($user, $_GET, $clientID, $secret, $secure);

    And I got this: ¡Ups!
    parsererror

    What it can be?

  • BleistivtBleistivt Moderator

    @danytothetowers said:
    What it can be?

    I don't know, have you changed the four lines to get the user date from your host system?

    This doesn't seem to be related to this discussion, I suggest you open a new discussion and describe your setup and what application you are trying to connect with.

Sign In or Register to comment.