Seite 1 von 1

Probleme mit Download Mod

Verfasst: 24.01.2006 08:43
von MartinG
Hallo zusammen,

ich habe in mein Forum (vers 2.0.17) den Download MOD 4.0.1 integriert. Bei der Installation hat soweit auch alles geklappt. Das Datenbank-Update habe ich ebenfalls durchgeführt. Soweit keine Probleme. Ich konnte auch im ACP die Downloads konfigurieren.

Wenn ich allerdings eine Datei ( x.pdf ) downloaden möchte wird jedesmal eine Datei namens load.php heruntergeladen. Diese Datei hat allerdings noch nicht einmal einen Inhalt?

Weiß jemand woran das liegen könnte ? Ich weiß an dieser Stelle nicht mehr weiter.


MfG, Martin

Verfasst: 24.01.2006 09:53
von MartinG
Habe hier nocheinmal die load.php beigefügt:
<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/dl_common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//

$id = ( $HTTP_POST_VARS['id'] ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);

$sql = "SELECT * FROM " . DOWNLOADS_TABLE . "
WHERE id = '$id'";
$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result))
{
$sql_cat = "SELECT path FROM " . DL_CAT_TABLE . " WHERE id = ".$row['cat']."";
$result_cat = $db->sql_query($sql_cat);
$data = $db->sql_fetchrow($result_cat);
$cat_id = $row['cat'];
$file_path = $data['path'];
$file_name = $row['file_name'];
$file_size = ($row['extern']==1 ) ? '' : $row['file_size'];
$file_free = $row['free'];
$file_extern = $row['extern'];
$file_clicks = $row['klicks'];
$file_traffic = $row['file_traffic'];
$approve = $row['approve'];
}

$dl_auth = array();
$dl_auth = dl_auth('all_cats', 0);

$index = array();
$index = create_dl_overview_index();

set_auto_traffic();
reset_dl_klicks();

// Auto Overall Traffic START
if ($userdata['user_id'] != ANONYMOUS)
{
$auto_overall_traffic_month = create_date('Ym', $board_config['traffic_retime'], $userdata['user_timezone']);
$current_traffic_month = create_date('Ym', time(), $board_config['board_timezone']);

if ($auto_overall_traffic_month < $current_traffic_month)
{
$board_config['traffic_retime'] = time();

$sql = "UPDATE " . DL_CONFIG_TABLE . "
SET config_value = '0'
WHERE config_name = 'remain_traffic'";
$db->sql_query($sql);

$sql = "UPDATE " . DL_CONFIG_TABLE . "
SET config_value = '" . $board_config['traffic_retime'] . "'
WHERE config_name = 'traffic_retime'";
$db->sql_query($sql);

$board_config['remain_traffic'] = 0;
}
}
// Auto Overall Traffic END

$user_id = $userdata['user_id'];
$user_traffic = $userdata['user_traffic'];

$dl_status = array();
$dl_status = get_dl_status($file_size, $file_extern, $id, $file_name, $file_free, $file_klicks, $file_traffic, $cat_id);

$status = $dl_status['auth_dl'];

if ($approve != TRUE)
{
if ((($dl_auth[$cat_id]['auth_mod'] || $index[$cat_id]['auth_mod']) && $userdata['user_level'] != ADMIN) || $userdata['user_level'] == ADMIN)
{
$status = true;
}
}

if ($status == true)
{
$query_klicks = "UPDATE " . DOWNLOADS_TABLE . " SET klicks = klicks + 1, overall_klicks = overall_klicks + 1, last_time = " . time() . " WHERE id = $id";
$result_klicks = $db->sql_query($query_klicks);

if ($user_id != ANONYMOUS && $file_free == "0" && $file_extern == "0")
{
$query_traffic = "UPDATE " . USERS_TABLE . " SET user_traffic = user_traffic - $file_size WHERE user_id = $user_id";
$result_traffic = $db->sql_query($query_traffic);
}
}

if ($file_extern == "0" && $status == true)
{
$query_overall_traffic = "UPDATE " . DL_CONFIG_TABLE . " SET config_value = config_value + $file_size WHERE config_name = 'remain_traffic'";
$result_overall_traffic = $db->sql_query($query_overall_traffic);
}

if ($file_extern == "1")
{
header("HTTP/1.1 301 Moved Permanently");
Header("Location: $file_name");
}
else if ($status == true)
{

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$file_name\"");
readfile($download_dir . "" . $file_path . "/" . $file_name);
}
else
{
message_die(GENERAL_MESSAGE, $lang['Dl_no_access']);
}

?>

Verfasst: 24.01.2006 22:36
von MartinG
Kann mir denn niemand einen Hinweis geben, woran es liegen könnte, dass ich nur die load.php downloaden kann?