diff --git a/ext/random_image/info.php b/ext/random_image/info.php index 4b01c327..bc6ac3a1 100644 --- a/ext/random_image/info.php +++ b/ext/random_image/info.php @@ -5,22 +5,22 @@ class RandomImageInfo extends ExtensionInfo public const KEY = "random_image"; public $key = self::KEY; - public $name = "Random Image"; + public $name = "Random Post"; public $url = self::SHIMMIE_URL; public $authors = self::SHISH_AUTHOR; public $license = self::LICENSE_GPLV2; - public $description = "Do things with a random image"; + public $description = "Do things with a random post"; public $documentation = -"Viewing a random image +"Viewing a random post
Visit /random_image/view -

Downloading a random image +

Downloading a random post
Link to /random_image/download. This will give -the raw data for an image (no HTML). This is useful so that you +the raw data for a post (no HTML). This is useful so that you can set your desktop wallpaper to be the download URL, refreshed every couple of hours. -

Getting a random image from a subset -
Adding a slash and some search terms will get a random image +

Getting a random post from a subset +
Adding a slash and some search terms will get a random post from those results. This can be useful if you want a specific size -of random image, or from a category. You could link to +of random post, or from a category. You could link to /random_image/download/size=1024x768+cute"; } diff --git a/ext/random_image/main.php b/ext/random_image/main.php index a7fa55b5..e0e59355 100644 --- a/ext/random_image/main.php +++ b/ext/random_image/main.php @@ -22,7 +22,7 @@ class RandomImage extends Extension $image = Image::by_random($search_terms); if (!$image) { throw new SCoreException( - "Couldn't find any images randomly", + "Couldn't find any posts randomly", Tag::implode($search_terms) ); } @@ -43,7 +43,7 @@ class RandomImage extends Extension public function onSetupBuilding(SetupBuildingEvent $event) { - $sb = new SetupBlock("Random Image"); + $sb = new SetupBlock("Random Post"); $sb->add_bool_option("show_random_block", "Show Random Block: "); $event->panel->add_block($sb); } @@ -62,7 +62,7 @@ class RandomImage extends Extension public function onPageSubNavBuilding(PageSubNavBuildingEvent $event) { if ($event->parent=="posts") { - $event->add_nav_link("posts_random", new Link('random_image/view'), "Random Image"); + $event->add_nav_link("posts_random", new Link('random_image/view'), "Random Post"); } } } diff --git a/ext/random_image/test.php b/ext/random_image/test.php index b9af4950..0e185836 100644 --- a/ext/random_image/test.php +++ b/ext/random_image/test.php @@ -8,10 +8,10 @@ class RandomImageTest extends ShimmiePHPUnitTestCase $this->log_out(); $page = $this->get_page("random_image/view"); - $this->assertEquals("Image $image_id: test", $page->title); + $this->assertEquals("Post $image_id: test", $page->title); $page = $this->get_page("random_image/view/test"); - $this->assertEquals("Image $image_id: test", $page->title); + $this->assertEquals("Post $image_id: test", $page->title); $page = $this->get_page("random_image/download"); $this->assertNotNull($page->data); @@ -27,21 +27,21 @@ class RandomImageTest extends ShimmiePHPUnitTestCase # enabled, no image = no text $config->set_bool("show_random_block", true); $page = $this->get_page("post/list"); - $this->assertNull($page->find_block("Random Image")); + $this->assertNull($page->find_block("Random Post")); # enabled, image = text $image_id = $this->post_image("tests/pbx_screenshot.jpg", "test"); $page = $this->get_page("post/list"); - $this->assertNotNull($page->find_block("Random Image")); + $this->assertNotNull($page->find_block("Random Post")); # disabled, image = no text $config->set_bool("show_random_block", false); $page = $this->get_page("post/list"); - $this->assertNull($page->find_block("Random Image")); + $this->assertNull($page->find_block("Random Post")); # disabled, no image = no image $this->delete_image($image_id); $page = $this->get_page("post/list"); - $this->assertNull($page->find_block("Random Image")); + $this->assertNull($page->find_block("Random Post")); } } diff --git a/ext/random_image/theme.php b/ext/random_image/theme.php index dc17d0af..38606619 100644 --- a/ext/random_image/theme.php +++ b/ext/random_image/theme.php @@ -7,7 +7,7 @@ class RandomImageTheme extends Themelet { public function display_random(Page $page, Image $image) { - $page->add_block(new Block("Random Image", $this->build_random_html($image), "left", 8)); + $page->add_block(new Block("Random Post", $this->build_random_html($image), "left", 8)); } public function build_random_html(Image $image, ?string $query = null): string