[PREVIEW] Sj MartLife - Modern eCommerce Joomla VirtueMart Template

0
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum

We are here to serve :)

Our support team is currently online to solve your issues.

Our support team is currently offline

Our support heroes might not be around this hour. Please expect some delays.

Our support is available from

Monday - Friday 8am - 5:30pm GMT+7

Your time: 00:00:00
Our time: 00:00:00

Welcome, Guest

Facebook counter is 0 (IT WORKS CURL VERSION)
(1 viewing) (1) Guest
Read user-guide, report bugs and discuss more
  • Page:
  • 1

TOPIC: Facebook counter is 0 (IT WORKS CURL VERSION)

Facebook counter is 0 (IT WORKS CURL VERSION) 4 years ago #32686

  • darekmer
  • OFFLINE
  • Single Product
  • Junior Boarder
  • Posts: 20
  • Karma: 2
Hello.
rod-lubocza.pl
Sorry for english, google translator;)
My hosting blocks 'allow_url_fopen' and does not work 'file_get_contents'.
I have a question if I can replace 'file_get_contents' 'curl'?
And do you have the function 'private static function getFacebookLike'
Last Edit: 4 years ago by darekmer.

Re: Facebook counter is 0 new post 4 years ago #32696

  • darekmer
  • OFFLINE
  • Single Product
  • Junior Boarder
  • Posts: 20
  • Karma: 2
Please help. Can I replace file get content CURL?

Re: Facebook counter is 0 new post 4 years ago #32697

  • darekmer
  • OFFLINE
  • Single Product
  • Junior Boarder
  • Posts: 20
  • Karma: 2
No help via support
I did it myself
Maybe someone will use it
CURL version if "file_get_content" does not work
	private static function getFacebookLike($params){
		$id = $params->get('facebook_url');
        $appid = $params->get('appid');
        $appsecret = $params->get('appsecret');
		$ch = curl_init('https://graph.facebook.com/'.$id.'?access_token='.$appid.'|'.$appsecret.'&fields=likes');
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);
		$response = curl_exec($ch);
		curl_close($ch);
		$json_output = json_decode($response);
        //Extract the likes count from the JSON object
        $like_count = isset($json_output->likes) ? $json_output->likes : 0;
        return $like_count;
	}
Last Edit: 4 years ago by darekmer.

Re: Facebook counter is 0 new post 4 years ago #32727

Dear darekmer

You can try to set it php.ini file for your site.
refer this link: github.com/Solutions-Nitriques/oembed_field/issues/28

thanks
  • Page:
  • 1
Time to create page: 0.41 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Suggested Posts

(/)
Result not found!

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes
Quà Tết Cao Cấp Hộp quà tết Giỏ quà tết Túi quà tết