schade das dieser Mod die Ultimate Points nicht unterstützt. Der Mod ist so genial, da ist es schade das der das nicht unterstützt.
Desswegen habe ich mich mal hingesetzt und geschaut wie das alles so geht.
Hier mal meine veränderungen.
Ich hoffe das ist erwünscht!!
Funktioniert Tadellos:
====================================================================
dll_mod\includes\dl_upload.php
Finde:
Code: Alles auswählen
'direction' => 1,
'user_ip' => $user->data['session_ip'],
'browser' => $browser,
'time_stamp' => time()));
$db->sql_query($sql);
Code: Alles auswählen
//----- Ultimate Points für upload eintragen --------
//Ultimate Points MOD installed and enabled?
if(isset($config['points_enable']) and $config['points_enable'] == true)
{
$sql = 'SELECT user_points FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_points = ' . ($row['user_points'] + $points_values['dll_mod_upload']) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
//---------------------------------------
language/de/mod/info_apc_points.php
finde:
Code: Alles auswählen
'POINTS_GALLERY_VIEW' => 'Bilder ansehen',
'POINTS_GALLERY_VIEW_EXPLAIN' => 'Gib hier den Wert ein, den Benutzer abgezogen bekommen, wenn sie ein Bild ansehen. Gib 0 ein, wenn nichts abgezogen werden soll.',
Code: Alles auswählen
'POINTS_DLL_MOD' => 'phpBB Download MOD Integration',
'POINTS_DLL_MOD_EXPLAIN' => 'Wie es aussieht, hast du den phpBB Download MOD 6.4.5 - 2010 by Hotschi installiert. Hier kannst du ein paar Grundwerte eintragen. <br /><strong>Bitte beachte die wichtigen Hinweise in der Benutzerhilfe!</strong>',
'POINTS_DLL_MOD_DOWNLOAD' => 'Files Downloaden',
'POINTS_DLL_MOD_DOWNLOAD_EXPLAIN' => 'Gib hier den Wert ein, den Benutzer für das Downloaden eines Files von ihrem Konto abgezogen bekommen. Gib 0 ein, wenn nichts abgezogen werden soll',
'POINTS_DLL_MOD_UPLOAD' => 'Files Uploaden',
'POINTS_DLL_MOD_UPLOAD_EXPLAIN' => 'Gib hier den Wert ein, den Benutzer für das uploaden von Files erhalten. Gib 0 ein, wenn sie nichts erhalten sollen',
SQL in phpMyAdmin ausführen
Code: Alles auswählen
ALTER TABLE `phpbb_points_values` ADD `dll_mod_upload` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0.00',
ADD `dll_mod_download` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0.00';
include/acp/acp_points.php
finde:
Code: Alles auswählen
'gallery_remove' => round(request_var('gallery_remove', 0.00),2),
'gallery_view' => round(request_var('gallery_view', 0.00),2),
Code: Alles auswählen
'dll_mod_upload' => round(request_var('dll_mod_upload', 0.00),2),
'dll_mod_download' => round(request_var('dll_mod_download', 0.00),2),
adm/style/acp_points_main.html
finde:
Code: Alles auswählen
<dt><label for="gallery_view">{L_POINTS_GALLERY_VIEW}:</label><br /><span>{L_POINTS_GALLERY_VIEW_EXPLAIN}</span></dt>
<dd><input class="post" type="text" maxlength="8" size="10" name="gallery_view" value="{GALLERY_VIEW}" /> {POINTS_NAME}</dd>
</dl>
</fieldset>
<!-- ENDIF -->
Code: Alles auswählen
<fieldset>
<legend>{L_POINTS_DLL_MOD}</legend>
<p>{L_POINTS_DLL_MOD_EXPLAIN}</p>
<dl>
<dt><label for="dll_mod_upload">{L_POINTS_DLL_MOD_UPLOAD}:</label><br /><span>{L_POINTS_DLL_MOD_UPLOAD_EXPLAIN}</span></dt>
<dd><input class="post" type="text" maxlength="8" size="10" name="dll_mod_upload" value="{DLL_MOD_UPLOAD}" /> {POINTS_NAME}</dd>
</dl>
<dl>
<dt><label for="dll_mod_remove">{L_POINTS_DLL_MOD_DOWNLOAD}:</label><br /><span>{L_POINTS_DLL_MOD_DOWNLOAD_EXPLAIN}</span></dt>
<dd><input class="post" type="text" maxlength="8" size="10" name="dll_mod_download" value="{DLL_MOD_DOWNLOAD}" /> {POINTS_NAME}</dd>
</dl>
</fieldset>
downloads.php
finde:
Code: Alles auswählen
if ($count_user_traffic)
{
$user->data['user_traffic'] -= $dl_file['file_size'];
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'user_traffic' => $user->data['user_traffic'])) . ' WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
if ($config['dl_user_traffic_once'])
{
$sql = 'INSERT INTO ' . DL_NOTRAF_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => $user->data['user_id'],
'dl_id' => $dl_file['id']));
$db->sql_query($sql);
}
Code: Alles auswählen
//----- Ultimate Points für upload eintragen --------
//Ultimate Points MOD installed and enabled?
if(isset($config['points_enable']) and $config['points_enable'] == true)
{
$sql = 'SELECT user_points FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_points = ' . ($row['user_points'] - $points_values['dll_mod_download']) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
//---------------------------------------
includes/functions.php
finde:
Code: Alles auswählen
global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
global $arcade;
if (defined('HEADER_INC'))
{
return;
}
define('HEADER_INC', true);
Code: Alles auswählen
/*--- DL Mod ---*/
if (defined('DL_INSTALLED'))
{
$template->assign_var('S_DL_MOD_INSTALLED', true);
}
/*-------------*/
folgendes ist schon umgesetzt im Code oben am 29.01.2011
So nun noch zwei Fragen.
Ich möchte noch eine Abfrage machen ob der Mod auch installiert ist.
<!-- IF S_DL_MOD_Install -->
Das weiß ich leider nicht wie das geht.
Das zweite wäre:
Ich habe das programmiert:
Code: Alles auswählen
//----- Ultimate Points für upload eintragen --------
$user_id = $user->data['user_id'];