Skip to content

Instantly share code, notes, and snippets.

function force_of_gravity() { ?>
if (get_post_meta(get_the_ID(), "image", true)) || (get_post_meta(get_the_ID(), "text", true)) { ?>
<b>Submitted by: </b><?php echo get_post_meta(get_the_ID(), "name", true) ?> in <?php echo get_post_meta(get_the_ID(), "location", true); ?>
<?php endif; ?>
<?php
}
add_action('thesis_hook_before_content', 'force_of_gravity');
function force_of_gravity() {
if (get_post_meta(get_the_ID(), "image", true)) || (get_post_meta(get_the_ID(), "text", true)): ?>
<b>Submitted by: </b><?php echo get_post_meta(get_the_ID(), "name", true) ?> in <?php echo get_post_meta(get_the_ID(), "location", true); ?>
<?php endif; ?>
<?php
}
add_action('thesis_hook_before_content', 'force_of_gravity');
/media/*
/var/*
/app/etc/local.xml
/app/etc/use_cache.ser
/nbproject/*
/downloader/pearlib/cache/*
/downloader/pearlib/download/*
/downloader/pearlib/temp/*
/.htaccess
.svn
@shanestillwell
shanestillwell / time.html
Created October 29, 2010 17:57
Select HTML Time (15 minute increments)
<select name="time" id="time">
<option value="5:00 AM">5:00 AM</option>
<option value="5:15 AM">5:15 AM</option>
<option value="5:30 AM">5:30 AM</option>
<option value="5:45 AM">5:45 AM</option>
<option value="6:00 AM">6:00 AM</option>
<option value="6:15 AM">6:15 AM</option>
<option value="6:30 AM">6:30 AM</option>
<option value="6:45 AM">6:45 AM</option>
@shanestillwell
shanestillwell / time.php
Created October 29, 2010 18:00
PHP array of time in 15 minute increments
$time = array(
"5:00 AM" => "5:00 AM",
"5:15 AM" => "5:15 AM",
"5:30 AM" => "5:30 AM",
"5:45 AM" => "5:45 AM",
"6:00 AM" => "6:00 AM",
"6:15 AM" => "6:15 AM",
"6:30 AM" => "6:30 AM",
"6:45 AM" => "6:45 AM",
@shanestillwell
shanestillwell / provinces.xml
Created October 29, 2010 19:28
Provinces in XML format
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<AD>
<region>Andorra</region>
<region>Parròquia de Canillo</region>
<region>Parròquia d'Encamp</region>
<region>Parròquia de la Massana</region>
<region>Parròquia d'Ordino</region>
<region>Parròquia de Sant Julià de Lòria</region>
<region>Parròquia d'Andorra la Vella</region>
@shanestillwell
shanestillwell / recursive.php
Created December 27, 2010 20:25
Recursive Array Search
// Recursivly search through an array, if the key is found, then return TRUE
private function _recursiveArraySearch($haystack, $needle, $index = null)
{
$aIt = new RecursiveArrayIterator($haystack);
$it = new RecursiveIteratorIterator($aIt);
while($it->valid())
{
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
//return $aIt->key();
@shanestillwell
shanestillwell / test_zend_auth_login
Created December 27, 2010 20:27
Create an instance of Zend_Auth with the user_id you want.
protected function _logIn($id = 4)
{
$user = Doctrine_Core::getTable('Default_Model_User')->find(4);
Zend_Auth::getInstance()->getStorage()->write($user);
}
@shanestillwell
shanestillwell / BootstrapFile.php
Created January 3, 2011 17:22
Edit the Bootstrap for the Zend Tool to pull the APPLICATION_ENV from the shell.
--- BootstrapFile.php (saved version)
+++ (current document)
@@ -106,9 +106,11 @@
define('APPLICATION_PATH', $this->_applicationDirectory->getPath());
$applicationOptions = array();
$applicationOptions['config'] = $this->_applicationConfigFile->getPath();
+
+ $env = getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development';
$this->_applicationInstance = new Zend_Application(
@shanestillwell
shanestillwell / toHeirarchy.php
Created January 4, 2011 14:31
Converts a NestedSet array into a mutli-dimensional array (Hydrates the flat array returned by Doctrine)
/**
* original http://groups.google.com/group/doctrine-user/browse_thread/thread/8674c5f27de54e0c
*/
public function toHierarchy($collection)
{
// Trees mapped
$trees = array();
$l = 0;