|
From: Jon O. <jon...@us...> - 2005-12-08 15:15:54
|
Update of /cvsroot/mxbb/mx_pafiledb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5653/modules/mx_pafiledb Modified Files: db_install.php db_upgrade.php dload.php dload_lists.php dload_quickdl.php Log Message: in progress commit for mx_pafiledb Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_upgrade.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** db_upgrade.php 1 Oct 2005 14:15:19 -0000 1.10 --- db_upgrade.php 8 Dec 2005 15:15:11 -0000 1.11 *************** *** 41,45 **** } ! $mx_module_version = 'mxBB pafileDB Module 2.0.1'; $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.0</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; --- 41,45 ---- } ! $mx_module_version = 'mxBB pafileDB Module 2.0.2'; $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.0</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; *************** *** 83,86 **** --- 83,98 ---- $message .= "<b>Validating v. 2.0.1...ok</b><br/><br/>"; } + + // validate before 2.0.2 + $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "pa_config WHERE config_name = 'internal_comments'" ); + if ( $db->sql_numrows( $result ) == 0 || true) + { + $upgrade_202 = 1; + $message .= "<b>Upgrading to v. 2.0.2...ok</b><br/><br/>"; + } + else + { + $message .= "<b>Validating v. 2.0.2...ok</b><br/><br/>"; + } // ------------------------------------------------------------------------------------------------------ *************** *** 109,118 **** // Upgrade the config table to avoid duplicate entries ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "kb_config MODIFY config_name VARCHAR(255) NOT NULL default '' "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "kb_config MODIFY config_value VARCHAR(255) NOT NULL default '' "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "kb_config DROP PRIMARY KEY, ADD PRIMARY KEY (config_name) "; } if ( !MXBB_27x ) { --- 121,206 ---- // Upgrade the config table to avoid duplicate entries ! /* ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config MODIFY config_name VARCHAR(255) NOT NULL default '' "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config MODIFY config_value VARCHAR(255) NOT NULL default '' "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config DROP PRIMARY KEY, ADD PRIMARY KEY (config_name) "; ! */ } + + if ( $upgrade_202 == 1 ) + { + // Upgrade the config table to avoid duplicate entries + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config MODIFY config_name VARCHAR(255) NOT NULL default '' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config MODIFY config_value VARCHAR(255) NOT NULL default '' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_config DROP PRIMARY KEY, ADD PRIMARY KEY (config_name) "; + + // Configs + $sql[] = "UPDATE " . $mx_table_prefix . "pa_config" . " SET config_name = 'enable_module' WHERE config_name = 'settings_disable'"; + $sql[] = "UPDATE " . $mx_table_prefix . "pa_config" . " SET config_name = 'module_name' WHERE config_name = 'settings_dbname'"; + $sql[] = "UPDATE " . $mx_table_prefix . "pa_config" . " SET config_name = 'pagination' WHERE config_name = 'settings_file_page'"; + + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'art_pagination'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'comments_show'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'pm_notify'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'allow_wysiwyg_comments'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'allow_wysiwyg'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'formatting_fixup'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'formatting_comment_fixup'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'need_validation'"; + $sql[] = "DELETE FROM " . $mx_table_prefix . "pa_config" . " WHERE config_name = 'validator'"; + + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('wysiwyg_path', 'modules/')"; + + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('use_comments', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('internal_comments', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_wordwrap', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_image_resize', '300')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_truncate_links', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_comment_subject_chars', '50')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_comment_chars', '5000')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_wysiwyg', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_html', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_bbcode', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_smilies', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_links', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_image_message', '[No image please]')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_link_message', '[No links please]')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allowed_comment_html_tags', 'b,i,u,a')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('del_topic', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('autogenerate_comments', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('comments_pagination', '5')"; + + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('use_ratings', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('votes_check_userid', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('votes_check_ip', '1')"; + + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('notify', '0')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('notify_group', '0')"; + + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('show_pretext', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pt_header', 'File Submission Instructions')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pt_body', 'Please check your references and include as much information as you can.')"; + + + // add fields to pa_category table + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD internal_comments tinyint(2) NOT NULL DEFAULT '-1' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD autogenerate_comments tinyint(2) NOT NULL DEFAULT '-1' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD comments_forum_id mediumint(8) NOT NULL DEFAULT '-1' "; + + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD show_pretext tinyint(2) NOT NULL default '-1' "; + + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD notify tinyint(2) NOT NULL DEFAULT '-1' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD notify_group mediumint(8) NOT NULL DEFAULT '-1' "; + + // auth + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_approval_groups tinyint(2) NOT NULL default '0' "; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_approval_groups tinyint(1) DEFAULT '0' NOT NULL "; + // add fields to pa_files table + $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_files ADD topic_id mediumint(8) unsigned NOT NULL default '0'"; + } + if ( !MXBB_27x ) { Index: dload_lists.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload_lists.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dload_lists.php 24 Oct 2005 20:16:56 -0000 1.13 --- dload_lists.php 8 Dec 2005 15:15:11 -0000 1.14 *************** *** 18,22 **** * (at your option) any later version. */ ! function this_pa_mxurl( $args = '', $force_standalone_mode = false, $page_id = 1 ) { --- 18,22 ---- * (at your option) any later version. */ ! function this_pa_mxurl( $args = '', $force_standalone_mode = false, $page_id = 1 ) { *************** *** 96,106 **** include_once( $module_root_path . 'pafiledb/includes/pafiledb_constants.' . $phpEx ); include_once( $module_root_path . 'pafiledb/includes/functions_pafiledb.' . $phpEx ); ! // Set ALBUM Version ! ! // Read block Configuration ! $album_sp_config['img_rows'] = $mx_block->get_parameters( 'num_of_rows' ); $album_sp_config['img_cols'] = $mx_block->get_parameters( 'num_of_cols' ); --- 96,105 ---- include_once( $module_root_path . 'pafiledb/includes/pafiledb_constants.' . $phpEx ); + include_once( $module_root_path . 'pafiledb/includes/functions_auth.' . $phpEx ); include_once( $module_root_path . 'pafiledb/includes/functions_pafiledb.' . $phpEx ); ! // // Read block Configuration ! // $album_sp_config['img_rows'] = $mx_block->get_parameters( 'num_of_rows' ); $album_sp_config['img_cols'] = $mx_block->get_parameters( 'num_of_cols' ); *************** *** 142,146 **** $catrows = array(); ! $pafiledb = new pafiledb(); $pafiledb->init(); --- 141,145 ---- $catrows = array(); ! $pafiledb = new pafiledb_public(); $pafiledb->init(); Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_install.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** db_install.php 1 Oct 2005 14:15:19 -0000 1.16 --- db_install.php 8 Dec 2005 15:15:11 -0000 1.17 *************** *** 41,45 **** } ! $mx_module_version = 'mxBB pafileDB Module 2.0.1'; $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.0</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; --- 41,45 ---- } ! $mx_module_version = 'mxBB pafileDB Module 2.0.2'; $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.0</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; *************** *** 57,61 **** $message = "<b>This is a fresh install!</b><br/><br/>"; ! $sql = array( "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_cat ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_auth ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_comments ", --- 57,62 ---- $message = "<b>This is a fresh install!</b><br/><br/>"; ! $sql = array( ! "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_cat ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_auth ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_comments ", *************** *** 71,280 **** // Table structure for table `pa_auth` "CREATE TABLE " . $mx_table_prefix . "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_edit_file tinyint(1) DEFAULT '0' NOT NULL, ! auth_delete_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_approval 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 `pa_cat` "CREATE TABLE " . $mx_table_prefix . "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_allow_ratings tinyint(2) NOT NULL default '1', ! cat_allow_comments tinyint(2) NOT NULL default '1', ! 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_edit_file tinyint(2) DEFAULT '0' NOT NULL, ! auth_delete_file tinyint(2) DEFAULT '0' NOT NULL, ! 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', ! auth_approval tinyint(2) NOT NULL default '0', ! PRIMARY KEY (cat_id) ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_comments` "CREATE TABLE " . $mx_table_prefix . "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) ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_config` "CREATE TABLE " . $mx_table_prefix . "pa_config ( ! config_name varchar(255) NOT NULL default '', ! config_value varchar(255) NOT NULL default '', ! PRIMARY KEY (config_name) ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_custom` "CREATE TABLE " . $mx_table_prefix . "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) ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_customdata` "CREATE TABLE " . $mx_table_prefix . "pa_customdata ( ! customdata_file int(50) NOT NULL default '0', ! customdata_custom int(50) NOT NULL default '0', ! data text NOT NULL ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_download_info` "CREATE TABLE " . $mx_table_prefix . "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 '' ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_files` "CREATE TABLE " . $mx_table_prefix . "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 '0' NOT NULL, ! file_last int(50) default NULL, ! file_pin int(2) default NULL, ! file_docsurl text, ! file_approved TINYINT(1) DEFAULT '1' NOT NULL, ! file_broken TINYINT(1) DEFAULT '0' NOT NULL, ! PRIMARY KEY (file_id) ! )", // -------------------------------------------------------- "CREATE TABLE " . $mx_table_prefix . "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) ! )", // Table structure for table `phpbb_pa_license` "CREATE TABLE " . $mx_table_prefix . "pa_license ( ! license_id int(10) NOT NULL auto_increment, ! license_name text, ! license_text text, ! PRIMARY KEY (license_id) ! )", // -------------------------------------------------------- // Table structure for table `phpbb_pa_votes` "CREATE TABLE " . $mx_table_prefix . "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) ! )", ! ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (1, 'My Category', '', 0, '', 1, 0, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (2, 'Test Cagegory', 'Just a test category', 1, '', 2, 1, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0)", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_image_message', '[No image please]')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_smilies', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_links', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_link_message', '[No links please]')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_disable', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_html', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_bbcode', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_topnumber', '10')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_newdays', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_stats', '')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_viewall', '1')", - "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_dbname', 'Download Database')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_dbdescription', '')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_comment_chars', '5000')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('tpl_php', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_file_page', '20')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('hotlink_prevent', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('hotlink_allowed', '')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_method', 'file_time')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_order', 'DESC')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pm_notify', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_search','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_stats','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_toplist','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_viewall','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_file_size','262144')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('upload_dir','pafiledb/uploads/')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('screenshots_dir','pafiledb/images/screenshots/')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('forbidden_extensions','php, php3, php4, phtml, pl, asp, aspx, cgi')", ); --- 72,350 ---- // Table structure for table `pa_auth` "CREATE TABLE " . $mx_table_prefix . "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_edit_file tinyint(1) DEFAULT '0' NOT NULL, ! auth_delete_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_approval tinyint(1) DEFAULT '0' NOT NULL, ! auth_approval_groups 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 `pa_cat` "CREATE TABLE " . $mx_table_prefix . "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_allow_comments tinyint(2) NOT NULL default '1', ! internal_comments tinyint(2) NOT NULL default '-1', ! autogenerate_comments tinyint(2) NOT NULL default '-1', ! comments_forum_id mediumint(8) NOT NULL DEFAULT '-1', ! ! cat_allow_ratings tinyint(2) NOT NULL default '-1', ! ! show_pretext tinyint(2) NOT NULL default '-1', ! ! notify tinyint(2) NOT NULL default '-1', ! notify_group mediumint(8) unsigned NOT NULL default '-1', ! ! 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_edit_file tinyint(2) DEFAULT '0' NOT NULL, ! auth_delete_file tinyint(2) DEFAULT '0' NOT NULL, ! 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', ! auth_approval tinyint(2) NOT NULL default '0', ! auth_approval_groups tinyint(2) NOT NULL default '0', ! PRIMARY KEY (cat_id) ! )", ! ! // ! // Insert ! // ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (1, 'My Category', '', 0, '', 1, 0, 1, 1, 0, 0, '', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (2, 'Test Cagegory', 'Just a test category', 1, '', 2, 1, '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", ! ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_comments` "CREATE TABLE " . $mx_table_prefix . "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) ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_config` "CREATE TABLE " . $mx_table_prefix . "pa_config ( ! config_name varchar(255) NOT NULL default '', ! config_value varchar(255) NOT NULL default '', ! PRIMARY KEY (config_name) ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_custom` "CREATE TABLE " . $mx_table_prefix . "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) ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_customdata` "CREATE TABLE " . $mx_table_prefix . "pa_customdata ( ! customdata_file int(50) NOT NULL default '0', ! customdata_custom int(50) NOT NULL default '0', ! data text NOT NULL ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_download_info` "CREATE TABLE " . $mx_table_prefix . "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 '' ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_files` "CREATE TABLE " . $mx_table_prefix . "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 '0' NOT NULL, ! file_last int(50) default NULL, ! file_pin int(2) default NULL, ! file_docsurl text, ! file_approved TINYINT(1) DEFAULT '1' NOT NULL, ! file_broken TINYINT(1) DEFAULT '0' NOT NULL, ! topic_id mediumint(8) unsigned NOT NULL default '0', ! PRIMARY KEY (file_id) ! )", ! // -------------------------------------------------------- "CREATE TABLE " . $mx_table_prefix . "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) ! )", ! // Table structure for table `phpbb_pa_license` "CREATE TABLE " . $mx_table_prefix . "pa_license ( ! license_id int(10) NOT NULL auto_increment, ! license_name text, ! license_text text, ! PRIMARY KEY (license_id) ! )", ! // -------------------------------------------------------- // Table structure for table `phpbb_pa_votes` "CREATE TABLE " . $mx_table_prefix . "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) ! )", ! // ! // Config values ! // ! ! // General ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('enable_module', '0')", // settings_disable ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('module_name', 'Download Database')", // settings_dbname ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('wysiwyg_path', 'modules/')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('upload_dir','pafiledb/uploads/')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('screenshots_dir','pafiledb/images/screenshots/')", ! ! // Files ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_file_size','262144')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('forbidden_extensions','php, php3, php4, phtml, pl, asp, aspx, cgi')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('hotlink_prevent', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('hotlink_allowed', '')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('tpl_php', '0')", ! ! // Appearance "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_topnumber', '10')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_newdays', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_stats', '')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_viewall', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_dbdescription', '')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_method', 'file_time')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_order', 'DESC')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pagination', '20')", // art_pagination & settings_file_page ! ! // Comments ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('use_comments', '1')", // comments_show ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('internal_comments', '1')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_wordwrap', '1')", // formatting_comment_fixup ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_image_resize', '300')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('formatting_comment_truncate_links', '1')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_comment_subject_chars', '50')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('max_comment_chars', '5000')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_wysiwyg', '0')", // allow_wysiwyg_comments & allow_wysiwyg ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_html', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_bbcode', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_smilies', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_links', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_image_message', '[No image please]')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('no_comment_link_message', '[No links please]')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allowed_comment_html_tags', 'b,i,u,a')", // NEW ! "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('del_topic', '1')", // NEW ! "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('autogenerate_comments', '1')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('comments_pagination', '5')", ! ! // Ratings ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('use_ratings', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('votes_check_userid', '1')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('votes_check_ip', '1')", ! ! // Instructions ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('show_pretext', '0')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pt_header', 'File Submission Instructions')", // NEW ! "INSERT INTO " . $mx_table_prefix . "pa_config values ('pt_body', 'Please check your references and include as much information as you can.')", // NEW ! ! // Notifications ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('notify', 'pm')", // pm_notify ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('notify_group', '0')", // NEW ! ! // Permissions ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_search','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_stats','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_toplist','0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('auth_viewall','0')", ! ); Index: dload.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dload.php 24 Oct 2005 20:16:56 -0000 1.15 --- dload.php 8 Dec 2005 15:15:11 -0000 1.16 *************** *** 18,22 **** * (at your option) any later version. */ ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { --- 18,22 ---- * (at your option) any later version. */ ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { *************** *** 38,45 **** // Start session management - $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); init_userprefs( $userdata ); - // End session management } --- 38,43 ---- *************** *** 61,68 **** // Start session management - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); - // End session management --- 59,64 ---- *************** *** 83,87 **** { // ! // Read Block Settings // $title = $mx_block->block_info['block_title']; --- 79,83 ---- { // ! // Read Block Settings (default mode) // $title = $mx_block->block_info['block_title']; *************** *** 94,107 **** } list( $trash, $mx_script_name_temp ) = split ( trim( $board_config['server_name'] ), PORTAL_URL ); $mx_script_name = preg_replace( '#^\/?(.*?)\/?$#', '\1', trim( $mx_script_name_temp ) ); // =================================================== // Include the common file // =================================================== - /* - orig - include($phpbb_root_path . 'pafiledb/pafiledb_common.'.$phpEx); - */ - // MX - include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); --- 90,106 ---- } + // ------------------------------------------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------------------------------------------------------- + + // =================================================== + // ? + // =================================================== list( $trash, $mx_script_name_temp ) = split ( trim( $board_config['server_name'] ), PORTAL_URL ); $mx_script_name = preg_replace( '#^\/?(.*?)\/?$#', '\1', trim( $mx_script_name_temp ) ); + // =================================================== // Include the common file // =================================================== include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); *************** *** 109,124 **** // Get action variable other wise set it to the main // =================================================== ! $action = ( isset( $_REQUEST['action'] ) ) ? htmlspecialchars( $_REQUEST['action'] ) : 'main'; // =================================================== // if the database disabled give them a nice message // =================================================== ! if ( intval( $pafiledb_config['settings_disable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); } // =================================================== // an array of all expected actions // =================================================== ! $actions = array( 'download' => 'download', 'category' => 'category', 'file' => 'file', --- 108,128 ---- // Get action variable other wise set it to the main // =================================================== ! $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, 'main'); ! ! $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; ! // =================================================== // if the database disabled give them a nice message // =================================================== ! if ( intval( $pafiledb_config['module_enable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); } + // =================================================== // an array of all expected actions // =================================================== ! $actions = array( ! 'download' => 'download', 'category' => 'category', 'file' => 'file', *************** *** 135,148 **** 'ucp' => 'ucp', 'main' => 'main' ); // =================================================== // Lets Build the page // =================================================== $page_title = $lang['Download']; if ( $action != 'download' ) { - /* - orig - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - */ - // MX if ( !$is_block ) { --- 139,150 ---- 'ucp' => 'ucp', 'main' => 'main' ); + // =================================================== // Lets Build the page // =================================================== $page_title = $lang['Download']; + if ( $action != 'download' ) { if ( !$is_block ) { *************** *** 156,163 **** if ( $action != 'download' ) { - /* - orig - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - */ - // MX if ( !$is_block ) { --- 158,161 ---- *************** *** 165,168 **** } } - ?> \ No newline at end of file --- 163,165 ---- Index: dload_quickdl.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload_quickdl.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dload_quickdl.php 24 Oct 2005 20:16:56 -0000 1.5 --- dload_quickdl.php 8 Dec 2005 15:15:11 -0000 1.6 *************** *** 85,89 **** // if the database disabled give them a nice message // =================================================== ! if ( intval( $pafiledb_config['settings_disable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); --- 85,89 ---- // if the database disabled give them a nice message // =================================================== ! if ( intval( $pafiledb_config['module_enable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); |