Ich habe mich mal rangesetzt um den MD5 Hash beim UL automatisch zu ermitteln und in die DB einzutragen. Vllt. kann dies ja auch in der aktuellen Version genutzt werden.
Zuerst per PMA eine neue Spalte namens md5 einfügen:
Code: Alles auswählen
ALTER TABLE `phpbb_downloads` ADD `md5` VARCHAR( 32 ) NOT NULL
Suche:
Code: Alles auswählen
$file_language = $dl_file['file_language'];
Code: Alles auswählen
$file_hash = $dl_file['md5'];
Code: Alles auswählen
'L_DL_FILES_TITLE' => $lang['Dl_files_title'],
Code: Alles auswählen
'L_FILE_HASH' => $lang['Dl_file_hash'],
'L_FILE_HASH_EXPLAIN' => 'Dl_file_hash',
Code: Alles auswählen
'FILE_LANGUAGE' => $file_language,
Code: Alles auswählen
'FILE_HASH' => $file_hash,
Code: Alles auswählen
$file_name = (isset($HTTP_POST_VARS['file_name'])) ? trim($HTTP_POST_VARS['file_name']) : "";
Code: Alles auswählen
$file_hash = (isset($HTTP_POST_VARS['md5'])) ? trim($HTTP_POST_VARS['md5']) : "";
Code: Alles auswählen
$file_size = (!$file_extern) ? sprintf("%u", @filesize($dl_config['dl_path'] . $file_path . $file_name)) : -1;
if (!$file_size && !$file_extern)
{
message_die(GENERAL_MESSAGE, sprintf($lang['Dl_file_not_found'], $file_name, $dl_config['dl_path'] . $file_path));
}
Code: Alles auswählen
$file_size = (!$file_extern) ? sprintf("%u", @filesize($dl_config['dl_path'] . $file_path . $file_name)) : -1;
$file_hash = (!$file_extern) ? sprintf(@md5_file($dl_config['dl_path'] . $file_path . $file_name)) : $lang['Dl_not_availible'];
if (!$file_size && !$file_hash && !$file_extern)
{
message_die(GENERAL_MESSAGE, sprintf($lang['Dl_file_not_found'], $file_name, $dl_config['dl_path'] . $file_path));
}
Code: Alles auswählen
$sql = "UPDATE " . DOWNLOADS_TABLE . " SET
description = '" . str_replace("\'", "''", $description) . "',
file_traffic = '" . str_replace("\'", "''", $file_traffic) . "',
long_desc = '" . str_replace("\'", "''", $long_desc) . "',
file_name = '" . str_replace("\'", "''", $file_name) . "',
file_language = '" . str_replace("\'", "''", $file_language) . "',
free = '" . str_replace("\'", "''", $file_free) . "',
extern = '" . str_replace("\'", "''", $file_extern) . "',
cat = '" . str_replace("\'", "''", $cat_id) . "',
hacklist = '" . str_replace("\'", "''", $hacklist) . "',
hack_author = '" . str_replace("\'", "''", $hack_author) . "',
hack_author_email = '" . str_replace("\'", "''", $hack_author_email) . "',
hack_author_website = '" . str_replace("\'", "''", $hack_author_website) . "',
hack_version = '" . str_replace("\'", "''", $hack_version) . "',
hack_dl_url = '" . str_replace("\'", "''", $hack_dl_url) . "',
test = '" . str_replace("\'", "''", $test) . "',
req = '" . str_replace("\'", "''", $require) . "',
todo = '" . str_replace("\'", "''", $todo) . "',
warning = '" . str_replace("\'", "''", $warning) . "',
mod_desc = '" . str_replace("\'", "''", $mod_desc) . "',
mod_list = '" . str_replace("\'", "''", $mod_list) . "',
bbcode_uid = '" . str_replace("\'", "''", $bbcode_uid) . "',
approve = '" . str_replace("\'", "''", $approve) . "',
file_size = '" . str_replace("\'", "''", $file_size) . "'";
Code: Alles auswählen
$sql = "UPDATE " . DOWNLOADS_TABLE . " SET
description = '" . str_replace("\'", "''", $description) . "',
file_traffic = '" . str_replace("\'", "''", $file_traffic) . "',
long_desc = '" . str_replace("\'", "''", $long_desc) . "',
file_name = '" . str_replace("\'", "''", $file_name) . "',
file_language = '" . str_replace("\'", "''", $file_language) . "',
free = '" . str_replace("\'", "''", $file_free) . "',
extern = '" . str_replace("\'", "''", $file_extern) . "',
cat = '" . str_replace("\'", "''", $cat_id) . "',
hacklist = '" . str_replace("\'", "''", $hacklist) . "',
hack_author = '" . str_replace("\'", "''", $hack_author) . "',
hack_author_email = '" . str_replace("\'", "''", $hack_author_email) . "',
hack_author_website = '" . str_replace("\'", "''", $hack_author_website) . "',
hack_version = '" . str_replace("\'", "''", $hack_version) . "',
hack_dl_url = '" . str_replace("\'", "''", $hack_dl_url) . "',
test = '" . str_replace("\'", "''", $test) . "',
req = '" . str_replace("\'", "''", $require) . "',
todo = '" . str_replace("\'", "''", $todo) . "',
warning = '" . str_replace("\'", "''", $warning) . "',
mod_desc = '" . str_replace("\'", "''", $mod_desc) . "',
mod_list = '" . str_replace("\'", "''", $mod_list) . "',
bbcode_uid = '" . str_replace("\'", "''", $bbcode_uid) . "',
approve = '" . str_replace("\'", "''", $approve) . "',
file_size = '" . str_replace("\'", "''", $file_size) . "',
md5 = '" . str_replace("\'", "''", $file_hash) . "'";
Code: Alles auswählen
$sql = "INSERT INTO " . DOWNLOADS_TABLE . "
(file_name, file_language, cat, description, long_desc, md5, free, extern,
hacklist, hack_author, hack_author_email, hack_author_website,
hack_version, hack_dl_url, test, req, todo, warning, mod_desc, approve,
mod_list, bbcode_uid, file_size, change_time, add_time,
change_user, add_user, file_traffic)
VALUES
('" . str_replace("\'", "''", $file_name) . "',
'" . str_replace("\'", "''", $file_language) . "',
'" . str_replace("\'", "''", $cat_id) . "',
'" . str_replace("\'", "''", $description) . "',
'" . str_replace("\'", "''", $long_desc) . "',
'" . str_replace("\'", "''", $file_free) . "',
'" . str_replace("\'", "''", $file_extern) . "',
$hacklist,
'" . str_replace("\'", "''", $hack_author) . "',
'" . str_replace("\'", "''", $hack_author_email) . "',
'" . str_replace("\'", "''", $hack_author_website) . "',
'" . str_replace("\'", "''", $hack_version) . "',
'" . str_replace("\'", "''", $hack_dl_url) . "',
'" . str_replace("\'", "''", $test) . "',
'" . str_replace("\'", "''", $require) . "',
'" . str_replace("\'", "''", $todo ) . "',
'" . str_replace("\'", "''", $warning) . "',
'" . str_replace("\'", "''", $mod_desc) . "',
$approve, $mod_list,
'" . str_replace("\'", "''", $bbcode_uid) . "',
$file_size,
$current_time, $current_time, $current_user, $current_user,
'" . str_replace("\'", "''", $file_traffic) . "')";
Code: Alles auswählen
$sql = "INSERT INTO " . DOWNLOADS_TABLE . "
(file_name, file_language, cat, description, long_desc, md5, free, extern,
hacklist, hack_author, hack_author_email, hack_author_website,
hack_version, hack_dl_url, test, req, todo, warning, mod_desc, approve,
mod_list, bbcode_uid, file_size, change_time, add_time,
change_user, add_user, file_traffic)
VALUES
('" . str_replace("\'", "''", $file_name) . "',
'" . str_replace("\'", "''", $file_language) . "',
'" . str_replace("\'", "''", $cat_id) . "',
'" . str_replace("\'", "''", $description) . "',
'" . str_replace("\'", "''", $long_desc) . "',
'" . str_replace("\'", "''", $file_hash) . "',
'" . str_replace("\'", "''", $file_free) . "',
'" . str_replace("\'", "''", $file_extern) . "',
$hacklist,
'" . str_replace("\'", "''", $hack_author) . "',
'" . str_replace("\'", "''", $hack_author_email) . "',
'" . str_replace("\'", "''", $hack_author_website) . "',
'" . str_replace("\'", "''", $hack_version) . "',
'" . str_replace("\'", "''", $hack_dl_url) . "',
'" . str_replace("\'", "''", $test) . "',
'" . str_replace("\'", "''", $require) . "',
'" . str_replace("\'", "''", $todo ) . "',
'" . str_replace("\'", "''", $warning) . "',
'" . str_replace("\'", "''", $mod_desc) . "',
$approve, $mod_list,
'" . str_replace("\'", "''", $bbcode_uid) . "',
$file_size,
$current_time, $current_time, $current_user, $current_user,
'" . str_replace("\'", "''", $file_traffic) . "')";
suche:
Code: Alles auswählen
$file_status = array();
$file_status = $dl_mod->dl_status($df_id);
Code: Alles auswählen
$file_hash = $dl_files['md5'];
Code: Alles auswählen
'FILE_OVERALL_KLICKS' => $file_overall_klicks,
'FILE_NAME' => $file_name,
Code: Alles auswählen
'FILE_HASH' => $file_hash,
Code: Alles auswählen
'L_DOWNLOAD' => $lang['Dl_download'],
'L_FILE_NAME' => $lang['Dl_file_name'],
Code: Alles auswählen
'L_FILE_HASH' => $lang['Dl_file_hash'],
suche:
Code: Alles auswählen
<tr>
<td class="row1" width="30%"><span class="gen"><b>{L_LINK_URL}:</b></span></td>
<td class="row1" width="2%"> [<a href="javascript:void(0)" onclick="javascript:help_popup('{L_LINK_URL_EXPLAIN}')" class="nav">?</a>] </td>
<td class="row2" width="68%"><input type="text" class="post" name="file_name" size="40" maxlength="255" value="{URL}" /></td>
</tr>
Code: Alles auswählen
<tr>
<td class="row1" width="30%"><span class="gen"><b>{L_FILE_HASH}:</b></span></td>
<td class="row1" width="2%"> [<a href="javascript:void(0)" onclick="javascript:help_popup('{L_FILE_HASH_EXPLAIN}')" class="nav">?</a>] </td>
<td class="row2" width="68%"><span class="gen"> {FILE_HASH}</span></td>
</tr>
Code: Alles auswählen
<tr>
<td width="20%" class="{ROW_CLASS2}" align="right" nowrap="nowrap"><span class="gen">{L_FILE_NAME}:</span></td>
<td width="20%" class="{ROW_CLASS1}" align="center"><span class="gen">{downloads.FILE_NAME}</span></td>
</tr>
Code: Alles auswählen
<tr>
<td width="20%" class="{ROW_CLASS2}" align="right" nowrap="nowrap"><span class="gen">{L_FILE_HASH}:</span></td>
<td width="20%" class="{ROW_CLASS1}" align="center"><span class="gen">{downloads.FILE_HASH}</span></td>
</tr>
suche nach:
Code: Alles auswählen
$lang['Dl_file_name'] = "Datei";
Code: Alles auswählen
$lang['Dl_file_hash'] = 'MD5 Hash';
suche nach:
Code: Alles auswählen
$lang['HELP_Dl_files_url'] = 'Der Dateiname des Downloads.<br />Gib ihn ohne Pfadangaben und ohne führenden Slash an.<br />Die Datei muss vor dem Speichern bereits im Ordner der Kategorie existieren, sonst wird eine Fehlermeldung angezeigt.<br />Beachte auch verbotene Dateiendungen: Dateien, die hierzu zählen, werden abgewiesen.';
Code: Alles auswählen
$lang['HELP_Dl_file_hash'] = 'Der Message-Digest Algorithm 5 (MD5) ist eine weit verbreitete kryptographische Hashfunktion, die aus einer beliebigen Nachricht einen 128-Bit-Hashwert (Prüfsumme) erzeugt. Dies erlaubt beispielsweise die leichte Überprüfung eines Downloads auf Korrektheit. MD5 wurde 1991 von Ronald L. Rivest entwickelt. Sie gilt inzwischen nicht mehr als sicher, da es mit überschaubarem Aufwand möglich ist, unterschiedliche Nachrichten zu erzeugen, die dieselbe MD5-Prüfsumme aufweisen.';
Bye