Gumbo
Erfahrenes Mitglied
Mein Vorschlag:
PHP:
<?php
$trans = array(
'name' => $table_row['name'],
'titel' => $table_row['titel'],
'votes' => $table_row['votes'],
'vote' => $table_row['vote'],
'vote_form' => $table_row['vote_form'],
'size' => size($table_row['size']),
'downloads' => $table_row['downloads'],
'views' => $table_row['views'],
'text' => nl2br($table_row['text']),
'screens' => $table_row['screens'],
'dlspeed' => dlspeed($table_row['size']),
'time' => date($settings['date_format'], $table_row['time']),
'uploader' => user($table_row['uploader']),
'id' => $table_row['id'],
'autor' => $table_row['autor'],
'alt' => alt_switch(),
'alt_1' => $template['alt_1'],
'alt_2' => $template['alt_2'],
'footer_bg' => $template['footer_bg'],
'header_bg' => $template['header_bg'],
'table_border' => $template['table_border'],
'script_file' => $settings['script_file'],
'count' => $total,
'files' => $table_row['files'],
'subdirs' => $table_row['subdirs'],
'filename' => $table_row['filename'],
'traffic' => size($table_row['traffic']),
'list' => $list,
'rows' => $table_row
);
function replace($trans, $template)
{
if( !is_array($trans) || !is_string($template) ) {
return false;
}
foreach( $trans as $wildcard => $value ) {
$template = str_replace('{'.$wildcard.'}', $value, $template);
}
return $temaplte;
}
?>