PDA

View Full Version : [fixed] Little Bug in adminfunctions.php


CouJo
Sat 15th Sep '01, 3: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!

Mike Sullivan
Sat 15th Sep '01, 6:22pm
Hmm... guess so. :)

JamesUS
Sun 16th Sep '01, 3:00am
Just checked the latest code and it hasn't been fixed, so I guess we'd better move it over to the Bugs forum :)

Mike Sullivan
Sun 16th Sep '01, 2:20pm
Originally posted by JamesUS
Just checked the latest code and it hasn't been fixed, so I guess we'd better move it over to the Bugs forum :) I woulda sworn I did that! :)

JamesUS
Sun 16th Sep '01, 2:58pm
Fraid not :D

The most recent change to adminfunctions.php was over a week ago (by Kier) :)

Mike Sullivan
Mon 17th Sep '01, 12:14am
Oh, yeah, I know it hasn't been changed in the code -- I actually meant I thought I moved this to the bugs forum (hence my first response).