recent topics excluding a certain board

Started by stog, August 27, 2016, 03:31:20 AM

Previous topic - Next topic

stog

Hi I have a 2.0.11 backgammon forum site with TP and i would like to mod the Recent Topics ssi block to exclude a certain board which gets Tourneybot results autoposted 4 or 5 times a day, and consequentially 'takes over' Recent posts/topics (when the forum was 1.1.21, i used Dragoon's recent topics which did the trick, but now i am trying to do the same in SMF2)

the block i am using at the moment is
global $context, $modSettings, $settings, $txt;
$context['TPortal']['recentboxnum'] = '15';

if(isset($modSettings['recycle_board']))
$bb = $modSettings['recycle_board'];

$what = ssi_recentTopics($context['TPortal']['recentboxnum'], NULL, NULL, 'array');
$counter=1;
$cmax = count($what);

echo '
<div style="width: 100%; overflow: auto; height: 30ex;">';

foreach($what as $w)
{
echo '
<div class="smalltext"><a href="http://www.fibsboard.com/'.$w['href'].'">' . $w['short_subject'] . '</a></div>
<div class="smalltext">', $txt['by'], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
echo '<a href="http://www.fibsboard.com/'.$w['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';

echo '['.$w['time'].']
</div>';

if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div>';


2 snippets i have found when searching which might help are

ssi_recentTopics($num_recent = 5, $exclude_boards = null, $include_boards = 15, $output_method = 'echo'); from zarprime i think

and

$array = ssi_recentPosts2($num_recent = 1, $exclude_boards = null, $include_boards = array(10,11,1,21), $output_method = 'array', false);



so i have been trying to utilise these snippets by adding/editing etc but with woeful results ;)  -- for example..

$array = ssi_recentPosts2($num_recent = 1, $exclude_boards = null, $include_boards = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125), $output_method = 'array', false);


i actually just want to exclude board 98

any help gratefully received

cheers

stog

#1
oops

ok figured it ;)

ssi_recentTopics(10, 0, 9, 'array');


where 10 = number of posts
0 = board is to exclude
9 = board id to include
array = output method

(from http://www.simplemachines.org/community/index.php?action=post;quote=3513095;topic=367352.0;last_msg=3513095)

so my code became $what = ssi_recentTopics($context['TPortal']['recentboxnum'], 98, NULL, 'array'););




also if i then want to exclude 2 boards, eg 49 & 98 how do i separate them, and maintain the snippet? do i use and i wonder? will try!

many thx to the posters who posted their snippets with explanations i found in 'search'




Advertisement: