Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-09-13 02:35:31

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,012
Website

Updating phplugins

This is just a short summary on how to update phplugins from Backlight 1 to Backlight 2.

It's a good idea to look at the new sample file (backlight/custom/phplugins/phplugins-pangolin-sample.php) to see all the available functions and how the file structure is.

1) Phplugins are now class based. So all functions need to be defined within a class context. This is well seen in the example file.

class PHPlugins extends APHPlugins {
  // put your functions here 
}

2) Function names changed and lost their arguments. You only need to remove the ttg_ prefix and whatever is between parentheses.
Before:

function ttg_pallet_top_title( $style, $path ) { 
	echo '
		// ......
	';
	return false;
} // END /**/

After:

// Basic structure for a PHPlugins function
function pallet_top_title() { 
	echo '
		// ......
	';
	return false;
} // END /**/

3) If you call another function within the PHPlugins class, you need to use

$this->my_function()

instead of just

my_function()

4) Backlight 1 $style and $path arguments are accessible as

$this->style

and

$this->path

Daniel Leu | Photography   
DanielLeu.com

Offline

#2 2018-09-13 02:56:31

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,412
Website

Re: Updating phplugins

Thanks, Daniel! This was on my To-do list, but you've just saved me having to find that time. big_smile


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

Board footer

Powered by FluxBB