3.2 & 3.3 Extensions Database 3.2 / 3.3Downloadlog

<span class="qte-attr qte_32_33-qte">3.2.x & 3.3.x</span>
User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Downloadlog

Post by dmzx »

uruguayito wrote: 13 Jun 2016, 15:36 apart from Admins who can view the log of downloads and how?
Open ext\dmzx\downloadlog\controller\downloadlog.php
Replace with Replace the preceding lines with the following

Code: Select all

<?php
/**
*
* @package phpBB Extension - Downloadlog
* @copyright (c) 2015 dmzx - https://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace dmzx\downloadlog\controller;

class downloadlog
{
	/** @var \phpbb\template\template */
	protected $template;

	/** @var \phpbb\user */
	protected $user;

	/** @var \phpbb\auth\auth */
	protected $auth;

	/** @var \phpbb\db\driver\driver_interface */
	protected $db;

	/** @var \phpbb\cache\service */
	protected $cache;

	/** @var \phpbb\request\request */
	protected $request;

	/** @var \phpbb\pagination */
	protected $pagination;

	/** @var \phpbb\controller\helper */
	protected $helper;

	/** @var \phpbb\config\config */
	protected $config;

	/**
	* The database tables
	*
	* @var string
	*/
	protected $userdownloadslog_table;

	/**
	* Constructor
	*
	* @param \phpbb\template\template			$template
	* @param \phpbb\user						$user
	* @param \phpbb\auth\auth					$auth
	* @param \phpbb\db\driver\driver_interface	$db
	* @param \phpbb\request\request				$request
	* @param \phpbb\pagination					$pagination
	* @param \phpbb\controller\helper			$helper
	* @param \phpbb\config\config				$config
	* @param 									$userdownloadslog_table
	*
	*/

	public function __construct(\phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\pagination $pagination, \phpbb\controller\helper $helper, \phpbb\config\config $config, $userdownloadslog_table)
	{
		$this->template 				= $template;
		$this->user 					= $user;
		$this->auth 					= $auth;
		$this->db 						= $db;
		$this->request 					= $request;
		$this->pagination 				= $pagination;
		$this->helper 					= $helper;
		$this->config 					= $config;
		$this->userdownloadslog_table 	= $userdownloadslog_table;
	}

	public function handle_downloadlog()
	{
		// Add lang file
		$this->user->add_lang_ext('dmzx/downloadlog', 'common');

		$fileid = $this->request->variable('file', 0);
		$start = $this->request->variable('start', 0);

		// Pagination number from ACP
		$dll = $this->config['downloadlog_value'];

		// Generate pagination
		$sql = 'SELECT COUNT(downloadslog_id) AS total_downloadlogs
			FROM ' . $this->userdownloadslog_table . '
			WHERE user_id = user_id
			AND file_id = ' . $fileid;
		$result = $this->db->sql_query($sql);
		$total_downloadlogs = (int) $this->db->sql_fetchfield('total_downloadlogs');

		$sql = 'SELECT d.user_id, d.down_date, u.user_id, u.username, u.user_colour
			FROM ' . $this->userdownloadslog_table . ' d, ' . USERS_TABLE . ' u
			WHERE u.user_id = d.user_id
			AND file_id = ' . $fileid . '
			ORDER BY d.down_date DESC';
		$top_result = $this->db->sql_query_limit($sql, $dll, $start);

		while($row = $this->db->sql_fetchrow($top_result))
		{
			$this->template->assign_block_vars('downloaders',array(
				'D_USERNAME'			=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
				'D_TIME'				=> $this->user->format_date($row['down_date'])
			));
		}
		
		$pagination_url = $this->helper->route('dmzx_downloadlog_controller', array('file' => $fileid));

		//Start pagination
		$this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $total_downloadlogs, $dll, $start);
		$this->template->assign_vars(array(
			'DOWNLOADERS_USERS'		=> ($total_downloadlogs == 1) ? $this->user->lang['DOWNLOADERS_COUNT'] : sprintf($this->user->lang['DOWNLOADERS_COUNTS'], $total_downloadlogs),
			'DOWNLOADERS_VERSION'	=> $this->config['downloadlog_version'],
		));

		return $this->helper->render('DownloadLog.html', $this->user->lang('DOWNLOADERS_LOG'));
	}
}
Open ext\dmzx\downloadlog\styles\prosilver\template\event\attachment_file_prepend.html
Replace with Replace the preceding lines with the following

Code: Select all

<!-- IF _file.S_IMAGE -->
	<dl class="filedoawnload">
		<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" class="postimage" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>
		<!-- IF _file.COMMENT --><dd><em>{_file.COMMENT}</em></dd><!-- ENDIF -->
		<dd>{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}</dd>
	</dl>
<!-- ENDIF -->
<!-- IF _file.S_FILE -->
	<dl class="filedownload">
		<dt><!-- IF _file.UPLOAD_ICON -->{_file.UPLOAD_ICON} <!-- ENDIF --><a class="postlink" href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a></dt>
		<!-- IF _file.COMMENT --><dd><em>{_file.COMMENT}</em></dd><!-- ENDIF -->
		<dd>({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}</dd>
		<dd><a href="{U_DOWNLOADLOG}?file={_file.U_FILE_ID}" onclick="popup(this.href, 950, 350); return false;"	title="{L_DOWNLOADLOG_VIEW_LOG}" >{L_DOWNLOADLOG_VIEW_LOG}</a></dd>
	</dl>
<!-- ENDIF -->
Clear cache.

User avatar

uruguayito
Donator
Donator
Posts: 120
Joined: 02 Jul 2015, 19:40
    Windows 8.1 Chrome

Re: Downloadlog

Post by uruguayito »

Works perfect :tumbsyes: :tumbsyes: :tumbsyes:
:eusa_dance: :eusa_dance:

thanks dmzx :buigen:
Sorry for my bad English. :oops:
I'm a latin american man.
Spanish is my language.

User avatar

samemmerde
Users
Users
Posts: 34
Joined: 12 Dec 2015, 10:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

Sans titre.png
Hello
I installed the extension, but how did we get to this image instead of the trombone :eyes2:
Thank you

I find it's File Download
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Downloadlog

Post by dmzx »

samemmerde wrote: 19 Jun 2016, 15:48
Sans titre.png
Hello
I installed the extension, but how did we get to this image instead of the trombone :eyes2:
Thank you

I find it's File Download
Check also Link bbCode Extension

User avatar

samemmerde
Users
Users
Posts: 34
Joined: 12 Dec 2015, 10:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

Thank you :eusa_dance:

User avatar

samemmerde
Users
Users
Posts: 34
Joined: 12 Dec 2015, 10:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

It does not work
I have that I do not understand?
Can you help me ?
1.png
2.png
Thanks
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Downloadlog

Post by dmzx »

This topic is for Downloadlog.

You have a other extension installed post it in correct topic.

User avatar

samemmerde
Users
Users
Posts: 34
Joined: 12 Dec 2015, 10:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

Sorry :whistl:

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: Downloadlog

Post by dmzx »

First post updated

User avatar

martin
Admin
Admin
Posts: 5105
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: Downloadlog

Post by martin »

Here's both exts download logs and filedownload both into one ext.
dmzx_downloadlog_1_0_2.zip
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Image

User avatar

Solidjeuh
Donator
Donator
Posts: 348
Joined: 13 Dec 2014, 02:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: 05 Feb 2018, 19:00 Here's both exts download logs and filedownload both into one ext.
dmzx_downloadlog_1_0_2.zip
Can you please take a look at this? It breaks the footer in phpBB 3.3

Image
Forum voor NL Extensie vertalingen ---> https://www.supportforum.be
----------------------------------------------------------------------------

User avatar

martin
Admin
Admin
Posts: 5105
Joined: 06 Apr 2014, 16:12
    Linux Chrome

Re: Downloadlog

Post by martin »

Hmm strange it dont here or on my site have you any thing else installed.

User avatar

Solidjeuh
Donator
Donator
Posts: 348
Joined: 13 Dec 2014, 02:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: 08 Jan 2020, 01:48 Hmm strange it dont here or on my site have you any thing else installed.
Disabled: Header banner, steam status, modxcommands, posting buttons, Footer chat, smiley scroll box..
Don't think anything elsa can break it?
Same problem on standard prosilver
Image

User avatar

Solidjeuh
Donator
Donator
Posts: 348
Joined: 13 Dec 2014, 02:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: 08 Jan 2020, 01:48 Hmm strange it dont here or on my site have you any thing else installed.
I disabled all extensions, still the same problem.

Image

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: Downloadlog

Post by dmzx »

First post updated.

This version has the css in for the download box.

Post Reply Previous topicNext topic