Skip to: site menu |main content

Welcome to my personal site. If You have any question or suggestion please feel free to contact me from contact page.

Advertisements

Contact me to place your Ads Here..

Powered by Drupal, an open source content management system

Syndicate

Syndicate content
 
 

August 2010

Detect Flash enabled in IE and firefox

var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
}
if(!hasFlash)window.location="/static-content.html";

Extract Sql.gz and tar.gz file Drupal and Linux

If you want to decompress / extract an sql archive generated from phpmyadmin you can do it easily:-

gunzip myolddrupaldb.sql.gz

Also you can use tar command for extracting drupal archive in gz. format. e.g a file like drupal-6.15.tar.gz

tar -zxvf Drupal-6.15.tar.gz

Execute Drupal Php script for documents

<?php
if($_REQUEST['idebug']){
for($i=0;$i<=10;$i++){
$node = new stdClass();
$node->type = 'story'; // Your specified content type
$node->created = time();
$node->changed = $node->created;
$node->status = 1;
$node->promote = 1;
$node->sticky = 0;
$node->format = 1; // Filtered HTML

Remove Delete All .svn files and directories from Drupal INstallation

Want to bulk delete .svn folders recursively?

Warning: Before you use this command make sure you have changed to the correct directory where you want to apply this. example:
Lets say you want to delete all .svn files from drupal folder "inderweb"

cd htdocs/inderweb

find -name "\.svn" -exec rm -rf {} \;


rm -rf `find . -type d -name .svn`

Mysql Sorting Field function ,Number And character fields Mysql

For sorting in ascending order numbers which are written in text or characters:-
mysql> select number from (table) order by number;
+--------+
| number |
+--------+
| 1 |
| 10 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
+--------+

Use this:

Back to top

Recent comments

InderSingh.com v1.2
(Feb 05, 2012)