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
-- phpMyAdmin SQL Dump | |
-- version 2.11.6 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost:3306 | |
-- Generation Time: Jan 11, 2013 at 04:24 PM | |
-- Server version: 5.0.51 | |
-- PHP Version: 5.2.5 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
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
/* | |
Plugin Name: Patti | |
Description: Modify Wordpress Add New Post for Adding Patti Data | |
Version: 1.0 | |
Author: Ankit Agrawal | |
*/ | |
/****************************************************************************/ | |
/************************* ADD PATTI CUSTOM FIELDS *************************/ | |
add_action( 'admin_init', 'patti_admin' ); |
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
/* | |
Plugin Name: Admin mods | |
Description: This plugin removes unwanted items from wordpress admin panel | |
Version: 1.0 | |
Author: Ankit Agrawal | |
*/ | |
//function to add custom coloumns | |
add_filter( 'manage_edit-post_columns', 'my_columns_filter', 10, 1 ); | |
add_action( 'manage_posts_custom_column', 'my_column_action', 10, 1 ); |
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
/* | |
* This is wordpress API for importing latest news from cnn ibn | |
* http://localhost/Sandbox/wordpress/wp-content/plugins/data_import/import_news18_images.php | |
*/ | |
//load wordpress functions | |
require_once("../../../wp-load.php"); | |
include 'functions.php'; | |
/** |
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 to get wordpress date | |
*/ | |
function get_wp_date($date) { | |
return date('Y-m-d H:m:i', strtotime($date)); | |
} |
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
/** | |
* This functions Sends Post curl request | |
* @param string $url url where posts request is send | |
* @param array $post_data array containing post data with key value pairs | |
* @return string | |
*/ | |
function post_curl($url, $post_data){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
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))) { |
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
//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
var cities = ['delhi', 'mumbai', 'pune']; | |
function getRandomCity() { | |
return cities[Math.floor(Math.random() * cities.length)]; | |
} |