Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block nicolassaad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nicolassaad / ajax-greeting.php
Last active Dec 18, 2018
Timely Greeting (2.0.1) A PHP script that you can use on your site to automatically display a greeting based on what time of day it is for the user. TO USE: See Readme.txt file
View ajax-greeting.php
// Handle AJAX request
if( isset($_POST['value']) ){
// Storing the timezone offset from the jQuery code
$timezone_offset_minutes = $_POST['value'];
// Convert minutes to seconds
$timezone_name = timezone_name_from_abbr("", ($timezone_offset_minutes*60), false);
//JS code is needed to retrieve the user's timezone dynamically so we have it set statically for now
You can’t perform that action at this time.