Support > cpg1.6 themes (visuals)

My theme doesn't work properly on PHP7.1 and higher

(1/4) > >>

KchoPrro:
Hello friends, I would like to know what my gallery would need to be able to work with Php 7.6 or Php8. Apparently, I am using an old version of Php on my hosting but I have tried to update to higher versions but the gallery does not display well, it does not even display.

I put some screenshots with different versions of Php.

I have discovered that it is a problem with my theme, when I use the "curve" theme or any other integrated in CPG, everything is displayed correctly.

With PHP8 and 8.1 I see other problems even with "curve", related to the BBCode Control or Minicms plugins, but I'd be happy if my theme could at least work on PHP7.4. Any idea of the problem?

In PHP version 7.1-7.4, I get the following message if I enter directly:


--- Quote ---Fatal error: Uncaught ArgumentCountError: Too few arguments to function CPGPluginAPI::filter(), 1 passed in /galeria/themes/chaoticsoul/theme.php on line 1061 and at least 2 expected in /galeria/include/plugin_api.inc.php:156 Stack trace: #0 galeria/themes/chaoticsoul/theme.php(1061): CPGPluginAPI::filter('theme_thumbnail...') #1 /galeria/include/functions.inc.php(3166): theme_display_thumbnails(Array, '978', '\xC3\x9Altimas subida...', 'lastup', 0, 1, 245, false, false, 'thumb', NULL) #2 /galeria/index.php(1164): display_thumbnails('lastup', 0, 1, '4', 1, false) #3 {main} thrown in /galeria/include/plugin_api.inc.php on line 156
--- End quote ---

I guess that is the source of the problem  :'(.

KchoPrro:
In debug mode I get these errors:


--- Quote ---/themes/chaoticsoul/theme.php

    Warning line 31: Use of undefined constant album - assumed 'album' (this will throw an Error in a future version of PHP)
    Notice line 31: Trying to access array offset on value of type null

/admin.php

    Notice line 174: Undefined index: alb_desc_thumb
    Notice line 513: Undefined index: alb_desc_thumb


--- End quote ---

I don't know if they have anything to do with the problem  :-\.

ron4mac:

--- Quote from: KchoPrro on September 13, 2022, 07:53:02 pm ---In PHP version 7.1-7.4, I get the following message if I enter directly:

--- End quote ---

In the theme's theme.php file, replace line #1061 with:

--- Code: ---    $wrapper_start = CPGPluginAPI::filter('theme_thumbnails_wrapper_start', null);
--- End code ---

KchoPrro:

--- Quote from: ron4mac on September 13, 2022, 10:35:13 pm ---In the theme's theme.php file, replace line #1061 with:

--- Code: ---    $wrapper_start = CPGPluginAPI::filter('theme_thumbnails_wrapper_start', null);
--- End code ---

--- End quote ---

Thanks ron4mac, now the last uploaded photos appear (lastup), but the menu (sidebar) still does not appear, it only appears when we enter an image. Random images are also not displayed.  :-[

ron4mac:
In trying to help you with your site, I had gotten the original ChaoticSoul version (it is very old) and made necessary changes to get it to function properly. At the time, I didn't know that you were using PHP 7.0 and I just fixed things with it to get it functioning with PHP 8.1 ... as my focus was to see whether the theme was part of the problem for FancyBox. Attached here is the theme.php file I have that is running with CPG and PHP 8.1

Navigation

[0] Message Index

[#] Next page

Go to full version