Thursday, August 9, 2018

Drupal Menu not Saving Due to max_input_vars

Add below line to the php.ini or .user.ini which is located in site root folder, if this file is not available you care create and add this line and upload it to the server.
------------------------------------------
max_input_vars = 2000
------------------------------------------

OR

Add these lines to your .htaccess file:
php_value post_max_size = 20000M
php_value upload_max_filesize = 20000M
php_value max_execution_time = 30000
php_value max_input_time = 60000
php_value memory_limit = 8000M
php_value max_input_vars = 8000
php_value suhosin.post.max_vars = 8000
php_value suhosin.request.max_vars = 8000

Tuesday, June 19, 2018

Drupal special characters showing like & and   etc... in drupal page title. Code for fix

Replace below code in page.tpl:
<?php print html_entity_decode($head_title) ?>
instead of
<?php //print $title; ?>

Wednesday, November 8, 2017

Youtube Video Link directly to particular time


Here is the Youtube Video Link directly to particular time link code.

https://www.youtube.com/watch?v=whGwm0Lky2s&feature=youtu.be&t=14m11s

Thursday, April 20, 2017

How to add drupal block into a node?

<?php
     $block = module_invoke('block_name', 'block_view', 'block_id');
     print render($block['content']);
 ?>

Wednesday, July 13, 2016

Countdown Timer / Days count in Business days code in PHP

<?php
$start = new DateTime(null, new DateTimeZone('America/New_York'));
$end = new DateTime('2017-05-05');
// otherwise the  end date is excluded (bug?)
$end->modify('+1 day');

$interval = $end->diff($start);

// total days
$days = $interval->days;

// create an iterateable period of date (P1D equates to 1 day)
$period = new DatePeriod($start, new DateInterval('P1D'), $end);

// best stored as array, so you can add more than one
//$holidays = array('2012-09-07');

foreach($period as $dt) {
    $curr = $dt->format('D');

    // for the updated question
   // if (in_array($dt->format('Y-m-d'), $holidays)) {
     //  $days--;
   // }

    // substract if Saturday or Sunday
    if ($curr == 'Sat' || $curr == 'Sun') {
        $days--;
    }
}


echo $days; // 4?>

Sunday, March 13, 2016

The Future of Angular - Write Code. Learn Angular.

The  Angular is the most important in future for any web applications, it has more features and easy to implement what you want. In the future the trend of web desing is going off and using the latest platform  like bootstrap and Angular Js. these are most important in present trend.

There are lot of predefined codes are available to just do plug and play. So better to focus on latest frameworks and learn and use them on your works for better quality output.

Here are few website to follow:
http://www.learn-angular.org/
https://thinkster.io/a-better-way-to-learn-angularjs
https://www.codecademy.com/learn/learn-angularjs
http://www.w3schools.com/angular/


Monday, February 29, 2016

RGB to CMYK: how to prepare photos for print in Photoshop

In this photo editing tutorial we show you how to convert images from RGB to CMYK in Photoshop to produce perfect colour prints.
RGB to CMYK: how to prepare photos for print in Photoshop
After processing a photo to look good on screen, you may end up with a print that suffers from shifts in colour. The discrepancy between the screen and print colour is caused by a variety of factors.
Your computer’s screen produces millions of colours by mixing reds, greens and blues (RGB) together, while most domestic printers combine cyan, magenta, black and yellow (CMYK) inks to create a narrower range of colours. Colours that can’t be printed are referred to as ‘out-of-gamut’ colours.
In this tutorial we’ll demonstrate how to prepare a picture for print and avoid colour-related disappointments. By default, Photoshop uses the screen-friendly colour space called sRGB (standard RGB).
You can change this colour space to a narrower, more printable one called Adobe RGB (1998) that helps you reduce the number of out-of-gamut colours. There’s also a handy gamut warning that you can summon to identify unprintable colours.
We’ll show you how to set up Photoshop’s colour management tools so that you can convert files that have an unprintable sRGB colour space to the printer-compatible Adobe RGB (1998) colour space.
We’ll also demonstrate how to change Photoshop’s colour mode so it’s compatible with the printer’s CMYK ink-mixing technique, so that your images have a vibrant, printable range of colours.

How to convert photos from RGB to CMYK

How to convert photos from RGB to CMYK: step 1
01 Manage your colours
Go to Edit > Color Settings. In the Color Settings window, choose an appropriate location-based profile such as Europe Prepress 3. This will ensure Photoshop uses a print-friendly colour space called Adobe RGB (1998) instead of the default sRGB one. Leave the Profile Mismatch boxes ticked.
How to convert photos from RGB to CMYK: step 2
02 Convert the embedded profile
Download our start file and follow along! Open print_start.jpg. The embedded colour profile of this image describes its colours using the screen-friendly sRGB colour space. You can change the sRGB profile to a printer-compatible one by ticking the ‘Convert document’s colors to the working space’ button. Click OK to close the dialog box.
How to convert photos from RGB to CMYK: step 3
03 Gamut warning
To discover remaining unprintable colours, choose View > Gamut Warning. Problematic colours will appear as patches of grey. You could use a Vibrance adjustment layer to reduce the saturation of the colours. The gamut warning patches would vanish, but other colours may look a bit drab.
How to convert photos from RGB to CMYK: step 4
04 Change the mode
Go to Mode and choose CMYK Color. Click OK. This forces the colours into a print-compatible CMYK colour space. The gamut warning patches will vanish. Choose Mode > RGB Color. You can now use a Vibrance adjustment layer to boost the saturation without producing warnings.