Using Responsive Menus with CodeIgniter

Ajax, Codeigniter, JQuery, plugins

In a previous post (A jQuery Responsive Menu Plugin), I discussed how to use the gpResponsiveMenu jQuery plugin to create responsive menus. While developing the plugin, I tested the options with CodeIgniter (I use CodeIgniter for my demo site). I had to make minor changes to the CodeIgniter navigation in order to use the plugin.

Continue reading

Checkout My New Site - T-shirts For Geeks

Multi-Purpose CodeIgniter Forms

Codeigniter

One aspect of CodeIgniter that I don’t like is the amount of view files that I have to create. Although I create folders to group relevant views, I’m always searching through files to find the view that I need. To reduce the amount of files that I need for a project, I usually create a single view file to handle both inserts and updates to a table. But I had to create a CodeIgniter Helper function in order to make it work.

Continue reading

Checkout My New Site - T-shirts For Geeks

Dynamic ComboBox With CodeIgniter

Codeigniter

I’m updating a project that I created using CodeIgniter. I have to add a combobox (select) to a registration form that contains state names. I did not want to create a static combo box, so I created a states table in the MySQL database that I’m using for the project. The states table contains three fields (state_id, state_abbrev, state_name).

Continue reading

Checkout My New Site - T-shirts For Geeks

CodeIgniter and TinyMCE

Codeigniter

I’m updating a project for a client that I developed using CodeIgniter. One of the updates involves adding a text editor. I decided to use TinyMCE. Integrating TinyMCE with CodeIgniter was easier than I thought.

Create a folder under the js folder and name it tiny_mce (/js/tiny_mce). Download TinyMCE and place the files in the tiny_mce folder.

Continue reading

Checkout My New Site - T-shirts For Geeks

PHP: Testing IPN in PayPal Sandbox

Codeigniter, PHP

I just completed a website where the client uses PayPal to handle the payment transaction. I have used PayPal quite a bit in the past, but I have always had problems using IPN (Instant Payment Notification). Because of the problems, I usually opted not to use IPN, but I was determined to use it for this project. The primary problem with testing IPN is, because the transaction occurs in the background, it is difficult to figure out where the point of failure is. But that is all behind me now.

Continue reading

Checkout My New Site - T-shirts For Geeks

Using JQuery with CodeIgniter

Ajax, Codeigniter, JQuery, plugins

Using JQuery with CodeIgniter is simple. In fact, using most Ajax frameworks with CodeIgniter is easy. I created a simple JQuery plugin that displays randomly selected images (imBannerRotater).

First I use CodeIgniter’s ‘base_url’ function to link the necessary Javascript files in a main view of my application:

<script type="text/javascript" src="js/jquery/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.imBannerRotater-0.5.js"></script>

Next, I define a Javascript variable to be used with by the plugin:

<script type="text/javascript">
//<![CDATA[
base_url = '<?= base_url();?>';
//]]>
</script>

I then use this variable in my JQuery Plugin:

?View Code JASVASCRIPT
$(document).ready(function(){
     $(".randPic").imBannerRotater({
	data_url: base_url + 'assets/sidebar/sidebar.php',
	base_path: base_url + 'assets/sidebar/'
     });
});

That’s about it. While this is a simple example, using CodeIgniter’s base_url function is the key to using JQuery or any other Ajax Framework.

Checkout My New Site - T-shirts For Geeks

CodeIgniter: 500 Internal Server Error

Codeigniter, Pebblet

I just finished a project using CodeIgniter. I ftp’d the files to the host provider’s servers. When I attempted to view the website, I received a ‘500 Internal Server Error’. Viewing the error logs, I found: SoftException in Application.cpp:252: File “/home/arrowcol/public_html/index.php” is writeable by group. I looked at the permissions of the index.php file and found that it was set to 0666, so I changed it to 0755 and the site is now up and running.

Checkout My New Site - T-shirts For Geeks