so, hab ich gemacht (2einträge inder admin_medal.php), aber geht trotzdem nich...
aber wenn ich folgenden code entferne, zeigts wenigstens das acp an...
Code: Alles auswählen
function get_info($mode, $id)
{
global $db;
switch($mode)
{
case 'category':
$table = MEDAL_CAT_TABLE;
$idfield = 'cat_id';
$namefield = 'cat_title';
break;
case 'medal':
$table = MEDAL_TABLE;
$idfield = 'medal_id';
$namefield = 'medal_name';
break;
default:
message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__);
break;
}
$sql = "SELECT count(*) as total
FROM $table";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get Medals/Medal Category information", "", __LINE__, __FILE__, $sql);
}
$count = $db->sql_fetchrow($result);
$count = $count['total'];
$sql = "SELECT *
FROM $table
WHERE $idfield = $id";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get Medals/Medal Category information", "", __LINE__, __FILE__, $sql);
}
if( $db->sql_numrows($result) != 1 )
{
message_die(GENERAL_ERROR, "Medals/Medal Category doesn't exist or multiple medal/medal categories with ID $id", "", __LINE__, __FILE__);
}
$return = $db->sql_fetchrow($result);
$return['number'] = $count;
return $return;
}
function get_list($mode, $id, $select)
{
global $db;
switch($mode)
{
case 'category':
$table = MEDAL_CAT_TABLE;
$idfield = 'cat_id';
$namefield = 'cat_title';
break;
default:
message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__);
break;
}
$sql = "SELECT *
FROM $table";
if( $select == 0 )
{
$sql .= " WHERE $idfield <> $id";
}
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Medal Categories/Medals", "", __LINE__, __FILE__, $sql);
}
$cat_list = "";
while( $row = $db->sql_fetchrow($result) )
{
$s = "";
if ($row[$idfield] == $id)
{
$s = " selected=\"selected\"";
}
$catlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n";
}
return($catlist);
}
zitat: *daßdasimmernochkeinervondenmodderngelernthat*
was meinstn damit? außerdem bin ich kein modler, sondern quadfahrer!