Difference between revisions of "Extensions:Galleries"

From Lorekeeper Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
Tag: 2017 source edit
Line 1: Line 1:
 
{{Extensioninfobox|title=Galleries|desc=Provides a space for users to upload art and writing.|auth=Mercury|status=Testing|github={{Github|user=itinerare|branch=galleries}}|migration=yes|package=yes}}
 
{{Extensioninfobox|title=Galleries|desc=Provides a space for users to upload art and writing.|auth=Mercury|status=Testing|github={{Github|user=itinerare|branch=galleries}}|migration=yes|package=yes}}
 
<!-- Put a short summary of your extension here! -->
 
<!-- Put a short summary of your extension here! -->
WIP WIP WIP WIP
+
Provides a structured space (galleries/folders) for users to upload images (art) and writing to, as well as for display of submitted art/literature, admin approval flows, favorites on gallery submissions, comments on gallery submissions, and (optionally) handling for awarding group currency for submissions made to galleries. See Features section below for more information.
=== just so many features ===
+
=== Features ===
 +
==== Galleries ====
 +
Submissions (art/literature) can be, well, submitted to these. They can be nested with no strict limit (though you should probably only nest them so deep...) and have fields/settings for:
 +
* Name: Self explanatory!
 +
* Sort: A number; these don't have to be unique. Galleries are sorted first by their sort number, then by name. Sub-galleries are also sorted this way, but only displayed within the context of their parent gallery, so a sub-gallery with a sort number of 1 will only ever display at the top of its' parent gallery's list of sub-galleries.
 +
* Description: A short, plaintext description of the gallery. I don't expect HTML would be necessary for this...
 +
* Submissions open (toggle): This per-gallery setting does not override submissions being closed globally, and staff with the "manage submissions" permission disregard it.
 +
* (If submissions can award group currency) Whether submissions award group currency (toggle): Similarly to the above, this does not override the global setting if it is disabled, but can disable group currency awards for particular galleries.
 +
* (If submissions must be approved) Number of votes required for approval: Number of staff votes (from staff with the "manage submissions" permission) required to approve a submission.
 +
==== Gallery Submissions ====
 +
==== Group Currency Module ====
 
== Installation ==
 
== Installation ==
 
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
 
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->

Revision as of 12:53, 20 October 2020

Galleries
Description Provides a space for users to upload art and writing.
Author(s) Mercury
Status Testing
Github galleries
LK Version Unspecified
Contains a Migration
Uses a Package


Provides a structured space (galleries/folders) for users to upload images (art) and writing to, as well as for display of submitted art/literature, admin approval flows, favorites on gallery submissions, comments on gallery submissions, and (optionally) handling for awarding group currency for submissions made to galleries. See Features section below for more information.

Features

Galleries

Submissions (art/literature) can be, well, submitted to these. They can be nested with no strict limit (though you should probably only nest them so deep...) and have fields/settings for:

  • Name: Self explanatory!
  • Sort: A number; these don't have to be unique. Galleries are sorted first by their sort number, then by name. Sub-galleries are also sorted this way, but only displayed within the context of their parent gallery, so a sub-gallery with a sort number of 1 will only ever display at the top of its' parent gallery's list of sub-galleries.
  • Description: A short, plaintext description of the gallery. I don't expect HTML would be necessary for this...
  • Submissions open (toggle): This per-gallery setting does not override submissions being closed globally, and staff with the "manage submissions" permission disregard it.
  • (If submissions can award group currency) Whether submissions award group currency (toggle): Similarly to the above, this does not override the global setting if it is disabled, but can disable group currency awards for particular galleries.
  • (If submissions must be approved) Number of votes required for approval: Number of staff votes (from staff with the "manage submissions" permission) required to approve a submission.

Gallery Submissions

Group Currency Module

Installation

See Tutorial: Installing Extensions for general information on how to install extensions. The following is the summary of installation steps required for galleries specifically:

  • Pull the branch.
  • Install the associated package using this method:
Installing packages with Composer:
Commands are given as composer [command]; if you have not installed composer globally, they will be php composer.phar [command] instead.
You may need to run composer self-update (assuming you have not recently) before installing package(s). If possible, update to composer v2.x; you may need to use the command composer self-update --2.
If feasible, run composer update.
If you encounter memory issues: Locally, run composer update. Copy the composer.lock file to your site's server.
Run composer install.
  • Run php artisan migrate.
  • Run php artisan add-gallery-settings.

Configuration

Basic Configuration

Adjust the added settings in the site settings admin panel. These are as follows:

  • gallery_submissions_open
  • gallery_submissions_require_approval
  • gallery_submissions_reward_currency

You may want to close gallery submissions globally while you are performing basic set up of galleries.

Create galleries in the data/galleries admin panel, adjusting settings per gallery as desired.

Currency Form Configuration

Only necessary if gallery_submissions_reward_currency is ENABLED.

If necessary, set the group_currency site setting (in the site settings admin panel) to the ID of the currency you wish to award to users for gallery submissions. By default, it is set to 1.

This module will work out of the box but will not be customized to your game, so you should configure it as appropriate.

The form itself is configured in config/lorekeeper/group_currency_form.php. This config file is commented extensively in an endeavor to make it easy to customize.

The function responsible for calculating a total based on users' form input is at the top of app/Helpers/AssetHelpers. This is unfortunately more or less hard-coded; however, it is also commented extensively. Note that the fields used in this formula must be the same as the ones within the form, or it will break and/or not calculate the total properly.

Usage

Submit art and/or writing to galleries by clicking the "submit" button in the index or on the gallery's page.

Troubleshooting

There is a known issue that arises when viewing a page with currency-related information with no currencies created, or with the group_currency site setting set to the ID of a currency that does not/no longer exists. This can be solved by creating a currency or setting the site setting to the ID of a currently extant currency.

For other issues, I can be found in the Lorekeeper discord.

See Also