open [Wamp Installation Dir]\bin\mysql\[mysql vX.X]\my-innodb-heavy-4G.ini
Search for
default-storage-engine = MYISAM
and Replace with
default-storage-engine = InnoDB
open [Wamp Installation Dir]\bin\mysql\[mysql vX.X]\my-innodb-heavy-4G.ini
Search for
default-storage-engine = MYISAM
and Replace with
default-storage-engine = InnoDB
Posted in MYSQL | Leave a Comment »
<html>
<head>
<style type=”text/css”>
/* administrative hover links */
div.view div.views-admin-links {
font-size: xx-small;
margin-right: 1em;
margin-top: 1em;
width: 30px;
}
.main div.view div.views-admin-links {
margin-top: 0;
}
div.view div.views-admin-links ul {
padding-left: 0;
list-style-type:none;
}
div.view div.views-admin-links li a {
color: #ccc;
}
div.view div.views-admin-links li {
padding-bottom: 2px;
z-index: 201;
}
div.view div.views-admin-links-hover a,
div.view div.views-admin-links:hover a {
color: #000;
}
div.view div.views-admin-links-hover,
div.view div.views-admin-links:hover {
background: transparent;;
}
div.view div.views-admin-links a:before {
content: “[";
}
div.view div.views-admin-links a:after {
content: "]“;
}
div.view div.views-hide {
display: none;
}
/** For IE we add the class via js; for other browsers we rely on :hover **/
div.view div.views-hide-hover,
div.view:hover div.views-hide {
display: block;
position: absolute;
z-index: 200;
}
/* don’t do this one in IE */
div.view:hover div.views-hide {
margin-top: -1.5em;
}
/* Remove the border on tbody that system puts in */
.views-view-grid tbody {
border-top: none;
}
/*.view{
float:left;
}*/
.main{
float:left;
width:500px;
height:100px;
}
</style>
</head>
<body>
<div>
<div>
<div>
<ul><li><a href=”[link]“>Edit</a></li>
</ul>
</div>
<div>Text</div>
<div>Footer</div>
</div>
</div>
<div>
<div>
<div>
<ul><li><a href=”[link]“>Edit</a></li>
</ul>
</div>
<div>Text</div>
<div>Footer</div>
</div>
</div>
</body>
</html>
Posted in drupal | Leave a Comment »
<Directory D:\wamp\www\localdir>
Order Deny,Allow
Allow from all
</Directory>
<Directory D:/wamp/www>
Order Deny,Allow
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot D:/wamp/www
ServerName localhost
</VirtualHost>
[Server Name]
<VirtualHost *:80>
DocumentRoot D:/wamp/www
ServerName calbl06ba48d
</VirtualHost>
[Machine IP]
<VirtualHost *:80>
DocumentRoot D:/wamp/www
ServerName 10.227.73.71
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/wamp/www/dev
ServerName www.localdev.com
</VirtualHost>
Posted in 1 | Leave a Comment »
preg_match(“/.*\/\/(.*)@.*$/”,”http://info@abc.com”,$data);
print_r($data);
// O/P : Array ( [0] => http://info@abc.com [1] => info )
preg_match(“/(.*):\/\/(.*)@(.*)\.(.*)$/”,”http://info@abc.com”,$data);
print_r($data);
// O/P : Array ( [0] => http://info@abc.com [1] => http [2] => info [3] => abc [4] => com )
Posted in 1 | Leave a Comment »
http://drupal.org/node/291799
In the new system you just need to know the timezone name and either the UTC or local time. We store the UTC time and the timezone name in the database (in two separate fields). We retrieve that data and do:<?php
$date = the UTC value from the database
$local_zone = the name of the local timezone
$type = the type of date value, DATE_DATETIME, DATE_ISO, or DATE_UNIX
$date = date_make_date($date, 'UTC', $type);
date_timezone_set($date, timezone_open($local_zone));
$date now contains the local value of the date.
Output it like:
print date_format_date($date, 'custom', 'm/d/Y H:i');
To convert a local date back to UTC to store it in the database, do:
<?php
$date = local date value
$local_zone = the name of the local timezone
$type = the type of date value, DATE_DATETIME, DATE_ISO, or DATE_UNIX
$date
= date_make_date($date, $local_zone, $type);
date_timezone_set($date, timezone_open('UTC'));
$date now contains the UTC value of the date.
Output it like:
print
date_format_date($date, 'custom', 'm/d/Y H:i');
?>Posted in 1 | Leave a Comment »
function cpaglobal_preprocess_page(&$vars) {
$vars['styles'] = drupal_get_css_custom();
$vars['scripts'] = drupal_get_js_custom();
}
function drupal_get_css_custom($css = NULL) {
$output = ”;
if (!isset($css)) {
$css = drupal_add_css();
}
$url = explode( “/”, $_REQUEST['q'] );
if( $url[0] == ‘ip-review-online’ )
{
$css['all']['theme'][drupal_get_path('theme', 'cpaglobal').'/ipreview.css'] = 1;
$css['all']['theme'][drupal_get_path('theme', 'cpaglobal').'/articles.css'] = 1;
$css['all']['theme'][drupal_get_path('theme', 'cpaglobal').'/dropdown_ipreview.css'] = 1;
}
else
{
$css['all']['theme'][drupal_get_path('theme', 'cpaglobal').'/dropdown.css'] = 1;
}
$no_module_preprocess = ”;
$no_theme_preprocess = ”;
$preprocess_css = (variable_get(‘preprocess_css’, FALSE) && (!defined(‘MAINTENANCE_MODE’) || MAINTENANCE_MODE != ‘update’));
$directory = file_directory_path();
$is_writable = is_dir($directory) && is_writable($directory);
// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed.
$query_string = ‘?’. substr(variable_get(‘css_js_query_string’, ’0′), 0, 1);
foreach ($css as $media => $types) {
// If CSS preprocessing is off, we still need to output the styles.
// Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones.
foreach ($types as $type => $files) {
if ($type == ‘module’) {
// Setup theme overrides for module styles.
$theme_styles = array();
foreach (array_keys($css[$media]['theme']) as $theme_style) {
$theme_styles[] = basename($theme_style);
}
}
foreach ($types[$type] as $file => $preprocess) {
// If the theme supplies its own style using the name of the module style, skip its inclusion.
// This includes any RTL styles associated with its main LTR counterpart.
if ($type == ‘module’ && in_array(str_replace(‘-rtl.css’, ‘.css’, basename($file)), $theme_styles)) {
// Unset the file to prevent its inclusion when CSS aggregation is enabled.
unset($types[$type][$file]);
continue;
}
// Only include the stylesheet if it exists.
if (file_exists($file)) {
if (!$preprocess || !($is_writable && $preprocess_css)) {
// If a CSS file is not to be preprocessed and it’s a module CSS file, it needs to *always* appear at the *top*,
// regardless of whether preprocessing is on or off.
if (!$preprocess && $type == ‘module’) {
$no_module_preprocess .= ‘<link type=”text/css” rel=”stylesheet” media=”‘. $media .’” href=”‘. base_path() . $file . $query_string .’” />’.”\n”;
}
// If a CSS file is not to be preprocessed and it’s a theme CSS file, it needs to *always* appear at the *bottom*,
// regardless of whether preprocessing is on or off.
else if (!$preprocess && $type == ‘theme’) {
$no_theme_preprocess .= ‘<link type=”text/css” rel=”stylesheet” media=”‘. $media .’” href=”‘. base_path() . $file . $query_string .’” />’.”\n”;
}
else {
$output .= ‘<link type=”text/css” rel=”stylesheet” media=”‘. $media .’” href=”‘. base_path() . $file . $query_string .’” />’.”\n”;
}
}
}
}
}
if ($is_writable && $preprocess_css) {
$filename = md5(serialize($types) . $query_string) .’.css’;
$preprocess_file = drupal_build_css_cache($types, $filename);
$output .= ‘<link type=”text/css” rel=”stylesheet” media=”‘. $media .’” href=”‘. base_path() . $preprocess_file .’” />’.”\n”;
}
}
return $no_module_preprocess . $output . $no_theme_preprocess;
}
function drupal_get_js_custom($scope = ‘header’, $javascript = NULL) {
if ((!defined(‘MAINTENANCE_MODE’) || MAINTENANCE_MODE != ‘update’) && function_exists(‘locale_update_js_files’)) {
locale_update_js_files();
}
if (!isset($javascript)) {
$javascript = drupal_add_js(NULL, NULL, $scope);
}
if (empty($javascript)) {
return ”;
}
$output = ”;
$preprocessed = ”;
$no_preprocess = array(‘core’ => ”, ‘module’ => ”, ‘theme’ => ”);
$files = array();
$preprocess_js = (variable_get(‘preprocess_js’, FALSE) && (!defined(‘MAINTENANCE_MODE’) || MAINTENANCE_MODE != ‘update’));
$directory = file_directory_path();
$is_writable = is_dir($directory) && is_writable($directory);
// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed. Files that should not be cached (see drupal_add_js())
// get time() as query-string instead, to enforce reload on every
// page request.
$query_string = ‘?’. substr(variable_get(‘css_js_query_string’, ’0′), 0, 1);
// For inline Javascript to validate as XHTML, all Javascript containing
// XHTML needs to be wrapped in CDATA. To make that backwards compatible
// with HTML 4, we need to comment out the CDATA-tag.
$embed_prefix = “\n<!–//–><![CDATA[//><!--\n";
$embed_suffix = "\n//--><!]]>\n”;
foreach ($javascript as $type => $data) {
if (!$data) continue;
switch ($type) {
case ‘setting’:
$output .= ‘<script type=”text/javascript”>’ . $embed_prefix . ‘jQuery.extend(Drupal.settings, ‘ . drupal_to_js(call_user_func_array(‘array_merge_recursive’, $data)) . “);” . $embed_suffix . “</script>\n”;
break;
case ‘inline’:
foreach ($data as $info) {
$output .= ‘<script type=”text/javascript”‘ . ($info['defer'] ? ‘ defer=”defer”‘ : ”) . ‘>’ . $embed_prefix . $info['code'] . $embed_suffix . “</script>\n”;
}
break;
default:
// If JS preprocessing is off, we still need to output the scripts.
// Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
foreach ($data as $path => $info) {
$path_parts = explode(‘/’, $path);
if (in_array(“wysiwyg”, $path_parts)) $info['preprocess'] = ”;
if (!$info['preprocess'] || !$is_writable || !$preprocess_js) {
$no_preprocess[$type] .= ‘<script type=”text/javascript”‘. ($info['defer'] ? ‘ defer=”defer”‘ : ”) .’ src=”‘. base_path() . $path . ($info['cache'] ? $query_string : ‘?’. time()) .”\”></script>\n”;
}
else {
$files[$path] = $info;
}
}
}
}
// Aggregate any remaining JS files that haven’t already been output.
if ($is_writable && $preprocess_js && count($files) > 0) {
$filename = md5(serialize($files) . $query_string) .’.js’;
$preprocess_file = drupal_build_js_cache($files, $filename);
$preprocessed .= ‘<script type=”text/javascript” src=”‘. base_path() . $preprocess_file .’”></script>’.”\n”;
}
// Keep the order of JS files consistent as some are preprocessed and others are not.
// Make sure any inline or JS setting variables appear last after libraries have loaded.
$output = $preprocessed . implode(”, $no_preprocess) . $output;
return $output;
}
Posted in drupal | Tagged drupal | Leave a Comment »
<form action=”<?php print base_path() ?>search/node” method=”post” id=”search-form”>
<input type=”text” value=”" size=”18″ name=”keys” />
<input type=”submit” value=”>>” name=”op” title=”Search” alt=”Search” />
<input type=”hidden” value=”<?php print drupal_get_token(‘search_form’); ?>” name=”form_token” />
<input type=”hidden” value=”search_form” id=”edit-search-form” name=”form_id” />
</form>
Posted in drupal | Tagged drupal | 2 Comments »
// set to the user defined error handler
$old_error_handler = set_error_handler(“myErrorHandler”);
// error handler function
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
global $user;
print_r($user);
drupal_set_message(‘The Server is Connected with Databse in Read(r+) Mode’);*/
/*switch ($errno) {
case E_USER_ERROR:
echo “<b>My ERROR</b> [$errno] $errstr<br />\n”;
echo “ Fatal error on line $errline in file $errfile”;
echo “, PHP ” . PHP_VERSION . ” (” . PHP_OS . “)<br />\n”;
echo “Aborting…<br />\n”;
exit(1);
break;
case E_USER_WARNING:
echo “<b>My WARNING</b> [$errno] $errstr<br />\n”;
break;
case E_USER_NOTICE:
echo “<b>My NOTICE</b> [$errno] $errstr<br />\n”;
break;
default:
echo “Unknown error type: [$errno] $errstr<br />\n”;
break;
}*/
/* Don’t execute PHP internal error handler */
return true;
}
Posted in Core PHP | Tagged Core PHP | Leave a Comment »
OFF :
error_reporting(0);
ini_set(‘display_errors’, 0);
ON :
error_reporting(1);
ini_set(‘display_errors’, 1);
Posted in Core PHP | Tagged Core PHP | Leave a Comment »
Restricting Key By Javascript
<!–<script language=”javascript”>
function restrict_keyRestrict(e, validchars)
{
if(e.keyCode){
return false;
}
var key=”, keychar=”;
key = restrict_getKeyCode(e);
if (key == null) return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
validchars = validchars.toLowerCase();
if (validchars.indexOf(keychar) != -1)
return true;
if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
return true;
//alert(“Plese enter a valid character.”);
return false;
}
function restrict_getKeyCode(e)
{
if (window.event)
return window.event.keyCode;
else if (e)
return e.which;
else
return null;
}
</script>–>
Posted in Javascript | Tagged Javascript | Leave a Comment »