Posts

Showing posts from February, 2013

Export to csv : CI Helper File

Image
This is another helper file by Jérôme Jaglale. I used this helper file to export my data into csv files in a codeigniter project: Registraion System . Its preety good and easy than to export to .xls file. CSV files are good if you are more flexible to use. You might like to use it. To know more about csv file please visit the click here . The helper file is embeded as follows:

Random String Generator : CI Helper File

Image
Now, I have this small helper file that I used in a project I was working on using codeigniter where I generated random strings which were used as activation code of users. The helper file is embeded as follows: Using this is very easy just copy the code in a file rand_helper.php and put it in helpers directory and load the helper file using $this->load->helper('rand_helper') and call the function generateRandomString()or with length of string to be generated generateRandomString(15). THe default length of string is 10. Its documented in the helper file too. If you need to modify it, please go ahead. :)

Numbers to Words conversion library for codeigniter

Image
If you are writing an application that deals with financial stuffs, then most probably you will come to a situation where you would have to convert numerical values to words e.g. to write the amounts in words. And if the situation has come then you are at the right place, here is a CodeIgniter library that will help you with what you are really in need of. This library can be used in your CodeIgniter project. And the usage is very simple. Just import the library and call the function as follows: <?php $a=$this->load->library('numbertowords'); $number=1234567890; echo $this->numbertowords->convert_number($number); ?>  Not only this, you can also use the following javascript library: To use this javascript library, all you need to do is select all the code and save it in a file numbertoword.js and use it as follows: //Import the javascript file: <script src="numbertoword.js"></script> //Call the function toWords(number) passing a number

Finding page id of Facebook fan-page

Image
Sometimes you come to a situation when you need the page id of the Facebook fan page. This happens usually when you are writing Facebook application that needs to use the Facebook fan-pages. If you have been to the situation then here's you solution. It just a few lines of code which is as follows: This simple program echoes your Facebook fan-page when "http://www.facebook.com/nosklub" is replaced with the url of your Facebook Fan-page. No rocket science right?  :) And yeah one more thing to add, this not only just gives you the id of your fanpage, it also returns the facebook id of the user, supplied the persons facebook url e.g. http://www.facebook.com/opnchaudhary