Hi, may i know what should i do to the source code of the TPortal template so that i could remove the "X comments | Write Comment" from the forum posts shown in the first index page?
I am currently using SMF 1.1.8, TinyPortal v1.0 beta 3, OverViewLight theme.
Really hope that someone could help me on that! :-\
If you are talking about forum post themselves you may need to ask this over at SMF. By first index page are you talking about the frontpage of TP or from the index page of the forums page?
Hi! Thanks for your speedy reply!
I am talking about the front page of TP. When i list the forum posts at the main page of TP, it will always show up "X comments | Write Comment" at the bottom of every single forum entries.
I wanted to find any settings to remove it, but i couldn't find it. So is there any ways for me to remove it by editing the source code of it?
Thanks for your help! :laugh:
hi! really hope that someone could help me on that!
nelsontyc,
Before I start looking for where this is located in the code I want to make sure I'm not wasting my time with this, since it's going to take a while to find it.
Are you saying that you want people on your Forum to be able see the first post in the topics from your News Board but you don't want them to be able to see how many replies were made or even be able to reply to those messages?
ZarPrime
Hi,
Really thanks for your reply! Is the news board you mentioned also means the front page of the TPortal? If it is then it is correct!
I enabled the "What to display on frontpage" option to show "Only forum-posts", but I wanted to remove the "0 comments | Write Comment" that was written at every single forum posts shown on the TPortal main page.
Thank you so much for your help!!
Yes, that is correct. Removing that means that your Forum members will not be able to respond to these messages from the Front Page.
It's too late to start looking for this tonight. I'll do it sometime tomorrow.
ZarPrime
Thanks for your help! really hope to see your reply soon! :D
I'm assuming it works from SMF's SSI.php file, in the root directory.
in ssi.php, find:
', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
[edit]
The whole section for that code is:
foreach ($return as $news)
{
echo '
<div>
<a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
<div class="smaller">', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '</div>
<div class="post" style="padding: 2ex 0;">', $news['body'], '</div>
', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
</div>';
if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />';
}
I would just comment that line out
// commented line, ignored by browsers.
hi zetan,
thanks for your reply. I tried to delete or commented that line out, but it didn't work :'(.
Hope that you could help me on this.
Thanks a million!
I guess TP is using it elsewhere, I'll have a nose through the files.
Z,
I thought it might have been in the ssi.php as well, but I got to looking in the TPortal.template.php and I think that's the file it's in, but I'm having trouble sorting it out. It seems like it should be down around line 940 where is says "// any comments then?" or line 953, where it says "// show number of comments, and if new ones". Everything around those lines that I try to comment out doesn't do the trick, so I'm somewhat stumped on this. Thanks for stepping in here and taking a look. I'll keep looking as well.
ZarPrime
Thats the same file I'm looking in.. It is in that file, lol.. not sure where though.
In TPModules.php, there is an array created, which includes
'replies' => $row['numReplies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . ';num_replies=' . $row['numReplies'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . ';num_replies=' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',
I can't find any place that those are used, though.
Gottcha
in
/Themes/default/TPortal.template.php
right at the bottom, find
elseif($story['is_boardnews'])
echo '
'.$story['link'].' | '.$story['new_comment'];
change to:
/* elseif($story['is_boardnews'])
echo '
'.$story['link'].' | '.$story['new_comment'];
*/
Z,
OMG. ::) That does indeed look like it. I never would have looked down that far.
JPDeni. Thanks for your help as well, I don't think Zetan or me either one would have been able to find that if you hadn't have found that array.
ZP
Quote from: ZarPrime on April 19, 2009, 04:34:01 PM
Z,
OMG. ::) That does indeed look like it. I never would have looked down that far.
JPDeni. Thanks for your help as well, I don't think Zetan or me either one would have been able to find that if you hadn't have found that array.
ZP
lol, I didn't realise Deni had posted a comment.
Z,
:2funny: Ah, then you're still better at seeking out code than I am. I fully admit that I'm still somewhat of a noobie when it come to that.
ZP
Hi everyone,
Thanks a lot for the help! Zetan's code worked well. I am just so happy about it now!
Great job on the forum support!! =D