//AutoFacebook
$app_id = "111111111111111"; //given when you created app
$app_secret = "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"; //given when you created app
$page_id = "222222222222222"; //obtained from running facebook_authorization.php from your browser
$page_token = "ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4a b3cd4ab3cd4ab3cd4ab3cd4ab3cd4ab3cd4"; //long number obtained from facebook_authorization.php
$store_name = "BillyBoyle"; // store name i.e. "Mary's Car Shop", or "MikesCupcakes.com."
$store_url = 'http://your-shop.co.uk'; //path to your store without the trailing "/"
$cur = '£'; //change to your currency symbol. Assumes symbol comes in front of numbers
$new_message = "Your Message in a bottle!"; // change to whatever or leave the same. i.e "New Cupcake!"
// No Need to edit below here.
$prod_image = $store_url . "/images/" . $_POST['products_image'];
$prod_url = $store_url . '/index.php?main_page=product_info&cPath=' . $current_category_id . '&products_id=' . $products_id;
$prod_name = $_POST['products_name'][$_SESSION['languages_id']];
$products_description = strip_tags($products_description);
// $products_description = $_POST['products_description'][$_SESSION['languages_id']];
// $products_description = implode(" ", $_POST['products_description']);
$vat = .20;
$price = (number_format(( $products_price + $products_price * $vat), 2, '.', ''));
include_once 'facebook/facebook.php';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true, ));
$attachment = array(
'access_token' => $page_token,
'message' => $new_message,
'name' => $prod_name,
'link' => $prod_url,
'description' => $products_description,
'picture' => $prod_image,
'caption' => 'For only: '.$cur . $price,
);
try {
$status = $facebook->api($page_id.'/feed', 'post', $attachment);
$messageStack->add_session('Facebook was successfully updated!', 'success');
}
catch (FacebookApiException $fbe){
$fberror = $fbe->result['error']['message'];
$messageStack->add_session('Facebook Error: '.$fberror, 'error');
}
//end of autoFacebook
//
Bookmarks