MyBB Community Forums

Full Version: ougc Pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
(2020-11-06, 03:54 PM)Omar G. Wrote: [ -> ]Pages that load at init do load during the plugins load process, which means any plugin that isn’t loaded before this plugin is loaded won’t load at all as the page will stop the script execution.

This can be worked around by enabling your plugins before this plugin, so they load before. Or simply disabling and enabling this plugin alone, which would probably be the best approach as other plugins might perform template edits, etc.

This is one of the major downsides with loading pages at init, as there is little more to load apart from plugins when they are rendered as you can see in the following link.
https://github.com/mybb/mybb/blob/2408f4...t.php#L239

I should probably look into improving the pages.php file to load pages only after all init code was executed, opposed to how it works right now where that file is not used for pages loaded at init.

That would certainly be desirable at some point.

That sounds like a good idea, the way I got around it after trying disabling all plugins then enabling as you suggested. This did not work but altering the priority of my plugin call to global_end did get it working.
Oh, I see, yes, if you are using a basic page which load at global_end you would need to hook at a lower priority as you just did or use a previous hook like global_intermediate.

I suppose this plugin should run at a higher plugin priority so all other plugins run before this, as well as adding a couple of extra hooks.
(2020-11-06, 11:26 PM)Omar G. Wrote: [ -> ]Oh, I see, yes, if you are using a basic page which load at global_end you would need to hook at a lower priority as you just did or use a previous hook like global_intermediate.

I suppose this plugin should run at a higher plugin priority so all other plugins run before this, as well as adding a couple of extra hooks.

I can not use 'global_start' or 'global_intermediate' as they appear in global.php before $navbits() is defined so I have to use 'global_end'
Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/.../data/www/.../inc/plugins/ougc_pages.php:41 Stack trace: #0 /var/www/.../data/www/.../admin/modules/config/plugins.php(522): require_once() #1 /var/www/.../data/www/.../admin/index.php(825): require('/var/www/.../...') #2 {main} thrown in /var/www/.../data/www/.../inc/plugins/ougc_pages.php on line 41
https://github.com/OUGC-Network/OUGC-Pag...1.8.33_dev

A new pre-release has been made. Keep reading to get the information onto what has changed:
  • Minimum MyBB requirement bumped up to 1.8.30
  • Minimum PHP requirement bumped up to 8.2
  • Update required for MySQL 8 (not minimum requirement).
  • Update to the plugin files structure.
  • Select the priority for appending categories to the UserCP menu.
  • initialize PHP files on global end (default), global intermediate, global start, or at plugin execution time ("init").
  • Build a menu for each category to link to pages in the header.
  • Use a theme template instead for each page's content.
  • Add a navigation (previous/next) to categories.
  • Add a "last edited on" message to all pages.
  • Update example pages for PHP and MyBB versions.

Importing PageManager pages should still work but no test was made.

Updates from previous version should be possible but always take precautions. This is probably going to be the major and final release for MyBB 1.8, next major update will be for MyBB 1.9.

I will be writing a proper documentation for all the plugin features in the following days and then release the package.
Looks really cool, Omar.
Thank you Laird. As per our beloved contributor @Eldenroot I added support for PHP 7.4, and it is possible it also works on PHP 7.2 but I won't support lower than 7.4 officially.

Some issues related to update from previous versions and minor improvements were also pushed.
why am i getting this error ?

Fatal error: Cannot use 'true' as class name as it is reserved in /home/storiesp/public_html/inc/plugins/ougc_pages.php on line 59
(2023-05-30, 09:03 AM)PARADOX987 Wrote: [ -> ]why am i getting this error ?

'Cos you're downloading the release before Omar:

(2023-05-30, 01:26 AM)Omar G. Wrote: [ -> ]added support for PHP 7.4

(Which also, it seems, added support for PHP < 8.2, given that per the changelog of the Type declarations manual page, support for declaring the "true" literal - which the previous plugin code was doing - was only added in that version).

Try this one instead: https://github.com/OUGC-Network/OUGC-Pag...e-1833.zip

I still get an error on that one on installation though, which seems to be due to line #296 of inc/plugins/ougcPages/admin.php assuming that the ougc_pages database table already exists.

Omar, I also encountered errors accessing pages and categories when the "Use SEO-friendly URLs" was set to "No".

The attached patch fixes those errors as well as the installation error mentioned above (line #360 also needed fixing).
Thank you @Laird, I trust your code so I went ahead and pushed your fix along a few last minute fixes, additionally I have been pushing several changes over the past few hours to finish a solid package.

I encourage anyone interested in this plugin to test it and comment with any issue you find in order for them to get fixed.

I also uploaded some screenshots that you can find in the feature branch and should be included in the develop package linked below.

https://github.com/OUGC-Network/OUGC-Pag...1.8.33_dev

I pushed the documentation for this new version in the feature branch if anyone is interested. I will now focus on testing for a few days before releasing a final package, in the meantime I will get to update other plugin.
Pages: 1 2 3 4 5 6 7 8 9