Wednesday, October 14, 2009

Add Favicon icon to drupal site

Now, to add it to drupal with a theme using the phptemplate engine is easy. Just upload the favicon.ico file to the base directory of your theme. The same directory your style.css file is in. Drupal will automatically detect it and do the work to make it display on your site.
If you are using something other than drupal than to have your favicon display will need one more step. Once the file is uploaded to the sever, the following piece of code needs to be up on your web pages in the
<head/>
:
<link rel="shortcut icon" href="/path/to/favicon.ico" type="image/x-icon" />
Just change the /path/to to the path to your favicon.ico file and your all set.

Add Front page to Drupal's home page

1. Within your theme, copy the file named page.tpl.php to page-front.tpl.php.
2. Note that the name page-front.tpl.php conforms to Drupal's naming standards, so Drupal will realize you want this to be the theme page for your front page.
3. Modify page-front.tpl.php to make your front page look the way you want it to. This page is really just a combination of HTML, CSS, PHP, and possibly JavaScript, so if you're comfortable working with these tools, this page can easily be modified.

Integrate tinyMCE with IMCE

# add this function to your current theme's template.php file.(create it if you don't have it.& put it into php clause )

/<?php
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {

static $access, $integrated;



if (!isset($access)) {

$access = function_exists('imce_access') && imce_access();

}



$init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);



if ($init && $access) {

$init['file_browser_callback'] = 'imceImageBrowser';

if (!isset($integrated)) {

$integrated = TRUE;

drupal_add_js("function imceImageBrowser(fid, url, type, win) {win.open(Drupal.settings.basePath +'?q=imce&app=TinyMCE|url@'+ fid, '', 'width=760,height=560,resizable=1');}", 'inline');

}

}

return $init;

}?/>


# Go to admin/settings/performance and Clear cached data (at the bottom).
# Make sure your users have access to IMCE (admin/settings/imce)
# Clear your browser's cache and start testing.

Wednesday, September 23, 2009

Steps to Install Google Chrome in Ubuntu

sudo gedit /etc/apt/sources.list

For Ubuntu 9.04

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main


Then,update the source list and install chromium

sudo apt-get update
sudo apt-get install chromium-browser

After installation you can open up the browser at Applications–>Internet–>Chromium Web Browser,right click on it and select “add this launcher to panel”

Friday, August 28, 2009

Java Script Validator .........

The JavaScript Code Quality Tool is very good reference link used for validating/finding error of your javascript code go for it

Saturday, June 6, 2009

Image Format Convertor : Script

To Covert all images from one folder from one format to another format

Create file test.sh
Add following line to that file

for i in *png

do
echo $i
temp=$(echo $i | sed -e 's|\.png||')
convert -resize 640x200 $i $temp.gif
done

Save file
Chmod +x test.sh
Run File : ./test.sh


Here I have used .png and .gif. We can try with other .jpg, .jpeg, tif, ttf, bmp etc.

Friday, May 29, 2009

mogrify : ImageMagic

Install ImageMagic :

apt-get install imagemagick

mogrify - With the use of resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. Mogrify overwrites the original image file, whereas, convert(1) writes to a different image file

e.g Let's resize images

mogrify -resize 500x300 Test/*.png
 

webcounter