1 (edited by 2012-07-21 14:35:39)

Topic: Facebook like button

So I've googled and looked for codes to integrate Facebook like button into cutenews, there's really no way yet until now.

You literally have to put his on the php file that cutenews is integrated into. It took me a while to figure out how to do this, but I think it actually works.
Don't put it in Deafult.tpl because it won't work. You rather put it in your header file of your php file.


<div class="fb-like" data-href="http://<? echo $_SERVER['SERVER_NAME']; ?><? echo $_SERVER['REQUEST_URI']; ?>" data-send="false" data-layout="button_count" data-width="120" data-show-faces="true"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=APP_ID_HERE";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>



Using the default facebook like options, the change is only the URL, sometimes when you try to embed Facebook like button onto the Default.tpl, it'll only go to the http://yoursite.com/news.php?subaction=showfull. So to do this, we use the default like option and put in

<? echo $_SERVER['SERVER_NAME']; ?><? echo $_SERVER['REQUEST_URI']; ?>

.

<? echo $_SERVER['SERVER_NAME']; ?>

for the website URL and

<? echo $_SERVER['REQUEST_URI']; ?>

for if you have the php file like http://yoursite.com/news?subaction=showfull instead and also, it's a better way than

<? echo $_SERVER['PHP_SELF']; ?>

.


NOTE: Don't use these PHP codes on Default.tpl for tpl files cannot read PHP functions.

Re: Facebook like button

I'm new to cutephp, but I need this functionality, thanks for the post


No problem, the PHP codes only will work in the PHP file that cutenews is integrated into. You cannot put it in the Default.tpl.
I wish they can update the tpl functions, but as of right now, it's sort of weird to do so.

Hope this works.

Re: Facebook like button

Looks like this is what you are looking for: http://www.likebtn.com

4 (edited by 2013-06-06 06:40:32)

Re: Facebook like button

You can shorten that to

<?=$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']?>

<?=$_SERVER['SERVER_NAME']?>

<?=$_SERVER['REQUEST_URI']?>

Which is easier to read.


___________________
See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too. Free hosting

Re: Facebook like button

thanks

Re: Facebook like button

Thanks a lot . This code snippet did help me a lot.
Please keep your good work.

Re: Facebook like button

I have a doubts that is i include cute news in my website page for example it include in my site's latest_news.php page but each of my article got same tiltle and meta tags when i click on it ,i need seperate title tags with respect to the article please help me.I am using the latest version of cute news

Re: Facebook like button

I have a doubts that is i include cute news in my website page for example it include in my site's latest_news.php page but each of my article got same tiltle and meta tags when i click on it ,i need seperate title tags with respect to the article please help me.I am using the latest version of cute news

Dear franklyan,

Could you kindly give us more details describing your problem. Can you show an example?

Best regards,
CN Support team

Re: Facebook like button

Thanks so much

Re: Facebook like button

Thank.  I have more leaning

Re: Facebook like button

That IS really IMPRESSIVE. Good job!

Re: Facebook like button

... Thank you for sharing. I have to learn more and more. Headache https://cutephp.com/forum/style_emoticons/default/sad.gif

Re: Facebook like button

You topic is very great and useful for me. Thank you

Re: Facebook like button

Such a great information about coding you share with us.

15 (edited by xenderforpcs 2016-09-15 15:55:41)

Re: Facebook like button

Really great information thanks for sharing this info bro..

Re: Facebook like button

wonderful post!!Thank you for sharing this.keep on sharing.

Re: Facebook like button

I think php made life easy and even it is getting better day by day. you can try automatic call recording on your android device.

Re: Facebook like button

Well, PHP is most comprehensive language of all out there.

19 (edited by uspstrackingnow 2016-12-19 05:58:20)

Re: Facebook like button

Facebook is really nice social media platform I have purchased something from facebook shop and usps tracking delivers it to me in no time.

Re: Facebook like button

https://www.ted.com/profiles/40463544/about