Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-type: application/javascript; charset=utf-8');
- $servername = "localhost";
- $username = "username";
- $password = "password";
- $dbname = "databasename";
- $memID = $_COOKIE['memberID'];
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM Profiles WHERE ID='$memID'";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- $dnick = $row[NickName];
- $dname = $row[FullName];
- $demail = $row[Email];
- $dstatus = $row[Status];
- }
- }
- $sqlpic = "SELECT Hash as pic FROM `bx_photos_main` WHERE Owner = $memID and ID = ( SELECT LastObjId FROM `sys_albums` WHERE Owner = $memID and Uri like '%-s-photos' )";
- $ressql = $conn->query($sqlpic);
- if ($ressql->num_rows > 0) {
- // output data of each row
- while($row = $ressql->fetch_assoc()) {
- $pic = $row[pic];
- }
- }
- $conn->close();
- ob_start(); //Start output buffer for full picture
- echo "http://mydolphin.com/m/photos/get_image/file/{$pic}.jpg";
- $dfullpic = ob_get_contents(); //Grab output
- ob_end_clean(); //Discard output buffer for full picture
- ob_start(); //Start output buffer for thumbnail
- echo "http://mydolphin.com/m/photos/get_image/thumb/{$pic}.jpg";
- $dsmallpic = ob_get_contents(); //Grab output
- ob_end_clean(); //Discard output buffer for thumbnail
- if($dstatus=="Active"){
- //JSConnect Code Begins
- require_once dirname(__FILE__).'/functions.jsconnect.php';
- // 1. Get your client ID and secret here. These must match those in your jsConnect settings.
- $clientID = "Your client ID";
- $secret = "Your client Secret";
- // 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'] = $dnick;
- $user['name'] = $dname;
- $user['email'] = $demail;
- $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 = true;
- WriteJsConnect($user, $_GET, $clientID, $secret, $secure);
- } else {
- echo 'It seems you are not Logged In at My Dolphin or You account is not active!';
- }
Add Comment
Please, Sign In to add comment