This file contains 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
CREATE DATABASE databasename; | |
GRANT ALL PRIVILEGES ON databasename.* TO username@localhost IDENTIFIED BY "password"; | |
FLUSH PRIVILEGES; | |
EXIT; |
This file contains 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 $images = get_post_meta($post->ID, 'image'); | |
if ($images) { | |
foreach ($images as $image) { | |
$image = explode('{}', $image); | |
echo '<div class="image"><img src="/media' . $image[0] . '" />'; | |
if ($image[1]) { | |
echo '<p class="credit">' . $image[1] . '</p>'; | |
} | |
echo '</div>'; | |
} |
This file contains 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 | |
// Handy method to remove the hook for email notifications of custom post status changes | |
function ef_remove_post_status_notifications() { | |
global $edit_flow; | |
// Edit Flow originally hooks into 'transition_post_status' to know when to send custom post status notifications | |
remove_action( 'transition_post_status', array( &$edit_flow->notifications, 'notification_status_change' ), 10, 3 ); | |
} | |
// Hook this action into init so Edit Flow is already loaded | |
add_action( 'init', 'ef_remove_post_status_notifications' ); | |
?> |
This file contains 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
REPLACE THIS WITH ANY ASSIGNMENT INTRODUCTION TEXT YOU WANT | |
<div class="assignment-headlines"></div> | |
<script type="text/javascript" src="http://static.journalism.cuny.edu/useful_js/load_site_headlines.js"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
// Load all of the websites in an array | |
var websites = new Array(); | |
websites[0] = 'http://ernest.entrepreneurial.2011.journalism.cuny.edu/'; | |
websites[1] = 'http://hong.entrepreneurial.2011.journalism.cuny.edu/'; |
This file contains 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 type="text/javascript">var host = (("https:" == document.location.protocol) ? "https://secure." : "http://");document.write(unescape("%3Cscript src='" + host + "wufoo.com/scripts/embed/form.js' type='text/javascript'%3E%3C/script%3E"));</script> | |
<script type="text/javascript"> | |
var p7p1q1 = new WufooForm(); | |
p7p1q1.initialize({ | |
'userName':'cunyjschool', | |
'formHash':'p7p1q1', | |
'autoResize':true, | |
'height':'340', | |
'ssl':true}); |
This file contains 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 | |
/** | |
* Random set of improvements | |
*/ | |
/** | |
* Tidy up the admin and remove options we don't need | |
*/ | |
function db_clean_up_admin() { |
This file contains 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 | |
require_once('./wp-load.php'); | |
$all_users = get_users(); | |
foreach( $all_users as $user ) { | |
if ( $user->user_login == $user->display_name ) { | |
$user_info = get_userdata( $user->ID ); | |
$new_display_name = $user_info->first_name . ' ' . $user_info->last_name; |
This file contains 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 | |
/* Plugin Name: P2 Resolved Posts | |
* Description: Allows you to mark P2 posts for resolution. | |
* Author: Andrew Nacin | |
* Author URI: http://andrewnacin.com/ | |
*/ | |
/* WARNING about studying and copying this code: | |
* | |
* P2 is not currently an ideal platform for developing extensions. Some of this |
This file contains 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 | |
/** | |
* Give the user a 404 if they do an internal WP search | |
*/ | |
function db_unresolve_search() { | |
global $wp_query; | |
if ( $wp_query->is_search ) | |
$wp_query->is_404 = true; | |
} | |
add_action( 'template_redirect', 'db_unresolve_search' ); |
OlderNewer