uploader docs and storyline info functions
This commit is contained in:
parent
471ae0a782
commit
8d57acb09d
@ -17,6 +17,8 @@ class ComicPressAdmin {
|
||||
add_filter('comicpress_display_attached_images', array(&$this, 'comicpress_display_attached_images'), 10, 2);
|
||||
}
|
||||
|
||||
add_filter('comicpress_core_version', array(&$this, 'comicpress_core_version'));
|
||||
|
||||
$this->comic_image_types = array(
|
||||
'none' => __('Not a comic', 'comicpress'),
|
||||
'comic' => __('Comic', 'comicpress'),
|
||||
@ -31,6 +33,8 @@ class ComicPressAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
function comicpress_core_version($version = '') { return '1.0'; }
|
||||
|
||||
function comicpress_attached_image($content, $attachment_id, $index) {
|
||||
$content .= '<label class="comic-image-ordering">'
|
||||
. __('Image index:', 'comicpress')
|
||||
@ -167,6 +171,8 @@ class ComicPressAdmin {
|
||||
$id = preg_replace('#[^a-z0-9]+#', '_', strtolower($title));
|
||||
$content = implode('', $content);
|
||||
|
||||
$content = str_replace('src="', 'src="' . plugin_dir_url($path . '/' . $file), $content);
|
||||
|
||||
$all_docs[$id] = compact('title', 'content');
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,58 @@
|
||||
<h1>Uploading Comic Files</h1>
|
||||
<h1>Uploading and Managing Comic Files</h1>
|
||||
|
||||
<h2>WordPress Media Uploader Integration</h2>
|
||||
<h2>Comic Image Types</h2>
|
||||
|
||||
<p>
|
||||
<img src="../images/comic-image-types.png" alt="Comic Image Types" class="alignright" />
|
||||
|
||||
On webcomic websites, the comic image or images for a post typically have additional images associated to them — images for the archive pages, for nagivation, and for RSS feeds are common.
|
||||
|
||||
These images usually have set widths and/or heights so that they fit in with the layout of each page.
|
||||
|
||||
You can set these dimensions, as well as other important properties, on the <em>ComicPress</em> theme options page under <strong>Comic Image Types.</strong>
|
||||
|
||||
In a default <em>ComicPress Core</em> install, the following properies of each image are modifyable:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Name:</strong> The name of the image type when it's referred to within WordPress.</li>
|
||||
<li><strong>Short name:</strong> When using the <code>EM()</code> tag, the string used to access that particular image of a comic.</li>
|
||||
<li><strong>Default image type:</strong> If you don't provide a string to the first parameter of <code>EM()</code>, this is the image to show. There must always be a default image.</li>
|
||||
<li><strong>Dimensions:</strong> The width and/or height to set this image to when shown on screen. If set before uploading images, the standard WordPress thumbnail generation mechanism will automatically generate images of these sizes for you.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Other backends — ways of accessing different data sources beyond post attachments — may provide additional options in the future.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can add an infinite number of image types to your site, but you need at least one to be able to use ComicPress, even if you never embed any images.
|
||||
</p>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
||||
<h2>WordPress Media Uploader Integration</h2>
|
||||
|
||||
<p>
|
||||
<img src="../images/comicpress-media-uploader.png" alt="ComicPress Media Uploader" class="alignright" />
|
||||
|
||||
<em>ComicPress Core</em>'s standard method of storing comic images uses the <strong>Media Uploader</strong> under <em>Edit Post</em>.
|
||||
This is the way you normally upload images for inserting into your posts, except now, you have an additional option to enable so that
|
||||
ComicPress knows to treat an uploaded image as a comic image.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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>
|
||||
<code><img title></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.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When done, click <strong>Save changes</strong> rather than <em>Insert into Post</em>.
|
||||
<strong>Save changes</strong> will not close the popup window, so you can upload multiple images in one session.
|
||||
</p>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
BIN
docs/images/comic-image-types.png
Normal file
BIN
docs/images/comic-image-types.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
BIN
docs/images/comicpress-media-uploader.png
Normal file
BIN
docs/images/comicpress-media-uploader.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 116 KiB |
@ -167,3 +167,9 @@ function EM($attachment_info, $which = 'default', $action = 'embed') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SL() {
|
||||
$storyline = new ComicPressStoryline();
|
||||
$storyline->read_from_options();
|
||||
return $storyline->_structure;
|
||||
}
|
@ -5,6 +5,10 @@ require_once('MockPress/mockpress.php');
|
||||
require_once(dirname(__FILE__) . '/../functions.inc');
|
||||
|
||||
class FunctionsTest extends PHPUnit_Framework_TestCase {
|
||||
function setUp() {
|
||||
_reset_wp();
|
||||
}
|
||||
|
||||
function providerTestM() {
|
||||
return array(
|
||||
array(null),
|
||||
@ -176,4 +180,12 @@ class FunctionsTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals($expected_result, EM($info, $which, $action));
|
||||
}
|
||||
|
||||
function testSL() {
|
||||
$s = new ComicPressStoryline();
|
||||
$s->set_flattened_storyline('0/1,0/2,0/2/3');
|
||||
$s->read_from_options();
|
||||
|
||||
$this->assertEquals($s->_structure, SL());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user