TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

December 09, 2024, 08:50:17 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,443
  • Total Topics: 21,252
  • Online today: 132
  • Online ever: 6,457 (November 30, 2024, 02:40:09 PM)
Users Online
  • Users: 1
  • Guests: 116
  • Total: 117
  • @rjen

Current Topics in an article

Started by rrolle, February 08, 2024, 02:49:00 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Arminus

Quote from: tino on February 11, 2024, 10:53:17 AMthe functions we supply were never intended to just be called.
I can see that, but that was suggested by rjen above and I figured that since we are calling this from within a TP Article, the context might be implicitly there - but I really don't have any understanding on how the bits and pieces play together there.

At any rate, seems that setting these 3 vars is sufficient:
$context['TPortal']['recentboxnum'] = 5;
$context['TPortal']['recentlength'] = 25;
$context['TPortal']['useavatar'] = 0;

So we're fine here for now.

@rjen

For the record: I did not suggest anything. OP asked where to find the code. That's what I answered
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: Arminus on February 11, 2024, 03:10:00 PM
Quote from: tino on February 11, 2024, 10:53:17 AMthe functions we supply were never intended to just be called.
I can see that, but that was suggested by rjen above and I figured that since we are calling this from within a TP Article, the context might be implicitly there - but I really don't have any understanding on how the bits and pieces play together there.

At any rate, seems that setting these 3 vars is sufficient:
$context['TPortal']['recentboxnum'] = 5;
$context['TPortal']['recentlength'] = 25;
$context['TPortal']['useavatar'] = 0;

So we're fine here for now.

That should work, but you might have unintended results if you have other blocks on the same page.

It was never built to be shown in an article box. The safer option is to copy the logic across and amend as needed.