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
Under CE4, I had a php script (https://drive.google.com/file/d/1tWYeS7 … sp=sharing), wherein I had set up some conditional code to place StatCounter icons (with associated code to track users) on specific pages of the site.
A section of the CE4 code is below. The conditional statements selected the various pages (HOME, GALLERIES. etc.). What would the equivalent Backlight if / elseif code be? The code listed for StatCounter is provided by StatCounter. I will probably use Rod's Tips & Tricks code for a Custom Footer and would like to place the Statcounter icon on the right side, with the social icons to its left, and the Copyright notices and TTG citation on the left.
Any help would be appreciated
-Herschel
========================================================
// Add statcounter HOME
function ttg_footer_bottom ( $style, $path ) {
if (G_STYLE == 'CE4-PAGES-HOME') {
echo '
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10262831;
var sc_invisible=0;
var sc_security="13728379";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type=\'text/javascript\' src=\'" +
scJsHost+
"statcounter.com/counter/counter.js\'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify site
analytics" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/10262831/0/13728379/0/"
alt="shopify site analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
';
return false;
}
// START NEW CODE
elseif (G_PATH == 'CLUBS') {
echo '
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10266129;
var sc_invisible=0;
var sc_security="14491902";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type=\'text/javascript\' src=\'" +
scJsHost+
"statcounter.com/counter/counter.js\'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="web stats"
href="http://statcounter.com/free-web-stats/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/10266129/0/14491902/0/"
alt="web stats"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
';
return false;
}
elseif (G_STYLE == 'CE4-PAGES-GALLERIES') {
echo '
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10266124;
var sc_invisible=0;
var sc_security="aa3309b5";
Offline
You can very likely use the same code that you inserted, but you will need to rewrite the wrapper function for Backlight. See the sample php file at /backlight/custom/phplugins/phplugins-pangolin-sample.php in your Backlight installation for examples and documentation.
Offline
Pages: 1