HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

July 20, 2024, 04:18:46 PM

Login with username, password and session length
  • Total Posts: 195,333
  • Total Topics: 21,233
  • Online today: 133
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 52
  • Total: 52

Articles bug with TP copyright

Started by Nolt, June 19, 2011, 06:22:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Link to my site: localhost
SMF version: SMF 2.0
TP version: TP 1.0 RC2
Default Forum Language: polish
Theme name and version: happens on all themes
Browser Name and Version: FF4
Mods installed: TP only
Related Error messages:

Hi, I got an issue with articles and TP copyright. When I create HTML (with WYSIWYG) article with all options turned off (no frame no nothing) randomaly in this article shows TP copyright.
The most strange thing that the TP copyright is there where i put link with text Simple Machines ex. Simple Machines :o I tryied other links and then all seems to be fine.
Screens attached

EDIT: I forgot to add, that those articles are menu items (single article).


This is because of the way that TP adds it's copyright to the bottom of the page. SMF uses what's called an output buffer. It holds all the page code in a buffer until execution is done, then the buffer is output to the page. TinyPortal (and many other big mods now) add their copyright by searching through the buffer for a certain text. In TP's case it looks for the text "Simple Machines</a>". Once it finds that text, it appends its own copyright to that text. You can see how this works by looking at the tp_addcopy() function at the bottom of the TPsubs.php file.

So that also means any time you create a link with the exact words "Simple Machines</a>", TP will append it's copyright anywhere it finds it on the page.

The fix will be that the code will need to be changed to look for something more specific instead of the generic link text.


Too bad... this thing hold me up with big update one of site and implementing TP :/
It reffers also to discriptions in download section and all releated TP functions?

Is there any possibilyty to fix or change it?


If you simply add a space after the word 'machines', it should not pick up the copyright.

Otherwise, you'll have to wait until I can refactor that function to pick up different text.


Thanks for the tip, space trick is very helpful :)


Hey, this topic is kind a old but... One of mine Moderators - phantom from found a solution for this issue.

Here is a fix:
Code (Find) Select

   $find = array(
      'Simple Machines</a>',
   $replace = array(
      'Simple Machines</a><br />' . $string,
      'class="copywrite" style="line-height: 1;"',

Code (Replace) Select

   $find = array(
      '<a href="" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>',
   $replace = array(
      '<a href="" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a><br />' . $string,
      'class="copywrite" style="line-height: 1;"',