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
@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
Where did you place header('content-type: application/javascript; charset=utf-8'); ?
// 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);
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.
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
Where did you place header('content-type: application/javascript; charset=utf-8'); ?
@danytothetowers Preferably at the top of the file, after the
<?php
. Make sure there is no output or whitespace prior to that.My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
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?
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.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS