Skip to content

Instantly share code, notes, and snippets.

<img class="size-medium wp-image-2927 alignleft" title="Bloomington-City-Hall" src="http://wjbc.com/files/2010/12/Bloomington-City-Hall1-300x207.jpg" alt="Bloomington City Hall" width="307" height="218" />
<div><strong>A new tavern will be coming to downtown Bloomington. But council leaders say this comes with much needed action, instead of just conversation. <!--more-->The city council approved a liquor license for an establishment called Eleven with a close 5-to-4 vote including the mayor. Alderwoman Karen Schmidt says the way licenses are distributed is inconsistent.</strong></div>
<strong>"I'm very concerned we have this conversation over and over again. We just need to get on the same page," said Schmidt.</strong>
<strong>Tyler Holloway of the Downtown Bar Owners Association says he supports the business plan, but questioned the safety of adding another bar to the area.</strong>
<strong>"I know of 12 bars right now running dollar specials. When you have cheap drinks like that, you have a lot of intoxic
<td class="spent-time"><%= @issue.spent_hours > 0 ? (link_to l_hours(@issue.spent_hours), {:controller => 'timelog', :action => 'details', :project_id => @project, :issue_id => @issue}) : "-" %></td>
@sproutventure
sproutventure / Example filter for GBS Messages
Created January 4, 2011 21:10
Filter the GBS messages, find a match and change it.
add_filter('additional_messages', 'translate_mail_errors', 1);
function translate_mail_errors($message)
{
$message = str_ireplace( 'Purchase Successful. Now we wait for the deal to end.', 'CHANGE TO WHATEVER', $message );
return $message;
}
@sproutventure
sproutventure / gist:796249
Created January 26, 2011 04:58
latest deal redirect.
function new_latest_deal_redirect( $redirect = null ) {
$latest_deal_qv = get_query_var( 'todays-deal' );
$latest_deal = ( $latest_deal_qv != '' ) ? $latest_deal_qv : $_GET['todays-deal'] ;
// redirect from homepage if cookie is set or we are using the todays-deal link
if( 1 == $latest_deal || ( is_home() && isset( $_COOKIE[ 'your-selected-location' ] ) ) ) {
$redirect = get_gbs_latest_deal_link();
} elseif ( is_home() && is_user_logged_in() ) { // redirect for logged in users
$redirect = get_gbs_deals_link();
}
if ( $redirect != null ) { // if we have something to redirect to let's do it.
@sproutventure
sproutventure / gist:799639
Created January 28, 2011 01:15
Modify GB States
add_filter('getStates','new_states');
function new_states()
{
return array(
'' => 'Select',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AS' => 'American Samoa',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
if ( isset($_GET['payment-success']) && ($_GET['payment-success'] != '0' || $_GET['payment-success'] != null) ) {
$userID = Group_Buying_Utility::getCurrentUserId();
?>
<iframe src="http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/post.php?secret=XXXXXXX&trans_id=<?php echo $_GET['trnId'] ?>&ap_id=XXXXXXXX&sale_amt=<?php echo get_deal_value_in_credits( $_GET['item-id'] ); ?>&item_id=<?php echo $_GET['item-id'] ?>" scrolling="no" frameborder="0" width="1" height="1"></iframe>
<?php
}
if ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
$userID = Group_Buying_Utility::getCurrentUserId();
?>
/**
* Unhook regsitration_form_addons from parent theme on init. Hooking to init because register_form has already been hooked-in
*
* @author Dan Cameron
*/
add_action('init', 'unhook_registration_form_addons');
function unhook_registration_form_addons()
{
remove_action( 'register_form', 'registration_form_addons' );
}
@sproutventure
sproutventure / Basic GBS loop
Created March 18, 2011 18:15
Returns some GBS deals
<?php
global $wp_query;
$add_deal_query= null;
$args=array(
'post_type' => 'deal',
'post_status' => 'publish',
'meta_key' => $gb->_metaDealExpiration, // Make sure the deal is not exprired
'posts_per_page' => 3, // return this many
'post__not_in' => array( $wp_query->post->ID ) // do not show the current deal within this loop
);
@sproutventure
sproutventure / GBS latest deal redirect
Created March 21, 2011 20:04
list of locations, link to latest deal instead of archive page
function gb_list_locations_custom( $format = 'ul' )
{
global $gb;
// Form an array of all the locations ( the location term is called 'deals' )
$locations = get_terms(array('deals'),array('hide_empty'=>true,'fields'=>'all'));
// Build out the ul of locations
if ( !empty( $locations) && $format == 'ul' ) {
echo "<ul class='locations-ul clearfix'>";
foreach ($locations as $location) {
$args=array(
@sproutventure
sproutventure / gist:980988
Created May 19, 2011 15:13
PaymentExpress Payment Class
<?php
#******************************************************************************
#* Name : PxPay_Curl.inc.php
#* Description : Classes used interact with the PxPay interface using PHP with the cURL extension installed
#* Copyright : Direct Payment Solutions 2009(c)
#* Date : 2009-04-10
#* Version : 1.0
#* Author : Thomas Treadwell
#******************************************************************************