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>
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Firefox

Re: Downloadlog

Post by dmzx »

uruguayito wrote: Jun 13th, '16, 13: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.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

uruguayito
Donator
Donator
Status: Offline
User theme: Dark
Posts: 120
Joined: Jul 2nd, '15, 17: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.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

samemmerde
Users
Users
Status: Offline
User theme: Dark
Posts: 34
Joined: Dec 12th, '15, 09: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.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Firefox

Re: Downloadlog

Post by dmzx »

samemmerde wrote: Jun 19th, '16, 13: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

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

samemmerde
Users
Users
Status: Offline
User theme: Dark
Posts: 34
Joined: Dec 12th, '15, 09:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

Thank you :eusa_dance:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

samemmerde
Users
Users
Status: Offline
User theme: Dark
Posts: 34
Joined: Dec 12th, '15, 09: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.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20: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.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

samemmerde
Users
Users
Status: Offline
User theme: Dark
Posts: 34
Joined: Dec 12th, '15, 09:52
    Windows 10 Firefox

Re: Downloadlog

Post by samemmerde »

Sorry :whistl:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: Downloadlog

Post by dmzx »

First post updated

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14: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

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Solidjeuh
Users
Users
Status: Offline
User theme: Dark
Posts: 348
Joined: Dec 13th, '14, 01:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: Feb 5th, '18, 18: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
----------------------------------------------------------------------------

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Downloadlog

Post by martin »

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

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Solidjeuh
Users
Users
Status: Offline
User theme: Dark
Posts: 348
Joined: Dec 13th, '14, 01:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: Jan 8th, '20, 00: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

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Solidjeuh
Users
Users
Status: Offline
User theme: Dark
Posts: 348
Joined: Dec 13th, '14, 01:40
    Windows 10 Firefox

Re: Downloadlog

Post by Solidjeuh »

martin wrote: Jan 8th, '20, 00: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

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: Downloadlog

Post by dmzx »

First post updated.

This version has the css in for the download box.