<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function get_calender_events() { $params = array(); /*Get current date*/ $current_date = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key = "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"] . ":" .
$_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$pageURL = curPageURL();
$uri_parts = explode('?', $pageURL , 2);
if($uri_parts[1]=="___store=nl&___from_store=nl")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=en&___from_store=en")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=nl&___from_store=en")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=en&___from_store=nl")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
?>
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"] . ":" .
$_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$pageURL = curPageURL();
$uri_parts = explode('?', $pageURL , 2);
if($uri_parts[1]=="___store=nl&___from_store=nl")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=en&___from_store=en")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=nl&___from_store=en")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
if($uri_parts[1]=="___store=en&___from_store=nl")
{
?>
<script type="text/javascript"> window.location="<?php echo $uri_parts[0]; ?>";</script>
<?php
}
?>
Comments
Post a Comment