Compare commits

..

19 Commits

Author SHA1 Message Date
John Bintz a2e13853ab undo amother merge 2010-01-24 10:51:10 -05:00
John Bintz c5b54a19f3 Revert "Merge branch '1.9-release'"
This reverts commit 6181a4ee3c, reversing
changes made to 398bbc01c2.
2010-01-24 10:46:54 -05:00
Philip M. Hofer (Frumph) d7797ef29a removing the code { } css out of the stylesheet
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 18:12:01 -08:00
Philip M. Hofer (Frumph) f38e92d374 Temporary Fix for ComicPressMediaHandling.inc for comics not being shown. This currently disables the config -> filters I believe.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 16:25:24 -08:00
Philip M. Hofer (Frumph) 367d6f9b41 disable_lrsidebars_frontpage is now disable_lrsidebars for the entire site
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 10:31:35 -08:00
John Bintz 6181a4ee3c Merge branch '2.9-release' 2010-01-23 10:03:15 -05:00
John Bintz 398bbc01c2 Merge branch 'master' of github.com:johnbintz/comicpress-2.8 2010-01-23 10:00:37 -05:00
Philip M. Hofer (Frumph) fd52a600ba added flags for showing the title date and comments link to the ComicBlogPostWidget.inc widget
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 04:43:47 -08:00
Philip M. Hofer (Frumph) 96b5db1227 more ComicBlogPostWidget.inc fixes to check if its in the comic category or not
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 04:10:15 -08:00
Philip M. Hofer (Frumph) 36a8a1a2b6 ComicBlogPostWidget.inc now defaults the title the posts title which is css'd.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 04:04:51 -08:00
Philip M. Hofer (Frumph) 8f254211e5 Index.php fix for not showing the proper blog posts in the right places.
reverting ComicBlogPostWidget.inc

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 04:02:49 -08:00
Philip M. Hofer (Frumph) 5ff967308e put the protect back in layout-head.php and adjusted ComicBlogPostWidget.inc to get the right info.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 03:45:41 -08:00
Philip M. Hofer (Frumph) 758ebe3ce8 syncing the blog template with the extra 40px margin at the .post-foot as well.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 02:44:32 -08:00
Philip M. Hofer (Frumph) 548e077a94 CSS Changes where .home .post-blog .post-foot {} has the 40px margin at the bottom and .post is completely emptied.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 02:42:57 -08:00
Philip M. Hofer (Frumph) 2dcd8bf19b Comment widget spacial fix for #
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 02:33:28 -08:00
Philip M. Hofer (Frumph) 80d9d946a6 Removed the extra </div> after removing .column forevah and fixed the style.css to putting padding in .narrowcolumn now and increase width to 550px;
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 02:31:51 -08:00
Philip M. Hofer (Frumph) bae1436fc1 Deprecated .column is being removed for good, and layout-head.php fix for proper logic.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-23 02:22:37 -08:00
John Bintz 3613121c05 Merge branch '2.9-release' 2010-01-22 23:14:20 -05:00
Philip M. Hofer (Frumph) a68e5258d1 sidebar - overblog is now inside the narrowcolumn above column instead of floating above the whole section
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-21 14:27:26 -08:00
21 changed files with 85 additions and 468 deletions

View File

@ -24,16 +24,15 @@ class ComicPressMediaHandling {
function _get_filter($filter_to_use = null) {
global $comic_filename_filters;
if (!is_null($filter_to_use)) {
if (is_string($filter_to_use)) {
if (isset($comic_filename_filters[$filter_to_use])) {
return $this->_convert_to_percent_filter($comic_filename_filters[$filter_to_use]);
}
$options = get_option('comicpress_options');
if (isset($options['comic_filename_filters'][$filter_to_use])) {
return $this->_convert_to_percent_filter($options['comic_filename_filters'][$filter_to_use]);
}
// if (isset($options['comic_filename_filters'][$filter_to_use])) {
// return $this->_convert_to_percent_filter($options['comic_filename_filters'][$filter_to_use]);
// }
}
}
@ -43,7 +42,6 @@ class ComicPressMediaHandling {
} else {
$filter = str_replace('{date}', $this->default_filename_filter, $filter);
}
return $filter;
}
@ -100,9 +98,6 @@ class ComicPressMediaHandling {
case 'type-folder':
$value = $this->type_folder;
break;
case 'upload-path':
$value = get_option('upload_path');
break;
default:
if (preg_match('#^date-(.*)$#', $matches[1], $date_matches) > 0) {
if (isset($this->post_to_use)) {

View File

@ -19,23 +19,6 @@ function comicpress_admin_print_styles() {
wp_enqueue_style('comicpress-options', get_template_directory_uri() . '/options/options.css');
}
function comicpress_save_options_comic_filename_filters($incoming) {
$filters = array();
foreach (array_values($incoming) as $filter) {
$filters[wp_filter_nohtml_kses($filter['name'])] = wp_filter_nohtml_kses($filter['filter']);
}
if (!empty($filters)) {
if (!isset($filters['default'])) {
$cpmh = new ComicPressMediaHandling();
$filters['default'] = $cpmh->default_filter;
}
}
return $filters;
}
function comicpress_admin_page_head() { ?>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]-->
<?php }
@ -71,7 +54,7 @@ function comicpress_admin() {
'comic_clicks_next',
'disable_default_comic_nav',
'enable_widgetarea_use_sidebar_css',
'disable_lrsidebars_frontpage',
'disable_lrsidebars',
'disable_footer_text',
'disable_blogheader',
'enable_comicpress_debug',
@ -207,13 +190,6 @@ function comicpress_admin() {
) as $key) {
$comicpress_options['comicpress_config'][$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
if (isset($_REQUEST['comic_filename_filters'])) {
$comicpress_options['comic_filename_filters'] = comicpress_save_options_comic_filename_filters($_REQUEST['comic_filename_filters']);
} else {
$comicpress_options['comic_filename_filters'] = array();
}
$tab = 'config';
update_option('comicpress_options',$comicpress_options);
}

View File

@ -133,7 +133,7 @@ function comicpress_load_options() {
'disable_comic_blog_frontpage' => false,
'disable_comic_blog_single' => false,
'disable_blog_frontpage' => false,
'disable_lrsidebars_frontpage' => false,
'disable_lrsidebars' => false,
'disable_footer_text' => false,
'disable_blogheader' => false,
'disable_page_titles' => false,
@ -206,8 +206,7 @@ function comicpress_load_options() {
'enable_comment_count_in_rss' => false,
'enable_scroll_to_top' => false,
'enable_page_load_info' => false,
'comic_filename_filters' => array()
'enable_page_load_info' => false
) as $field => $value) {
$comicpress_options[$field] = $value;

View File

@ -2,20 +2,23 @@
<?php include(get_template_directory() . '/layout-head.php'); ?>
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) {
if (is_archive()) echo "Thinks its an archive";
Protect();
$comic_query = '&showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query);
$comic_query = 'showposts=1&cat="'.get_all_comic_categories_as_cat_string().'"';
query_posts($comic_query);
$wp_query->is_archive = false;
if (have_posts()) {
comicpress_display_post();
while (have_posts()) : the_post();
comicpress_display_post();
endwhile;
}
Restore();
UnProtect();
Restore();
UnProtect();
wp_reset_query();
?>
<?php } ?>
<?php if (function_exists('the_project_wonderful_ad')) {
<?php if (function_exists('the_project_wonderful_ad')) {
the_project_wonderful_ad('blog');
} ?>

View File

@ -1,5 +1,4 @@
<?php if (comicpress_check_child_file('layout-foot') == false) { ?>
</div>
</div>
<?php if (is_cp_theme_layout('v3cr')) { ?>
</div>

View File

@ -16,28 +16,32 @@
<?php if (is_cp_theme_layout('v,v3c')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php get_sidebar('overblog'); ?>
<?php } ?>
<?php
if (!$comicpress_options['disable_comic_frontpage'] && is_home()) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query);
if (have_posts()) {
while (have_posts()) : the_post();
global $frontpage_postnum;
$frontpage_postnum = $post->ID;
$wp_query->is_single = true;
comicpress_display_comic_area();
endwhile;
if (is_home()) {
if (!$comicpress_options['disable_comic_frontpage']) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
query_posts($comic_query);
if (have_posts()) {
while (have_posts()) : the_post();
$temp_single = $wp_query->is_single;
$wp_query->is_single = true;
comicpress_display_comic_area();
$wp_query->is_single = $temp_single;
$temp_single = null;
endwhile;
}
Restore();
UnProtect();
wp_reset_query();
}
} else {
if (is_single() && in_comic_category()) {
comicpress_display_comic_area();
}
Restore();
UnProtect();
wp_reset_query();
}
if (is_single() & in_comic_category()) {
comicpress_display_comic_area();
}
?>
@ -46,8 +50,7 @@
<div id="subcontent-wrapper">
<?php } ?>
<?php get_sidebar('overblog'); ?>
<?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('v3cr')) { ?>
<div id="subcontent-wrapper-head"></div>
@ -56,7 +59,7 @@
<?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php get_sidebar('overblog'); ?>
<?php } ?>
<?php } ?>

View File

@ -112,7 +112,7 @@
</th>
<td>
<?php _e('Choose a directory to get the Archive/Search thumbnails from.','comicpress'); ?>
<?php _e('Choose a directory to get the ARCHIVE/SEARCH thumbnails from.','comicpress'); ?>
</td>
</tr>
@ -135,7 +135,7 @@
</th>
<td>
<?php _e('Choose a directory to get the Mini thumbnails from. (for archive-comic-list, etc.)','comicpress'); ?>
<?php _e('Choose a directory to get the MINI thumbnails from. (for archive-comic-list, etc.)','comicpress'); ?>
</td>
</tr>
@ -147,86 +147,18 @@
</tr>
<tr>
<th scope="row"><label for="archive_comic_width"><?php _e('Archive Thumbnail Width','comicpress'); ?></label></th>
<th scope="row"><label for="archive_comic_width"><?php _e('ARCHIVE Thumbnail Width','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="archive_comic_width" id="archive_comic_width" value="<?php echo $comicpress_options['comicpress_config']['archive_comic_width']; ?>" />
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="mini_comic_width"><?php _e('Mini Thumbnail Width','comicpress'); ?></label></th>
<th scope="row"><label for="mini_comic_width"><?php _e('MINI Thumbnail Width','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="mini_comic_width" id="mini_comic_width" value="<?php echo $comicpress_options['comicpress_config']['mini_comic_width']; ?>" />
</td>
</tr>
<?php
$cpmh = new ComicPressMediaHandling();
$filters = $comicpress_options['comic_filename_filters'];
if (!isset($filters['default'])) {
$filters['default'] = $cpmh->default_filter;
}
?>
<tr>
<th scope="row"><label><?php _e('Comic Filename Filters', 'comicpress'); ?></label></th>
<td colspan="2">
<p>
<em>For advanced users.</em> Specify the filters used to find the filename.
</p>
<div id="comicpress-comic-filename-filters-holder">
</div>
<a href="#" id="add-new-filter"><?php _e('Add new filter', 'comicpress') ?></a>
<script type="text/javascript">
(function($) {
var filter_data = [];
<?php foreach ($filters as $name => $filter) { ?>
filter_data.push({name:'<?php echo esc_js($name) ?>', filter:'<?php echo esc_js($filter) ?>'});
<?php } ?>
var build_row = function(data) {
var key = (new Date()).getTime();
var row = $('<div>\
<label>\
<strong>Key:</strong>\
<input type="text" size="15" name="comic_filename_filters[' + key + '][name]" value="' + data.name + '" />\
</label>\
<label>\
<strong>Filter:</strong>\
<input type="text" size="60" name="comic_filename_filters[' + key + '][filter]" value="' + data.filter + '" />\
</label>\
<a href="#">Remove</a>\
</div>');
$('a', row).click(function() {
if (confirm('<?php _e('Are you sure?', 'comicpress') ?>')) {
$(this).parent().remove();
}
return false;
});
return row;
};
$('#add-new-filter').click(function() {
$('#comicpress-comic-filename-filters-holder').append(build_row({name:'new_filter',filter:'%wordpress%'}));
return false;
});
$.each(filter_data, function(index, f) {
$('#comicpress-comic-filename-filters-holder').append(build_row(f));
});
}(jQuery))
</script>
<p>
Available parameters:
</p>
<ul>
<li><strong>%wordpress%</strong>: The WordPress root folder</li>
<li><strong>%type-folder%</strong>: The folder for the requested filetype (comic, rss, archive, or mini)</li>
<li><strong>%date-(format)%</strong>: The formatting to use for the requested date as per the <a href="http://php.net/date">date()</a> function <em>(ex: %date-Ymd% is <?php echo date('Ymd') ?>)</em></li>
<li><strong>%upload-path%</strong>: The value of the upload_path option, which is the destination upload directory for WPMU installs.</li>
</ul>
</td>
</tr>
</table>

View File

@ -152,12 +152,12 @@
</td>
</tr>
<tr>
<th scope="row"><label for="disable_lrsidebars_frontpage"><?php _e('Disable home page sidebars','comicpress'); ?></label></th>
<th scope="row"><label for="disable_lrsidebars"><?php _e('Disable left and right sidebars','comicpress'); ?></label></th>
<td>
<input id="disable_lrsidebars_frontpage" name="disable_lrsidebars_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_lrsidebars_frontpage']); ?> />
<input id="disable_lrsidebars" name="disable_lrsidebars" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_lrsidebars']); ?> />
</td>
<td>
<?php _e('Your home page will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?>
<?php _e('Your site will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?>
</td>
</tr>
</table>

View File

@ -221,20 +221,3 @@ div.show .cpadmin-footer img{
min-width: 80px;
text-align: center;
}
/** Comic Filters **/
#comicpress-comic-filename-filters-holder div {
border: solid #ddd 1px;
padding: 3px;
overflow: hidden;
}
#comicpress-comic-filename-filters-holder label {
float: left;
display: inline;
}
#comicpress-comic-filename-filters-holder input {
margin: 0 10px;
}

View File

@ -1,5 +1,5 @@
<?php global $comicpress_options;
if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
if (!$comicpress_options['disable_lrsidebars']) { ?>
<div id="sidebar-left">
<div class="sidebar-head"></div>
<div class="sidebar">

View File

@ -1,5 +1,5 @@
<?php global $comicpress_options;
if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
if (!$comicpress_options['disable_lrsidebars']) { ?>
<div id="sidebar-right">
<div class="sidebar-head"></div>
<div class="sidebar">

View File

@ -86,15 +86,6 @@ acronym, abbr {
border-bottom: 1px dashed #000;
}
code {
padding: 5px;
margin: 10px 0;
display: block;
overflow: scroll;
font-family: 'Courier', monospace;
border: 1px dotted #000;
}
form {
margin: 0;
}
@ -443,8 +434,8 @@ h4, h4 a {
}
.narrowcolumn {
width: 540px;
padding: 5px 10px;
width: 550px;
padding: 0 5px;
}
/* add 10px to smaller width layouts */
@ -458,10 +449,6 @@ h4, h4 a {
overflow: hidden;
}
.column {
overflow: hidden;
}
.column_one {
width: 48%;
float: left;
@ -474,18 +461,15 @@ h4, h4 a {
padding: 1%;
}
.post, .post-page {
clear: both;
text-align: left;
padding: 2px;
margin-bottom: 20px;
}
.post {}
.post-content {
padding: 3px;
}
.post-foot {
.home .post-blog .post-foot,
.page-template-blog-php .post-foot {
margin-bottom: 40px;
}
.post-image {

View File

@ -41,8 +41,7 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
array(null, $default),
array('fail', $default),
array(array(), $default),
array('test', 'test'),
array('test-from-option', 'test-from-option'),
array('test', 'test')
);
}
@ -54,12 +53,6 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
$comic_filename_filters['test'] = 'test';
update_option('comicpress_options', array(
'comic_filename_filters' => array(
'test-from-option' => 'test-from-option'
)
));
$default = str_replace('{date}', $this->cpmh->default_filename_filter, $this->cpmh->default_filter);
$cpmh = $this->getMock('ComicPressMediaHandling', array('_convert_to_percent_filter'));
@ -102,8 +95,7 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
array('%test test%', '%test test%'),
array('%wordpress%/%type-folder%', vfsStream::url('root') . '/comic'),
array('%date-Y%', '2009'),
array('%wordpress%/%type-folder%/%date-Y-m-d%*.*', vfsStream::url('root') . '/comic/2009-01-01.*\..*'),
array('%wordpress%/%upload-path%/%type-folder%/%date-Y-m-d%*.*', vfsStream::url('root') . '/1/files/comic/2009-01-01.*\..*')
array('%wordpress%/%type-folder%/%date-Y-m-d%*.*', vfsStream::url('root') . '/comic/2009-01-01.*\..*')
);
}
@ -114,8 +106,6 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
$cpmh = $this->getMock('ComicPressMediaHandling', array('_abspath'));
$cpmh->expects($this->any())->method('_abspath')->will($this->returnValue(vfsStream::url('root')));
update_option('upload_path', '1/files');
$this->assertEquals($expected_result, $cpmh->_expand_filter($filter, 'comic', (object)array('ID' => 1, 'post_date' => '2009-01-01 15:00:00')));
}

View File

@ -1,43 +0,0 @@
<?php
require_once('PHPUnit/Framework.php');
require_once('MockPress/mockpress.php');
require_once(dirname(__FILE__) . '/../comicpress-options.php');
require_once(dirname(__FILE__) . '/../classes/ComicPressMediaHandling.inc');
class ComicPressOptionsAdminTest extends PHPUnit_Framework_TestCase {
function providerTestSaveComicFilenameFilters() {
$cpmh = new ComicPressMediaHandling();
return array(
array(
array(),
array()
),
array(
array(1 => array(
'name' => 'test', 'filter' => 'myfilter'
)),
array(
'default' => $cpmh->default_filter,
'test' => 'myfilter'
)
),
array(
array(1 => array(
'name' => 'default', 'filter' => 'test'
)),
array(
'default' => 'test'
)
)
);
}
/**
* @dataProvider providerTestSaveComicFilenameFilters
*/
function testSaveComicFilenameFilters($incoming, $expected) {
$this->assertEquals($expected, comicpress_save_options_comic_filename_filters($incoming));
}
}

View File

@ -11,6 +11,7 @@ class ComicPressRelatedPostsTest extends PHPUnit_Framework_TestCase {
}
function testBuildPostTable() {
$this->markTestIncomplete();
$posts = array(
(object)array('ID' => 1, 'post_date' => '2009-01-01', 'post_title' => 'Post 1', 'guid' => 'post-1'),
(object)array('ID' => 2, 'post_date' => '2009-01-02', 'post_title' => 'Post 2', 'guid' => 'post-2'),
@ -31,7 +32,7 @@ class ComicPressRelatedPostsTest extends PHPUnit_Framework_TestCase {
wp_set_post_categories($id, $cats);
}
$output = '<div class="related_posts"><h4>Title</h4><ul><li><a title="Post 3" href="post-3">Post 3</a></li></ul></div>';
$output = '<div class="related_posts"><span>Title</span><table class="month-table"><tr><td class="archive-date" align="right">Jan 3, 2009</td><td class="archive-title"><a title="Post 3" href="post-3">Post 3</a></td></tr></table></div>';
$this->rp->related_categories = array(2);

View File

@ -1,3 +0,0 @@
<?php
$builder->option('sidebars_widgets', array());

View File

@ -1,154 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://comicpress.local/" />
<title>TestComicFilenameFilters</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TestComicFilenameFilters</td></tr>
</thead><tbody>
<tr>
<td>clickAndWait</td>
<td>link=ComicPress Options</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@id='comicpress-tab-config']/span</td>
<td></td>
</tr>
<!--Remove existing filters-->
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>filter_count</td>
</tr>
<tr>
<td>while</td>
<td>${filter_count} &gt; 0</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@id='comicpress-comic-filename-filters-holder']/div[1]/a</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you sure?</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>filter_count</td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<!--Add and remove works-->
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>filter_count</td>
</tr>
<tr>
<td>echo</td>
<td>${filter_count}</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>add-new-filter</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count} + 1)</td>
<td>true</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count} + 1)</td>
<td>true</td>
</tr>
<tr>
<td>click</td>
<td>//div[@id='comicpress-comic-filename-filters-holder']/div[2]/a</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you sure?</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count})</td>
<td>true</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count})</td>
<td>true</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>TestWidgetInitIsCorrect</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TestWidgetInitIsCorrect</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/wp-admin/</td>
<td></td>
</tr>
<!--Blow away all widgets-->
<tr>
<td>clickAndWait</td>
<td>link=Post Fixtures</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=themes/comicpress-2.8/test/fixtures/destroy-widgets.inc</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>pf[is_ok]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Load Provided Data']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>New data set loaded into WordPress.</td>
<td></td>
</tr>
<!--Check to make sure no widgets have lingering init code-->
<tr>
<td>clickAndWait</td>
<td>site-visit-button</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//script[contains(text(), 'var image_root')]</td>
<td></td>
</tr>
<!--Done, go home-->
<tr>
<td>open</td>
<td>/wp-admin/</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View File

@ -45,11 +45,12 @@ class ComicPressBookmarkWidget extends WP_Widget {
);
}
function init() {}
function init() {
add_action('wp_head', array(&$this, 'wp_head'));
}
function is_active() {
add_action('wp_head', array(&$this, 'wp_head'));
add_action('template_redirect', array(&$this, 'template_redirect'));
add_action('template_redirect', array(&$this, 'template_redirect'));
}
function template_redirect() {

View File

@ -33,8 +33,11 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
$temp_query = $wp_query->is_single;
$wp_query->is_single = true;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">".$title."</div>\r\n"; }
if ($instance['showtitle']) { echo "<div class=\"comic-post-widget-title\">".get_the_title()."</div>\r\n"; }
if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">".get_the_time('F jS, Y')."</div>\r\n"; }
the_content();
if ($instance['showcommentlink']) comicpress_display_comment_link();
$wp_query->is_single = $temp_query;
echo $after_widget;
}
@ -44,11 +47,14 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
UnProtect();
wp_reset_query();
} else {
if (!empty($post->post_content)) {
if (!empty($post->post_content) && in_comic_category()) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">".$title."</div>\r\n"; }
if ($instance['showtitle']) { echo "<div class=\"comic-post-widget-title\">".get_the_title()."</div>\r\n"; }
if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">".get_the_time('F jS, Y')."</div>\r\n"; }
the_content();
if ($instance['showcommentlink']) comicpress_display_comment_link();
echo $after_widget;
}
}
@ -57,17 +63,27 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
$instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
$instance['showtitle'] = (bool)( $new_instance['showtitle'] == 1 ? true : false );
$instance['showdate'] = (bool)( $new_instance['showdate'] == 1 ? true : false );
$instance['showcommentlink'] = (bool)( $new_instance['showcommentlink'] == 1 ? true : false );
return $instance;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false ) );
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false, 'showtitle' => false, 'showdate' => false, 'showcommentlink' => false ) );
$title = strip_tags($instance['title']);
$onlyhome = $instance['onlyhome'];
$showtitle = $instance['showtitle'];
$showdate = $instance['showdate'];
$showcommentlink = $instance['showcommentlink'];
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Heading:<br /><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<p><label for="<?php echo $this->get_field_id('showtitle'); ?>"><input id="<?php echo $this->get_field_id('showtitle'); ?>" name="<?php echo $this->get_field_name('showtitle'); ?>" type="checkbox" value="1" <?php checked(true, $showtitle); ?> /> Show the title of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showdate'); ?>"><input id="<?php echo $this->get_field_id('showdate'); ?>" name="<?php echo $this->get_field_name('showdate'); ?>" type="checkbox" value="1" <?php checked(true, $showdate); ?> /> Show the date of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showcommentlink'); ?>"><input id="<?php echo $this->get_field_id('showcommentlink'); ?>" name="<?php echo $this->get_field_name('showcommentlink'); ?>" type="checkbox" value="1" <?php checked(true, $showcommentlink); ?> /> Show the comment link to the post?</label></p>
<?php
}
}

View File

@ -24,7 +24,7 @@ class ComicPressCommentsWidget extends WP_Widget {
echo $before_widget;
$title = empty($instance['title']) ? __('Permalink','comicpress') : apply_filters('widget_title', $instance['title']); ?>
<?php if ('open' == $post->comment_status) { ?><div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&rdquo;</span>Comment ', '<span class="comment-balloon">1</span>Comment ', '<span class="comment-balloon">%</span>Comment '); ?></div><?php } ?>
<?php if ('open' == $post->comment_status) { ?><div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> Comment ', '<span class="comment-balloon">1</span> Comment ', '<span class="comment-balloon">%</span> Comment '); ?></div><?php } ?>
<?php
echo $after_widget;
}