Using iCarousel for Photos

I've never been quite satisfied with how I've been displaying Flickr photos. At first, I just shot out 50 thumbnail images without any formatting. After that, I tried SimpleViewer that used Flash to display the photos. I left that up for a while, even though it bothered me that it always loaded the full images in the background even if you weren't interested in looking at them.

A couple days ago, there was an interesting Ajaxian article about iCarousel which displays small images in a "carousel". I guess the carousel name is fitting if I think of it like the old slide viewers with a wheel of slides. There never was an end to the slides, i.e. the slides would repeat endlessly, and iCarousel does the same.

Integrating iCarousel was pretty easy since I already had a Flickr library in place. Instead of writing out XML like I did for Simpleviewer, I just wrote out the HTML/CSS for the <li> elements to a $li_out variable. I'm using CodeIgniter, and so all this was part of my controller file, photos.php. I passed the $li_out variable to my view "photos/index.php," and that was enough to get the carousel to appear.

The examples didn't go anywhere when you clicked on a thumbnail, so I had to work on that part. Using a little bit of AJAX knowhow, I display a larger image below the carousel.

So, it's all working fairly well for the 25 images I load. Later, I'll add code to grab the next 25 images from Flickr. I'd like to have a list of popular or suggested tags someday too ...

Oh, here's my peave, which is probably due to my hacking code without fully understanding things .... My href is going to "#" as if there is an anchor tag somewhere. When I click a thumbnail, I'd like it to display the image without the page going to http://www.overfood.com/photos/# ....




Dynamic Lists with Xajax and Code Igniter

I have been working on integrating the "dynamic lists" example from the alexajax.com site, and I can get the Ajax piece to create the secondary dropdown menus. That wasn't too bad. However, I'm having a rough time prepolulating thhe menus if some data in the form doesn't validate correctly.

Alex makes it work with xajax and codeigniter, which is my exact same set up, so I know it can be done. I just have to figure out how to integrate it with my humongous form!




Autosuggest Restaurant Cities with AJAX

I've read about AJAX for a long time, but I never dove into it. Now that this site is "live", I thought it'd be a good time to try my hand at it.

I took advantage of the Alex's Ajax site since it has examples of Ajax working within CodeIgniter. I don't have a Ajax library preference yet, so I followed along with the use of Xajax. I'll say once again that I can figure things out a lot faster with just PHP, and working things out in OOP and CI did slow me down a bit. I will just call it good experience.

Now, my restaurant search by city uses the "autosuggest" method to look up cities in the restaurant database. It makes suggestions whenever the list of cities is less than 20. I did that so that it would not suggest a crazy number of restaurants after you typed the first letter. I think I will change the code to wait a few seconds before doing a lookup so that it will only lookup when you pause. That will reduce the load on the database.

It's not the smoothest thing, but it gets the job done. It is a shame that it only fills in the city for you. I can grab the city and state together, but because I've got the city and state in separate fields, I cannot force it to put the suggestion data into both fields. With that, I wonder if it's better to just have a single field for city, state. Weather.com and Google Maps both work with that method. It would not be very difficult to split the field on a comma.




Page :  1