General Community > Scripting Help
Remove "Latest Post" from Info Center (but keep Recent Posts list)
(1/1)
krystal:
Hi,
This is just a very small tweak I want to make, but I would really appreciate some help since I am totally rubbish at editing PHP. :-[
I'm running SMF 2.0.2 here: http://www.playmofriends.com/forum/index.php
I have chosen to show 5 posts on the board index in the "Recent Posts" section and I think that works just fine for us. But directly below it, in the Forum Stats, I also have "Latest Post." That seems superfluous to me since it is just doubling up on information shown at the top of the Recent Posts list.
I found the section in BoardIndex.template.php which needs to be edited (lines 397-402)
--- Code: ---', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br />
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
--- End code ---
and I can see exactly which line produces the Latest Post statistic. If I try to remove it I get a parsing error because I'm obviously removing a quote, comma, colon, or something else that I shouldn't be. :(
I know that I can elect to turn off the Recent Posts altogether on the Theme Options and Preferences page, but I don't want to do that because I like showing that small list. :)
Antes:
Hello,
--- Code: --- <div class="title_barIC">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<a href="', $scripturl, '?action=recent"><img class="icon" src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
', $txt['recent_posts'], '
</span>
</h4>
</div>
--- End code ---
Find and delete those in your BoardIndex.template
krystal:
Thanks for the reply. :)
I tried what you suggested but it's not what I was looking for.
Removing that code only removed the title bar for Recent Posts. I want that heading to stay there, as well as the 5 recent posts shown below it. ;)
I just want to remove the single line that says "Latest Post: "xxxxxxxxxxxxxxxxxxx" ( Today at 04:39:55 ).
This sits directly between "210942 Posts in 10565 Topics by 593 Members. Latest Member: xxxx" and "View the most recent posts on the forum." in the Forum Stats section.
It's not a big problem for me to leave it there. I suppose I just can't help wanting to eliminate unnecessary links or text.
Antes:
--- Code: (BoardIndex.Template) --- ', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
--- End code ---
Sorry my bad, little bit hot here (100F)
krystal:
That's it! Brilliant. ;D
For some reason I thought it was much more complicated and that I had to leave in the bracket, comma and quote at the end of that line. :-[ As I said, I'm pretty useless at this stuff. ;)
Thank you! :-*
Navigation
[0] Message Index
Go to full version