From 39a88d8a60e095a502303a206ed725c9f8acc9c1 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 18 Nov 2009 22:52:43 -0500 Subject: [PATCH] more cleanup --- classes/ComicPressComicPost.inc | 5 +++++ docs/en_US/media-uploader.html | 8 +++++++- docs/en_US/storyline-post-template-tags.html | 2 +- functions.inc | 15 +++++++++++++++ test/ComicPressComicPostTest.php | 4 ++-- test/FunctionsTest.php | 4 ++++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/classes/ComicPressComicPost.inc b/classes/ComicPressComicPost.inc index ec2e035..efac07e 100644 --- a/classes/ComicPressComicPost.inc +++ b/classes/ComicPressComicPost.inc @@ -186,6 +186,11 @@ class ComicPressComicPost { $attachment = array_merge($attachment, $info['children']); $remove_from_list = array_merge($remove_from_list, array_values($info['children'])); } + foreach ($comicpress->comicpress_options['image_types'] as $type => $info) { + if (!isset($attachment[$type])) { + $attachment[$type] = $attachment[$default_type]; + } + } $attachments_with_children[] = $attachment; } } diff --git a/docs/en_US/media-uploader.html b/docs/en_US/media-uploader.html index 75dd82e..0645f27 100644 --- a/docs/en_US/media-uploader.html +++ b/docs/en_US/media-uploader.html @@ -45,6 +45,12 @@ After uploading an image, check Let ComicPress treat this image as a comic media file. This will enable ComicPress management of the file.

+

+ Uploaded media needs to be attached to a post so that ComicPress can work with it. You'll see all of the attached images under the Gallery tab. + If you want to use an image in your Media Library that isn't attached to the post, find the image in your Library, enable the option Change Parent?, + and save the changes. A file can only be attached to one image at a time. +

+

<img title> hovertext, a common way to add an additional punchline or comment to a comic, can be added on the Caption line. If not empty, it will automatically be inserted in the correct way into the image tag. @@ -72,7 +78,7 @@

- If you attach new images using the Media Uploader, click the Refersh button to reload the ordering. Any changes not saved via Update post will be lost. + If you attach new images using the Media Uploader, click the Refresh button to reload the ordering. Any changes not saved via Update post will be lost.

diff --git a/docs/en_US/storyline-post-template-tags.html b/docs/en_US/storyline-post-template-tags.html index 4feb2a8..fa60769 100644 --- a/docs/en_US/storyline-post-template-tags.html +++ b/docs/en_US/storyline-post-template-tags.html @@ -138,7 +138,7 @@ R('previous', 'comic'); // only search the children of the comic category R('previous', array('child_of' => 'comic', '!only' => 'comic')); -// get the previos post relative to the provided post +// get the previous post relative to the provided post R('previous', null, $other_post); diff --git a/functions.inc b/functions.inc index 364b796..962f37e 100644 --- a/functions.inc +++ b/functions.inc @@ -152,6 +152,21 @@ function RL($restrictions = null, $override_post = null) { // @codeCoverageIgnoreEnd +function In_R($restrictions = null, $override_post = null) { + global $post; + $post_to_use = !is_null($override_post) ? $override_post : $post; + + $post_categories = wp_get_post_categories($post_to_use->ID); + if (is_array($post_categories)) { + $category_id = reset($post_categories); + if (is_numeric($category_id)) { + return in_array($category_id, RL($restrictions, $post_to_use)); + } + } + + return false; +} + function M($override_post = null) { global $post, $__attachments; $post_to_use = !is_null($override_post) ? $override_post : $post; diff --git a/test/ComicPressComicPostTest.php b/test/ComicPressComicPostTest.php index a2a4f4f..6b9a10b 100644 --- a/test/ComicPressComicPostTest.php +++ b/test/ComicPressComicPostTest.php @@ -195,8 +195,8 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase { 'test-4' => array('enabled' => false), ), array( - array('comic' => 'test-1', 'default' => 'test-1'), - array('comic' => 'test-2', 'default' => 'test-2') + array('default' => 'test-1', 'comic' => 'test-1', 'rss' => 'test-1'), + array('default' => 'test-2', 'comic' => 'test-2', 'rss' => 'test-2') ) ), array( diff --git a/test/FunctionsTest.php b/test/FunctionsTest.php index 896a8ad..ff7afea 100644 --- a/test/FunctionsTest.php +++ b/test/FunctionsTest.php @@ -223,4 +223,8 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $this->assertEquals($expected_result, $result->term_id); } } + + function testIs_R() { + $this->markTestIncomplete(); + } }