KAT_Ayanami hat geschrieben:By the way FABI, in what is your ZIP file different from ltiefland???
It weighs different and has some different files.... ¬¬ ?
Kat
I don't know, I've uploaded it, as he has sent it to me!
What do you think is better to take as a basic to work on, the mod by hotschi, or the one by ltiefland?
I also want to change that the recently added downloads are not at the bottom, but at the top, do you know if this is possible (of course it is :mrgreen: ) and how I could manage it?
I think best would be, that you can choose if the files are sorted by date (added), name, size, outside / not outside, free / not free and if they are ascending or descendig (a bit like the memberlist).
But that goes far beyond my horizon of php^^ so if you could help me, that would be really great.
I've also found the following fixes (if so. has more, send them) :
Code: Alles auswählen
##############################################################
## MOD Title: Fix Download Mod for phpBB 2.0.9 and newer
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description: This Mod makes the Download Mod compatible for phpBB 2.0.9 and newer
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 2-5 Minutes
## Files To Edit: 5
## downloads.php
## load.php
## admin/admin_dl_cat.php
## admin/admin_dl_traffic_all_users.php
## admin/admin_dl_traffic_single_user.php
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2005-04-09 - Version 1.0.1
## - Fix several security leaks
##
## 2004-04-26 - Version 1.0.0
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
downloads.php
#
#-----[ FIND ]------------------------------------------
#
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
$cat = ( $HTTP_POST_VARS['cat'] ) ? intval($HTTP_POST_VARS['cat']) : intval($HTTP_GET_VARS['cat']);
$view = ( $HTTP_POST_VARS['view'] ) ? $HTTP_POST_VARS['view'] : $HTTP_GET_VARS['view'];
$id = ( $HTTP_POST_VARS['id'] ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);
#
#-----[ OPEN ]------------------------------------------
#
load.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
$id = ( $HTTP_POST_VARS['id'] ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_cat.php
#
#-----[ FIND ]------------------------------------------
#
$cat_name = ( isset($HTTP_POST_VARS['cat_name']) ) ? trim($HTTP_POST_VARS['cat_name']) : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$path = ( isset($HTTP_POST_VARS['path']) ) ? trim($HTTP_POST_VARS['path']) : "";
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_traffic_all_users.php
#
#-----[ FIND ]------------------------------------------
#
if ($x == "bytes") $traffic_bytes = $traffic;
if ($x == "kb") $traffic_bytes = bcmul($traffic,1024);
if ($x == "mb") $traffic_bytes = bcmul($traffic,1048576);
//
// Ok, the traffic has been modified and submitted, let's update
//
if( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) )
{
$traffic = ( !empty($HTTP_POST_VARS['traffic']) ) ? trim(strip_tags( $HTTP_POST_VARS['traffic'] ) ) : '';
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
$traffic = ( !empty($HTTP_POST_VARS['traffic']) ) ? trim(strip_tags( $HTTP_POST_VARS['traffic'] ) ) : '';
$x = ( !empty($HTTP_POST_VARS['x']) ) ? trim(strip_tags( $HTTP_POST_VARS['x'] ) ) : '';
$function = ( !empty($HTTP_POST_VARS['function']) ) ? trim(strip_tags( $HTTP_POST_VARS['function'] ) ) : '';
if ($x == "bytes") $traffic_bytes = $traffic;
if ($x == "kb") $traffic_bytes = bcmul($traffic,1024);
if ($x == "mb") $traffic_bytes = bcmul($traffic,1048576);
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_traffic_single_user.php
#
#-----[ FIND ]------------------------------------------
#
if ($x == "bytes") $traffic_bytes = $user_traffic;
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$x = ( !empty($HTTP_POST_VARS['x']) ) ? trim(strip_tags( $HTTP_POST_VARS['x'] ) ) : '';
$function = ( !empty($HTTP_POST_VARS['function']) ) ? trim(strip_tags( $HTTP_POST_VARS['function'] ) ) : '';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Alles auswählen
##############################################################
## MOD Title: DlModTrafficLimitAddon
## MOD Author: netzmeister < netzmeister@source-code.de > www.source-code.de
## MOD Description: Erlaubt ein Traffic Limit pro Datei anzugeben.
## Das Limit wird in Bytes angegeben.
## MOD Version: 1.0.0
##
## Installation Level: (Intermediate)
## Installation Time: 10-20 Minuten
## Files To Edit:
## - templates/subSilver/admin/dl_files_body.tpl
## - templates/subSilver/admin/dl_files_edit_body.tpl
## - admin/admin_dl_files.php
## - downloads.php
## - language/lang_german/lang_admin.php
##
##
## Included Files: n/a
##############################################################
## Author Notes:
##
## Mod funktioniert nur mit eingebautem Download-Mod von
## Hotschi. ( http://phpbb.hotschi.de )
## Mod befindet sich noch in der Testphase. ;-)
##
##############################################################
## MOD History:
##
## 2004-03-09 - Version 1.0.0
## - Erste Version des Mods.
##
##############################################################
## Bitte alle Dateien sichern befor Du diesen Mod einbaust.
##
## Auch ein Dump der zu verändernden Tabellen machen. ;-)
##############################################################
#
#-----[ SQL ]------------------------------------------
# // Bitte Tabellen Prefix anpassen
ALTER TABLE phpbb2_downloads ADD traffic INT(255) DEFAULT 0
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/dl_files_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_DL_FILE_KLICKS}</th>
#
#-----[ AFTER ADD ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_DL_FILE_TRAFFIC}</th>
#
#-----[ FIND ]------------------------------------------
#
<td class="{downloads.ROW_CLASS}" align="center"><span class="gen">{downloads.FILE_KLICKS}</span></td>
#
#-----[ AFTER ADD ]------------------------------------------
#
<td class="{downloads.ROW_CLASS}" align="center"><span class="gen">{downloads.FILE_TRAFFIC}</span></td>
#
#-----[ FIND ]------------------------------------------
#
<td class="catBottom" align="center" colspan="9"><input type="submit" class="mainoption" name="add" value="{L_ADD_DOWNLOAD}" /></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<td class="catBottom" align="center" colspan="10"><input type="submit" class="mainoption" name="add" value="{L_ADD_DOWNLOAD}" /></td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/dl_files_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_DL_IS_FREE}:</span><br />
<span class="gensmall">{L_FREE_EXPLAIN}</span></td>
<td class="row2"><input type=checkbox name="file_free" {CHECKFREE} value="true"></td>
</tr>
#
#-----[ AFTER ADD ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_DL_TRAFFIC}:</span><br />
<span class="gensmall">{L_DL_TRAFFIC_EXPLAIN}</span></td>
<td class="row2"><input type="text" name="traffic" size="40" maxlength="255" value="{TRAFFIC}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_files.php
#
#-----[ FIND ]------------------------------------------
#
$description = $row['description'];
#
#-----[ AFTER ADD ]------------------------------------------
#
$file_traffic = $row['traffic'];
#
#-----[ FIND ]------------------------------------------
#
"L_DL_DESCRIPTION" => $lang['Dl_file_description'],
#
#-----[ AFTER ADD ]------------------------------------------
#
"L_DL_TRAFFIC" => $lang['Dl_traffic'],
"L_DL_TRAFFIC_EXPLAIN" => $lang['Dl_traffic_explain'],
#
#-----[ FIND ]------------------------------------------
#
"DESCRIPTION" => $description,
#
#-----[ AFTER ADD ]------------------------------------------
#
"TRAFFIC" => $file_traffic,
#
#-----[ FIND ]------------------------------------------
#
$cat_id = ( isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;
#
#-----[ AFTER ADD ]------------------------------------------
#
$file_traffic = ( isset($HTTP_POST_VARS['traffic']) ) ? intval($HTTP_POST_VARS['traffic']) : 0;
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . DOWNLOADS_TABLE . "
SET description = '" . str_replace("\'", "''", $description) . "', long_desc = '" . str_replace("\'", "''", $long_desc) . "', file_name = '" . str_replace("\'", "''", $file_name) . "', free = '" . str_replace("\'", "''", $file_free) . "', extern = '" . str_replace("\'", "''", $file_extern) . "', cat = '" . str_replace("\'", "''", $cat_id) . "'
WHERE id = $download_id";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "UPDATE " . DOWNLOADS_TABLE . "
SET traffic = '" . str_replace("\'", "''", $file_traffic) . "', description = '" . str_replace("\'", "''", $description) . "', long_desc = '" . str_replace("\'", "''", $long_desc) . "', file_name = '" . str_replace("\'", "''", $file_name) . "', free = '" . str_replace("\'", "''", $file_free) . "', extern = '" . str_replace("\'", "''", $file_extern) . "', cat = '" . str_replace("\'", "''", $cat_id) . "'
WHERE id = $download_id";
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . DOWNLOADS_TABLE . " (file_name, cat, description, long_desc, free, extern)
VALUES ('" . str_replace("\'", "''", $file_name) . "', '" . str_replace("\'", "''", $cat_id) . "', '" . str_replace("\'", "''", $description) . "', '" . str_replace("\'", "''", $long_desc) . "', '" . str_replace("\'", "''", $file_free) . "', '" . str_replace("\'", "''", $file_extern) . "')";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "INSERT INTO " . DOWNLOADS_TABLE . " (file_name, cat, description, long_desc, free, extern, traffic)
VALUES ('" . str_replace("\'", "''", $file_name) . "', '" . str_replace("\'", "''", $cat_id) . "', '" . str_replace("\'", "''", $description) . "', '" . str_replace("\'", "''", $long_desc) . "', '" . str_replace("\'", "''", $file_free) . "', '" . str_replace("\'", "''", $file_extern) . "', '" . str_replace("\'", "''", $file_traffic) . "')";
#
#-----[ FIND ]------------------------------------------
#
$file_klicks = $row['klicks'];
#
#-----[ AFTER ADD ]------------------------------------------
#
$file_traffic = $row['traffic'];
#
#-----[ FIND ]------------------------------------------
#
'FILE_KLICKS' => $file_klicks,
#
#-----[ AFTER ADD ]------------------------------------------
#
'FILE_TRAFFIC' => $file_traffic,
#
#-----[ FIND ]------------------------------------------
#
"L_DL_FILE_KLICKS" => $lang['Dl_klicks'],
#
#-----[ OPEN ]------------------------------------------
#
downloads.php
#
#-----[ FIND ]------------------------------------------
#
$cat_desc = $row['description'];
#
#-----[ AFTER ADD ]------------------------------------------
#
$file_traffic = $row['traffic'];
#
#-----[ FIND ]------------------------------------------
#
if ($file_extern == "1") $file_size_out = $lang['Dl_not_availible'];
#
#-----[ BEFORE ADD ]------------------------------------------
#
if ((($file_klicks * $file_size) >= $file_traffic) AND ($file_traffic > 0))
{
$file_free = "0";
$user_traffic = 0;
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_admin.php
d
#
#-----[ FIND ]------------------------------------------
#
// That's all Folks!
#
#-----[ BEFORE ADD ]------------------------------------------
#
$lang['Dl_traffic'] = "Max. Traffic";
$lang['Dl_traffic_explain'] = "Maximaler Traffic in Byte, welcher durch die Datei erzeugt werden darf.<br>Der Wert 0 deaktiviert die Traffickontrolle";
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Alles auswählen
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT id, cat_name FROM " . DL_CAT_TABLE;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT * FROM " . DL_CAT_TABLE . " ORDER by sort";
Code: Alles auswählen
################################################################################
##
## Mod Title: Dl Mod (Hotschi) Addon - Category Pagination
## Mod Author: AmigaLink < webmaster@amigalink.de > (Markus Schmidt) http://www.EssenMitFreude.info
## Mod Description: Causes paginations to the categories of the Dl Mod from Hotschi.
##
## Mod Version: 1.0.0
##
##
## Compatibility: 2.0.x
## Installation Level: Easy
## Installation Time: 5- 10 Minutes
##
## Files To Edit: <5>
## admin/admin_board.php
##
## downloads.php
##
## language/lang_english/lang_admin.php
## language/lang_german/lang_admin.php
##
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: <1>
##
## templates/subSilver/downloads_body.tpl
##
## Author Notes:
## This Addon is for the Download Mod 2.1.2 from Hotschi.
## The included download_body.tpl is optional! Only use it when you doesn't like the Original!
##
################################################################################
##
## The following sites also contain the latest version of this MOD:
##
## http://www.AmigaLink.de
## http://www.phpBBhacks.com
## http://www.phpBB.de
##
## Full support for this MOD can be obtained at:
##
## http://www.AmigaLink.de
##
################################################################################
##
## 2005-01-10 - Version 1.0.0
## - Release
##
################################################################################
##
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property Rights are retained by the hack author(s)
## listed above.
##
################################################################################
##
## BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL
## affected files.
##
################################################################################
#
#----------[ RUN SQL ]----------------------------------
#
# Run the following SQL statement to update your phpBB database.
# You can use phpMyAdmin or a similar tool to run this update.
#
# IMPORTANT: If you have changed the table prefix from the default of phpBB,
# please be sure to replace phpBB with your prefix BEFORE running this update.
#
INSERT INTO `phpbb_config` VALUES ('dl_links_per_page', '10');
#
#----------[ COPY FILES ]-------------------------------
#
# Copy / upload the following file only if you doesn't like the Original!
#
downloads_body.tpl to templates/subSilver/downloads_body.tpl
#
#----------[ OPEN ]-------------------------------------
#
admin/admin_board.php
#
#----------[ FIND ]-------------------------------------
#
"L_HOT_THRESHOLD" => $lang['Hot_threshold'],
#
#----------[ AFTER, ADD ]-------------------------------
#
"L_DL_LINKS_PER_PAGE" => $lang['Dl_Links_per_page'],
#
#----------[ FIND ]-------------------------------------
#
"HOT_TOPIC" => $new['hot_threshold'],
#
#----------[ AFTER, ADD ]-------------------------------
#
"DL_LINKS_PER_PAGE" => $new['dl_links_per_page'],
#
#----------[ OPEN ]-------------------------------------
#
downloads.php
#
#----------[ FIND ]-------------------------------------
#
//
// End session management
//
#
#----------[ AFTER, ADD ]-------------------------------
#
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
#
#----------[ FIND ]-------------------------------------
#
$sql = "SELECT * FROM " . DOWNLOADS_TABLE . " where cat=".$cat." ORDER by sort";
#
#----------[ REPLACE WITH ]-----------------------------
#
// <!-- Pagination Addon -->
$sql = 'SELECT count(*) AS seite FROM ' . DOWNLOADS_TABLE . ' where cat=' . $cat . '';
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error getting total downloads', '', __LINE__, __FILE__, $sql);
}
if( $total = $db->sql_fetchrow($result) )
{
$total_downloads = $total['seite'];
$pagination = generate_pagination("downloads.$phpEx?cat=$cat", $total_downloads, $board_config['dl_links_per_page'], $start). ' ';
}
$template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval($board_config['dl_links_per_page']) ) + 1 ), ceil( $total_downloads / intval($board_config['dl_links_per_page']) )),
'L_GOTO_PAGE' => $lang['Goto_page'])
);
$sql = "SELECT * FROM " . DOWNLOADS_TABLE . " where cat=".$cat." ORDER by sort LIMIT $start, ". $board_config['dl_links_per_page'];
// <!-- Pagination Addon -->
#
#----------[ OPEN ]-------------------------------------
#
language/lang_english/lang_admin.php
#
#----------[ FIND ]-------------------------------------
#
$lang['Hot_threshold'] = 'Posts for Popular Threshold';
#
#----------[ AFTER, ADD ]-------------------------------
#
$lang['Dl_Links_per_page'] = 'Downlods Per Page';
#
#----------[ OPEN ]-------------------------------------
#
language/lang_german/lang_admin.php
#
#----------[ FIND ]-------------------------------------
#
$lang['Hot_threshold'] = 'Beiträge, die ein Thema braucht, um ein \'Hot Topic\' zu werden';
#
#----------[ AFTER, ADD ]-------------------------------
#
$lang['Dl_Links_per_page'] = 'Downlods pro Seite';
#
#----------[ OPEN ]-------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#----------[ FIND ]-------------------------------------
#
<tr>
<td class="row1">{L_HOT_THRESHOLD}</td>
<td class="row2"><input class="post" type="text" name="hot_threshold" size="3" maxlength="4" value="{HOT_TOPIC}" /></td>
</tr>
#
#----------[ AFTER, ADD ]-------------------------------
#
<tr>
<td class="row1">{L_DL_LINKS_PER_PAGE}</td>
<td class="row2"><input class="post" type="text" name="dl_links_per_page" size="3" maxlength="4" value="{DL_LINKS_PER_PAGE}" /></td>
</tr>
#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM