Avatar of Jen0910
Flag for United States of America asked on

Display Facebook Events on a Website

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!
FacebookWeb DevelopmentHTML

Avatar of undefined
Last Comment

8/22/2022 - Mon

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

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?

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.
Also you should still have those options on a mac, the location will just be different.
Your help has saved me hundreds of hours of internet surfing.

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.

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.

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!
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.

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.

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!

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.