Tag Archives: CodeIgniter

Two students presented CodeIgniter research projects

Beyond the training and consulting business I am also part-time teacher for the Technology School Electronic Systems - Sofia and I do teach web technologies and WordPress. As the representer of the Web 2.0 world I took part in mentoring 2 teams for their diploma research assignments based on CodeIgniter.

One of the projects was a music web portal for artists, media, albums and more. Encyclopedia format for music addicts that could easily transform in a front-end manner using the same database structure. It was meant to start as a hard rock and metal project and later easily skinned and themed into other music categories as well. I really do hope to see it ready, as I already saw most pages and the database structure which extended the modeling structure that exists by default in CodeIgniter.

The other project is a social network for places. A mix of the foursquare listing of categories and places and the Golden Pages catalogue, but with better interaction for users, taking advantage of the localization browser services and latest HTML 5 fine tunes. It has a pretty neat design and more than 30 DB tables at the moment and is going to be ready soon. Users in the site could interact to each other and follow the new places being added with their comments. The basic idea is filling in a database of places with location (easy to find in a Google Map) with comments, ratings and more that is built on the CodeIgniter framework. This is a great profiler that helps the PR managers of a company or a restaurant to improve the quality and social skills and keeps the good rating online.

I'm glad to see the enthusiasm of the development process and the improving code quality and feature set. Both teams work hard and would probably take part in competitions with their projects.

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com

CodeIgniter advanced search implemented

 

I had to implement advanced search algorithm which supports pagination and multiple open sessions at one browser. My main issues were the following:

  • how am I able to support the pagination?
  • where am I going to save the search parameters?
  • what happens when I open 3 tabs and search simultaneously?
  • when am I going to flush the recorded results?

It was clear that I had to persist the data to each page. My first idea was saving the params into flashdata() (the temporary 1-time session or rather request forwarding). It was good solution if you restrict yourself to one tab only and navigation only page-to-page. The problem was my 'details' page where parameters got lost. As well as the 'back' button, too.

CodeIgniter itself doesn't allow GET queries in the URL. Actually it does, but not by default and it's bad practise to do it.

Therefore I decided to resend the flashdata on all required pages. But what happens if you open few tabs at the same time? All search results get mixed up and all tabs get the data from the last query called.

Another popular trick is persisting into multidimensional $_SESSION array - the name (unique) of the session and all the params. I actually can't think of a reasonable way to flush the sessions regularly and manage big sessions (cookie limit is 4K after all).

So we decided to create a new DB table for sessions. There we save all the params as serialized array. We use both the session unique ID and the page number when navigating.

Code snippet and explaining in the CI forums - How to implement complex search

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com