CouJo
Sat 15th Sep '01, 4:07pm
There is a little Bug in 1 function in the adminfunctions.php file:
// ###################### Start makeforumchoosercode #######################
function makeforumchoosercode ($title,$name,$selvalue=-1,$extra="") {
// returns a combo box containing a list of titles in the forum table, except for "My BB" (-1).
// allows specification of selected value in $selvalue
global $DB_site;
echo "<tr class='".getrowbg()."' valign='top'>\n<td><p>$title</p></td>\n<td><p><select name=\"$name\" size=\"1\">\n";
$result=$DB_site->query("SELECT title,forumid FROM forum WHERE forumid<>-1 ORDER BY title");
while ($currow=$DB_site->fetch_array($result)) {
// ####### now comes the little bug ########
if ($selvalue==$currow[$tableid]) {
// ####### end bug ##################
echo "<option value=\"$currow[forumid]\" SELECTED>$currow[title]</option>\n";
} else {
echo "<option value=\"$currow[forumid]\">$currow[title]</option>\n";
}
} // for
if ($extra!="") {
if ($selvalue==-1) {
echo "<option value=\"-1\" SELECTED>$extra</option>\n";
} else {
echo "<option value=\"-1\">$extra</option>\n";
}
}
echo "</select>\n</p></td>\n</tr>\n";
}
The line between the "##" lines must be:
if ($selvalue==$currow[$forumid]) {
else you will never get an pre selected Forum!
Is this correct ;) ?!
Greets from Germany, CouJo!
// ###################### Start makeforumchoosercode #######################
function makeforumchoosercode ($title,$name,$selvalue=-1,$extra="") {
// returns a combo box containing a list of titles in the forum table, except for "My BB" (-1).
// allows specification of selected value in $selvalue
global $DB_site;
echo "<tr class='".getrowbg()."' valign='top'>\n<td><p>$title</p></td>\n<td><p><select name=\"$name\" size=\"1\">\n";
$result=$DB_site->query("SELECT title,forumid FROM forum WHERE forumid<>-1 ORDER BY title");
while ($currow=$DB_site->fetch_array($result)) {
// ####### now comes the little bug ########
if ($selvalue==$currow[$tableid]) {
// ####### end bug ##################
echo "<option value=\"$currow[forumid]\" SELECTED>$currow[title]</option>\n";
} else {
echo "<option value=\"$currow[forumid]\">$currow[title]</option>\n";
}
} // for
if ($extra!="") {
if ($selvalue==-1) {
echo "<option value=\"-1\" SELECTED>$extra</option>\n";
} else {
echo "<option value=\"-1\">$extra</option>\n";
}
}
echo "</select>\n</p></td>\n</tr>\n";
}
The line between the "##" lines must be:
if ($selvalue==$currow[$forumid]) {
else you will never get an pre selected Forum!
Is this correct ;) ?!
Greets from Germany, CouJo!