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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 104
  • Total: 104

Removing Comments from front page Forum

Started by Darketower, June 13, 2006, 08:01:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darketower

Hello there. I'm a new TP user, and I'm getting to know the functionality of it bit-by-bit. Presently I'm putting together a website, and I've got the front page set to display the posts in a forum. It does exactly what it's supposed to, including displaying those posts on the front page, even to people that don't normally have access to that board.

Here's my question: No matter who is viewing the front page, the "Comments" section is always included there (i.e. "Write Comment (0 Comments)"). I'd like it to emulate a simple "news post" on the front page, without that comment text there. Is there a way to disable the Comments text within TP? Or do I need to find the file that has that code and manually remove it?

moviespot

you don't want users to view the comments only you view it right ?

Darketower

I'm looking for a way to remove both the "Write Comment" link (and the icon that goes with it), as well as the display of the current number of comments. It's alright if comments are added and readable through the actual forum, I'd just prefer that the option not be available in the front page view.

bloc

You can remove it by simply removing this code in TPortal.template.php:
<div ' , ($news['is_last']=='theme' || $news['is_last']==false) ? 'class="windowbg"' : '' , ' style="padding: 6px;">', ($context['TPortal']['frontpage_limit_len']>0 && strlen($news['body'])>$context['TPortal']['frontpage_limit_len']) ? '<a href="' .$news['href']. '">'.$txt['tp-readmore'].'</a> &nbsp;&nbsp;' : '' , ' ' , $news['icon']!='noicon' ? '<img src="'.$settings['images_url'].'/TPmodify.gif" alt="*" /> '.$news['new_comment'].' (<a href="' .$news['href']. '">'.$news['replies'].' '.$txt['tp-comments'].'</a>)' : '' ,'</div>
</div>


Beware that it also remove the "read more" link for articles this way, since its intertwined in the code there.

Darketower

Just to make sure that I understand the functionality I'll be removing:

I could go to the Frontpage Settings and increase the "Length of posts to show on frontpage(in characters)" field to some ungodly number to get around this by never needing a link to "read more", correct?


navjotjsingh

#6
But TP 0.8.6 does not show Read more for Sticky Topics...Is that a bug? it should do just like if I post sticky posts in announcements section it does not show read more link. This should not be there. Is there a fix to it?

Also for locked threads it shows write comments...so its not working properly as it should do..on frontpage. Can some code can fix it?

This problem occurs in www.career-discussions.com

Darketower

Quote from: Bloc on June 14, 2006, 10:06:44 AM
You can remove it by simply removing this code in TPortal.template.php:
<div ' , ($news['is_last']=='theme' || $news['is_last']==false) ? 'class="windowbg"' : '' , ' style="padding: 6px;">', ($context['TPortal']['frontpage_limit_len']>0 && strlen($news['body'])>$context['TPortal']['frontpage_limit_len']) ? '<a href="' .$news['href']. '">'.$txt['tp-readmore'].'</a> &nbsp;&nbsp;' : '' , ' ' , $news['icon']!='noicon' ? '<img src="'.$settings['images_url'].'/TPmodify.gif" alt="*" /> '.$news['new_comment'].' (<a href="' .$news['href']. '">'.$news['replies'].' '.$txt['tp-comments'].'</a>)' : '' ,'</div>
</div>


Thanks for the help. I'll note for the benefit of others that may try this that I didn't remove the lone </div> at the end of that code block, since there already appeared to be a </div> at the end of that very long line of code right above it, and I didn't want to orphan another <div> somewhere else in the file.

It seems to work fine, and is functioning like I'd hoped.

By the way, I've only been fooling with TP for a couple of days now, and I've found it very easy to use, which is a huge relief to me. I'd started trying to mess with Joomla (and had used Mambo on a site in the past), but to be honest, all I really wanted to do with the site was add functionality that TP provides very simply and gracefully. You've got a great thing going here. Keep up the good work!

bloc

Thanks. :)

You are right, the lone </div> there should not be removed, my mistake.

This website is proudly hosted on Crocweb Cloud Website Hosting.