Created
October 8, 2012 18:42
-
-
Save beezee/3854138 to your computer and use it in GitHub Desktop.
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 | |
class swDFPBaseModule | |
{ | |
private function parent_or_child($tax, $query_key) | |
{ | |
$slug = $wp_query->query_vars[$query_key] | |
$s = get_term_by('slug', $slug, $tax); | |
return ($s->parent>0) ? | |
'get_on_'.$tax.'_page' : 'get_on_child_'.$tax.'_page'; | |
} | |
public function get_dfp_content() | |
{ | |
global $wp_query; | |
if(is_single()) $method = 'get_on_single_post'; | |
if($wp_query->query_vars['channel']) $method = 'get_on_channel_page'; | |
if($wp_query->query_vars['series']) $method = $this->parent_or_child('series', 'series'); | |
if($wp_query->query_vars['category_name']) $method = $this->parent_or_child('category', 'category_name'); | |
} | |
public function get_site_name() | |
{ | |
global $blog_id; | |
if($blog_id==1) return 'bos'; | |
elseif($blog_id==2) return 'dc'; | |
else return ''; | |
} | |
} | |
class swDFPPostID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPAuthorID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPChannelID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPSeriesID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPParentSeriesID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPPostTagsIDs extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPCategoryID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPSubCategoryID extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPSectionFrontYOrN extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPSubSectionFrontYOrN extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
class swDFPSlideshowYOrN extends swDFPBaseModule | |
{ | |
public function get_on_single_post() | |
{ | |
global $post; | |
} | |
public function get_on_channel_page() | |
{ | |
} | |
public function get_on_series_page() | |
{ | |
} | |
public function get_on_child_series_page() | |
{ | |
} | |
public function get_on_category_page() | |
{ | |
} | |
public function get_on_child_category_page() | |
{ | |
} | |
public function get_on_single_post_with_slideshow() | |
{ | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment