Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2018-12-19 02:01:33

bdfisher
Member
Registered: 2012-09-25
Posts: 27

WordPress Error

I have just installed the WP Theme. When I selected the theme within WordPress the following error message appeared. The WordPress pages do not resemble my Backlight pages so far - could this be the reason. I have not found a file, or even a directory, with the name shown, using Transmit, on my ISP's server.

Fatal error: Class 'APHPlugins' not found in /homepages/29/d247816976/htdocs/fisherpix/backlight/custom/phplugins/MyPlugins75_general_BL2rev.php on line 6

Any suggestions would be welcome  - thanks.

Barry

Offline

#2 2018-12-19 02:22:36

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: WordPress Error

Are you using one of the latest phplugins files that come with Backlight 2. There have been changes since Backlight 1
See this post: http://community.theturninggate.net/vie … hp?id=8966


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2018-12-19 05:36:32

bdfisher
Member
Registered: 2012-09-25
Posts: 27

Re: WordPress Error

I am using a phplugin file (using the pallet_top_title function) in my Backlight 2 and have used the coding described in the post to which you referred. Line 6 that is referred to in the error message is:

"class PHPlugins extends APHPlugins {"

That seems contrary to the error message. The Backlight 2 area of the site functions as expected and nothing changed after installing WordPress.

What else should I be checking?

Barry

Offline

#4 2018-12-19 05:58:38

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: WordPress Error

is this a new installation or were you previously using a backlight 1 based wordpress theme?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2018-12-19 06:00:30

bdfisher
Member
Registered: 2012-09-25
Posts: 27

Re: WordPress Error

I have been using Backlight 2 for some time. The WordPress installation is new.

Offline

#6 2018-12-19 06:17:15

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: WordPress Error

The code above the one you've quoted should include another reference to APHPLugins, so that those few lines look like this:

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}

class PHPlugins extends APHPlugins

Is that the case?  If not can you add in:

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}

above the class PHPlugins line and see if that fixes it.

You may need to re-export your theme after making that change.

Offline

#7 2018-12-19 06:43:52

bdfisher
Member
Registered: 2012-09-25
Posts: 27

Re: WordPress Error

Thanks to Ben - that fixed it.

I have never come across the code addition you recommended. It is not mentioned in post 8966 or any other postings that I have seen. Is this required only when using the WordPress addition to Backlight 2?

What code should I use to add an additional function? I once attempted to add a second function using the coding recommended in paragraphs 3 of post 8966. That did not work. I dropped the addition of "$this->my_" as recommended in the post and the phplugin worked fine.

My compliments and thanks to Mat, Ben, Daniel, Rod and everyone who provides their support in the online community. There are some very technical/complex aspects of the Backlight system and your support enables people like me to make effective use of the system.

Barry

Offline

#8 2018-12-19 07:02:43

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: WordPress Error

That code is part of the new phplugins.php files included in Backlight-2-Installer-105 download (in the backlight/custom/phplugins/ folder).
Specifically, the phplugins-pangolin-sample.php and phplugins-okapi-sample.php. The other, the theturninggate.php has older code in it. So use one of the other two as your starting point and add your own functions to them in the User Functions area.

For your functions, things work pretty much the same as they always have except that the hook names have changed (dropped the ttg_ part) and you no longer have to add the arguments ($style, $path).

So a function would start like this:

function footer_top() {
....your code.....

}

I've yet to come across a situation where I needed to use points 3 and 4 from Daniel's post, which is good because frankly, I don't understand it completely. I think it's for including your own php functions (like helper functions written to do specific things) inside of one of a hook function like what's illustrated here: http://community.theturninggate.net/vie … hp?id=9005


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#9 2018-12-19 13:27:51

bdfisher
Member
Registered: 2012-09-25
Posts: 27

Re: WordPress Error

Thanks for the clarification. I did not include that code in the phplugin that I have used to date (before installing WordPress); however, the function worked as intended in the Backlight area, even after installing WordPress.

Please also clarify whether it is necessary to include the following code in the phplugins-pangolin-sample.php in a phplugin file:

Lines 2 to 8
   >> presumably not necessary

Lines 10 to 17  "function user_load($style, $path) { ..."
   >> I have never included these lines. Are they necessary?
   
Lines 19 to 23
   >> Obviously necessary

Line 24  "{"
   >> Is the "}" in line 527 the closing bracket? If so, both are presumably necessary.

Lines 25 to 219
   >> presumably not necessary

Thanks again!

Barry

Offline

#10 2018-12-19 14:06:48

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: WordPress Error

Lines 10-17 are definitely necessary. If they're not there, the space-time continuum will crack.

25-219 while not necessary, describe all the hooks available.

the opening and closing braces on lines 24 and 527 are necessary.

All the sample functions in the USER area are not necessary and all are commented out. They are there to serve as examples and can be used by un-commenting them.

Since the file is basically a text file and doesn't take up a lot of space or resources, and since much of it is commented out anyway (all those hook definitions), it's not really necessary to remove "uneeded" text.

I remove the sample functions that I'm not going to use simply to make that area cleaner and easier to read.

I leave in the hook descriptions in case I need to refer to them for additional functions.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB