TinyPortal

Development => Bugs/Errors => Feedback => Fixed Bugs => Topic started by: Nolt on June 19, 2011, 06:22:13 PM

Title: Articles bug with TP copyright
Post by: Nolt on June 19, 2011, 06:22:13 PM
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 (http://www.simplemachines.org) :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).
Title: Re: Articles bug with TP copyright
Post by: Nolt on June 21, 2011, 11:13:31 AM
anyone can check this?
Title: Re: Articles bug with TP copyright
Post by: IchBin on June 21, 2011, 08:07:01 PM
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.
Title: Re: Articles bug with TP copyright
Post by: Nolt on June 21, 2011, 09:26:57 PM
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?
Title: Re: Articles bug with TP copyright
Post by: IchBin on June 21, 2011, 09:41:56 PM
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.
Title: Re: Articles bug with TP copyright
Post by: Nolt on June 21, 2011, 10:11:23 PM
Thanks for the tip, space trick is very helpful :)
Title: Re: Articles bug with TP copyright
Post by: Nolt on June 25, 2014, 08:32:07 PM
Hey, this topic is kind a old but... One of mine Moderators - phantom from www.smf.pl found a solution for this issue.

Here is a fix:
Code (Find) Select

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


Code (Replace) Select

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