Viglink

Author Topic:  Add category link to SP article post  (Read 4089 times)


0 Members and 1 Guest are viewing this topic.

June 26, 2014, 11:18:21 PM

Offline Brian

  • Administrator
  • Jr. Member
  • *
  • Posts: 49
  • Country: us
  • Karma: 0
    • View Profile
Add category link to SP article post
« on: June 26, 2014, 11:18:21 PM »

(Register to disable this ad!)
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.

Code: [Select]
', $txt['postedin'], ' ', $article['board']['link'], '

Instead of looking like this:
Brian 1 hour ago 0 Comments

Will look like this:
Brian Posted in Portal Discussions 1 hour ago 0 Comments

In Themes/default/PortalArticles.template.php

Find:
Code: [Select]
            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:
Code: [Select]
            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:
Code: [Select]
$txt['postedin'] = 'Posted in';

« Last Edit: June 26, 2014, 11:22:03 PM by Brian »

HostGator
Use SMFHELP25OFF for 25% off!
Tags: