Image to Post - random list
This commit is contained in:
parent
f497094482
commit
456176ac11
3 changed files with 9 additions and 9 deletions
|
@ -9,8 +9,8 @@ class RandomListInfo extends ExtensionInfo
|
|||
public $url = "http://www.drudexsoftware.com";
|
||||
public $authors = ["Drudex Software"=>"support@drudexsoftware.com"];
|
||||
public $license = self::LICENSE_GPLV2;
|
||||
public $description = "Allows displaying a page with random images";
|
||||
public $description = "Allows displaying a page with random posts";
|
||||
public $documentation =
|
||||
"Random image list can be accessed through www.yoursite.com/random
|
||||
"Random post list can be accessed through www.yoursite.com/random
|
||||
It is recommended that you create a link to this page so users know it exists.";
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class RandomList extends Extension
|
|||
$images_per_page = $config->get_int("random_images_list_count", 12);
|
||||
$random_images = [];
|
||||
|
||||
// generate random images
|
||||
// generate random posts
|
||||
for ($i = 0; $i < $images_per_page; $i++) {
|
||||
$random_image = Image::by_random($search_terms);
|
||||
if (!$random_image) {
|
||||
|
@ -57,12 +57,12 @@ class RandomList extends Extension
|
|||
|
||||
public function onSetupBuilding(SetupBuildingEvent $event)
|
||||
{
|
||||
$sb = new SetupBlock("Random Images List");
|
||||
$sb = new SetupBlock("Random Posts List");
|
||||
|
||||
// custom headers
|
||||
$sb->add_int_option(
|
||||
"random_images_list_count",
|
||||
"Amount of Random images to display "
|
||||
"Amount of Random posts to display "
|
||||
);
|
||||
|
||||
$event->panel->add_block($sb);
|
||||
|
|
|
@ -17,9 +17,9 @@ class RandomListTheme extends Themelet
|
|||
*/
|
||||
public function display_page(Page $page, array $images)
|
||||
{
|
||||
$page->title = "Random Images";
|
||||
$page->title = "Random Posts";
|
||||
|
||||
$html = "<b>Refresh the page to view more images</b>";
|
||||
$html = "<b>Refresh the page to view more posts</b>";
|
||||
if (count($images)) {
|
||||
$html .= "<div class='shm-image-list'>";
|
||||
|
||||
|
@ -29,10 +29,10 @@ class RandomListTheme extends Themelet
|
|||
|
||||
$html .= "</div>";
|
||||
} else {
|
||||
$html .= "<br/><br/>No images were found to match the search criteria";
|
||||
$html .= "<br/><br/>No posts were found to match the search criteria";
|
||||
}
|
||||
|
||||
$page->add_block(new Block("Random Images", $html));
|
||||
$page->add_block(new Block("Random Posts", $html));
|
||||
|
||||
$nav = $this->build_navigation($this->search_terms);
|
||||
$page->add_block(new Block("Navigation", $nav, "left", 0));
|
||||
|
|
Reference in a new issue