vinodkram http://www.vinodkram.com php ,perl, mysql, symfony framework, javascript, ajax, html, zipcode of India, Day to Day Important Tips, Image Gallery, SMS messages.. Sun, 27 Dec 2009 09:22:48 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 How to use FCKeditor in symfony http://www.vinodkram.com/2009/12/how-to-use-fckeditor-in-symfony/ http://www.vinodkram.com/2009/12/how-to-use-fckeditor-in-symfony/#comments Fri, 25 Dec 2009 15:34:50 +0000 vinodkram http://www.vinodkram.com/2009/12/how-to-use-fckeditor-in-symfony/ 1. Download the FCKeditor source from http://ckeditor.com/download

2. Extract the source to /web/js/ directory of your symfony project directory

3. To use the editor in symfony, add (edit if present)the below line //config/settings.yml

.settings:
rich_text_fck_js_dir: js/fckeditor

4. You have to edit /web/js/fckeditor/fckconfig.js

var _FileBrowserLanguage = ‘php’ ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ‘php’ ; // asp | aspx | cfm | lasso | php

Depending on the technology you are using you have to set the above two parameter

5. In newer versions of FCKEditor you also have to enable the PHP connector in file /web/js/fckeditor/editor/filemanager/connectors/php/config.php on line 28, and also set your upload directory (on line 32).

$Config['Enabled'] = false;
$Config['UserFilesPath'] = ‘/uploads/assets/’ ;

You can set the UserFilesPath to whatever folder you want to store the uploaded file

6. Now you are ready to use the fck editor in your page

$options = array(
‘rich’ => ‘fck’,
‘height’ => 500,
‘width’ => 500,
);
echo textarea_tag(’inputname’, ‘Lorem ipsum’, $options );

Thats All :)

]]>
http://www.vinodkram.com/2009/12/how-to-use-fckeditor-in-symfony/feed/ 0
Update query in symfony http://www.vinodkram.com/2009/12/update-query-in-symfony/ http://www.vinodkram.com/2009/12/update-query-in-symfony/#comments Sat, 12 Dec 2009 06:04:54 +0000 vinodkram http://www.vinodkram.com/2009/12/update-query-in-symfony/ add(TableNamePeer::COLUMN_NAME, $conditionForColumn1); /* Here you have to set the column [...]]]> Suppose you want to execute query like
UPDATE tableName SET column1 = ‘abc’,column2 = ‘xyz’ WHERE column =’1′;
then you can use the below syntax to do so :)

—————————————————————————-

$con = Propel::getConnection();

/* Here you have to set the condition for which you need to update */
$c1 = new Criteria();
$c1->add(TableNamePeer::COLUMN_NAME, $conditionForColumn1);

/* Here you have to set the column value */
$c2 = new Criteria();
$c2->add(TableNamePeer::COLUMN_TO_UPDATE, $value);

BasePeer::doUpdate($c1, $c2, $con);

]]>
http://www.vinodkram.com/2009/12/update-query-in-symfony/feed/ 0
How to set the meta tag information intemplate file in symfony http://www.vinodkram.com/2009/10/how-to-set-the-meta-tag-information-intemplate-file-in-symfony/ http://www.vinodkram.com/2009/10/how-to-set-the-meta-tag-information-intemplate-file-in-symfony/#comments Sun, 25 Oct 2009 14:46:02 +0000 vinodkram http://www.vinodkram.com/2009/10/how-to-set-the-meta-tag-information-intemplate-file-in-symfony/ getResponse()->setTitle(’Your meta title here’); sfContext::getInstance()->getResponse()->addMeta(’description’,’ Meta description information’); sfContext::getInstance()->getResponse()->addMeta(’keywords’,'meta tag keywords seperated by commas’); That’s it. Thanks ]]> You can set the meta tag information in your template file as below.

sfContext::getInstance()->getResponse()->setTitle(’Your meta title here’);
sfContext::getInstance()->getResponse()->addMeta(’description’,’ Meta description information’);
sfContext::getInstance()->getResponse()->addMeta(’keywords’,'meta tag keywords seperated by commas’);

That’s it.

Thanks

]]>
http://www.vinodkram.com/2009/10/how-to-set-the-meta-tag-information-intemplate-file-in-symfony/feed/ 0
nl2br in perl http://www.vinodkram.com/2009/08/nl2br-in-perl/ http://www.vinodkram.com/2009/08/nl2br-in-perl/#comments Thu, 20 Aug 2009 07:23:19 +0000 admin http://www.vinodkram.com/2009/08/nl2br-in-perl/ How to replace new line character with br

$tempString = “Hello is testing for new line\n to br”;

$tempString =~ s/\n/<br\/>/;

output = “Hello is testing for new line
to br”;

]]>
http://www.vinodkram.com/2009/08/nl2br-in-perl/feed/ 1
How to convert bitmap image(.jpg , .jpeg, .gif, .png) to vector format (.ai , .eps, .svg) http://www.vinodkram.com/2009/08/how-to-convert-bitmap-image-jpg-jpeg-gif-png-to-vector-format-ai-eps-svg/ http://www.vinodkram.com/2009/08/how-to-convert-bitmap-image-jpg-jpeg-gif-png-to-vector-format-ai-eps-svg/#comments Fri, 14 Aug 2009 10:26:54 +0000 admin http://www.vinodkram.com/?p=88 For converting bitmap image to vector image you need to have autotrace library installed .

If you not installed you can install that bu using the command “yum install autotrace”.

Follow the instruction step till the installation is complete.

Once its installed you can use the below command to convert the image to vector format.

$ autotrace testInputImage.png -output-file testOutputImage.svg

Other example :

$autotrace –input-format=jpg –output-file=tshirt.ai –dpi=1024 –color-count=256 –despeckle-level=0 –despeckle-tightness=0 –corner-always-threshold=60 –line-threshold=0.1 –width-weight-factor=0.1 –line-reversion-threshold=0.1 –preserve-width –remove-adjacent-corners tshirt.ai 2>&1

and your are done.

For more information and option visit http://autotrace.sourceforge.net

Thanks

]]>
http://www.vinodkram.com/2009/08/how-to-convert-bitmap-image-jpg-jpeg-gif-png-to-vector-format-ai-eps-svg/feed/ 0
GD support http://www.vinodkram.com/2009/07/gd-support/ http://www.vinodkram.com/2009/07/gd-support/#comments Sat, 11 Jul 2009 15:10:24 +0000 admin http://www.vinodkram.com/?p=70 How to check if GD support is enabled or not.

<?php
var_dump(gd_info());
?>

If GD support is enabled then you will get an array in that you will get “GD Version”.

If you didn’t get this that means GD support is not there .

To enable GD support you should install
GD library by the below command
“yum install php-gd” (Fedora Linux)
This will install GD support.

Now when you check the output of the above php code it will display the GD version

]]>
http://www.vinodkram.com/2009/07/gd-support/feed/ 2
How to execute local system command by using javascript http://www.vinodkram.com/2009/07/how-to-execute-local-system-command-by-using-javascript/ http://www.vinodkram.com/2009/07/how-to-execute-local-system-command-by-using-javascript/#comments Sat, 11 Jul 2009 06:31:25 +0000 vinodkram http://www.vinodkram.com/?p=67 <script type=”text/javascript”>
MyObject = new ActiveXObject( “WScript.Shell”)
MyObject.Run(”cmd”) ;
</script>

In second line instead of “cmd” you can execute any command of your system , it could me “notepad.exe” or any other command .

]]>
http://www.vinodkram.com/2009/07/how-to-execute-local-system-command-by-using-javascript/feed/ 0
How to establish oracle database connection in php http://www.vinodkram.com/2009/06/how-to-establish-oracle-database-connection-in-php/ http://www.vinodkram.com/2009/06/how-to-establish-oracle-database-connection-in-php/#comments Wed, 03 Jun 2009 06:36:07 +0000 vinodkram http://vinodkram.wordpress.com/?p=65 First of all you need to check whether “oci8″ support is enabled or not, if not you have to enable that you can check this in your phpinfo file.

Once this is done.

Now in you test.php file

You have to explicitly set the ORACLE_HOME and LD_LIBRARY_PATH path.
This information will be available in you phpinfo file.

The “$dbstr” variable information you can find it from your “tnsnames.ora” file .

Test.php start

—————————————————————————————–

if (!ini_get(’display_errors’)) {
ini_set(’display_errors’, 1);
}
PutEnv(”ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/”);
PutEnv(”LD_LIBRARY_PATH=-Wl,-rpath,/usr/lib/oracle/xe/app/oracle/product/10.2.0/server//lib -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server//lib -lclntsh”);

$dbstr =”(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.XX)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = YOURDATABASENAME)
)
)”;

if(!@($conn = oci_connect(’DBUSERNAME’,'DBPASSWORD’,$dbstr)))
{
print_r(ocierror());

}
else
{
echo “connected succesfully”;
}

—————————————————————————————–

Thanks

]]>
http://www.vinodkram.com/2009/06/how-to-establish-oracle-database-connection-in-php/feed/ 0
How to import data into mysql db from sql file http://www.vinodkram.com/2009/05/how-to-import-data-into-mysql-db-from-sql-file/ http://www.vinodkram.com/2009/05/how-to-import-data-into-mysql-db-from-sql-file/#comments Tue, 26 May 2009 10:15:50 +0000 vinodkram http://vinodkram.wordpress.com/?p=63 Open your shell prompt

navigate to the mysql directory (default is /var/lib/mysql)
cd /pathToYourMysqlDirectory/

then type the below command

$ mysql -u mysqlUserName -p Password -h HostName DatabaseName < /loactionOfYourSqlFile/yourSqlFileName.sql

Where
mysqlUserName = Mysql User Name
Password = Mysql User Password
HostName = Mysql Host Name (This could be local host or some remote IP where you want to import the database)
DatabaseName = Mysql Database Name
/loactionOfYourSqlFile/yourSqlFileName.sql = This is the location of your sql file

Note : This is work only in Linux system

Thanks

]]>
http://www.vinodkram.com/2009/05/how-to-import-data-into-mysql-db-from-sql-file/feed/ 0
How to copy file from local machine to remote server in linux http://www.vinodkram.com/2009/05/how-to-copy-file-from-local-machine-to-remote-server-in-linux/ http://www.vinodkram.com/2009/05/how-to-copy-file-from-local-machine-to-remote-server-in-linux/#comments Fri, 22 May 2009 14:02:33 +0000 vinodkram http://vinodkram.wordpress.com/?p=61 scp fileName userName@remoteServerIP:remoteServerFolderPath

Example :
>scp abc.txt root@XXX.XXX.XXX.XXX:/home/xyzFolder/

once you type this command, system will ask for the remote server login password.once password is verified , file get copied to remote server.

]]>
http://www.vinodkram.com/2009/05/how-to-copy-file-from-local-machine-to-remote-server-in-linux/feed/ 0