MarkFL
04-08-2015, 05:27 PM
Hello,
I am working on modifying a product I wrote, and for the product's option settings in the AdminCP, I want to present the user with radio buttons to select a forum, rather than having to enter the forumid manually. This I have working, however, I want the default value to be the forum that has been chosen to receive user-reporting of posts.
Here is my code for the setting:
<setting varname="markfl_par_report_forumid" displayorder="35">
<optioncode><![CDATA[" . eval('$options = "";
foreach($vbulletin->forumcache AS $forumid => $forum)
{
if ($forum[parentid] > 0)
{
$options .= "\\t\\t<label for=\\"setting[$setting[varname]]$forumid\\" title=\\"forumid: $forumid\\"><input type=\\"radio\\" tabindex=\\"1\\" name=\\"setting[$setting[varname]]"."[]\\" id=\\"setting[$setting[varname]]$forumid\\" value=\\"$forumid\\"" . iif(strpos(",$setting[value],", ",$forumid,") !== false, \' checked="checked"\') . iif($vbulletin->debug, " title=\\"name="setting[$setting[varname]]"\\"") . " />$forum[title]</label><br />\\n";
}
}
return "<span class=\\"smallfont\\">\\n$options\\t</span>";') . "<input type=\"hidden\" name=\"setting[$setting[varname]][]\" value=\"-1\" />]]>
</optioncode>
<datatype>free</datatype>
<defaultvalue><![CDATA[" . eval('return $vbulletin->options[\'rpforumid\'];') . "]]></defaultvalue>
</setting>
The code in red is what's not working, and I would like to know what I need there. :D
I am working on modifying a product I wrote, and for the product's option settings in the AdminCP, I want to present the user with radio buttons to select a forum, rather than having to enter the forumid manually. This I have working, however, I want the default value to be the forum that has been chosen to receive user-reporting of posts.
Here is my code for the setting:
<setting varname="markfl_par_report_forumid" displayorder="35">
<optioncode><![CDATA[" . eval('$options = "";
foreach($vbulletin->forumcache AS $forumid => $forum)
{
if ($forum[parentid] > 0)
{
$options .= "\\t\\t<label for=\\"setting[$setting[varname]]$forumid\\" title=\\"forumid: $forumid\\"><input type=\\"radio\\" tabindex=\\"1\\" name=\\"setting[$setting[varname]]"."[]\\" id=\\"setting[$setting[varname]]$forumid\\" value=\\"$forumid\\"" . iif(strpos(",$setting[value],", ",$forumid,") !== false, \' checked="checked"\') . iif($vbulletin->debug, " title=\\"name="setting[$setting[varname]]"\\"") . " />$forum[title]</label><br />\\n";
}
}
return "<span class=\\"smallfont\\">\\n$options\\t</span>";') . "<input type=\"hidden\" name=\"setting[$setting[varname]][]\" value=\"-1\" />]]>
</optioncode>
<datatype>free</datatype>
<defaultvalue><![CDATA[" . eval('return $vbulletin->options[\'rpforumid\'];') . "]]></defaultvalue>
</setting>
The code in red is what's not working, and I would like to know what I need there. :D