News: September 21st, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.4! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 18, 2019, 07:24:47 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189090
  • Total Topics: 20764
  • Online Today: 70
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 61
Total: 61

Author Topic: A way to block ID's for specific forums from showing up in Recent Topics?  (Read 846 times)

0 Members and 1 Guest are viewing this topic.

Offline @rjen

  • Support Team
  • *
  • Posts: 1868
    • FJR-club Nederland
It’s a template not a source. Look in themes/default
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

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

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 284
It’s a template not a source. Look in themes/default

Got it. TY

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 284
I made that change and added the following ID's. I still see Labeda Pharaoh's, id 1164 on the front page recent topics block.

Code: [Select]
// TPortal recent topics block
function TPortal_recentbox()
{
global $scripturl, $context, $settings, $txt, $modSettings, $forum_version;

// is it a number?
if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='10';

// leave out the recycle board, if any, to exclude certain boards put board id's in $bb array below
if(isset($modSettings['recycle_board']))
$bb = array($modSettings['recycle_board'],384,385,386,1164);
else
$bb = array(384,385,386,1164);

// to include only certain boards put board id's in array below
$include_boards = array();

Offline @rjen

  • Support Team
  • *
  • Posts: 1868
    • FJR-club Nederland
Are you sure that is the correct board is? Seems VERY high
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

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

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 284
Are you sure that is the correct board is? Seems VERY high

Sorry, you're right. That is a topic#. The board id is 383. I added that, saved, reloaded and did Shift F5 on the page and still see the topics from that forum ID in recent.

Code: [Select]
// TPortal recent topics block
function TPortal_recentbox()
{
global $scripturl, $context, $settings, $txt, $modSettings, $forum_version;

// is it a number?
if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='10';

// leave out the recycle board, if any, to exclude certain boards put board id's in $bb array below
if(isset($modSettings['recycle_board']))
$bb = array($modSettings['recycle_board'],383,384,385,386);
else
$bb = array(383,384,385,386);

// to include only certain boards put board id's in array below
$include_boards = array();

Offline @rjen

  • Support Team
  • *
  • Posts: 1868
    • FJR-club Nederland
Strange, it should work. Other boards are excluded successfully?
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

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

Offline @rjen

  • Support Team
  • *
  • Posts: 1868
    • FJR-club Nederland
Topic showing 'Labeda Pharaohs' is not posted in board 383! It is posted in board 397, which is a child board of 383.

When excluding board you will need to exclude board number 397. The exclusion of a parent board will NOT automatically exclude all its child boards...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

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

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 284
Hi, sorry, I went on a bike ride with my wife and kids. You are 100% correct. Works perfectly. I was assuming the child forums were picked up under the parents. I put them all in and the code did exactly what you said it would do.

Perfect! Thank you!

Offline lurkalot

  • Administrator
  • *
  • Posts: 6291
    • Camera Craniums
Glad @rjen got you sorted on this one.  O0

If I'm honest, it would be nice if these were block options for the recent block, it's been Number 1 on my ideas for TP list since at least 2017.  Whether it will ever make it to core, I'm not sure, but it's been requested a few times over the years.

Maybe drop a request in the "TinyPortal Feature Requests board". https://www.tinyportal.net/index.php?board=246.0

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 284
Glad @rjen got you sorted on this one.  O0

If I'm honest, it would be nice if these were block options for the recent block, it's been Number 1 on my ideas for TP list since at least 2017.  Whether it will ever make it to core, I'm not sure, but it's been requested a few times over the years.

Maybe drop a request in the "TinyPortal Feature Requests board". https://www.tinyportal.net/index.php?board=246.0

Done! Thanks Mick, you guys are the best.