News: Welcome to the TinyPortal Support site.

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

April 02, 2020, 01:25:19 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189572
  • Total Topics: 20808
  • Online Today: 625
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 1
Guests: 45
Total: 46

Author Topic: Articles bug with TP copyright  (Read 5516 times)

0 Members and 1 Guest are viewing this topic.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Articles bug with TP copyright
« on: June 19, 2011, 11:22:13 AM »
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).
« Last Edit: June 20, 2011, 01:57:26 AM by Nolt »

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Articles bug with TP copyright
« Reply #1 on: June 21, 2011, 04:13:31 AM »
anyone can check this?

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Articles bug with TP copyright
« Reply #2 on: June 21, 2011, 01: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.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Articles bug with TP copyright
« Reply #3 on: June 21, 2011, 02: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?

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Articles bug with TP copyright
« Reply #4 on: June 21, 2011, 02: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.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Articles bug with TP copyright
« Reply #5 on: June 21, 2011, 03:11:23 PM »
Thanks for the tip, space trick is very helpful :)

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Articles bug with TP copyright
« Reply #6 on: June 25, 2014, 01: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;"',
   );