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

Recent

Welcome to TinyPortal. Please login or sign up.

April 27, 2024, 01:39:17 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 90
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 40
  • Total: 40

Current Topics in an article

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

Previous topic - Next topic

0 Members and 1 Guest 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.