Skip to main content

Posts

Showing posts from June, 2014

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,

Php cookies demo example

<?php error_reporting("E_ALL"); if(isset($_POST['reset'])) { $expire=time()-60*60*24*30; setcookie("setcookies", "", $expire); } if($_POST['email']) { $expire=time()+60*60*24*30; setcookie("setcookies", $_POST['email'], $expire); } if (isset($_COOKIE["setcookies"])) {   echo "<b style='color:red;'>".$_COOKIE["setcookies"]."</b> this email id available !<br>";   echo "if you want to delete email id then <form action='' method='post'><input type='submit' name='reset' value='Reset'></form>"; } else {   echo "Email not available!<br>"; ?> <form action="" method="post"> Email: <input type="email" name="email"> <input type="submit" name="send" value="Submit"> </form> <?php } ?>

post slider with content

<script> $(document).ready(function() { $('.1').show(); $('.member').click(function(){ var callss=this.id; $('.ContentDiv').css('display','none'); $('.'+callss).show(); }) //for slider  $('.sliderDiv').bxSlider({     slideWidth: 200,     minSlides: 2,     maxSlides: 3,     moveSlides: 3,     slideMargin: 1,       }); }); </script> <script> $(window).load(function() { $('.sliderDiv img').each(function() { $(this).wrap('<div style="display:inline-block;width:' + this.width + 'px;height:' + this.height + 'px;">').clone().addClass('gotcolors').css({'position': 'absolute', 'opacity' : 0 }).insertBefore(this); this.src = grayscale(this.src); }).animate({opacity: 1}, 500); }); $(document).ready(function() { $(".sliderDiv a").hover( function() { $(this).find('.gotcolors').stop(

how to add new position in joomla 2.5 template

 First, Insert your Template Position in the /squarez/templates/baseline/TemplateDetails.xml like this: Code: <positions>       <position>left</position>       <position>right</position>       <position>top</position>       <position>Samrat</position> </positions> Then I would Insert a new <div> here in the Index.php for the Panorama image viewer Code: <div id="ja-wrapper"> <!-- BEGIN: MAIN NAVIGATION --> <!-- BEGIN: HEADER --> <div id="ja-headerwrap">    <div id="ja-header" class="clearfix">       <h1 class="logo"><a href="/index.php">Direccion Central de Inteligencia Delictiva - DINTEL</a></h1>              <div id="ja-usertools">             <a href="http://www.dintel.gov.do/webmail">WEBMAIL</a>            </div>              <div id=&q

Add Time left for the special price in Magento:

<?php                             if ($_product[special_price] != NULL && $_product[special_to_date] > date('m/d/y h:i:s', time())){ $timestamp = strtotime("$_product[special_to_date]");     $timestamp =  date('m/d/Y h:i A', $timestamp);                             echo 'Time left for the special price:<br>';                                 ?>                                 <script language="JavaScript"> TargetDate = "<?php echo $timestamp; ?>"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script>                                                             <script

Related product show in table format in magneto

<div id="samrat">         <?php //Releted product show in table format in magento         $related_prods = $_product->getRelatedProductIds();         if (count($related_prods) > 0) {             ?>             <div class="featureproduct">                 <h3 class="title"><?php echo $this->__('Related') ?></h3>                 <table class="data-table  sortable" id="super-product-table">                     <colgroup><col><col><col>            <col width="1">                         <col width="1">                     </colgroup><thead>                         <tr>                             <th colspan="2" class="sortcol"><strong>Product</strong></th> <th class="a-center nosort"><strong>Price</strong></th