Fatal Error: Call to undefined method JFBConnectFacebookLibrary::useFileUploadSupport()
set_time_limit(50);
require_once JPATH_ROOT . DS . 'components' . DS . 'com_jfbconnect' . DS . 'libraries' . DS . 'facebook.php';
$fbClient = JFBConnectFacebookLibrary::getInstance();
// Get User ID
$user = $fbClient->getUserID();
if ($user) {
} else {
$loginUrl = $fbClient->getLoginUrl();
header('Location:' . $loginUrl . '&scope=user_photos,publish_stream');
}
// Login or logout url will be needed depending on current user state.
if ($user) {
if (isset($_GET['upload'])) {
$fbClient->setFileUploadSupport(true);
$args = array('message' => 'some message');
copy('http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif', 'tmp/file.jpeg');
$args['image'] = '@' . realpath('tmp/file.jpeg');
$data = $fbClient->api('/me/photos', 'post', $args);
unlink('tmp/file.jpeg');
//assigning users to tag and cordinates
$argstag = array('to' => $user);
$argstag['x'] = 40;
$argstag['y'] = 40;
$datatag = $fbClient->api('/' . $data['id'] . '/tags', 'post', $argstag);
echo 'Success! Check your facebook wall now';
} else {
Click here to upload this image on your facebook wall
}
}
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
$fbClient = $jfbcLibrary->getFbClient();
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.
set_time_limit(50);
require_once JPATH_ROOT . DS . 'components' . DS . 'com_jfbconnect' . DS . 'libraries' . DS . 'facebook.php';
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
$fbClient = $jfbcLibrary->getFbClient();
$fbUser = $jfbcLibrary->getFbUserId();
$validate = $jfbcLibrary->validateToken();
if ($fbUser) {
} else {
$validate = $jfbcLibrary->validateToken();
header('Location:' . $validate . '&scope=user_photos,publish_stream');
}
// Login or logout url will be needed depending on current user state.
if ($fbClient) {
if (isset($_GET['upload'])) {
$fbClient->setFileUploadSupport(TRUE);
$args = array('message' => 'text messsage');
copy('image.jpg', 'tmp/file.jpeg');
$args['image'] = '@' . realpath('tmp/file.jpeg');
$data = $fbClient->api('/me/photos', 'post', $args);
unlink('tmp/file.jpeg');
//assigning users to tag and cordinates
$argstag = array('to' => $fbUser);
$argstag['x'] = 40;
$argstag['y'] = 40;
$datatag = $fbClient->api('/' . $data['id'] . '/tags', 'post', $argstag);
header( 'Location: success.html' ) ;
} else {
}
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.