This commit is contained in:
NottyNoz 2023-03-20 12:47:59 -04:00 committed by Shish
parent 39c939583b
commit 909e54b1e2
11 changed files with 73 additions and 26 deletions

View file

@ -26,7 +26,7 @@ class CronUploaderInfo extends ExtensionInfo
public function __construct()
{
$this->documentation = "Installation guide: activate this extension and navigate to System Config screen.</a>";
$this->documentation = "Installation guide: activate this extension and navigate to Board Config screen.</a>";
parent::__construct();
}
}

View file

@ -74,10 +74,10 @@ class CronUploaderTheme extends Themelet
$install_html = "
This cron uploader is fairly easy to use but has to be configured first.
<ol>
<li>Install & activate this plugin.</li>
<li>Go to the <a href='".make_link("setup")."'>Board Config</a> and change any settings to match your preference.</li>
<li>Copy the cron command above.</li>
<li>Create a cron job or something else that can open a url on specified times.
<li style='text-align: left;'>Install & activate this plugin.</li>
<li style='text-align: left;'>Go to the <a href='".make_link("setup")."'>Board Config</a> and change any settings to match your preference.</li>
<li style='text-align: left;'>Copy the cron command above.</li>
<li style='text-align: left;'>Create a cron job or something else that can open a url on specified times.
<br/>cron is a service that runs commands over and over again on a a schedule. You can set up cron (or any similar tool) to run the command above to trigger the import on whatever schedule you desire.
<br />If you're not sure how to do this, you can give the command to your web host and you can ask them to create the cron job for you.
<br />When you create the cron job, you choose when to upload new posts.</li>
@ -89,11 +89,11 @@ class CronUploaderTheme extends Themelet
$usage_html = "Upload your images you want to be uploaded to the queue directory using your FTP client or other means.
<br />(<b>{$queue_dirinfo['path']}</b>)
<ol>
<li>Any sub-folders will be turned into tags.</li>
<li>If the file name matches \"## - tag1 tag2.png\" the tags will be used.</li>
<li>If both are found, they will all be used.</li>
<li>The character \";\" will be changed into \":\" in any tags.</li>
<li>You can inherit categories by creating a folder that ends with \";\". For instance category;\\tag1 would result in the tag category:tag1. This allows creating a category folder, then creating many subfolders that will use that category.</li>
<li style='text-align: left;'>Any sub-folders will be turned into tags.</li>
<li style='text-align: left;'>If the file name matches \"## - tag1 tag2.png\" the tags will be used.</li>
<li style='text-align: left;'>If both are found, they will all be used.</li>
<li style='text-align: left;'>The character \";\" will be changed into \":\" in any tags.</li>
<li style='text-align: left;'>You can inherit categories by creating a folder that ends with \";\". For instance category;\\tag1 would result in the tag category:tag1. This allows creating a category folder, then creating many subfolders that will use that category.</li>
</ol>
The cron uploader works by importing files from the queue folder whenever this url is visited:
<br/><pre><a href='$cron_url'>$cron_url</a></pre>

View file

@ -29,5 +29,6 @@ class HelpPagesTheme extends Themelet
$page->set_title("Help - $title");
$page->set_heading("Help - $title");
$page->add_block(new NavBlock());
}
}

View file

@ -83,7 +83,7 @@ class Media extends Extension
public function onSetupBuilding(SetupBuildingEvent $event)
{
$sb = $event->panel->create_new_block("Media Engines");
$sb = $event->panel->create_new_block("Media Engine Commands");
// if (self::imagick_available()) {
// try {
@ -95,7 +95,6 @@ class Media extends Extension
// }
// } else {
$sb->start_table();
$sb->add_table_header("Commands");
$sb->add_text_option(MediaConfig::CONVERT_PATH, "convert", true);
// }

View file

@ -18,7 +18,7 @@ class PrivateImage extends Extension
public function onInitExt(InitExtEvent $event)
{
Image::$bool_props[] = "private ";
Image::$bool_props[] = "private";
}
public function onInitUserConfig(InitUserConfigEvent $event)
@ -29,9 +29,12 @@ class PrivateImage extends Extension
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
{
global $user;
$sb = $event->panel->create_new_block("Private Posts");
$sb->start_table();
$sb->add_bool_option(PrivateImageConfig::USER_SET_DEFAULT, "Mark posts private by default", true);
if ($user->can(Permissions::SET_PRIVATE_IMAGE)){
$sb->add_bool_option(PrivateImageConfig::USER_SET_DEFAULT, "Mark posts private by default", true);
}
$sb->add_bool_option(PrivateImageConfig::USER_VIEW_DEFAULT, "View private posts by default", true);
$sb->end_table();
}
@ -114,7 +117,7 @@ class PrivateImage extends Extension
{
global $user, $page;
if ($event->image->private==true && $event->image->owner_id!=$user->id && !$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
if ($event->image->private===true && $event->image->owner_id!=$user->id && !$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
}

View file

@ -10,7 +10,7 @@ class PrivateImageTheme extends Themelet
{
public function get_image_admin_html(Image $image): string
{
if ($image->private==false) {
if ($image->private===false) {
$html = SHM_SIMPLE_FORM(
'privatize_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),

View file

@ -39,7 +39,7 @@ class TagHistoryTheme extends Themelet
$h_next = '<a href="'.make_link('tag_history/all/'.($page_number+1)).'">Next</a>';
$nav = $h_prev.' | '.$h_index.' | '.$h_next;
$page->add_block(new Block("Navigation", $nav, "left"));
$page->add_block(new Block("Navigation", $nav, "left", 0));
}
/**

View file

@ -93,6 +93,14 @@ class Trash extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::VIEW_TRASH)) {
$event->add_link("Trash", make_link("/post/list/in%3Atrash/1"), 60);
}
}
public const SEARCH_REGEXP = "/^in:trash$/";
public function onSearchTermParse(SearchTermParseEvent $event)
{

View file

@ -98,6 +98,14 @@ class UserConfig extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if (!$user->is_anonymous()) {
$event->add_link("User Options", make_link("user_config"), 40);
}
}
public function onPageRequest(PageRequestEvent $event)
{
global $user, $database, $config, $page, $user_config;

View file

@ -62,6 +62,7 @@ class UserConfigTheme extends Themelet
$page->set_title("User Options");
$page->set_heading("User Options");
$page->add_block(new NavBlock());
$page->add_block(new Block("User Options", $table));
$page->set_mode(PageMode::PAGE);
}

View file

@ -32,16 +32,23 @@ A, A:visited {text-decoration: none; color: #0000EE;}
A:hover {text-decoration: underline; color: #DD0000;}
HR {border: none; border-top: 1px solid #D9BFB7; height: 0; clear: both;}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the navigation bar, and all its blocks *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
NAV {
width: 150px;
width: 200px;
float: left;
text-align:left;
text-align: center;
margin-left: 16px;
}
NAV .blockbody {
font-size: 0.85em;
text-align: center;
overflow: hidden;
}
NAV TABLE {
width: 150px;
}
NAV TD {
vertical-align: middle;
width: 100%;
}
NAV INPUT {
width: 100%;
@ -51,14 +58,34 @@ NAV SELECT {
width: 100%;
padding: 0;
}
NAV H3 {
text-align: left;
text-align: center;
}
.withleft {
margin-left: 160px;
}
TD {
vertical-align: top;
#paginator .blockbody {
background: none;
border: none;
box-shadow: none;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the main part of each page *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
ARTICLE {
margin-left: 226px;
margin-right: 16px;
margin-top: 16px;
text-align: center;
height: 1%;
}
ARTICLE TABLE {
width: 90%;
margin: auto;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *