Vijay Lathiya

Php Opensource Developer with writing articles on Php,HTML,CSS,jQuery, Google Map etc technologies area on blogger

Welcome to Vijay Lathiya Blog

I'm very thankfull for visiting my blog.

Wordpress Website development Surat

Google Map API Services

Google Map API V3 for get location with Lat-Long, Distance between two place and many more stuff you will get from my blog

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Sunday, November 16, 2014

Import Outlook Email to Gmail

Import Email from Outlook / Hotmail to Gmail


Yesterday I have call from my friend as he need my help to import all emails from his recently used Outlook.com account mail to his newly created Gmail account. After searching on Internet I see that on internet there are a number of articles for how to import your email from Gmail Account to Outlook, but no any clear instructions for importing the outlook (hotmail) mail to Gmail.
After checking Gmail account setting I found that it’s very easy to migrate mail from Outloook to Gmail.
Follow below simple step and relax by import your all existing mail to Gmail Account
  • 1. Log into your new Gmail account and click the gear icon and choose the Settings.
  • 2. In the Settings tabs, click on 4th tab "Accounts and Import"
  • 3. In Next step look at Check mail from other accounts (using POP3), click "Add a POP3 mail account you own"
  • 4. Put an email address in the Email Address Textbox to get email from that account and press next step button.
  • 5. Add your Outlook.com mail account username and password.
  • 6. Check – uncheck other option if you want to leave a copy of retrieved message on the Outlook account.
  • 7. If you getting connection error, you need to enable POP connection on Outlook.com. to activate Go to your Outlook.com settings, click on "Connect devices and apps with POP" and make it enable Pop.

Sunday, August 31, 2014

Generate Thumb in WP

In Wordpress its very easy to generate any size thumb of uploaded image using wp add_theme_support function.

WP add_theme_support() function create a thumb copy of the uploaded image with the specified dimensions when a new image is uploaded from the media gallery.

<?php add_image_size( $thumb-type-name, $width, $height, $crop); ?>


Note: To enable featured images with add_image_size function  in current theme it must include add_theme_support( 'post-thumbnails' ); in itsfunctions.php file. 

Parameters :
$thumb-type-name (string) (required)
- The new image size name.
Default: None

$width (int) (optional)
- The post thumbnail width in pixels.
Default: 0

$height (int) (optional)
- The post thumbnail height in pixels.
Default: 0

$crop (boolean/array) (optional) see Hard crop vs Soft crop
- crop images to specified height and width or resize based on soft and hard crop
  • false - Soft proportional crop mode.
  • true - Hard crop mode.
  • array - Specify positioning of the crop area (x_crop_position, y_crop_position).

Saturday, August 30, 2014

WP hard crop vs soft crop


In Wordpress, During work with Media Gallery Image upload i see that my uploaded image hard cropped to a specif size thumnail with some part of the image is chopped off.

so i tried to find out reason and setting provided by Wordpress framework. within few moment search i find out that in Wordpress there is setting for "Crop thumbnail to exact dimensions" with checkbox inside WordPress Dashboard > Media > Thumbnail size

With “Crop thumbnail to exact dimensions” option check and uncheck  we getting different types uploaded images thumbnail.



See Generate Custom size thumb in Wordpress

Example  : Im using following Wordpress logo image with orizinal size width 473 px and height  348 px



Checkbox checked - Hard Crop Image

The uploaded image is cropped to a thumbnail of 150 x 150 Px. here we can see that how some part of the image is chopped off so that it can fit it into the hard set 150px x 150px size.



Checkbox un-checked - Soft Crop Image
with soft crop case thumb of image should be generated with  either given width or height width (Contstrain Proportions) and corresponding width or height without chopped images.

Below thumbnail generated with 150px width and 110px height in soft cropped case.


while we install wordpress than by default checkbox checked so all thumbnail images will be hard cropped by default and all uploaded images  chopped off as .

WordPress by default checks this checkbox for you when installed so all your thumbnail images will be hard cropped by default. I personally don’t think that’s a good idea and always turn the checkbox off so my resized thumbnails still sees the full picture, instead of a cropped/chopped off thumbnail image.

if you want your uploaded images all thumbnail generated with the full picture instead of a cropped/chopped original image than i suggest keep unchecked (off) option "Crop thumbnail to exact dimensions" checkbox that is inside WordPress Dashboard > Media > Thumbnail size

References  : davidtan.org

Monday, August 25, 2014

Paypal customer return to Site

- Like our functionality for E-commerce Online Shopping site, mostly all require to get back thier customer on the website with Payment responce status to update on website after  payment done on Paypal

Follow below step & Image snap to Return back Customers to Website after payment done using Paypal

1 Log in and click the Profile subtab under My Account.
2 Click the My Selling Tools
3 Website Payment Preferences
4 Click the On radio button to enable Auto Return.  Enter the Return URL. Note: You must meet the Return URL requirements in order to set up Auto Return. Learn more about Return URL.
5 Click the On radio button to Payment Datat Transfer



 Source : Paypal 

Wednesday, August 20, 2014

Use WP Site Theme url in Javascript

To use wordpress Site URL, Theme Url or any information that you are fetching using wordpress default function and want to use it in Javascript that is either Internal or external.

If javascript code used in internal .php file than you can directly call wp function using <?php ?> in Javascript but main confusion is what is the best way while want to use in External .js file because we cant use Php script in External .js file.

In this case  2 possible solution.
1 Declare JS variable in header.php and assign value it
2 use WP wp_localize_script function : Localizes a registered script with data for a JavaScript variable. more

Example :
<?php 
wp_localize_script( 'custom-js', 'wpcj_variable', array( 'template_url' => get_bloginfo('template_url'),   'site_url' => get_bloginfo('url')));
?>
To use in Javascript
<script>
alert(wpcj_variable.template_url);
alert(wpcj_variable.site_url);
</script>


Wednesday, July 30, 2014

Decimal Number upto 2 Places Javascript Validation

Today, Im going to share very simple yet very useful Javascript validation for allow user to enter only Decimal value upto 2 place after . in Textbox as well as Only Integer 1-9 number allows in Textbox validation using Javascript.

Only Decimal Number upto 2 number after . Allow in Textbox using Javascript Validation

<script type="text/javascript">

//Decimal value validation using Javascript 
function decimalAmount(myfield, e, dec)
{
 var str = myfield.value;
 var decPos = str.split('.');

 var key;
 var keychar;

if (window.event)
 key = window.event.keyCode;
else if (e)
 key = e.which;
else
 return true;
 
keychar = String.fromCharCode(key);

if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) // control keys
 return true;
else if(decPos.length > 1)
{
 decPos = decPos[1];
 if(decPos.length >= 2) return false;
}
else if ((("0123456789.").indexOf(keychar) > -1)) // numbers
 return true;
else if (dec && (keychar == ".")) // decimal point jump
{
 myfield.form.elements[dec].focus();
 return false;
}
else
 return false;
}
</script>

Only Number 1-9 Allow in Textbox Javascript Validation

<script type="text/javascript">
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;

keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
   return true;
else if ((("0123456789").indexOf(keychar) > -1))
   return true;
else if (dec && (keychar == ".")) // decimal point jump
{
 myfield.form.elements[dec].focus();
 return false;
}
else
   return false;
}
</script>

How to Call/use above Function with Textbox

Call above function as per your requirement on textbox onKeyPress event, hence function call on every key press event and check user input value ok or not.
<input id="amount" type="text" name="amount" class="required number" onKeyPress="return onlyAmount(this, event)"/>

Sunday, July 27, 2014

Remove Omiga Plus from Chrome & Mozila Browser

After downloading one infected file from Torrent, my both Chrome & Mozilla browser setting change and  infected with Omiga Plus search, now problem is according to my habit for search anything i directly type in the browser address bar  instead of 1st open Google.com or yahoo.com. now problem is after infection when ever i search anything it showing result with ISearch.Omiga-plus.com that is completely unexpected for me.



To remove Omiga Plus i try with various option ie.
1 check Add / Remove program from Control Panel but not found any installed Program that relate of Omiga Plus search,

2 Check Addons, Extension of Mozilla as well as Chrome Browser

3 Run CCleaner removal tool

after all still problem exist...

Atlast, To find out solution for Remove Omiga Plus from Browser i search on Google by type "How to remove Omiga Plus" here many person suggest different different solutions, i try with top 3 suggest solution and spent my 30 minute but no hope and at-last i found solution at how-to-remove.com and within 2 minute Omiga Plus remove from my PC browser and it working fine as earlier..

To save time for others who fetching same issue and looking solutions for Remove Omiga Plus i'm sharing below steps that worked for me.

Remove Omiga Plus from Google Chrome

- Open Chrome.
- Click on the Chrome toolbar menu button (Right side of Address Bar)
- Select Settings.
- Scroll down to the end of the page, and expand Show advanced settings.
- Scroll down once again to the end of the page and click Reset browser settings button.
- Click Reset once more.

Remove Omiga Plus from Open Mozilla Firefox


- At the top of the Firefox window, click the Firefox button,
- Go over to the Help sub-menu,
- then select Troubleshooting Information.
- Click the Reset Firefox button in the upper-right corner of the Troubleshooting Information page.

If any other solution work for you.share it via comment for others.