Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: forum plugin  (Read 2773 times)

0 Members and 1 Guest are viewing this topic.

406man

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
forum plugin
« on: August 11, 2023, 04:58:11 pm »

The forum plugin has been around for over a decade but it was never upgraded to work with the CPG 1.6.x line. It has been a key feature of my galleries for a long time and serves a useful function. It’s the reason why I stayed on the CPG 1.5.x line for so long until a PHP upgrade to 7.x.x  at my web host a few months ago forced an upgrade to 1.6.22 and I had to leave the forum behind. With development by the original and later authors having ceased years ago I decided to upgrade it myself to be CPG 1.6.x compatible. The last version released was 2.1 Beta which was used as the base for this plugin. This Version 3.0. I’m releasing it to the CPG community as there may be other galleries out there that would like to use it. The major benefits over standalone forums are that it’s simple, closely linked into CPG and it looks like a part of the gallery rather than a separate feature to the side.  The administrator does not have to follow the development of a separate forum software product to arrange upgrades. Usernames and passwords are shared between gallery and forum without having to set up bridging.

The main changes which I’ve made involve:
1) the installation procedures
2) a new notification feature
3) Customisation – CSS and custom code (templates)

The previous installation procedures were, in my experience, troublesome. I had to do a lot of work to  get the database tables defined and working when I installed it into my 1.5.x gallery a decade ago.  With 1.6.x I’ve made a load of changes behind the scenes to make the database-related  installation smooth. It works great in my galleries and hope it will work well for others. Configuration of the plugin didn’t follow the latest standards so I rewrote this part to make it work like all other plugins from an administrator’s perspective.

The forum already has notifications for new topics and replies which have to be set up individually in advance. The feature I’ve added is to allow up to three email addresses to be notified when any new topic is added. Set it up once and forget. The idea is that the notification email addresses could be mailing list addresses so that a group of users can be notified. Most web hosts allow mailing lists to be set up or one of the dedicated mailing list services (Google Groups, groups.io) could be used. It could alternatively be used to notify up to three administrators or users. The existing notification functions are unchanged.

I’ve made a few small changes to the gallery which mainly relate to visuals including CSS. It now uses the CSS style sheet belonging to the Gallery’s theme. For elements relating to the forum only there’s a style sheet in \plugins\forum\forum\templates\classic\style.css
This is intended to be used with all themes. To be compatible with forum-specific CSS files created in the past it will pick up any style sheet in: \plugins\forum\forum\templates\xyxtheme\style.css   where xyxtheme is the name of the theme of your gallery. So if anyone had a customised style sheet for their 1.5.x forum and wants to re-use it – create this directory and put the style sheet there. If you want to change the CSS for the forum I suggest you put the code in your theme’s CSS file for your gallery, or, if you can’t override it using that file, create the <your-theme-name> directory and put style.css there.

During testing I found a fault which was present in 1.5.x that messed up the forum internals when the last message in a topic was deleted. Now fixed. Numerous other minor bugs, features and inconsistencies have been addressed.

The earliest CPG version I’ve tested it with is 1.6.22. It should also work with 1.6.18 which is when the time formats changed, so I don’t recommend going to earlier versions – although you could try it, there’s no guarantee that the time and date formats will appear correctly. I’ve tested it with PHP 7.4.33 and 8.0.26.  There were numerous changes needed for PHP 8 to exorcise silly little bugs that had been in there for years but it should be OK now. I hope I found and fixed them all.

If someone reading this has a CPG 1.5.x gallery with the forum and wants to upgrade to 1.6.x with this new plugin, here’s what to do in summary:   
-   Upgrade the Gallery to the latest version (1.6.25 at the time of writing this note) using the standard upgrade procedure.
-   Delete the forum plugin (the 1.5.x version)
-   Copy this new forum plugin to the plugin directory.
-   Using the Plugin Manager install the forum plugin
-   Using the Plugin Manager configure the plugin to suit

There is nothing you need to do with the database when upgrading from the most recent version of the 1.5.x forum which is 2.1 Beta. If you have an older version of the forum it might work but, sorry, I haven’t tested it.

Using the Forum
The administrator must first set up the basic structure of the forum. Here is an example where a forum is set up to discuss two separate areas: sport and travel.
Using the Forum Manager option in the Administrator’s menu , Sport Forum and Travel Forums are the categories and  are created using the “New Category” button.
Within the Sport board the various subjects are set up: Football, Cricket and Golf. Each of these is created using the “New Board” button and the order in which they are displayed is chosen using the up and down arrows.
Similarly, the Travel Board is set up with the subjects “Europe”, “USA” and “Australia” using the “New Board” button.
The users of the forum  can now create any topics that they want inside the headings just created. If the administrator has chosen to enable notifications, a notification email will be sent when (for example) a user creates the topic “France” in the Europe board in the Travel forum. If they create a topic in the wrong place – for example a discussion about Hawaii in the European Travel forum, the Administrator can move it by displaying the message and using the “Move Topic” button at the bottom left of the screen
There are settings to allow guests (someone who is not logged in to the Gallery) to read the forum and create topics. When the forum is installed the more secure option is set up so that guests don’t have access. These can be changed by the Administrator using the Settings button in Forum Manager.

Feedback welcome.
« Last Edit: August 25, 2023, 06:08:08 pm by 406man »
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.