Copyright Footer Management | XenForo Italia | Your guide to the xenForo world
wizard

Copyright Footer Management

wizardVerified member

Administrator

Staff member
Vip Member
Reputation: 61%

Easy way to merge your products' copyright footers in a single line

This is a quick and dirty tutorial for how to automatically merge all copyright footers from your products into a single line, avoiding a situation where you have 5 mods released with 5 separate lines :D

Template Modifications

Template:
PAGE_CONTAINER
Modification Key: your_namespace_copyright_footer_display
Description: Copyright Footer
Search type: PHP Callback
Find: #({{ phrase\('extra_copyright'\) }})#si
Replace: Your\Namespace\Template\Callback\Copyright::insert
Execution order: 10


Code Event Listeners

Listen to event:
app_setup
Execute callback: Your\Namespace\Listener :: appSetup
Execution order: 10
Description: App setup


PHP

/src/Your/Namespace/Listener.php

PHP:
You must log in to view
(34 lines)

(Replace prefix with the vendor prefix (e.g. dbtech is ours, normally it's the "your" part of the "Your\Namespace" replacement.)

/src/Your/Namespace/Template/Callback/Copyright.php
PHP:
You must log in to view
(43 lines)

(Replace prefix with the vendor prefix (e.g. dbtech is ours, normally it's the "your" part of the "Your\Namespace" replacement. Also, replace the www.yoursite.com links with the links to your actual website. Also, replace "YourCompany" with the name of your company. Lastly, either create the details.php page that accepts product IDs as parameters to display a list of the products that site is running, or remove that entire parenthesis section altogether.)


(Optional) DragonByte eCommerce Integration

If you are using DragonByte eCommerce and you use its "Generated" download handler, you can extend eCommerce to automatically strip branding.

This is intended to be a separate add-on, to run on your site where you have eCommerce installed!

This part of the guide assumes
a) You are using DragonByte eCommerce (duh ?)
b) You are familiar with how the "Generated" download handler works
1.webp

d) You have configured your "parent product" like this:
2.webp


Class Extension

Base class name:
DBTech\eCommerce\Service\DownloadVersion\Generator
Extension class name: Your\Namespace\DBTech\eCommerce\Service\DownloadVersion\Generator


PHP

Your/Namespace/DBTech/eCommerce/Service/DownloadVersion/Generator.php

PHP:
You must log in to view
(83 lines)

(As above, replace PREFIX with your vendor prefix and Your\Namespace with whatever your namespace is for this custom add-on.)
 
Back
Top