Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-03-13 18:06:27

hjrw
Member
From: Peoria (Phoenix) AZ
Registered: 2012-10-01
Posts: 168

Changing from CE4 to Backlight for a php file

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

#2 2018-03-13 18:25:50

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

Re: Changing from CE4 to Backlight for a php file

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.


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

Offline

Board footer

Powered by FluxBB