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

Recent

Welcome to TinyPortal. Please login or sign up.

April 23, 2024, 07:40:06 AM

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

"recent topics" in SMF style

Started by Lesmond, August 17, 2005, 12:01:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

I wouldn't have any idea how his code works. If I were you, I'd look at some of the other topics that do essentially the same thing and see if you get what you want.

Excalibur J

I don't think functions call themselves and all you added were the functions without calling them.

The post before the one with the separate functions shows how the functions can be actually called from either an article or a block. Put the code you want in front of the function definitions.

zapiy


Excalibur J

You wrote that you put it in a block.

The second code block in message:
http://www.tinyportal.net/index.php/topic,596.msg173244.html#msg173244
is about using it in a php box.

It all depends on what you want shown and how. You supply the parameters and then call the function. Because you are making the function local, you don't want/need to use the part near the top which is used to include the function when it's in an external file and almost all of the rest of the code shown is comments documenting use.

Example:
global $settings, $user_info, $modSettings, $sourcedir;

$parm = array();

$parm['type'] = 'last';
$parm['count'] = 5;
$parm['style'] = 'fullblock';

JAC_RecentTopics($parm, 'echo');

...

<this is where the code you have in place already is>


Will give 5 most recently posted to topics in center-block SMF-Style.

Example:
global $settings, $user_info, $modSettings, $sourcedir;

$parm = array();

$parm['type'] = 'last';
$parm['count'] = 10;
$parm['style'] = 'condensed';
$parm['height'] = 200;

JAC_RecentTopics($parm, 'echo');

...

<this is where the code you have in place already is>


Will give 10 most recently posted to topics in side block 200 pixels high with a scroll bar.

katers

Hi can you please tell me if this is the one that is used on this forum?

ZarPrime

Hi twister,

If you are asking if the code in this topic is the same as the standard TP Recent Topics block, the answer is no.  The code talked about in this topic is designed for a center block, or an upper block in the newer TP versions.  The best way to see how it works is to stick it into one of those panels and check it out.  I am using one of the blocks of code in this topic on one of my sites and the way it's formatted, it wouldn't look right in a left or right panel.

ZarPrime

katers

Ok, thank you.  Yes I am looking for something that fits on a side block like this forum.  I will keep searching.

ZarPrime

Twister,

I should have asked you this before but is the Recent Topics block in the left panel here on TinyPortal.net the one you are wanting to use?  If so, this is the same standard block type called "Recent Topics" which is available as standard in all versions of of TP 1.x.

ZarPrime

katers


ZarPrime

Twister,

Sure.  NP.  I'm glad we got you solved. :up:

ZarPrime