Solved

Display Facebook Events on a Website

Posted on 2012-03-19
10
4,169 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
  • 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now