With that out of the way, In my settings, I needed a dynamic menu option, to select which guild the addon would apply to. I created the /admin/conf.func.php with the function in it, it reads the database just fine, it shows the dropdown list just fine, but it wont save the option.
I've created html forms hundreds of times, so I'm pretty sure that the format for that is correct, i've done php enough to know what i'm doing to an extent. i've viewed the source from the main page and everything looks the same. I've opened roster/admin/roster_config_functions.php and looked at the pageNames() function and based my function off of that, but again, it still does not update. I always get "No changes have been made"
Any insite to this would be helpful. I cant tell if it's a bug in the roster, or if i'm really fubaring something. Here is my function, in case it's something in it.
- Code: Select all
function GetGuildList(){
global $roster;
global $addon;
$query = "SELECT * FROM {$roster->db->prefix}guild ORDER BY `guild_id` ASC";
$result = $roster->db->query( $query );
$return = '<select name="choose_guild">';
if ($addon['config']['choose_guild'] == 0){
$return .= '<option value="0" selected="selected">-[ Disabled ]-</option>';
}else{
$return .= '<option value="0">Disabled</option>';
}
while ($row = $roster->db->fetch( $result ) ){
if ($row['guild_id'] == $addon['config']['choose_guild']){
$return .= '<option value="'. $row['guild_id'].'" selected="selected">-[ '.$row['guild_name'].']-</option>';
}else{
$return .= '<option value="' . $row['guild_id'] . '">' . $row['guild_name'] . '</option>';
}
}
$return .= "</select>";
$roster->db->free_result($result);
return $return;
}
Edit: updated code.