Skip to main content

Posts

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

Create Category attribute in magento

app\code\community\Samrat\SamratAttribute\etc\config.xml <?xml version="1.0"?> <config>     <modules>         <Samrat_SamratAttribute>             <version>0.0.1</version>         </Samrat_SamratAttribute>     </modules>     <global>         <resources>             <add_samrat_attribute>                 <setup>                     <module>Samrat_SamratAttribute</module>                     <class>Mage_Catalog_Model_Resource_Setup</class>                 </setup>                 <connection>   ...

Add custom image/textarea attribute to category

Just copy paste the below code in header.phtml and run yourmagento once, your attribute will be created and you can see in backend under manage category. After you are done remove this code again. <?php $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $setup->addAttribute('catalog_category', 'sliderimage', array(     'group'         => 'General',     'input'         => 'image',     'type'          => 'varchar',     'label'         => 'Slider Image',     'backend'       => 'catalog/category_attribute_backend_image',     'visible'       => 1,     'required'        => 0,     'user_defined' => 1,     'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, )); ?> <?...

User check 30 days

Corn job https://www.setcronjob.com/manage/cron <?php ################################################################# //isFrontEndMember(); ################################################################# $SECTION_NAME='User'; $SECTION_TABLE=TBL_USER_NAME; $SECTION_FIELD_PREFIX=TBL_USER_PREFIX; $SECTION_VIEW_PAGE=FRT_USER_CHECK_FILE; $SECTION_MANAGE_PAGE=FRT_USER_CHECK_FILE; $sql=getSelectListQuery($SECTION_TABLE,$SECTION_FIELD_PREFIX); //$date = date ( 'Y-m-d H:i:s'); $date = getSiteTimezone();     $newdate = strtotime ( '-30 days' , strtotime ( $date ) ) ;     $newdate = date ( 'Y-m-d H:i:s' , $newdate );     //echo $newdate; $newdate2 = strtotime ( '-364 day' , strtotime ( $date ) ) ; $newdate2 = date ( 'Y-m-j H:i:s' , $newdate );     $sql.=" AND ".TBL_USER_PREFIX.TBL_USER_LEVEL_PREFIX."id=3"; $result_query=$dbc->select($sql); $total_row=count($result_quer...

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