more cleanup

This commit is contained in:
John Bintz 2009-11-18 22:52:43 -05:00
parent b0d1d42118
commit 39a88d8a60
6 changed files with 34 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -45,6 +45,12 @@
After uploading an image, check <strong>Let ComicPress treat this image as a comic media file</strong>. This will enable ComicPress management of the file.
</p>
<p>
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 <strong>Gallery</strong> 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 <strong>Change Parent?</strong>,
and save the changes. A file can only be attached to one image at a time.
</p>
<p>
<code>&lt;img title&gt;</code> hovertext, a common way to add an additional punchline or comment to a comic, can be added on the <strong>Caption</strong> line.
If not empty, it will automatically be inserted in the correct way into the image tag.
@ -72,7 +78,7 @@
</p>
<p>
If you attach new images using the <em>Media Uploader</em>, click the <em>Refersh</em> button to reload the ordering. Any changes not saved via <em>Update post</em> will be lost.
If you attach new images using the <em>Media Uploader</em>, click the <em>Refresh</em> button to reload the ordering. Any changes not saved via <em>Update post</em> will be lost.
</p>
<p>

View File

@ -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);
</pre>

View File

@ -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;

View File

@ -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(

View File

@ -223,4 +223,8 @@ class FunctionsTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected_result, $result->term_id);
}
}
function testIs_R() {
$this->markTestIncomplete();
}
}