Show Lightbox on Page Load Using Only Html


LIGHTBOX EXAMPLE
Paste all the content here which you want to show on lightbox

Social Media Sharing Buttons for Website

Share

How to Store Facebook Like Count in Database

$node_id='nid of page';
$data_url='url of the webpage which you want to save in db';
$fql = "SELECT url, share_count, like_count, comment_count, total_count FROM link_stat WHERE url='$data_url'";
$json = file_get_contents('https://api.facebook.com/method/fql.query?format=json&query='.urlencode($fql));
$fblike=json_decode($json);
$fbcount=intval($fblike[0]->total_count);
$rec=db_query("INSERT INTO tablename (nid, count) VALUES ($node_id,$fbcount) ON DUPLICATE KEY UPDATE count=$fbcount");

How Remove Special Charecters from File Field in Drupal

function sukant_rout_init()
{
if (!empty($_FILES['files']))
{
foreach ($_FILES['files']['name'] as $field => $filename)
{
$_FILES['files']['name'][$field] = preg_replace('`[^\.a-z0-9]`i','_',$filename);
}
}
}
Replace sukant_rout by your module name

How to create template files of a content type or as url parameters or default template

Add Following function if not present in your template.php file in theme folder
function phptemplate_preprocess_page(&$vars, $hook)
{
$url= drupal_get_path_alias($_GET['q']);
//print_r($url);
if($url == "as your type get from url")
{
$vars['template_files'][] = "page-yourgivenname";
}
else if ($vars['node']->type != "")
{
$vars['template_files'][] = "page-node-" . $vars['node']->type;
}
else
{
$vars['template_files'][] = "page";
}
}

How to redirect the page to custom path after creating new content in Drupal

function myfb_nodeapi(&$node, $op, $teaser = NULL, $page = NULL)
{
global $user;
$uid=$user->uid;
if ($node->type == 'type of your node') {
if ($op == 'insert') {
drupal_set_message(t('Some message for creating content'));
$path="new path";
drupal_goto($path);
}
}
}

Custom module to save extra cck field information in db using fbouth module

function myfb_fboauth_user_save($account, $fbuser)
{
$time = time();
$profile_node = new stdClass();
$profile_node->title = $account->name;
$profile_node->body = '';
$profile_node->type = 'profile'; // Your specified content type
$profile_node->created = $time;
$profile_node->changed = $time;
$profile_node->status = 1;
$profile_node->promote = 0;
$profile_node->sticky = 0;
$profile_node->format = 1; // Filtered HTML
$profile_node->uid = $account->uid; // UID of content owner
$hometown=$fbuser->hometown->name;
if(!isset($hometown))
{
$hometown=$fbuser->location->name;
}
$profile_node->field_country[0]['value']=$hometown;
$profile_node->field_city[0]['value'] =$hometown;
node_save($profile_node);
}

Two Most Popular Storage Engines in MySql are InnoDB and MyISAM

1. InnoDB supports supports transactions which is not supported by MyISAM storage engine in tables.

2. InnoDB has record(row) level locking, relational integrity means supports foreign keys, which is not possible in MyISAM tables.

3. Performance of InnoDB for high volume data cannot be beaten by MyISAM engines.

4. Only the speed of tables are higher in case of MyIASM but due to of (InnoDB supports volume, transactions, integrity ) it is more popular.

5. MyISAM stores each table on disk with three files whose names begin with same as table name. These files have different extensions to differentiate their purpose. A .frm files stores the table format, and a .MYD (MYData) file stores the data of the table. If the table has indexes then these are stored in the .MYI (MYIndex) files.

6. InnoDB tables and their indexes are stored in the tablespace, which consists of several files. That is why InnoDB tables can be very large and can store large volume of data. The InnoDB storage engine maintains its own buffer pool for caching data and indexes in main memory.

Check the engines being used for existing tables

7. Syntax of InnoDB ==================

CREATE TABLE sukant test varchar(30) ENGINE = InnoDB;

It is also possible to convert from one engine to the other by command: ALTER TABLE tablename ENGINE=new_engine_name;

Syntax of MyISAM ================

Since MyISAM is the default engine assigned when creating a table, so you need not to specify it
Syntax of displaying the table status =======================================

show table status;

for perticular table status =================

show table status where Name = ‘tablename’;

How to Redirect to a Custom Page After Content Creation in Drupal

-> First create a folder named as myredirect on /sites/all/modules folder
-> Then creat following two file within myredirect folder
1. myredirect.module
function myredirect_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
if ($node->type == 'yourcontenttype') {
if ($op == 'insert') {
drupal_goto('yourcustompath');
}
}
}
2. myredirect.info
; $Id: myredirect.info,v 1.0 2012/10/04 17:42:28 Exp $
name = myredirect
description = this is my custom redirect module.
package = custom modules
core = 6.x


Thanks
sukant

Linux command for memory, cpu, hard disk, os version and php-mysql version


For memory information
/proc/meminfo
For cpu information
/proc/cpuinfo
For hard disk size
df -H
For os version info
/proc/version /etc/redhat-release
For php and mysql information
php -v rpm -q --all |grep mysql
apache version
rpm -q httpd