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 | |
/** | |
* @Author Jonathon byrd | |
* @link http://www.jonathonbyrd.com | |
* @Package Wordpress | |
* @SubPackage Widgets | |
* @copyright Proprietary Software, Copyright Byrd Incorporated. All Rights Reserved | |
* @Since 1.0.0 | |
* | |
* Plugin Name: Master Widget |
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 | |
function set_video_info($post_id) { | |
$id = wp_is_post_revision($post_id); | |
$post_id = $id ? $id : $post_id; | |
$post = get_post($post_id); | |
if (get_the_post_thumbnail($post_id) || $post->post_type != 'videos') | |
return; | |
$upload_dir = wp_upload_dir(); |
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
<? $this->render_partial('shop:product_options'); ?> | |
<? if (PSInventory_Inventory::out_of_stock( $product, post('product_options') )): ?> | |
<p> | |
<strong> | |
<? $options_string = PSInventory_Data::create_option_string(post('product_options', array()), $product->id); | |
$data = PSInventory_Data::create()->where('product_id=? AND options_string=?', $product->id, $options_string)->find(); | |
$extended_sku = $data->extended_sku; | |
?> | |
We're sorry, the item (size/color/style) you've selected is temporarily out-of-stock. | |
<a href="<?= site_url('out-of-stock-contact-form') ?>?item=<?= urlencode($extended_sku); ?>" rel="lightbox[external 900 300]" title="Out of Stock Contact Form" id="oosLink" class="button">Notify me</a> when this item becomes available. |
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
<? | |
class ArclightML_Settings extends Backend_SettingsController | |
{ | |
public $implement = 'Db_ListBehavior, Db_FormBehavior'; | |
public $form_model_class = ''; | |
protected $access_for_groups = array(Users_Groups::admin); | |
public function config() { | |
$this->app_page_title = 'Mailing List Settings'; |
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 | |
public $has_and_belongs_to_many = array( | |
'add_on_order_status'=>array( | |
'class_name'=>'Shop_StatusTransition', | |
'primary_key'=>'psinventory_param_id', | |
'foreign_key' => 'shop_status_transition_id', | |
'join_table' => 'psinventory_params_shop_status_transitions', | |
'join_fields' => array( | |
'transition_flag' => 'active' | |
) |
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
public function add_field($code, $title, $side = 'full', $type = db_text, $just_column = false) | |
{ | |
$this->custom_columns[$code] = $type; | |
$this->_columns_def = null; | |
$col = $this->define_column($code, $title)->validation(); | |
if ( !$just_column ) { | |
$form_field = $this->add_form_field($code, $side)->optionsMethod('get_added_field_options'); | |
$this->added_fields[$code] = $form_field; | |
return $form_field; |
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
#26907620 - About 10 minutes from the end. Phar mummies to SS ult |
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
namespace :admin do | |
resources :services | |
end |
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
# Get all the properties that aren't fulltext (which will cause the query to break) | |
props = Product.properties.reject{|p| p.type == DataMapper::Types::Text }.map{|p| "`products`.`#{p.name}`" }.join(', ') | |
# Get categories before hand as it tends to be a little faster. | |
@categories = Category.all( :name.like => "%#{params[:search]}%" ) | |
# Do the massive query. | |
# You'll notice the << -1 on the queries. Since @category.id is an autoincrement it'll never be -1 and this is easier than a messey ternary statement. I'd imagine the messy statement could be a little faster, however. | |
@t_products = Product.find_by_sql(["SELECT " + props + " | |
FROM products | |
LEFT JOIN categories_products ON categories_products.product_id = products.id |
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
module DataMapper | |
class Query | |
alias :old_assert_valid_order :assert_valid_order | |
def assert_valid_order(order, fields) | |
old_assert_valid_order(order, fields) unless !order.nil? && order.any? { |p| p.is_a?(Direction) && p.property.name == :sort_order } | |
end | |
end | |
end |