This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// string dataType | |
profile.set( 'bio', 'I am a PHP developer' ); | |
// number dataType | |
profile.set( 'age', 29 ); | |
// pointer to User class | |
profile.set( "userId", { "__type": "Pointer", "className": "_User", "objectId": Parse.User.current().id } ); | |
// pointer to custom class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// string dataType | |
$parse->bio = "I am a PHP developer"; | |
// number dataType | |
$parse->age = 29; | |
// pointer to User class | |
$parse->userId = $parse->dataType( 'pointer', array( '_User', $user_id ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// new Profile object | |
var Profile = Parse.Object.extend("Profile"); | |
var profile = new Profile(); | |
// set DOB as date - needs to be ISO format | |
var dob = new Date("1985-01-01"); | |
profile.set( 'dob', { "__type": "Date", "iso": dob.toISOString() } ); | |
// bio string data | |
profile.set( 'bio', 'I am a PHP developer' ); | |
// pointer to User table (parse Classes should have _ prefix.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( 'Parse/parse.php' ); | |
// User ID from User table | |
$user_id = 'QLaLLqjJWi'; | |
// new Profile object | |
$parse = new parseObject('Profile'); | |
// set DOB as date - uses strtotime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { | |
$iPod = stripos( $_SERVER['HTTP_USER_AGENT'], "iPod" ); | |
$iPhone = stripos( $_SERVER['HTTP_USER_AGENT'], "iPhone" ); | |
$iPad = stripos( $_SERVER['HTTP_USER_AGENT'], "iPad" ); | |
$Android = stripos( $_SERVER['HTTP_USER_AGENT'], "Android" ); | |
$webOS = stripos( $_SERVER['HTTP_USER_AGENT'], "webOS" ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// requires Facebook PHP SDK 4.0.x or later | |
// user must be logged-in prior to API call | |
// publish story, requires 'places' attribute | |
// use a page_id with no address to tag hidden location | |
// $tags is a comma-separated string of IDs | |
$story = (new FacebookRequest( $session, 'POST', '/me/feed', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Facebook PHP SDK v4.0.8 | |
// path of these files have changes | |
require_once( 'Facebook/HttpClients/FacebookHttpable.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurl.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' ); | |
require_once( 'Facebook/Entities/AccessToken.php' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include lines 1-65 from https://gist.github.com/niraj-shah/fcd17411def017e3aefc here | |
// see if the viewer has liked the page | |
if ( $pageHelper->isLiked() ) { | |
// see if we have a session | |
if ( isset( $session ) ) { | |
// show logged-in user id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// required Facebook PHP SDK v4.0.9 or later. | |
// include required files form Facebook SDK | |
require_once( 'Facebook/HttpClients/FacebookHttpable.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurl.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' ); | |
require_once( 'Facebook/Entities/AccessToken.php' ); | |
require_once( 'Facebook/Entities/SignedRequest.php' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
βββ / | |
βββ application | |
β βββ cache | |
β βββ config | |
β βββ controllers | |
β βββ core | |
β βββ errors | |
β βββ helpers | |
β βββ hooks |