PDA

View Full Version : Mini Mods - Update: Default Pre-selected Post Icon: Now from Parent ID


jim doodle
01-10-2011, 10:00 PM
This is just a little update for the Default Pre-selected Post Icon (https://vborg.vbsupport.ru/showthread.php?t=113675)

Works in 3.8.6

It's been a while since any one used this mod by the looks of things, I've updated it a little to work with multiple forums where adding each forum as a separate 'If' statement is unthinkable.

Instead i've exploded the string of parantlist which contains a strong of parent forum IDs into an array, and made a conditional from there:

$newparentarray= explode(',', $foruminfo[parentlist]);

if (in_array(146, $newparentarray)) {
$newpost['iconid'] = '18';
}
else if (in_array(147, $newparentarray)) {
$newpost['iconid'] = '19';
}

And a little edit on the hook location it is "newthread_form_start" not forum.

piratarg
10-18-2012, 09:14 PM
Very thanks! I was looking for something like this.

Is it possible to select more forums? Example:

$newparentarray= explode(',', $foruminfo[parentlist]);

if (in_array(1,2,5,8, $newparentarray)) {
$newpost['iconid'] = '4';
}
else if (in_array(12,14,16, $newparentarray)) {
$newpost['iconid'] = '6';
}

piratarg
10-20-2012, 01:33 AM
Does not work, any suggestions? Help please!

stefan-baldes
10-23-2021, 02:17 PM
Is there a chance to get the original addon? Since the associated thread has been archived dowinloading it is not possible anymore.