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.
You are not logged in.
Pages: 1
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->styleand
$this->pathTip:
Please first make a copy of either /backlight/custom/phplugins/phplugins-pangolin-sample.php or /backlight/custom/phplugins/phplugins-okapi-sample.php and give it a good name: let's call it /backlight/custom/phplugins/site-phplugins.php. Then select this file in your template editor as your site's phplugins file. Add your custom functions from your Backlight 1 phplugins file and adjust them accordingly.
Last edited by Daniel Leu (2018-12-19 07:46:19)
Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Thanks, Daniel! This was on my To-do list, but you've just saved me having to find that time. 
Offline
And make sure to start with the file named phplugins-pangolin-sample.php or phplugins-okapi-sample.php (if you're still using Okapi page templates). They are the ones that are set up for Backlight 2.
Last edited by rod barbee (2019-09-13 01:28:52)
Rod  
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
This is just a short summary on how to update phplugins from Backlight 1 to Backlight 2...........
Is it possible that someone will rewrite the PHP script below from BL 1 to BL 3?
Unfortunately I have no experience to do this myself.
<?php
/*
 *	TTG Core Elements "PHPlugins" User Hooks v1.2 - initialization mainline
 *
 *	developed by john bishop images (http://johnbishopimages.com)
 *	for Matthew Campagna of The Turning Gate (http://theturninggate.net)
 *
 */
function ttg_user_load( $style, $path ) {
	$g_tsvrl = explode( ' ', $style );                          // Extract gallery type
	define ( 'G_STYLE', strtoupper($g_tsvrl[1]) );              // and set global for later
	$g_path = str_ireplace('\\','/',$path);                     // change \ to / 
	$chunks = explode('/',$g_path);                             // and put into array
	define ( 'G_PATH', strtoupper($chunks[count($chunks)-2]) ); // gallery folder name is second to last
	//define ( 'TTG_SITE', '');                                   // set new site root for navigation, resources, etc.
	}
// SET USER FUNCTIONS BELOW
// Some example functions are included below. Feel free to delete or modify unwanted functions.
// ****************************************************************************************************
// display Sitelock logo
function ttg_footer_bottom ( $style, $path ) {
echo <<<SITELOCK
<div id="sitelock">
<a href = "#" onclick = "window.open ('https://www.sitelock.com/verify.php?site=rainerhassmann.de','SiteLock','width=600,height= 600, left = 160, top = 170 '); "> <img title =" 1 & 1 SiteLock "src =" https://shield.sitelock.com/shield/rainerhassmann.de" alt =" Homepage Security "> </a>
</div>
SITELOCK;
} // END /**/
// ****************************************************************************************************
// END USER FUNCTIONS
?>Pixelmover Rainer
Learn for a lifetime
Offline
first thing to do is used the latest version of the phplugins file found in your Backlight 3 Installer download under backlight/custom/phplugins
I'm going to assume you're using Pangolin templates, so use the phplugins-pangolin-sample.php file
Then you can use the same function with just one difference: the first line
copy/paste your function into the User Functions area of the new file.
Change the first line from:
function ttg_footer_bottom ( $style, $path ) {to
function footer_bottom() {Be sure to use a plain text editor when doing this.
save the file, giving it a new name and upload it to your site at /backlight/custom/phplugins/
Select your new phplugins file in the page templates Advanced Setup area
that should be it.
Rod  
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hi Rod.
Thanks for your help.
It all worked out and I am very grateful for this great community.
Pixelmover Rainer
Learn for a lifetime
Offline
Pages: 1