Copyright & Footer Links

Started by All Colours Sam, May 16, 2009, 01:31:09 PM

Previous topic - Next topic

All Colours Sam

more than 10 years later, a new version has been released :P

- support for SMF 2.1.x
- removed the enable setting
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Rick53

You were very fast. Thanks very much.  :)

But I misunderstood. The Mod shows a text in the footer. My wish was to insert a link instead.
Example: Text "imprint" combined with a link.
Can the mod be supplemented in this way?


Rick53

It worked! So easy ...
Thanks

All Colours Sam

Yes the textfield admits plain text as well as any HTML tags, just be aware of who has admin access to your forum since there is no sanitization or otherwise any kind of filter.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

pikeman


Rick53

The mod works fine for me.
With HTML link or as text
SMF 2.1.3 with Curve2, PHP8

All Colours Sam

Quote from: pikeman on May 18, 2023, 03:24:01 PMThe mod reports the following error: https://i.postimg.cc/wvR8nX1y/Dnevnik-gre-aka.png .



Probably some other mod, since this one uses hooks, CustomCopy.english is the last (or first) file that gets loaded and PHP incorrectly assumes the error comes from that file.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

[chrisB]

#148
Many thanks for the mod, it makes life easier to update a modified theme I altered based on the Curve theme. 👍🏻

--

If like me, you prefer your sites copyright up top. Use this edit:

CustomCopy.php
/public_html/Sources
Find
/* Buffer time */
function CFL_Buffer($buffer)
{
global $modSettings;

if(empty($modSettings['CFL_foot_links'])) {
return $buffer;
}

$customCopy = $modSettings['CFL_foot_links'];
return preg_replace_callback(

'/(<li class="copyright">.+?)+(<\/li>)/i',

function($match) use ($customCopy) {
return ($match[1] .  ' ' . $customCopy);
},
$buffer
);
}


Replace
/* Buffer time */
function CFL_Buffer($buffer)
{
    global $modSettings;

    if (empty($modSettings['CFL_foot_links'])) {
        return $buffer;
    }

    $customCopy = $modSettings['CFL_foot_links'];
    return preg_replace_callback(

        '/(<li class="copyright">.+?)+(<\/li>)/i',

        function ($match) use ($customCopy) {
            return ($customCopy . ' ' . $match[1]);
        },
        $buffer
    );
}

Key change is:  return ($customCopy . ' ' . $match[1]);
I'm stuck in a time warp from the early 00's.

Advertisement: