[DEV] Pafiledb [DOWNLOAD MOD] 0.0.9d

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.
Locked
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Here's the corrected pafiledb_mysql.sql :

Code: Select all

# phpMyAdmin MySQL-Dump
# version 2.3.0-rc2
# http://phpwizard.net/phpMyAdmin/
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Jul 05, 2003 at 08:14 PM
# Server version: 4.00.01
# PHP Version: 4.2.2
# Database : `main`
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_cat`
#

CREATE TABLE phpbb_pa_cat (
  cat_id int(10) NOT NULL auto_increment,
  cat_name text,
  cat_desc text,
  cat_parent int(50) default NULL,
  parents_data text NOT NULL,
  cat_order int(50) default NULL,
  cat_allow_file tinyint(2) NOT NULL default '0',
  cat_files mediumint(8) NOT NULL default '-1',
  cat_last_file_id mediumint(8) unsigned NOT NULL default '0',
  cat_last_file_name varchar(255) NOT NULL default '',
  cat_last_file_time INT(50) unsigned DEFAULT '0' NOT NULL,  
  auth_view tinyint(2) NOT NULL default '0',
  auth_read tinyint(2) NOT NULL default '0',
  auth_view_file tinyint(2) NOT NULL default '0',
  auth_upload tinyint(2) NOT NULL default '0',
  auth_download tinyint(2) NOT NULL default '0',
  auth_rate tinyint(2) NOT NULL default '0',
  auth_email tinyint(2) NOT NULL default '0',
  auth_view_comment tinyint(2) NOT NULL default '0',
  auth_post_comment tinyint(2) NOT NULL default '0',
  auth_edit_comment tinyint(2) NOT NULL default '0',
  auth_delete_comment tinyint(2) NOT NULL default '0',
  PRIMARY KEY  (cat_id)
) TYPE=MyISAM;

# --------------------------------------------------------

INSERT INTO phpbb_pa_cat VALUES (1, 'My Category', '', 0, '', 1, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO phpbb_pa_cat VALUES (2, 'Test Category', 'Just a test category', 1, '', 2, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);


CREATE TABLE phpbb_pa_auth (
   group_id mediumint(8) DEFAULT '0' NOT NULL,
   cat_id smallint(5) UNSIGNED DEFAULT '0' NOT NULL,
   auth_view tinyint(1) DEFAULT '0' NOT NULL,
   auth_read tinyint(1) DEFAULT '0' NOT NULL,
   auth_view_file tinyint(1) DEFAULT '0' NOT NULL,
   auth_upload tinyint(1) DEFAULT '0' NOT NULL,
   auth_download tinyint(1) DEFAULT '0' NOT NULL,
   auth_rate tinyint(1) DEFAULT '0' NOT NULL,
   auth_email tinyint(1) DEFAULT '0' NOT NULL,
   auth_view_comment tinyint(1) DEFAULT '0' NOT NULL,
   auth_post_comment tinyint(1) DEFAULT '0' NOT NULL,
   auth_edit_comment tinyint(1) DEFAULT '0' NOT NULL,
   auth_delete_comment tinyint(1) DEFAULT '0' NOT NULL,
   auth_mod tinyint(1) DEFAULT '1' NOT NULL,
   auth_search tinyint(1) DEFAULT '1' NOT NULL,
   auth_stats tinyint(1) DEFAULT '1' NOT NULL,
   auth_toplist tinyint(1) DEFAULT '1' NOT NULL,
   auth_viewall tinyint(1) DEFAULT '1' NOT NULL,
   KEY group_id (group_id),
   KEY cat_id (cat_id)
);

#
# Table structure for table `phpbb_pa_comments`
#

CREATE TABLE phpbb_pa_comments (
  comments_id int(10) NOT NULL auto_increment,
  file_id int(10) NOT NULL default '0',
  comments_text text NOT NULL,
  comments_title text NOT NULL,
  comments_time int(50) NOT NULL default '0',
  comment_bbcode_uid varchar(10) default NULL,
  poster_id mediumint(8) NOT NULL default '0',
  PRIMARY KEY  (comments_id),
  KEY comments_id (comments_id),
  FULLTEXT KEY comment_bbcode_uid (comment_bbcode_uid)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_config`
#

CREATE TABLE phpbb_pa_config (
  config_name varchar(255) NOT NULL default '',
  config_value varchar(255) NOT NULL default '',
  PRIMARY KEY  (config_name)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_custom`
#

CREATE TABLE phpbb_pa_custom (
  custom_id int(50) NOT NULL auto_increment,
  custom_name text NOT NULL,
  custom_description text NOT NULL,
  data text NOT NULL,
  field_order int(20) NOT NULL default '0',
  field_type tinyint(2) NOT NULL default '0',
  regex varchar(255) NOT NULL default '',
  PRIMARY KEY  (custom_id)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_customdata`
#

CREATE TABLE phpbb_pa_customdata (
  customdata_file int(50) NOT NULL default '0',
  customdata_custom int(50) NOT NULL default '0',
  data text NOT NULL
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_download_info`
#

CREATE TABLE phpbb_pa_download_info (
  file_id mediumint(8) NOT NULL default '0',
  user_id mediumint(8) NOT NULL default '0',
  downloader_ip varchar(8) NOT NULL default '',
  downloader_os varchar(255) NOT NULL default '',
  downloader_browser varchar(255) NOT NULL default '',
  browser_version varchar(255) NOT NULL default ''
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_files`
#

CREATE TABLE phpbb_pa_files (
  file_id int(10) NOT NULL auto_increment,
  user_id mediumint(8) NOT NULL default '0',
  poster_ip varchar(8) NOT NULL default '',
  file_name text,
  file_size int(20) NOT NULL default '0',
  unique_name varchar(255) NOT NULL default '',
  real_name VARCHAR(255) NOT NULL,
  file_dir VARCHAR(255) NOT NULL,
  file_desc text,
  file_creator text,
  file_version text,
  file_longdesc text,
  file_ssurl text,
  file_sshot_link tinyint(2) NOT NULL default '0',
  file_dlurl text,
  file_time int(50) default NULL,
  file_update_time int(50) NOT NULL default '0',
  file_catid int(10) default NULL,
  file_posticon text,
  file_license int(10) default NULL,
  file_dls int(10) default NULL,
  file_last int(50) default NULL,
  file_pin int(2) default NULL,
  file_docsurl text,
  file_approved int(11) default NULL,
  file_broken TINYINT(1) DEFAULT '0' NOT NULL,
  PRIMARY KEY  (file_id)
) TYPE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `phpbb_pa_license`
#

CREATE TABLE phpbb_pa_license (
  license_id int(10) NOT NULL auto_increment,
  license_name text,
  license_text text,
  PRIMARY KEY  (license_id)
) TYPE=MyISAM;
# --------------------------------------------------------


CREATE TABLE phpbb_pa_mirrors (
  mirror_id mediumint(8) NOT NULL auto_increment, 
  file_id int(10) NOT NULL,
  unique_name varchar(255) NOT NULL default '',
  file_dir VARCHAR(255) NOT NULL, 
  file_dlurl varchar(255) NOT NULL default '',
  mirror_location VARCHAR(255) NOT NULL default '',
  PRIMARY KEY  (mirror_id),
  KEY file_id (file_id)
) TYPE=MyISAM;

#
# Table structure for table `phpbb_pa_votes`
#

CREATE TABLE phpbb_pa_votes (
  user_id mediumint(8) NOT NULL default '0',
  votes_ip varchar(50) NOT NULL default '0',
  votes_file int(50) NOT NULL default '0',
  rate_point tinyint(3) unsigned NOT NULL default '0',
  voter_os varchar(255) NOT NULL default '',
  voter_browser varchar(255) NOT NULL default '',
  browser_version varchar(8) NOT NULL default '',
  KEY user_id (user_id),
  KEY votes_file (votes_file),
  KEY votes_ip (votes_ip),
  KEY voter_os (voter_os),
  KEY voter_browser (voter_browser),
  KEY browser_version (browser_version),
  KEY rate_point (rate_point)
) TYPE=MyISAM;


INSERT INTO phpbb_pa_config VALUES ('allow_comment_images', '0');
INSERT INTO phpbb_pa_config VALUES ('no_comment_image_message', '[No image please]');
INSERT INTO phpbb_pa_config VALUES ('allow_smilies', '1');
INSERT INTO phpbb_pa_config VALUES ('allow_comment_links', '1');
INSERT INTO phpbb_pa_config VALUES ('no_comment_link_message', '[No links please]');
INSERT INTO phpbb_pa_config VALUES ('settings_disable', '0');
INSERT INTO phpbb_pa_config VALUES ('allow_html', '1');
INSERT INTO phpbb_pa_config VALUES ('allow_bbcode', '1');
INSERT INTO phpbb_pa_config VALUES ('settings_topnumber', '10');
INSERT INTO phpbb_pa_config VALUES ('settings_newdays', '1');
INSERT INTO phpbb_pa_config VALUES ('settings_stats', '');
INSERT INTO phpbb_pa_config VALUES ('settings_viewall', '1');
INSERT INTO phpbb_pa_config VALUES ('settings_dbname', 'Download Database');
INSERT INTO phpbb_pa_config VALUES ('settings_dbdescription', '');
INSERT INTO phpbb_pa_config VALUES ('max_comment_chars', '5000');
INSERT INTO phpbb_pa_config VALUES ('tpl_php', '0');
INSERT INTO phpbb_pa_config VALUES ('settings_file_page', '20');
INSERT INTO phpbb_pa_config VALUES ('hotlink_prevent', '1');
INSERT INTO phpbb_pa_config VALUES ('hotlink_allowed', '');
INSERT INTO phpbb_pa_config VALUES ('sort_method', 'file_time');
INSERT INTO phpbb_pa_config VALUES ('sort_order', 'DESC');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('auth_search','0');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('auth_stats','0');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('auth_toplist','0');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('auth_viewall','0');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('max_file_size','262144');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('upload_dir','pafiledb/uploads/');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('screenshots_dir','pafiledb/images/screenshots/');
INSERT INTO phpbb_pa_config (config_name, config_value) VALUES ('forbidden_extensions','php, php3, php4, phtml, pl, asp, aspx, cgi');
Last edited by Fearless on Sat Sep 06, 2003 4:22 pm, edited 1 time in total.
Frold
Registered User
Posts: 447
Joined: Sat Nov 02, 2002 8:19 am

Post by Frold »

Fearless wrote: Here's the corrected pafiledb_mysql.sql :

Code: Select all

#
# Table structure for table `phpbb_pa_votes`
#

CREATE TABLE phpbb_pa_votes (
  user_id mediumint(8) NOT NULL default '0',
  votes_ip varchar(50) NOT NULL default '0',
  votes_file int(50) NOT NULL default '0',
  rate_point tinyint(3) unsigned NOT NULL default '0',
  voter_os varchar(255) NOT NULL default '',
  voter_browser varchar(255) NOT NULL default '',
  browser_version varchar(8) NOT NULL default '',
  KEY user_id (user_id),
  KEY votes_file (votes_file),
  KEY votes_ip (votes_ip),
  KEY voter_os (voter_os),
  KEY voter_borwser (voter_browser),
  KEY browser_version (browser_version),
  KEY rate_point (rate_point)
) TYPE=MyISAM;


what about

Code: Select all

KEY voter_borwser (voter_browser),
Sholdn´t it be?

Code: Select all

KEY voter_browser (voter_browser),
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Yes, thanks for pointing that out :) . I don't know if I modified this before importing the SQL file into the database but a few functions are working now.

For those who are wondering what's been changed apart from a typo or two, I added cat_last_file_time field to the phpbb_pa_cat record and corrected the phpbb_pa_cat INSERTS so they are the right length.

I have two questions for Mohd :
- Is it possible to have links to files on an FTP ? This seems to work on the original pafileDB but not on the integration mod.
- Is it possible to disable user upload ? I don't really need it and it can be a potential hazard. What I've done, for the moment, is to comment out the upload function in pafiledb/includes/functions.php so that it is empty.
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Found another problem. For some reason, the information relative to the last file added to a category isn't updated when a new file is added.
User avatar
nubianniht
Registered User
Posts: 338
Joined: Thu Jun 05, 2003 4:02 am
Contact:

Post by nubianniht »

fearless i thank you! :wink:
i was going to wait on mohd's official release.
the reason why i'm not opening my download section part of my forum just yet is because it is for 2 of the reasons you stated above:
1: - Is it possible to disable user upload ? I don't really need it and it can be a potential hazard. What I've done, for the moment, is to comment out the upload function in pafiledb/includes/functions.php so that it is empty.
2: - For some reason, the information relative to the last file added to a category isn't updated when a new file is added.


but thank you for puttin in your time and effort on fixing alot of the sql commands.

again thank you!
Mohd
Registered User
Posts: 263
Joined: Mon Jul 15, 2002 9:06 pm
Contact:

Post by Mohd »

nubianniht wrote: fearless i thank you! :wink:
i was going to wait on mohd's official release.
the reason why i'm not opening my download section part of my forum just yet is because it is for 2 of the reasons you stated above:
1: - Is it possible to disable user upload ? I don't really need it and it can be a potential hazard. What I've done, for the moment, is to comment out the upload function in pafiledb/includes/functions.php so that it is empty.
2: - For some reason, the information relative to the last file added to a category isn't updated when a new file is added.


but thank you for puttin in your time and effort on fixing alot of the sql commands.

again thank you!


there some changes in zip package which related to the new version of pafiledb which is not complete, I don't know how I replaced them
Visit My Site Mohd Web Site!
My Current mod is PaFileDb Integration 0.0.8
Demo: Click Here
No support via PM
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Work in progress :D ?
nubianniht wrote: 1: - Is it possible to disable user upload ?


I don't know if this is sufficient but this quick hack should do the trick:

In pafiledb/modules/pa_user_upload.php

Code: Select all

class pafiledb_user_upload extends pafiledb_public
{
	function main($action)
	{
		global $_REQUEST, $_POST, $_FILES, ...
		...
			$this->display($lang['Download'], 'pa_file_add.tpl');
		}
	}
}
?>
Replace with :

Code: Select all

class pafiledb_user_upload extends pafiledb_public
{
	function main($action)
	{
		/*global $_REQUEST, $_POST, $_FILES, ...
		...
			$this->display($lang['Download'], 'pa_file_add.tpl');
		}
	*/}
}
?>
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Hmmm, now that this mod is working more or less, it's pretty cool. It's a shame that ftp:// links don't work, though. Here are some examples of what a cool download center would look like :

http://www.ut2003hq.com/pafiledb/pafiledb.php
http://badct.4players.de:1337/files.php?topicid=16
User avatar
peppers
Registered User
Posts: 14
Joined: Wed Jul 23, 2003 9:37 pm
Location: FL350
Contact:

Post by peppers »

Fearless wrote: Hmmm, now that this mod is working more or less, it's pretty cool. It's a shame that ftp:// links don't work, though. Here are some examples of what a cool download center would look like :

http://www.ut2003hq.com/pafiledb/pafiledb.php
http://badct.4players.de:1337/files.php?topicid=16


Like to know exactly what you have done, only the differences in the database? Did now remove my old updated 8 to 9B version and will reinstall the 9B version.
McLR
Registered User
Posts: 95
Joined: Thu Aug 21, 2003 12:51 pm

Post by McLR »

?!

Code: Select all

Could not obtain downloads info

DEBUG MODE

SQL Error : 1054 Unknown column 'downloader_browser' in 'field list'

SELECT downloader_os, downloader_browser FROM phpbb_pa_download_info

Line : 188
File : /var/www/virtual/talkt.com/www/mods/pafiledb/modules/pa_stats.php
=stats page
what i have to do ?
McLR
Registered User
Posts: 95
Joined: Thu Aug 21, 2003 12:51 pm

Post by McLR »

and when i uploaded some file i have an error when i entering the download page :

Code: Select all

Couldnt Query Files info

DEBUG MODE

SQL Error : 1054 Unknown column 'cat_last_file_time' in 'field list'

UPDATE phpbb_pa_cat SET cat_last_file_id = '1', cat_last_file_name = 'çãùåú ìôåøèì EZ', cat_last_file_time = '1062940941' WHERE cat_id IN (2)

Line : 292
File : /var/www/virtual/talkt.com/www/mods/pafiledb/includes/functions_pafiledb.php
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

I have simply imported the corrected SQL file as this was causing the majority of errors.

*This is what works for the moment*:
- You can create categories & sub-categories but not delete them (Fatal error: Call to a member function on a non-object in...).
- You can add a file via the ACP.
- You can use the e-mail button to send an e-mail although it will direct you to the wrong spot. For example, on the following download :

Code: Select all

http://a_web_site.com/phpBB2/dload.php?action=file&file_id=12
It will redirect you to :

Code: Select all

http://a_web_site.com/phpBB2/dload.php?action=file&id=12
- The votes function seems to work although the votes counter isn't displayed.
- User permissions seem to work and you can restrict categories to registered users.

*Problems remaining* :
- File uploading doesn't seem to be working properly (see above posts). I have disabled this by commenting out the upload function as basically anyone can upload files.
- The Categories table isn't updated to reflect the last file added in a category.
- The total files counter of a category doesn't seem to be updated properly.
- FTP links will not work. This is probably due to the way the url redirection is handled. I intend to use this mod for files that are hosted elsewhere than on the main site so I'd be happy with the popup system that that BADCT site uses.

I really wish I could dig into the code but I'm not very good at object-orientated programming and the script is very complex with a passing of values that I have seen in the phpBB scripts (which is tradeoff for it's modular approach with templates, languages and stuff).

What needs to be done is to find why some tables aren't being updated when something is removed/added and what causes this "Call to a member function on a non-object" error in a few functions such as category deletion.
Last edited by Fearless on Sun Sep 07, 2003 1:37 pm, edited 1 time in total.
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

McLR wrote: and when i uploaded some file i have an error when i entering the download page :

Code: Select all

Couldnt Query Files info

DEBUG MODE

SQL Error : 1054 Unknown column 'cat_last_file_time' in 'field list'

UPDATE phpbb_pa_cat SET cat_last_file_id = '1', cat_last_file_name = 'çãùåú ìôåøèì EZ', cat_last_file_time = '1062940941' WHERE cat_id IN (2)

Line : 292
File : /var/www/virtual/talkt.com/www/mods/pafiledb/includes/functions_pafiledb.php


Have you tried importing the corrected SQL file above ? A series of typos slipped in and one field was missing. Maybe there are some other things missing too that I have overlooked.

Basically, all I did was compare the update SQL files with the one used for a fresh installation to find out what was missing.
numarc
Registered User
Posts: 40
Joined: Mon Mar 24, 2003 10:18 am

Post by numarc »

Hy phpBB-Friends :wink:

Now I have the Files, but I can't find the How-to-Install-File in there :cry: Can anybody help me? :wink:
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

The documentation and the install.txt should be in pafiledb/docs/.
Locked

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