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

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 09:11:38 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 97
  • Total: 97

Topics in board displayed in block...

Started by OIDanTheManIO, November 14, 2005, 03:45:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OIDanTheManIO

How do I make the topics from a board (with a limit, of course) display in a blocK?  For example, just a small list of topic names that link to the topic.  Oh say, the five most recently created topics for board 5.


OIDanTheManIO


OIDanTheManIO

Hmm, I just now noticed the RSS Feed box...that would work.

EDIT:  Or not :P.  No feed is displayed after I configure it.

iowamf

I'm doing this in a column block ... the only difference is that I rewrote the ssi_recentTopics call to accept a board value to include - ie, the "array(9)" parameter,   in the default ssi_recentTopics command it requires you to provide a list of boards to exclude boards (difficult to maintain if you are going to be adding boards).

global $context, $scripturl;
$result=ssi_recentTopics_hack(10,array(9),'return');
foreach($result as $my){
  echo '<span class="smalltext">'.$my['link'];
  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
echo '
                                                <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';



OIDanTheManIO

Quote from: iowamf on November 14, 2005, 06:46:26 PM
I'm doing this in a column block ... the only difference is that I rewrote the ssi_recentTopics call to accept a board value to include - ie, the "array(9)" parameter,   in the default ssi_recentTopics command it requires you to provide a list of boards to exclude boards (difficult to maintain if you are going to be adding boards).

global $context, $scripturl;
$result=ssi_recentTopics_hack(10,array(9),'return');
foreach($result as $my){
  echo '<span class="smalltext">'.$my['link'];
  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
echo '
                                                <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';




Hmm, won't let me use that code in a PHP block.

iowamf

I'm a rookie - bled all over the keyboard with that one.
Perpaps try it in a PHP article and debug there?
Sorry I can't be of more help - just trying to help out where/when I can as this board has helped me.
The output of that looks like the 2nd box (note, I stripped the time out).


snork13

Quote from: iowamf on November 14, 2005, 09:27:17 PM
I'm a rookie - bled all over the keyboard with that one.
Perpaps try it in a PHP article and debug there?
Sorry I can't be of more help - just trying to help out where/when I can as this board has helped me.
The output of that looks like the 2nd box (note, I stripped the time out).



i like to see the hacked version if possible?

thanks

snork

iowamf

Not sure I understand your question - I'm calling the code I posted a "hack" as it has limited usage ... but it does produce the output shown in the attachment and my error log isn't going too crazy.

snork13

Quote from: iowamf on November 15, 2005, 03:10:41 AM
Not sure I understand your question - I'm calling the code I posted a "hack" as it has limited usage ... but it does produce the output shown in the attachment and my error log isn't going too crazy.



right, i assume you reworked the original code to work with the block, i was interested in see what you excluded