Posted by vinodkram | Posted in Symfony | Posted on 25-12-2009
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
Posted by vinodkram | Posted in Symfony | Posted on 11-12-2009
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);
Posted by vinodkram | Posted in Symfony | Posted on 25-10-2009
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
Posted by admin | Posted in PERL | Posted on 20-08-2009
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”;
Posted by admin | Posted in linux | Posted on 14-08-2009
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
Posted by admin | Posted in PHP | Posted on 11-07-2009
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
Posted by vinodkram | Posted in javascript | Posted on 10-07-2009
<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 .
Posted by vinodkram | Posted in ORACLE | Posted on 03-06-2009
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
Posted by vinodkram | Posted in Mysql | Posted on 26-05-2009
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
Posted by vinodkram | Posted in Uncategorized | Posted on 22-05-2009
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.