Solved

Display Facebook Events on a Website

Posted on 2012-03-19
10
4,450 Views
Last Modified: 2012-03-21
I have a client who is looking to have facebook events dynamically displayed through his website. When my company launches his re-design, he is looking to have his events page automatically sync with his facebook events so I do not need to manually edit anything for him. He has a simple 6 page HTML5/CSS3 website. He doesn't have a need for anything bigger, and doesn't make enough edits to necessitate any CMS.

I have seen various threads mentioning the use of PHP, but unfortunately, I am not that versed in backend coding nor is any of his site setup in PHP. I have strong front-end skills with HTML and CSS, and have used some jquery toys, but anything beyond that I havent touched yet. I cannot get the PHP working for the example I found. I downloaded both the facebook sdk package and the package from the example, but no dice.

Are there any Facebook developers out there who have done this, or have some solid advice? Or is anyone brave enough to help me through the PHP way (if there is no other alternative). Can I even include PHP on an HTML-only site? Maybe I am missing something super simple due to lack of experience.

If it helps, my client's Facebook page is set to public so I shouldn't need any special permissions/logins or access tokens (I think): http://www.facebook.com/KenwoodOakLawn

The example i attempted to use: http://www.codeofaninja.com/2011/07/display-facebook-events-to-your-website.html, but of course all other ideas/help are very much welcome (non-PHP preferred, but I won't ignore you if you tell me it's the only way ;-). Thank you in advance to anyone who may be able to lend a hand!
0
Comment
Question by:Jen0910
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 37739805
In the comments on the code of a ninja site it says this,
Please note that this script works with facebook pages only, not personal fb account.
Also do remember that php must be installed on what ever server is running the pages for it to work.
If php is working I would check the error log, look for error_log in your ini file to see where that might be, on my local version of php.ini it is  set at log_errors =On error_log="C:\WINDOWS\temp\php-errors.log"
if you want the errors to display directly to the screen set display_errors = On
0
 
LVL 8

Author Comment

by:Jen0910
ID: 37742255
His Kenwood site isn't a personal page. It's a fan page for his business.

Our office doesn't have windows machines, so that isn't something I can do-and like i mentioned, I've never touched PHP before so what you wrote above is almost like speaking Italian to me! Do you know of any examples/tutorials I can take on how to install/error check on a mac, or any other way to get the same result?
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 37742339
This is from the official php site about mac installation, there should be apache and php already installed on a mac, it just has to be activated.
http://php.net/manual/en/install.macosx.php
Also you should still have those options on a mac, the location will just be different.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Author Comment

by:Jen0910
ID: 37743185
Thanks halo, with your guidance i was able to find this step-by-step on how to get PHP going on a mac: http://foundationphp.com/tutorials/php_leopard.php, and it seems like a pretty in-depth process but straight forward. I should be able to handle it.

Will I need to do anything different when we upload to his web server? Here is his domain if it offers and help: www.kenwoodliquors.com

The new site design will replace the current design on the same domain.
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 37743207
Not knowing what is installed on his server, I can't really say, but he will also need php installed for what you want to work and his server will need to be set up to deliver php pages when called on to do so.
0
 
LVL 8

Author Comment

by:Jen0910
ID: 37743354
Is there any way i can check what version of PHP he has on that server? There is a /specials.php page up there (hadn't noticed the extension before). If get login information for it, can i simply use that for testing without having to activate PHP on my mac?

Also, if I can in fact take that approach, can I simply use "<?php include("events.php"); ?>" to call a PHP file into an HTML file? So I can setup an events.php page separately with all of the Facebook codes to be included into my current kenwood-events.html page? Or will i need to convert the entire kenwood-events.html to PHP? If i need to convert the entire page, will my markup need to change? Currently it's setup in HTML5 based off of Boilerplate.

Thank you for your patience, I'm sure I'm driving you nuts with such basic stuff!
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 37743446
php must be activated for any php page to run.
To check the version of php just put <?php phpinfo(); ?> on a php page and run it.
You don't have to convert the entire site to php, you can probably just use an ajax call to the php page to avoid converting any pages to php from what they already are running.
If you convert the pages no markup needs to change unless you want php to do something with it.
0
 
LVL 8

Author Comment

by:Jen0910
ID: 37743549
Thank you. I'll see if I can get it going in that environment, and will check in with you on this thread if i screw it up!
0
 
LVL 8

Author Comment

by:Jen0910
ID: 37743748
Ok, so i did the test (http://kenwoodliquors.com/check.php), it's shows the server running an old version of PHP: 4.4.9

But i notice in the cgi-bin directory, there is in fact a "php5" file. How can i force the server to run the later version? I am getting fatal errors when running the "kenwoodliquors/events.php" page which is leading me to suspect the out of date php is causing the issue. I have attached screen shots of the 2 directories if it may be of any help for you.
Screen-shot-2012-03-20-at-12.30..png
Screen-shot-2012-03-20-at-12.30..png
0
 
LVL 13

Accepted Solution

by:
haloexpertsexchange earned 500 total points
ID: 37743869
What you would need to do would be to install a newer version of php.
Since it looks like he is running Linux there are instructions on what to do here http://www.php.net/manual/en/install.unix.php
If there is actually more than one version installed on that server then it is just a matter of forcing the server to load the correct php module.
For example if this was running on Apache, you would change this
 LoadModule php5_module modules/libphp5.so, in the httpd.conf file, to the correct module for the version that you wanted running/
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question