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
I have edited my phplugins for:
- Menu through wordpress
- The album name in the header
- activating the custom.css
The first two things work fine
The last one does not work (my background is not red). I have used the wordpress theme. Maybe that affects the css?
Custom css:
http://test.theomolenaar.nl/galleries/p … custom.css
My phplugins is here:
http://test.theomolenaar.nl/galleries/p … lugins.php
I have no clue why it does not work. Or are things different with the wordpress theme?
Contents PHPlugins:
<?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.
}
/*
*
* *************************************************************************************
* * *
* * Warning! When using echo or print special care must be qiven to using quotes. *
* * *
* * Strings inside single quotes must contain only double quotes *
* * or all single quotes must be escaped (ie \') or vice-versa *
* * *
* *************************************************************************************
*
* Fourteen user exits are defined in all web engines - all are optional
* (i.e. ttg_user_load.php may be the only processing)
*
* Some web engines will have additional exits defined, specific to that gallery type
*
* Each is called with the same parameters:
* %1 - TTG gallery-style gallery-release
* 3 blank delimited values
* - %1.1 - 'TTG'
* - %1.2 - string describing gallery type; no embedded blanks
* - %1.3 - a series of two to three period delimited integers
* describing gallery release level; x.y or x.y.z
* %2 - server filesystem file name and path of calling file
*
*
* Defined exits:
*
* ttg_user_load - return value ignored
* - called immediately after this file returns
* - called before any output is produced
* - all header and response variables are accessible
* - cookie and session processing can be initialized
* - globals to be used by later hook calls can be defined
*
* ttg_style_navigation - if return = false normal TTG navigation script is skipped
* - called in the style section in the head of the page
* - encompasses the call to the stylesheet for the site navigation menu;
* use to omit or replace this script when creating custom navigation
*
* ttg_head_end - return value ignored
* - called just before ending head tag
* - encompasses nothing; use to insert content with the head, after all other TTG head content has processed
*
* ttg_body_top - return value ignored
* - called first within the body element, before header
* - encompasses nothing; use to insert content at top of body
*
* ttg_header_masthead - if return = false normal TTG masthead processing is skipped
* - called inside the header element
* _ encompasses those elements comprising the masthead content
*
* ttg_header_navigation - if return = false normal TTG site navigation is skipped
* - called inside the header element, inside the nav element
* - encompasses those elements comprising the main site navigation
*
* ttg_canvas_top - return value ignored
* - called immediately after the header, before the block or grid content
* - encompasses nothing; use to insert content above page content
*
* ttg_block_top - if return = false normal TTG block content processing is skipped
* - called immediately within the div #the-block .core, before the copy
* - encompasses the full content of the div #the-block .core, which is typically the "gallery description"
*
* ttg_block_bottom - return value ignored
* - called just before closing the div #the-block .core, after the copy block
* - encompasses nothing; use to insert content following the gallery description, but within that same box
*
* ttg_grid_top - if return = false normal TTG grid content processing is skipped
* - called immediately within the div #the-grid .core, before the image gallery
* - encompasses the full content of the div #the-grid .core, which is typically the "image gallery"
*
* ttg_grid_bottom - return value ignored
* - called just before closing the div #the-grid .core, after the image gallery
* - encompasses nothing; use to insert content following the image gallery, but within that same box
*
* ttg_canvas_bottom - return value ignored
* - called immediately after page content, before the footer
* - encompasses nothing; use to insert content beneath page content
*
* ttg_social_media - if return = false normal TTG social networking block process is skipped
* - called first within the #social-media-profiles element
* - encompasses those elements comprising the social media profiles content
*
* ttg_footer_top - if return = false normal TTG footer process is skipped
* - called first within the footer element
* - encompasses those elements comprising the footer content
*
* ttg_footer_bottom - return value ignored
* - called just before closing the div #footer .core, after the footer content
* - encompasses nothing; use to insert content beneath footer content
*
* ttg_scripts_navigation - if return = false normal TTG navigation script is skipped
* - called in the scripts section at the end of the page
* - encompasses the call to the script used to power navigation;
* use to omit or replace this script when creating custom navigation
*
* ttg_body_bottom - return value ignored
* - called last within the body element, after the footer and before the closing body tag
* - encompasses nothing; use to insert content at the bottom of the body
*
*/
// SET USER FUNCTIONS BELOW
// Some example functions are included below. Feel free to delete or modify unwanted functions.
// ****************************************************************************************************
// CUSTOM STYLESHEET
// This function implements a custom stylesheet from which users may provide additional page styling or override existing styling set by the plugin
// Edit the custom.css file in /phplugins/css/ to define styles
// Serves as an example of a function being applied globally
function ttg_head_end( $style, $path ) {
echo '
<link rel="stylesheet" href="/phplugins/css/custom.css" />
';
} // END
/* TOEGEVOEGD voor wordpress menu's
*/
// GET FUNCTIONS FROM WORDPRESS
define('__ROOT__', '/home/strato/http/power/rid/90/89/51959089/htdocs/_pictures_CE4_V01/'); // SET PATH TO WORDPRESS
require_once(__ROOT__.'/wp-includes/version.php'); global $wp_version;
require_once(__ROOT__.'/wp-load.php');
// SITE-WIDE NAVIGATION FROM WORDPRESS
function ttg_header_navigation( $style, $path ) {
if (G_STYLE != 'CE4-WORDPRESS') {
echo '
<div id="navigation-container" class="navigation-container clearfix">
<div id="navigation" class="block-id navigation clearfix">
<div class="mantle clearfix">
<div class="core clearfix">
<div id="navigation-background">
<div id="r2d2-menu" class="clearfix">
<ul id="pull">
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li id="open-nav"><a href="#r2d2-menu"><i class="fa fa-reorder"></i></a></li>
<li id="close-nav"><a href="#"><i class="fa fa-times"></i></a></li>
</ul>
';
wp_nav_menu(array( 'theme_location' => 'site-navigation', 'container' => false, 'menu_id' => 'nav', 'menu_class' => '', 'fallback_cb' => false, 'walker' => new My_Walker_Nav_Menu() ));
echo '
</div><!-- #r2d2-menu -->
</div><!-- #navigation-background -->
</div>
</div>
</div> <!-- #navigation -->
</div> <!-- #navigation-container -->
';
return false; // Replaces normal menu for non-WordPress pages
}
return true; // WordPress returns normal menu
} // END
/* TOEGEVOEGD voor Titel in kop
*/
function ttg_header_masthead( $style, $path) {
if ((G_STYLE == 'CE4-GALLERY' || G_STYLE == 'CE4-AUTOINDEX' || G_STYLE == 'CE4-MOBILE')AND (G_PATH != 'GALLERIES'))
{
echo '
<div id="masthead" class="block-id masthead clearfix">
<div class="mantle clearfix">
<div class="core clearfix">
<div id="profile-image" class="profile-image clearfix">
<div id="profile-icon" class="profile-icon clearfix">
<a href="/"><img alt="Pictures.theomolenaar.nl - A visual blog" src="/galleries/lib/images/identityplate.png" width="402" height="90" /></a>
</div>
<div id="profile-labels" class="profile-labels clearfix">
<h1><span><a href="#">' . ALBUMTITLE . '</a></span></h1>
<h2><span>a visual travel blog</span></h2>
</div>
</div><!-- #profile-image -->
</div>
</div>
</div> <!-- #masthead -->
';
return false; // replaces normal mastead for CE4 Gallery pages
}
return true; //Pages not CE4-Gallery or autoindex use normal masthead
} //END
/* DELETE THIS LINE
// SITE-WIDE "TRADITIONAL" NAVIGATION MENU
// This function establishes a site-wide navigation menu using pseudo-absolute URLs (beginning "/")
// -- portable, domain agnostic, and without the location limitations of relative URLs.
// Serves as an example of a function being applied globally
function ttg_header_navigation( $style, $path ) {
echo '
<div id="navigation-container" class="navigation-container clearfix">
<div id="navigation" class="block-id navigation clearfix">
<div class="mantle clearfix">
<div class="core clearfix">
<div id="navigation-background">
<div id="r2d2-menu" class="clearfix">
<ul id="pull">
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li id="open-nav" class="toggle-nav"><a href="#r2d2-menu"><i class="fa fa-reorder"></i></a></li>
<li id="close-nav" class="toggle-nav"><a href="#"><i class="fa fa-remove"></i></a></li>
</ul>
<p id="nav" class="clearfix">
<!-- EDIT ONLY BELOW THIS LINE : -->
<span><a href="/">Home</a></span>
<span><a href="/galleries.php">Galleries</a></span>
<span><a href="/blog/">Blog</a></span>
<span><a href="/services.php">Services</a></span>
<span><a href="/info.php">Info</a></span>
<span><a href="/about.php">About</a></span>
<span><a href="/contact.php">Contact</a></span>
<!-- EDIT ONLY ABOVE THIS LINE -->
</p>
</div><!-- #r2d2-menu -->
</div><!-- #navigation-background -->
</div>
</div>
</div> <!-- #navigation -->
</div> <!-- #navigation-container -->
';
return false; // Replaces normal menu
} // END
DELETE THIS LINE */
/* DELETE THIS LINE
// SITE-WIDE "DROP-DOWN" NAVIGATION MENU
// This function establishes a site-wide navigation menu using pseudo-absolute URLs (beginning "/")
// -- portable, domain agnostic, and without the location limitations of relative URLs.
// Serves as an example of a function being applied globally.
function ttg_header_navigation( $style, $path ) {
echo '
<div id="navigation-container" class="navigation-container clearfix">
<div id="navigation" class="block-id navigation clearfix">
<div class="mantle clearfix">
<div class="core clearfix">
<div id="navigation-background">
<div id="r2d2-menu" class="clearfix">
<ul id="pull">
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li id="open-nav" class="toggle-nav"><a href="#r2d2-menu"><i class="fa fa-reorder"></i></a></li>
<li id="close-nav" class="toggle-nav"><a href="#"><i class="fa fa-remove"></i></a></li>
</ul>
<ul id="nav">
<!-- EDIT ONLY BELOW THIS LINE : -->
<li><a href="/">Home</a></li>
<li><a href="/galleries.php">Galleries</a>
<ul>
<li><a href="#">Example Drop-down Menus :</a></li>
<li><a href="#">A Few Good Bands</a>
<ul>
<li><a href="#">Efterklang</a></li>
<li><a href="#">Émilie Simon</a></li>
<li><a href="#">Liam Finn</a></li>
<li><a href="#">Sigur Rós</a></li>
<li><a href="#">The Dø</a></li>
</ul>
</li>
<li><a href="#">A Few Good Movies</a>
<ul>
<li><a href="#">Blade Runner</a></li>
<li><a href="#">The Brothers Bloom</a></li>
<li><a href="#">The Darjeeling Limited</a></li>
<li><a href="#">The Life Aquatic w/ Steve Zissou</a></li>
<li><a href="#">Pacific Rim</a></li>
</ul>
</li>
<li><a href="#">A Few Good TV Shows</a>
<ul>
<li><a href="#">Battlestar Galactica</a></li>
<li><a href="#">Castle</a></li>
<li><a href="#">Doctor Who</a></li>
<li><a href="#">Eureka</a></li>
<li><a href="#">Farscape</a></li>
<li><a href="#">Firefly</a></li>
<li><a href="#">Legend of Korra</a></li>
<li><a href="#">Luther</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/services.php">Services</a></li>
<li><a href="/info.php">Info</a></li>
<li><a href="/about.php">About</a></li>
<li><a href="/contact.php">Contact</a></li>
<!-- EDIT ONLY ABOVE THIS LINE -->
</ul>
</div><!-- #r2d2-menu -->
</div><!-- #navigation-background -->
</div>
</div>
</div> <!-- #navigation -->
</div> <!-- #navigation-container -->
';
return false; // Replaces normal menu
} // END
DELETE THIS LINE */
/* DELETE THIS LINE
// SITE-WIDE "DROP-DOWN" NAVIGATION MENU w/ AUTO INDEX DROP-MENU
// This function establishes a site-wide navigation menu using pseudo-absolute URLs (beginning "/")
// -- portable, domain agnostic, and without the location limitations of relative URLs.
// Serves as an example of a function being applied globally.
// Utilizes the auto index script to list galleries in a specified location as a drop-menu.
function ttg_header_navigation( $style, $path ) {
echo '
<div id="navigation-container" class="navigation-container clearfix">
<div id="navigation" class="block-id navigation clearfix">
<div class="mantle clearfix">
<div class="core clearfix">
<div id="navigation-background">
<div id="r2d2-menu" class="clearfix">
<ul id="pull">
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li><span> </span></li>
<li id="open-nav" class="toggle-nav"><a href="#r2d2-menu"><i class="fa fa-reorder"></i></a></li>
<li id="close-nav" class="toggle-nav"><a href="#"><i class="fa fa-remove"></i></a></li>
</ul>
<ul id="nav">
<!-- EDIT ONLY BELOW THIS LINE : -->
<li><a href="/">Home</a></li>
<li><a href="/galleries.php">Galleries</a>
<ul>
';
$theroot = $_SERVER['DOCUMENT_ROOT'];
$indexPath = '/galleries/'; // set folder location to scan for galleries
require_once($theroot.'/lib/autoindex/autoindex.php');
if (trim($_SERVER["QUERY_STRING"]) == 'debug')
define ('AUTOINDEX_DEBUG', true); // enable statement to output debugging info from autoindex()
$albums = autoindex($theroot.$indexPath);
// $albums = array_reverse($albums); // Reverses album order
// shuffle($albums); // Shuffles albums
$j = min(count($albums), 8); // build <li>s from first 8 in gallery list
for($i=0; $i < $j; $i++) {
echo '<li><a href="'.$albums[$i]['url'].'" title="'.$albums[$i]['description'].'">'.$albums[$i]['title'].'</a></li>';
};
if (count($albums) > 8) { // the 8 here matches the 8 above
echo '<li><a href="/galleries.php" title="See more galleries" >more ...</a></li>';
};
echo '
</ul>
</li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/services.php">Services</a></li>
<li><a href="/info.php">Info</a></li>
<li><a href="/about.php">About</a></li>
<li><a href="/contact.php">Contact</a></li>
<!-- EDIT ONLY ABOVE THIS LINE -->
</ul>
</div><!-- #r2d2-menu -->
</div><!-- #navigation-background -->
</div>
</div>
</div> <!-- #navigation -->
</div> <!-- #navigation-container -->
';
return false; // Replaces normal menu
} // END
DELETE THIS LINE */
/* DELETE THIS LINE
// KILL THE DEFAULT NAVIGATION MENU
// Using a series of three functions, you can completely gut the
// default navigation menu. Use this to author your own navigation.
// THIS FUNCTION REMOVES THE NAVIGATION SECTION FROM THE PAGE
function ttg_header_navigation( $style, $path ) {
echo '
<!-- put your navigation HTML here -->
';
return false;
} // END
// THIS FUNCTION REMOVES THE DEFAULT STYLESHEET FOR OUR NAVIGATION
function ttg_style_navigation( $style, $path ) {
echo '
<!-- link to your navigation stylesheet -->
';
return false;
} // END
// THIS FUNCTION REMOVES THE R2D2-MENU SCRIPT FROM THE PAGE
function ttg_scripts_navigation( $style, $path ) {
echo '
<!-- if your navigation requires Javascript, link your script files here; otherwise, leave this empty -->
';
return false;
} // END
DELETE THIS LINE */
// ****************************************************************************************************
// END USER FUNCTIONS
?>
Offline
you need to put the right path to the custom css in the phplugins.php file.
Right now you have:
<link rel="stylesheet" href="/phplugins/css/custom.css" />
However, your custom.css file is not in that location. You've placed your phplugins/ folder in the /galleries/ folder.
So the path to custom css needs to reflect that:
<link rel="stylesheet" href="/galleries/phplugins/css/custom.css" />
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Ok Thxs
I should have thought of that but I overlooked. Thinking of some syntax error thing. I guess it is because I have the blog and galleries bundle that the phplugins folder is not on the root level...
Offline
it doesn't hurt anything if you put the phplugins in the root.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Pages: 1