News: November 30th, 2018, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.1! GET IT NOW!!!

Login  |  Register
* *
TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 22, 2019, 03:56:53 PM

Login with username, password and session length

Recent

Members
  • Total Members: 3735
  • Latest: xMaster
Stats
  • Total Posts: 187126
  • Total Topics: 20629
  • Online Today: 49
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 2
Guests: 16
Total: 18

Author Topic: ARTICLE CATEGORIE BOX  (Read 4890 times)

0 Members and 1 Guest are viewing this topic.

Offline vincitygialam

  • Newbie
  • *
  • Posts: 1
ARTICLE CATEGORIE BOX
« on: October 23, 2018, 05:49:11 PM »
Is there any ready to use box that I can add to a tinyportal panel where I have a list of all existing categories for articles and if I click a categorie I get only the fitting articles?  Like in a blog.

Online lurkalot

  • Administrator
  • *
  • Posts: 5634
    • Camera Craniums
Re: ARTICLE CATEGORIE BOX
« Reply #1 on: October 24, 2018, 03:13:20 PM »
Sorry for delay in replying.

Pretty sure there isn't a block available to do this, but I'll have a check around and see if there's a workaround you could use for this purpose.

Offline @rjen

  • Support Team
  • *
  • Posts: 1254
    • FJR-club Nederland
Re: ARTICLE CATEGORIE BOX
« Reply #2 on: October 24, 2018, 03:24:08 PM »
It should be possible to create that in a php block...
Running TP1.6.1 on SMF2.0 at: www.fjr-club.nl

Testing TP1.6.2 on SMF2.0
Testing TP1.6.2 on SMF2.1
Want to check what php version I am testing on? See: PHP Info

Offline wildenborch

  • Support Team
  • *
  • Posts: 337
Re: ARTICLE CATEGORIE BOX
« Reply #3 on: October 24, 2018, 11:07:44 PM »
This can also be done with the menu manager.
Or do I misunderstand your question?
Do you want to show the articles or only the article titles?
« Last Edit: October 24, 2018, 11:55:51 PM by wildenborch »

Offline @rjen

  • Support Team
  • *
  • Posts: 1254
    • FJR-club Nederland
Re: ARTICLE CATEGORIE BOX
« Reply #4 on: October 25, 2018, 03:59:23 AM »
You can try this code in a PHP block...

It will build a list of all categories, and clicking the category will bring you to the category page, showing all articles in the category.

The category page will show in the layout type as you defined it in the settings for the category...

Code: [Select]
echo ' <div style="float:left;padding-right: 5px;"><img height="35px" src="Themes/default/images/tinyportal/TPov_categories.png"></img></div><strong>Categories</strong></br>' ;
echo ' <br>' ;
echo ' <hr>' ;

global $scripturl, $smcFunc;

$request = $smcFunc['db_query']('', '
     SELECT id, value1, type
     FROM {db_prefix}tp_variables
     WHERE type = "category"
     ORDER BY value1 ASC'
);
echo '
<ul style="list-style-type:disc; margin: 0pt; padding: 0pt 15px;">
 ';
while ($row = $smcFunc['db_fetch_assoc']($request))
{
     echo '<li><a href="', $scripturl, '?cat=', $row['id'], '">', $row['value1'], '</a></li>';
}
echo '</ul>';
$smcFunc['db_free_result']($request);
Running TP1.6.1 on SMF2.0 at: www.fjr-club.nl

Testing TP1.6.2 on SMF2.0
Testing TP1.6.2 on SMF2.1
Want to check what php version I am testing on? See: PHP Info