Re-Adding modifications which were missed

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-21 18:16:29 -08:00
parent cf51e18177
commit e8cdd1f7cf
5 changed files with 34 additions and 8 deletions

View File

@ -861,3 +861,29 @@ function latest_comic_jump() {
wp_redirect( get_permalink( get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false) ) );
exit;
}
//Generate a random comic page - to use simply create a URL link to "/?randomcomic"
function random_comic() {
$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat='.get_all_comic_categories_as_cat_string());
while ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();
$random_comic_id = get_the_ID();
endwhile;
wp_redirect( get_permalink( $random_comic_id ) );
exit;
}
if ( isset( $_GET['randomcomic'] ) )
add_action( 'template_redirect', 'random_comic' );
//Generate a random post page - to use simply create a URL link to "/?randompost"
function random_post() {
$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat=-'.exclude_comic_categories());
while ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();
$random_comic_id = get_the_ID();
endwhile;
wp_redirect( get_permalink( $random_comic_id ) );
exit;
}
if ( isset( $_GET['randompost'] ) )
add_action( 'template_redirect', 'random_post' );

View File

@ -27,7 +27,7 @@ function comicpress_comic_bookmark_embed() {
* Render the monthly archive dropdown widget
*/
function comicpress_archive_dropdown() {
$archive = new ArchiveDropdownWidget();
$archive = new ComicPressArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'monthly_archive'));
}
@ -35,7 +35,7 @@ function comicpress_archive_dropdown() {
* Render the comic archive dropdown widget
*/
function comicpress_archive_dropdown_comics() {
$archive = new ArchiveDropdownWidget();
$archive = new ComicPressArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'comic_archive'));
}
@ -43,6 +43,6 @@ function comicpress_archive_dropdown_comics() {
* Render the storyline order dropdown widget
*/
function comicpress_archive_dropdown_storyline() {
$archive = new ArchiveDropdownWidget();
$archive = new ComicPressArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'storyline_order'));
}

View File

@ -7,7 +7,7 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) :
if (!is_cp_theme_layout('standard,v')) {
the_widget('ComicPressCalendarWidget');
// the_widget('ComicPressArchiveDropdownWidget','mode=monthly_archive');
the_widget('ComicPressArchiveDropdownWidget','mode=monthly_archive');
}
the_widget('ComicPressLatestComicsWidget');
endif;

View File

@ -8,7 +8,7 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
// the_widget('ComicpressBookmarkWidget','mode=three-button');
if (is_cp_theme_layout('standard,v')) {
the_widget('ComicpressCalendarWidget');
// the_widget('ComicpressArchiveDropdownWidget','mode=monthly_archive');
the_widget('ComicpressArchiveDropdownWidget','mode=monthly_archive');
}
the_widget('WP_Widget_Pages');
the_widget('WP_Widget_Categories','hierarchical=1&count=1');

View File

@ -8,7 +8,7 @@ class ArchiveDropdownWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
$this->w = new ArchiveDropdownWidget();
$this->w = new ComicPressArchiveDropdownWidget();
}
function providerTestBuildDropdown() {
@ -60,7 +60,7 @@ class ArchiveDropdownWidgetTest extends PHPUnit_Framework_TestCase {
}
function testBuildComicArchiveDropdown() {
$w = $this->getMock('ArchiveDropdownWidget', array('_new_comicpressstoryline', '_new_wp_query', 'build_dropdown'));
$w = $this->getMock('ComicPressArchiveDropdownWidget', array('_new_comicpressstoryline', '_new_wp_query', 'build_dropdown'));
$storyline = $this->getMock('ComicPressStoryline', array('read_from_options', 'build_from_restrictions'));
$storyline->expects($this->once())->method('read_from_options');
@ -88,7 +88,7 @@ class ArchiveDropdownWidgetTest extends PHPUnit_Framework_TestCase {
}
function providerTestUpdate() {
$w = new ArchiveDropdownWidget();
$w = new ComicPressArchiveDropdownWidget();
$valid_mode = array_shift(array_keys($w->modes));
return array(