News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Help with code please?

Started by S3NTYN3L, December 17, 2010, 12:26:27 AM

Previous topic - Next topic

S3NTYN3L

I'm trying to edit the BoardIndex.template with the following:

Find:
foreach ($category['boards'] as $board)
{


Add after:
global $modsettings;
if (in_array ($context['RCB_remove_which']))
$board['children'] = null;


OK, so RCB_remove_which is an option in the ACP.
It's a text field that holds child board id numbers that are to get nulled.

Trouble is, this isn't doing anything at the moment.
I'm not sure how to get it working as I intend.
I suck with PHP/SMF syntax...

Anyone got a solution or feel like pointing in the right direction please?

DoctorMalboro

http://ar.php.net/manual/en/function.in-array.php

You need to add what you're looking for and where you're looking it. Example...

<?php

$fruits
= array('Apples', 'Oranges', 'Bananas', 'Grapes',);

if(
in_array('Apples'), $fruits)
{ echo
'We've got Apples!'; }
else
{ echo'
Go and buy some Apples!'; }

?>


At least from my point of view, it's that... what are you trying to search, BTW? (or do with that...)

S3NTYN3L

Got it sorted, thanks. ;D

if (in_array($board['id'], explode(",", $modSettings['kill_children'])))
$board['children'] = array();


The mod should be approved soon.
http://custom.simplemachines.org/mods/index.php?mod=2864

Advertisement: