Mysql Table Editor

04 Jun 2009

In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort. 

Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php code. 

You can  :

  1. Select the table to be displayed
  2. decide which column should be hidden
  3. Whether a column should be editable or not
  4. Add advanced searching option
  5. Download the table as csv format
  6. Add pagination
  7. Set alias display name for your column
Download Library from: 
Documentation:
Sample Code Below:

noDisplay('id');
$editor->noDisplay('password');
//the email column should not be editable
$editor->noEdit('email');
//set display name for column email and login
$editor->setDisplayNames(array('email'       => 'Email',
                              'login'     => 'Username'
                              ));
//sort order of first name
$editor->setDefaultOrderby('namefirst', 0);
//set which are the filed to be searchable
$editor->setConfig('searchableFields', array('namefirst', 'namelast', 'email'));
//can set the type of input field
$editor->setInputType('available', 'select');
//finally display the editor window
$editor->display();
?>

Tags: , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Contact Grabber

06 Nov 2008

If you are a social media website developer , sometimes you might search for grabbing contacts from a particular email account if the password is given. I also did the same.  In most of the cases it did not work properly. But recently i got a contact grabber from phpclasses.org which works perfectly on Gmail, Hotmail, Rediff, Yahoo, Orkut, MySpace, Indiatimes, Linkedin , AOL and lycos

screen shot

screen shot

But the zip file i got is not well arranged, so it shows some errors . I arranged it in proper way and uploaded here:

Download:

http://sajithmr.com/downloads/grabber.zip

(Under GNU Public License)

Using this php code , you can export the email contacts as csv file.

Here is the actual source website : http://www.phpclasses.org/browse/package/3895.html

Tags: , , , , , , , , , , , , , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Old rails has a buitl in pagination option. For example is you have to paginate @user, which is a model object for the table user

def user_list
@user_pages,@users=paginate(:users,:order=>’name’)
end

But in new version of rails, they removed the pagination option. So you need to install a plugin , which name is will_paginate

You can install this plugin using gem

gem install will_paginate

After the installation you have to add require “will_paginate” in config/environment.rb (at bottom)

You have to restart your ruby server after that.

In the controller area use:

def index
  @poems = Poem.paginate :page => params[:page], :o rder => 'created_at DESC'
end

and in the template page use

<%= will_paginate @poems, :container => false %>

Tags: , , ,

· · · ◊ ◊ ◊ · · ·

Online Photoshop in PHP Part (5) >>

(image after watermarked with gmail logo)

Those who haven’t seen  the online photoshop tool created by me, just click here: http://www.sajithmr.com/photoshop

Today we will implement the watermarking on images using php gd library. Intelligent watermarking means, apply a logo or a watermark image on another image by measuring the color depth of the applied image. For this water marking, use png images as logo or watermark  for better results.

Live example for watermark implementation: http://sajithmr.com/photoshop-tuts/watermark/addwatermark.php

You can see different watermark location by changing the x1,y1 and x2,y2 parameters of the following url:

http://sajithmr.com/photoshop-tuts/watermark/showresult.php?x1=405&y1=285&x2=520&y2=392&width=115&height=107

See the watermark php source code here: http://sajithmr.com/photoshop-tuts/watermark/watermark.class.txt

Download the full-source code of watermarking implementation using php+gd from here: http://sajithmr.com/photoshop-tuts/watermark.rar

Tags: , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

وظائف 2011 تحويل العملات برامج برنامج تسريع التحميل برنامج الفلاش برنامج محول الصوتيات عربي hotel 2011 زيادة رواتب العساكر 1431