[DEV] pafileDB MX Addon (Download Manager)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

[DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Tue Jul 17, 2007 5:04 pm

MOD Title: pafileDB MX Addon
MOD Description: Integration of pafiledb (Database files manager) with phpbb.
MOD Version: 0.9.0
phpBB Version: 2.0.22

MOD Download: http://www.phpbb.ro/dload.php?action=file&file_id=349
Last Stable version: (0.0.9d)

Demo Board: http://activ.caleacrestina.com/forum/
Demo Username: Registred
Demo Password: testpass

Version Notes:
The mod is an mxBB Addon for phpBB and extended version based on work from squall, MJ and now is maintained, as module, by The mxBB Development Team in wich I'm member.

This mod and the comming mxBB Addons writen for phpBB2 require that the "mx_mod" folder/mod to be uploaded to the phpbb_root, and it's recomanded to run it's included installer (mx_mod_install.php).

Mx Mod adds to phpBB the posibility to install special mx-addons that have files with some code as mx-modules, in phpBB with no CMS installed. This is hanly if you need to add CMS features to phpBB and you don't whan't keep the forum at the root of your domain.

Mx Mod for developers it's a custom version that have only the required files and can be installed very quick with any backend: link.
mxBB CMS is a fully modular portal & CMS writen for phpBB, that do not tuch/do not modify phpBB in any way but usualy is installed at root of the donain and the 2.8.x version require a phpBB installation in a subfolder.
Last edited by orynider on Tue Jul 15, 2008 1:21 pm, edited 5 times in total.

Caiorr
Registered User
Posts: 3
Joined: Tue Aug 14, 2007 5:05 pm

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by Caiorr » Tue Aug 14, 2007 5:16 pm

Why do pafiledb always change the standart user template to standart forum template ?

Example: In user config, he choosed subsilver template and the forum is configured as standart Vistalite template and is disabled the configuration to force the stardart forum template. Everithing its ok, but when he access the download page, the template change to VistaLite.

How can i change it?

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Tue Aug 14, 2007 8:59 pm

I think it's a mx_mod bug, not sure yet. mx_mod should have a admin configuration option, but this can be fixed more simple from the mod_common file I think. Let me install on the test site more templates and I wil give you a solution or I will upgrade the file in the zip if this can be fixed only by a variable, not sure. But, if is a pafileDB module not phpBB mod reated specific problem, and I don't think that is the case, will be solved only on next release.

Caiorr
Registered User
Posts: 3
Joined: Tue Aug 14, 2007 5:05 pm

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by Caiorr » Tue Aug 14, 2007 9:58 pm

Thanks
I will check too.. Im new in phpbb but will try.

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Tue Aug 14, 2007 10:21 pm

Open: pafiledb_common.php

Find:

Code: Select all

	$sql = 'SELECT *
		FROM ' . THEMES_TABLE . '
		WHERE themes_id = ' . (int) $style;
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not query database for theme info');
	}

	if !( $row = $db->sql_fetchrow($result) )
	{
		// We are trying to setup a style which does not exist in the database
		// Try to fallback to the board default (if the user had a custom style)
		// and then any users using this style to the default if it succeeds
		if ( $style != $board_config['default_style'])
		{
Replace with:

Code: Select all

	$sql = 'SELECT *
		FROM ' . THEMES_TABLE . '
		WHERE themes_id = ' . (int) $userdata['user_style'];
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not query database for theme info');
	}

	if ( $row = $db->sql_fetchrow($result) )
	{
		$db->sql_freeresult($result);
		$template_name = $row['template_name'] ;
	}
	else
	{
		// We are trying to setup a style which does not exist in the database
		// Try to fallback to the board default (if the user had a custom style)
		// and then any users using this style to the default if it succeeds
		if ( $userdata['user_style'] != $board_config['default_style'])
		{
The files are allso upgraded in Download Manager.

edit: Download link upgraded. :)

Caiorr
Registered User
Posts: 3
Joined: Tue Aug 14, 2007 5:05 pm

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by Caiorr » Wed Aug 15, 2007 12:31 pm

Hi Orynider

It worked, but i receive this error when i use VistaLite Template. In Subsilver looks good.

Warning: mkdir() [function.mkdir]: Permission denied in /home/manualdomaverick/www/forum/pafiledb/includes/template.php on line 84

Warning: Cannot modify header information - headers already sent by (output started at /home/manualdomaverick/www/forum/pafiledb/includes/template.php:84) in /home/manualdomaverick/www/forum/includes/page_header.php on line 520

Warning: Cannot modify header information - headers already sent by (output started at /home/manualdomaverick/www/forum/pafiledb/includes/template.php:84) in /home/manualdomaverick/www/forum/includes/page_header.php on line 522

Warning: Cannot modify header information - headers already sent by (output started at /home/manualdomaverick/www/forum/pafiledb/includes/template.php:84) in /home/manualdomaverick/www/forum/includes/page_header.php on line 523


In admin panel using VistaLite template i receive this error

Warning: mkdir() [function.mkdir]: Permission denied in /home/manualdomaverick/www/forum/pafiledb/includes/template.php on line 84

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Wed Aug 15, 2007 4:06 pm

Hi,

Looks like your hosting is running php in save mode or the fuction mkdir() is disabled in your php.ini file.

Please create manualy and chmod 777 the folders:

forum/pafiledb/cache/templates/VistaLite/
forum/pafiledb/cache/templates/VistaLite/admin/

Do the same for every template you have installed, or enable mkdir() in your php.ini file.

Gosudar
Registered User
Posts: 3
Joined: Sat Nov 04, 2006 10:44 am
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by Gosudar » Fri Sep 21, 2007 7:11 am

functions_pafiledb.php

Find:

Code: Select all

		$file_extension = $pafiledb_functions->get_extension($file_realname);
			
		if(in_array($file_extension, $forbidden_extensions))
		{
			$this->error[] = 'You are not allowed to upload this type of files';
		}
After, add:

Code: Select all

		$file_extension = $pafiledb_functions->get_extension($ss_name);
			
		if(in_array($file_extension, $forbidden_extensions))
		{
		message_die(GENERAL_ERROR, 'Hacking attempt? You are not allowed to upload this type of files');
		}

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Fri Sep 21, 2007 1:30 pm

Oky, we will fix this is next release. BTW, a phpbbplus admin allready sended mail about this but he proposed a to messy fix :D This fix looks better.

Gosudar
Registered User
Posts: 3
Joined: Sat Nov 04, 2006 10:44 am
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by Gosudar » Sat Sep 22, 2007 8:49 am

we will fix this is next release
Critical Vulnerabilities.
extension the screenshots not filtered.

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Thu Sep 27, 2007 10:29 pm

Gosudar wrote:
we will fix this is next release
Critical Vulnerabilities.
extension the screenshots not filtered.
Anone is free to use your fix to filter the extension with this public version. Our code is much upgraded allready and we may filter the file content and not the extension.

divinemanwah
Registered User
Posts: 34
Joined: Sat Sep 08, 2007 11:48 am

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by divinemanwah » Fri Sep 28, 2007 11:51 am

Hello, I ma currently experiencing a major problem regarding oyur mod...

I get this
Pafiledb Template->loadfile(): No file specified for handle body
Please help ASAP!!!!

Thanks in advance!!!!

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Fri Sep 28, 2007 2:02 pm

divinemanwah: You most provide more details about were you get that error (on wich pafileDB module), what phpBB2 version are you using, what php and SQL versions and modules (apache, IIS with easyphp, server cache, ...) are on your server, etc.

Gosudar: I'm just a member of our development team. So, I provided to the team some examples how to filter the ss extension, for example one of them was using GD to rezise the screenshot. But for now we will use just a simple fix. I'll post later this fix here, couse I can't release yet a new version only when we will have a mx_mod 100% compatible with last changes. We are very busy with the development line for mxBB3 wich have more backends, one for Olympus. :ugeek:

edit: Not sure if we will use this, but I will post it anway as temporaly fix:

Open: functions_pafiledb.php

Find:

Code: Select all

		$forbidden_extensions = array_map( 'trim', @explode( ',', $pafiledb_config['forbidden_extensions'] ) );
		$file_extension = $pafiledb_functions->get_extension( $file_realname );

		if ( in_array( $file_extension, $forbidden_extensions ) )
		{
			$this->error[] = 'You are not allowed to upload this type of files';
		}
After, Add:

Code: Select all

		$allowed_ss_extensions = array('jpg', 'gif', 'png');

		if ( !empty( $ss_name ) )
		{
			$ss_file_extension = $pafiledb_functions->get_extension( $ss_name );

			if ( !in_array( $ss_file_extension, $allowed_ss_extensions ) )
			{
				$this->error[] = 'You are not allowed to upload this type of screenshot image';
			}
		}

divinemanwah
Registered User
Posts: 34
Joined: Sat Sep 08, 2007 11:48 am

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by divinemanwah » Mon Oct 01, 2007 10:01 am

One last question please...

I got these error messages when I run mx_mod_install.php when I'm loogged in as ADMIN:
Warning: main(./extension.inc): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 18

Warning: main(./extension.inc): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 18

Warning: main(./extension.inc): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 18

Warning: main(): Failed opening './extension.inc' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 18

Warning: main(./common.): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 19

Warning: main(./common.): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 19

Warning: main(./common.): failed to open stream: No such file or directory in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 19

Warning: main(): Failed opening './common.' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 19

Fatal error: Call to undefined function: session_pagestart() in /home/www/bsit.freehostia.com/phpbb_root_temp/mx_mod_install.php on line 22
Any idea about my problem??

Thanks in advance!!! :mrgreen:

User avatar
orynider
Registered User
Posts: 151
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: [DEV] pafileDB MX Addon (Download Manager)

Post by orynider » Mon Oct 01, 2007 10:37 pm

LoL, you uploaded the files with the phpbb_root_temp folder; phpbb_root_temp is a simbolic name that means you have to copy the content the the phpBB2 root folder were is extension.inc and common.php, index.php etc., and then run the installer; temp mens that after the install you can remove the files couse you don't need them anymore.

Post Reply

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 10 guests