Кто скачал (модальное окно)
Достоинства:
* Нет запросов к БД.
* Подсветка ников.
* Загружается информация с помощю AJAX и jQuery UI Dialog.
* Все файлы в одной папке.
* Красивый эффект открытия(bounce) и закрытия(explode).
Совместимость с DataLife Engine 9.x
Установка:
1.Для начала скопируйте все файлы из папки upload в данном архиве на ваш сервер.
2.Откройте файл /engine/download.php
Найти:
if (! $row)
die ( "Access denied" );
die ( "Access denied" );
Ниже добавить:
@include ENGINE_DIR . '/modules/WhoDownloadThisFile/add.php';
3.Откройте файл /engine/modules/functions.php.php
Найти:
if ( ! $user_group[$member_id['user_group']]['allow_files'] ) {
$replace_1[] = "<span class="attachment">{$lang['att_denied']}</span>";
$replace_2[] = "<span class="attachment">{$lang['att_denied']}</span>";
} elseif( $config['files_count'] == 'yes' ) {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>";
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>";
} else {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}]</span>";
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}]</span>";
}
}
$db->free();
$story = str_replace ( $find_1, $replace_1, $story );
$story = preg_replace( $find_2, $replace_2, $story );
return $story;
$replace_1[] = "<span class="attachment">{$lang['att_denied']}</span>";
$replace_2[] = "<span class="attachment">{$lang['att_denied']}</span>";
} elseif( $config['files_count'] == 'yes' ) {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>";
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>";
} else {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}]</span>";
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}]</span>";
}
}
$db->free();
$story = str_replace ( $find_1, $replace_1, $story );
$story = preg_replace( $find_2, $replace_2, $story );
return $story;
Заменить на:
$WhoDownloadThisFile_button = '<br /> - <a href="#" onclick="WhoDownloadThisFile('.$row['id'].'); return false;"><i>Кто скачал этот файл?</i></a> © <a href="http://weboss.net/" target="_blank" style="text-decoration: none; font-size: 9px;">WEBoss.Net</a>';
if ( ! $user_group[$member_id['user_group']]['allow_files'] ) {
$replace_1[] = "<span class="attachment">{$lang['att_denied']}</span>";
$replace_2[] = "<span class="attachment">{$lang['att_denied']}</span>";
} elseif( $config['files_count'] == 'yes' ) {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>".$WhoDownloadThisFile_button;
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>".$WhoDownloadThisFile_button;
} else {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}]</span>".$WhoDownloadThisFile_button;
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}]</span>".$WhoDownloadThisFile_button;
}
}
$db->free();
$story = str_replace ( $find_1, $replace_1, $story );
$story = preg_replace( $find_2, $replace_2, $story );
return '<script type="text/javascript" src="/engine/modules/WhoDownloadThisFile/show.js"></script>'.$story;
if ( ! $user_group[$member_id['user_group']]['allow_files'] ) {
$replace_1[] = "<span class="attachment">{$lang['att_denied']}</span>";
$replace_2[] = "<span class="attachment">{$lang['att_denied']}</span>";
} elseif( $config['files_count'] == 'yes' ) {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>".$WhoDownloadThisFile_button;
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}] ({$lang['att_dcount']} {$row['dcount']})</span>".$WhoDownloadThisFile_button;
} else {
$replace_1[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >{$row['name']}</a> [{$size}]</span>".$WhoDownloadThisFile_button;
$replace_2[] = "<span class="attachment"><a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >1</a> [{$size}]</span>".$WhoDownloadThisFile_button;
}
}
$db->free();
$story = str_replace ( $find_1, $replace_1, $story );
$story = preg_replace( $find_2, $replace_2, $story );
return '<script type="text/javascript" src="/engine/modules/WhoDownloadThisFile/show.js"></script>'.$story;