Responsive SMF Themes. We're currently working on brand spankin' new Responsive SMF themes for SMF 2.1

Add category link to SP article post

Mick in Tutorials
Mar 20, 2013


The one thing SimplePortal forgot to do was the need to show where this article was posted in your category list next to the time posted and the author's name. We're going to use the simple code below and add it to the PortalArticles.template.php to get the effect we want.


', $txt['postedin'], ' ', $article['board']['link'], '

Instead of looking like this:
Mick ? 1 hour ago ? 0 Comments

Will look like this:
Mick ? Posted in Scripts & Tuts ? 1 hour ago ? 0 Comments



In Themes/default/PortalArticles.template.php

Find:

			echo '
<div class="middletext">', $article['message']['time'], ' ', $txt['by'], ' ', $article['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $article['topic']['views'], ' | ', $txt['sp-articlesComments'], ': ', $article['topic']['replies'], '</div>';

Replace with:

			echo '
<div class="middletext">', $txt['postedin'], ' ', $article['board']['link'], ' ', $article['message']['time'], ' ', $txt['by'], ' ', $article['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $article['topic']['views'], ' | ', $txt['sp-articlesComments'], ': ', $article['topic']['replies'], '</div>';


In Themes/default/languages/index.english.php
At the very end add:

$txt['postedin'] = 'Posted in';

Tagged with: simpleportal articles tut smf 


Mick

Mick G

Mick is an American theme designer for Simple Machines Forum software currently living in South Florida, USA. He runs idesignSMF and started tinkering with SMF in 2006 where he created several SMF forums of his own before he founded idesignSMF in 2009 to which he is dedicated full time and has a weakness for Tacos and Pizza.

Website: https://www.idesignsmf.com/

    


0 Comments



Connect with us:


Improve SMF

If you wish to contribute to the development of SMF you can contribute to the coding discussions taking place on Github. You are also welcome to suggest features which you would like to see added to the software in the Feature Requests board.

  Receive our monthly newsletter right in your inbox.


Advertisement  






go up