Skip to main content

Get Google Calendar Event List in WordPress

<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, ...

Add Google Map

<script>
<!--
function fullwin(){
window.open("bigpage.html","bfs","fullscreen,scrollbars")
}
//-->
</script>

<center>
<form>
<A HREF="#" OnClick="fullwin()">Open Full Screen Window</A>

</form>
</center>

<!DOCTYPE html>
<html>
<head>
<title>SAMRAT KESHARI PARIDA</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>

<script>
<!--
function fullwin(){
window.open("bigpage.html","bfs","fullscreen,scrollbars")
}
//-->
</script>
</head>
<body>

<div data-role="page">

<div data-role="header">
<h1>SAMRAT KESHARI PARIDA</h1>
</div><!-- /header -->

<div data-role="content">
<p>SAMRAT KESHARI PARIDA</p>
<div id='map-canvas' style="background-size:100%;height:300PX; width:300px; z-index:10000;"></div>
<div onclick="getDirction()"><A HREF="#">Getdirection </A></div>
<A HREF="#" OnClick="fullwin()">Open Full Screen Window</A>
</div><!-- /content -->

</div><!-- /page -->
<script>
var map1=
$( document ).ready(function() {

//var mylong=$('#mylong').val();
var myLatlng = new google.maps.LatLng(28.635308, 77.224960);
var mapOptions = {
zoom: 16,
center: myLatlng,
mapMaker: true,
mapTypeId: 'satellite'
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
map1=map;
var infowindow = new google.maps.InfoWindow({
content: '<p>SAMRAT KESHARI PARIDA<p>Kendrapara, Odisha</p>',
maxWidth: 500
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon:'samrat.png',
title: 'Hello World!'
});
google.maps.event.addListener(marker, 'click', function (event) {
infowindow.open(map, marker);
});
});

function onPositionUpdate(position) {
var  mylat = position.coords.latitude;
var mylong= position.coords.longitude;
var comlat=20.5176;
var comlong=86.38765;
//var comlat=38.907231
//var comlong=-77.036464;
var start = mylat+","+mylong;
var end = comlat+","+comlong;
var request =
{
origin:start,
destination:end,
travelMode: google.maps.DirectionsTravelMode.WALKING
};

var map = map1;

var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.setMap(map);

directionsService.route(request, function(response, status)
{
if (status == google.maps.DirectionsStatus.OK)
{
directionsDisplay.setDirections(response);
}
});
var latlng = new google.maps.LatLng(comlat,comlong);
directionsDisplay = new google.maps.DirectionsRenderer();
var myOptions = {
zoom: 14,
center: new google.maps.LatLng(comlat,comlong),
mapTypeId: 'satellite'
};
var map = new google.maps.Map(document.getElementById('map-canvas'),myOptions);

directionsDisplay.setMap(map);
var contentString = '';
var infowindow = new google.maps.InfoWindow({
content: contentString,
maxWidth:500
});
var marker = new google.maps.Marker({
position: map.getCenter(),
icon:'samrat.png',
map: map,
title: ''
});
google.maps.event.addListener(marker, 'click', function() {
//alert(1);
infowindow.open(map,marker);
});
}
function getDirction(){
navigator.geolocation.getCurrentPosition(onPositionUpdate);
}
</script>
</body>
</html>

Comments

Popular posts from this blog

Create Signature pad with save on database in php

Create Signature pad with save on database in php 1.create a folder images index.php ============   <!DOCTYPE >     <head>     <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />     <title>Signature Pad</title>     <script type="text/javascript" src="jquery-1.8.0.min.js"></script>     <script type="text/javascript"> $(document).ready(function () {     /** Set Canvas Size **/     var canvasWidth = 400;     var canvasHeight = 100;     /** IE SUPPORT **/     var canvasDiv = document.getElementById('signaturePad');     canvas = document.createElement('canvas');     canvas.setAttribute('width', canvasWidth);     canvas.setAttribute('height', canvasHeight);     canvas.setAttribute('id', 'canvas');     canvasDiv.appendChild(canvas);    ...

Get Google Calendar Event List in WordPress

<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, ...

WooCommerce Mini cart With Ajax

WooCommerce Mini cart //MINI CART SECTION   <div class="productdiv rightcart">                                                         <?php if ( ! WC()->cart->is_empty() ) : ?>     <ul class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr( $args['list_class'] ); ?>">         <?php             do_action( 'woocommerce_before_mini_cart_contents' );             foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {                 $_product     = apply_filters( 'woocommerce_cart_item_pro...