This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$(document).on("click", "a.next_button", function(){ | |
var id = parseInt($(this).attr('id').split('_')[2],10); | |
var id_to_show = id+1; | |
$('div.data_div_'+id).hide(); | |
$('div.data_div_'+id_to_show).show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function post_curl($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
return $output; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setCookie(c_name,value,exdays) { | |
var exdate=new Date(); | |
exdate.setDate(exdate.getDate() + exdays); | |
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); | |
document.cookie=c_name + "=" + c_value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCookie(c_name) { | |
var i,x,y,ARRcookies=document.cookie.split(";"); | |
for (i=0;i<ARRcookies.length;i++) | |
{ | |
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); | |
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); | |
x=x.replace(/^\s+|\s+$/g,""); | |
if (x==c_name) | |
{ | |
return unescape(y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cities = []; | |
$('div.weather_wrapper').each(function(idx) { | |
cities.push($(this).attr('id')); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cities = ['delhi', 'mumbai', 'pune']; | |
function getRandomCity() { | |
return cities[Math.floor(Math.random() * cities.length)]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check for cookie and show default city | |
if( typeof getCookie('city_name') == 'undefined') { | |
$('div#delhi').show(); | |
} else { | |
var cookie_city = getCookie('city_name'); | |
$('div#'+cookie_city).show(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This is wordpress API for importing data from text file | |
* http://localhost/sandbox/wordpress/wp-content/plugins/data_import/import_data.php | |
*/ | |
//load wordpress functions | |
require_once("../../../wp-load.php"); | |
//path of text file from where posts need to be imported |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* list all files in a directory & subdirectory | |
* @param string $directory path to dir | |
* @param boolean $recursive weather recurisve listing or not | |
* @return array list of contents in dir | |
*/ | |
function directoryToArray($directory, $recursive=false) { | |
$array_items = array(); | |
if ($handle = opendir($directory)) { | |
while (false !== ($file = readdir($handle))) { |
OlderNewer