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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 565
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 372
  • Total: 372

changing the default format of article comments

Started by prometheus fire, December 09, 2009, 06:51:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prometheus fire

I'm not sure if this a theming problem/solution or a TP general problem/solution so I'll start here....

I like having article comments, they are an important feature of some of the things we are doing - I just don't like the default formatting of the fonts and the layout.  The font size is too small and the layout of the comments is cluttered and difficult to read (especially with the "posted on" and "posted by" details)

This is how it appears on my site:
http://leafboxtea.com/index.php?page=26#tp-comment

Clearly, the eye is drawn to the system information instead of the actual comment. These are my issues:
1. the comment font is too small
2. the displayed system information is too much/perhaps not needed
3. the re: subject does not need to be there

The comment section of the TPreviews modules has a much cleaner appearance and would be a good change to the article comments.  There is only one issue with it: the edit/delete links appear to everyone, including guests.  linky: http://leafboxtea.com/index.php?action=tpmod;rvws;sa=viewitem;id=4

I wouldn't mind the format and style of the TPreviews comments to be used in the article comments (though I'm not sure how/what/where to copy and paste code from one to the other - I'd probably break everything in the process...) though I would be happy fixing just the article comments to make them more visually appealing and easy to read.

As I said, I'm not sure if this is a theme-based CSS issue or something more fundamental. Can you guys take a look into this and advise?


IchBin

1. tp_commentbody is the style in the tp_style.css file in the default theme for editing the font properties. (unless you have one in your custom theme).
2 & 3 -- means you're going to have to edit the PHP code to take out or change what you want. I'm not sure which file it's in, but I'd start with Themes/default/TPortal.template.php and Sources/TPmodules.php

prometheus fire

#2
Okay, so far, so good. That was great advice, I've some changes that I really like, but in order to make them look good I need to remove the avatar from displaying in the comments.

This is how it looks now - linky: http://leafboxtea.com/index.php?page=26#tp-comment

Here is the section of TPortal.template.php, I see the avatar stuff there, but I don't know enough about php to figure out where I need to remove it (what characters in terms of apostrophes, brackets, etc. make up a command) UPDATE BELOW

At this point, the only thing I want to remove is the avatar
Quote<div class="windowbg', $switch ? '2' : '3' , '" style="overflow: hidden;">
            <div class="tp_commentbody">
               <span class="comment_author">' , !empty($comment['avatar']['image']) ? $comment['avatar']['image'] : '' , '</span>
               ' , $comment['text'] , '
            </div>
            <div ', ($context['user']['is_admin'] || $context['user']['id']==$comment['posterID']) ? ' class="tp_comment_notice"' : 'class="tp_comment"' , '>
               '.$cc.'
            ', ($comment['is_new'] && $context['user']['is_logged']) ? '<img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="" />' : '' ,'
               <span class="author"> '.$txt['tp-by'].' <a href="'.$scripturl.'?action=profile;u='.$comment['posterID'].'">'.$comment['poster'].'</a>
               '.$txt[30].' '.$comment['date'].'</span>                           
            </div>

UPDATE: I took out all the stuff that is shown there by the strikethrough, including all the apostrophes and commas and things.  It appears to have worked at removing the avatar and didn't seem to break anything - is that the best way to analyze this stuff? Is there something important that I took out that may come back to haunt me?  I'm just confirming.

IchBin

What you removed was fine. I would have probably removed the span tags as well. So basically the whole line. This way, there's no empty span tag on your page that is not being used. Well done on figuring it out!

This website is proudly hosted on Crocweb Cloud Website Hosting.