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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 09:07:20 AM

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

Read More "Front Page"

Started by jernatety, April 25, 2019, 09:53:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jernatety

Hi,

I had @Rocklee install the UX theme for me and do some customizing of the theme. He did a great job, the theme looks good but something happened to the front page in my original theme Default curve. The most current forum post on the front page "Read More" doesn't show the CSS decoration I added over a month ago. And the second to most current "Read More" moved to the right and over text. It along with the other 10 posts all have the CSS text decoration though.

See here, link below and image attached.


youthhockeyinfo.com


Anybody have any idea what happened? Rocklee thinks something in the UX theme might be associated with TP that was changed.


@rjen

To be frank, this is something easily identified checking the page source..

are filled.<br /><br /... <p class="tp_readmore">

as it turns out the body text is 'cut' in the middle of a <br > statement, resulting in the <p > paragraph syntax being incorrect, and as a result your css does not take effect here...

Quickest solution: change the post text so it does not cut at that spot...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

jernatety

Quote from: @rjen on April 25, 2019, 10:02:05 PM
To be frank, this is something easily identified checking the page source..

are filled.<br /><br /... <p class="tp_readmore">

as it turns out the body text is 'cut' in the middle of a <br > statement, resulting in the <p > paragraph syntax being incorrect, and as a result your css does not take effect here...

Quickest solution: change the post text so it does not cut at that spot...

Thank you @rjen

He's in Argentina so I may not get a hold of him tonight. Is this an edit I can do? Which file do I edit and is it in the tiny portal files or the theme files?

Thank you

@rjen

Since it it the actual post text that you need to update, I am sure you can change it: it is not in a forum file, but this topic text: https://www.youthhockeyinfo.com/index.php?topic=1074.msg2314#msg2314
Running Latest TP on SMF2.1 at: www.fjr-club.nl

jernatety

That's strange because I have basic BBC formatting. Nothing special and no open tags.

[img]https://www.youthhockeyinfo.com/images/players.jpg[/img]

Whatever league your club is participating, if you are looking for players to round out teams please respond and we will update the list accordingly. We will re-post on social media daily until spots are filled.

This is for any league, WNYAHL, LIAHL, NJYHL, DVHL, CBHL, PAHL.......etc.

Please note:
[list]
[li]Organization[/li]
[li]Team(s)[/li]
[li]Number of players needed for each team[/li]
[li]Contact name[/li]
[li]Contact Phone or Email[/li]
[/list]

[color=red][b]***If anybody who posts doesn't know how to add an image, we will do it for you after your post is made.[/b][/color]

jernatety

I made a new post with not enough content for "Read More" to show up. If you look the problem stays with the first two forum posts shown with "Read More" on the front page no matter how the posts are formatted.

@rjen

Add or remove a word in the first 100 characters of the post
Running Latest TP on SMF2.1 at: www.fjr-club.nl

jernatety

Quote from: @rjen on April 26, 2019, 03:24:48 PM
Add or remove a word in the first 100 characters of the post

Very strange, never did that before.

@rjen

I am on mobile atm, will explain when I am on a keyboard ...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

Quick explanation...

When showing posts on the frontpage TP cuts the posts to a number of characters set in your frontpage setting: "Number of characters to display per forum-post: "

Now there is a code that cuts the text at the last ">" character or " " chracter (space) found BEFORE the end of the string...

This bit of code in Tportal.php.

$length = $context['TPortal']['frontpage_limit_len'];
if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
{
$row['body'] = $smcFunc['substr']($row['body'], 0, $length);

// The first space or line break. (<br />, etc.)
$cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '>'));

if ($cutoff !== false)
$row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);

$row['readmore'] = '... <p class="tp_readmore"><strong><a href="'. $scripturl. '?topic='. $row['id']. '">'. $txt['tp-readmore']. '</a></strong></p>';
}



It cannot deal with all cases though: especially the <br /> which has a space in itself..

What you see happens when the last bit of the <br /> string is cut off. Let's say the length is set to 100 characters: the last > is on place 101: it is then cut at the last space found, leaving a partial tag "<br ..."

It has been in the code of TP since before I even knew TP existed, and the cutting of the tag is normally not even visible to users but you have added a style to the 'readmore' tag, which is now not showing because of the open <br ...

Running Latest TP on SMF2.1 at: www.fjr-club.nl