Copyright Footer Management

Copyright Footer Management

I'm not sure what I'm doing wrong but do I need to have something set up already for prefix_branding_free or something? Nothing is displaying on my test site and I followed the instructions to the 'T'.
 
Where can I find this setting? I looked through the AdminCP but did not find it 😬
1589416047981.webp
 
Where can I find this setting? I looked through the AdminCP but did not find it 😬
View attachment 225047
Looks like that's a custom template modification that I missed; here's the code used:
HTML:
<xf:macro template="dbtech_ecommerce_product_macros" name="product_select"
          arg-productId="{$product.global_branding_free}"
          arg-digitalOnly="{{ true }}"
          arg-inputName="global_branding_free"
          arg-phrase="Global Branding Free"
/>

<xf:macro template="dbtech_ecommerce_product_macros" name="product_select"
          arg-productId="{$product.branding_free}"
          arg-digitalOnly="{{ true }}"
          arg-inputName="branding_free"
          arg-phrase="Branding Free"
/>
 
I think the only real thing that changed much was the copyright callback i think the listener is pretty much the same but went ahead and posted it, everything else is the same, I had an issue with the container section in the new update so this is what codex provided LOL.


this is the copyright callback
PHP:
<?php

namespace your\namespace\Template\Callback;

class Copyright
{
    protected const RENDERED_KEY = 'infdevSharedCopyrightRendered';
    protected const CALLBACK_TAG = '<xf:callback class="your\\namespace\\Template\\Callback\\Copyright" method="render"></xf:callback>';
    protected const COPYRIGHT_HTML = '<div>
            <a class="u-concealed" rel="nofollow" href="https://www.yoursite.com/" target="_blank">XenForo Add-Ons</a> from yourcompany&#8482;
            &copy;2011-2026 yourcompany
        </div>';
    protected static bool $rendered = false;

    public static function render($contents = '', array $params = [], \XF\Template\Templater $templater = null): string
    {
        if ($templater) {
            if (!empty($templater->pageParams[self::RENDERED_KEY])) {
                return '';
            }

            $templater->setPageParam(self::RENDERED_KEY, true);
        } else {
            if (self::$rendered) {
                return '';
            }

            self::$rendered = true;
        }

        return self::COPYRIGHT_HTML;
    }

    public static function getCopyrightText($matches): string
    {
        return ($matches[1] ?? '') . self::CALLBACK_TAG;
    }

    public static function insert($matches): string
    {
        return self::getCopyrightText($matches);
    }
}

the listener
PHP:
    protected static $_productId = 0;

    /**
     * @param \XF\App $app
     */
    public static function appSetup(
        \XF\App $app
    ) {
        if (!$app->offsetExists('prefix_branding_free')) {
            // Make sure we fetch the branding array from the application
            $branding = $app->offsetExists('prefix_branding') ? $app->prefix_branding : [];

            // Add productid to the array
            $branding[] = self::$_productId;

            // Store the branding
            $app->prefix_branding = $branding;
        }
    }
 
I think there is some kind of issue with modifying that PAGE_CONTAINER template that was introduced with the 2.3.13 update because it still is showing that error even with the modification I made, I turned it off for now until the next xf update. it was working all week then suddenly shows the error again LOL.

Template Compilation Error​

public PAGE_CONTAINER - Cannot modify container while locked in /home/customer/www/infernodev.com/public_html/forums/src/XF/Container.php:325
 
Last edited:
I think there is some kind of issue with modifying that PAGE_CONTAINER template that was introduced with the 2.3.13 update because it still is showing that error even with the modification I made, I turned it off for now until the next xf update. it was working all week then suddenly shows the error again LOL.

Template Compilation Error​

public PAGE_CONTAINER - Cannot modify container while locked in /home/customer/www/infernodev.com/public_html/forums/src/XF/Container.php:325
You aren’t unlocking the container, look at the updated code in the tutorial :)
 
Back
Top Bottom