If you dont have shell access to your server and need to unzip a file on your php server you can use this script. It basically extracts the zip file into the directory you specify. Make sure the directory you want to extract it to has write permissions.
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
// ==UserScript== | |
// @name Harvest Timer Growl Reminder | |
// @namespace http://harvestapp.com | |
// @description Displays Growl notifications at a user defined interval, reminding you to track your time. | |
// @include * | |
// @author Mike Green | |
// @version 0.1.1 | |
// ==/UserScript== | |
(function () { |
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
add_action('init', 'kp_author_base'); | |
function kp_author_base() { | |
global $wp_rewrite; | |
$author_slug = 'profile'; // change slug name | |
$wp_rewrite->author_base = $author_slug; | |
} |
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 is_old_post($days = 5) { | |
$days = (int) $days; | |
$offset = $days*60*60*24; | |
if ( get_post_time() < date('U') - $offset ) | |
return true; | |
return false; | |
} |
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
<div class="author-box"> | |
<div class="author-pic"><?php echo get_avatar( get_the_author_email(), '80' ); ?></div> | |
<div class="author-name"><?php the_author_meta( "display_name" ); ?></div> | |
<div class="author-bio"><?php the_author_meta( "user_description" ); ?></div> | |
</div> |
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 | |
$author_posts = new WP_Query( array( | |
'posts_per_page' => 3, | |
'author' => get_the_author_meta( 'ID' ) | |
) ); | |
if ( $author_posts->have_posts() ) while ( $author_posts->have_posts() ) : $author_posts->the_post(); | |
// loop | |
endwhile; | |
wp_reset_query(); |
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 showMessage($message, $errormsg = false) | |
{ | |
if ($errormsg) { | |
echo ' | |
<div id="message" class="error">'; | |
} | |
else { | |
echo ' | |
<div id="message" class="updated fade">'; | |
} |
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 | |
/** | |
* Enqueue scripts and styles | |
*/ | |
function load_scripts() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ); | |
$dir = get_stylesheet_directory_uri(); | |
wp_enqueue_script( 'jquery-masonry', $dir.'/js/jquery.masonry.min.js', array('jquery'), false, true ); |
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 | |
if ( !function_exists('wp_new_user_notification') ) { | |
function wp_new_user_notification( ) {} | |
} | |
if ( !function_exists( 'wp_password_change_notification' ) ) { | |
function wp_password_change_notification() {} |
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
add_filter('wp_mail_from', 'new_mail_from'); | |
add_filter('wp_mail_from_name', 'new_mail_from_name'); | |
function new_mail_from($old) { | |
return 'your email address'; | |
} | |
function new_mail_from_name($old) { | |
return 'your name or your website'; | |
} |