TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 08:11:34 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 86
  • Total: 86

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.

Nolt

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).


IchBin

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.

Nolt

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?

IchBin

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.

Nolt

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

Nolt

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;"',
   );