You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: Jon O. <jon...@us...> - 2005-04-11 17:56:21
|
Update of /cvsroot/mxbb/mx_pafiledb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2875/modules/mx_pafiledb Modified Files: db_install.php db_upgrade.php dload.php Log Message: finally upgrading this module/mod - merging phpBB mod, mxBB module (2.7.x and 2.8) -.permissions reviewed - pm notification added - and many many minor fixes all over the place Index: dload.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dload.php 6 Mar 2005 15:17:50 -0000 1.8 --- dload.php 11 Apr 2005 17:55:40 -0000 1.9 *************** *** 16,65 **** * (at your option) any later version. */ ! /* - orig ! define('IN_PHPBB', true); ! define('IN_DOWNLOAD', true); ! $phpbb_root_path = './'; ! include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); ! */ ! // MX ! if ( !function_exists( 'read_block_config' ) ) { define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); // End session management ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'PafileDB' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, "Could not query PafileDB module information", "", __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; } ! $is_block = false; ! } ! else ! { ! ! // Read block Configuration ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! ! $is_block = true; ! global $images; } --- 16,89 ---- * (at your option) any later version. */ ! ! // Switch for making this run as a phpBB MOD or mxBB module ! ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { + define( 'MXBB_MODULE', false ); + define( 'IN_PHPBB', true ); define( 'IN_PORTAL', true ); ! define( 'IN_DOWNLOAD', true ); ! ! // When run as a phpBB mod these paths are identical ;) ! $phpbb_root_path = $module_root_path = $mx_root_path = './'; ! ! include( $phpbb_root_path . 'extension.inc' ); ! include( $phpbb_root_path . 'common.' . $phpEx ); ! ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! ! define( 'PAGE_DOWNLOAD', -501 ); // If this id generates a conflict with other mods, change it ;) // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); ! init_userprefs( $userdata ); // End session management ! } ! else ! { ! define( 'MXBB_MODULE', true ); ! ! if ( !function_exists( 'read_block_config' ) ) { ! define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! ! // End session management ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'PafileDB' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Could not query PafileDB module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; } ! $is_block = false; } ! else ! { ! // Read block Configuration ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! $is_block = true; ! global $images; ! } ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); } Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_install.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** db_install.php 18 Mar 2005 18:14:38 -0000 1.12 --- db_install.php 11 Apr 2005 17:55:39 -0000 1.13 *************** *** 22,32 **** define( 'IN_PORTAL', true ); ! $mx_module_version = 'mxBB pafileDB Module 2.0.0'; ! $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.1</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; if ( !defined( 'IN_ADMIN' ) ) { - $mx_root_path = '../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); --- 22,32 ---- define( 'IN_PORTAL', true ); + $mx_root_path = './../'; ! $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>'; if ( !defined( 'IN_ADMIN' ) ) { include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); *************** *** 46,49 **** --- 46,58 ---- // End session management } + + // For compatibility with core 2.7.+ + define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); + + if ( MXBB_27x ) + { + include_once( $mx_root_path . 'modules/mx_pafiledb/pafiledb/includes/functions_mx.' . $phpEx ); + } + // If fresh install if ( !$result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "pa_config" ) ) *************** *** 62,240 **** "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_mirrors ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_files ", // 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_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(1) DEFAULT '0' NOT NULL, ! auth_delete_file tinyint(1) 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', ! 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)", ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (2, 'Test Category', '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)", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '0')", --- 71,252 ---- "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_mirrors ", "DROP TABLE IF EXISTS " . $mx_table_prefix . "pa_files ", + // 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')", *************** *** 259,268 **** "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_method', 'file_time')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_order', 'DESC')", - // Added by Haplo - // "INSERT INTO ".$mx_table_prefix."pa_config VALUES ('user_approval','1')", - "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('need_validation', '0')", - "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('validator', 'validator_admin')", "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')", --- 271,275 ---- *************** *** 275,282 **** ); ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); --- 282,292 ---- ); ! if ( !MXBB_27x ) ! { ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; + } $message .= mx_do_install_upgrade( $sql ); Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_upgrade.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_upgrade.php 6 Mar 2005 01:13:11 -0000 1.5 --- db_upgrade.php 11 Apr 2005 17:55:40 -0000 1.6 *************** *** 22,28 **** define( 'IN_PORTAL', true ); ! $mx_module_version = 'mxBB pafileDB Module 2.0.0'; ! $mx_module_copy = 'Based on <a href="http://www.phparena.net/" target="_phpbb" >PHP Arena, pafileDB 3.1</a> & <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=56035" target="_phpbb" >Mohd pafileDB 0.0.9d</a>'; if ( !defined( 'IN_ADMIN' ) ) --- 22,29 ---- define( 'IN_PORTAL', true ); + $mx_root_path = './../'; ! $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>'; if ( !defined( 'IN_ADMIN' ) ) *************** *** 46,72 **** // End session management } // Precheck if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "pa_config" ) ) { - $message = "<b>Upgrading! ...</b><br/><br/>"; - $sql = array( - // MX Addon 1.0 - "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_edit_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_view_file", - "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_delete_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_edit_file", - "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD cat_allow_ratings tinyint(2) NOT NULL default '1' AFTER cat_allow_file", - "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD cat_allow_comments tinyint(2) NOT NULL default '1' AFTER cat_allow_ratings", ! "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_edit_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_view_file", ! "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_delete_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_edit_file", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('need_validation', '0')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('validator', 'validator_admin')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pm_notify', '0')" ! ); ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); --- 47,129 ---- // End session management } + + // For compatibility with core 2.7.+ + define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); + + if ( MXBB_27x ) + { + include_once( $mx_root_path . 'modules/mx_pafiledb/pafiledb/includes/functions_mx.' . $phpEx ); + } + + $sql = array(); // Precheck if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "pa_config" ) ) { ! // Upgrade checks ! $upgrade_103 = 0; ! $upgrade_201 = 0; ! ! $message = "<b>Upgrading!</b><br/><br/>"; ! // validate before 1.0.3 ! if ( !$result = $db->sql_query( "SELECT auth_edit_file from " . $mx_table_prefix . "pa_cat" ) ) ! { ! $upgrade_103 = 1; ! $message .= "<b>Upgrading to v. 1.0.3...</b><br/><br/>"; ! } ! else ! { ! $message .= "<b>Validating v. 1.0.3...ok</b><br/><br/>"; ! } ! ! // validate before 2.0.1 ! if ( !$result = $db->sql_query( "SELECT auth_approval from " . $mx_table_prefix . "pa_cat" ) ) ! { ! $upgrade_201 = 1; ! $message .= "<b>Validating v. 2.0.1...ok</b><br/><br/>"; ! } ! else ! { ! $message .= "<b>Validating v. 2.0.1...ok</b><br/><br/>"; ! } ! // ------------------------------------------------------------------------------------------------------ ! if ( $upgrade_103 == 1 ) ! { ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_edit_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_view_file "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_delete_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_edit_file "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD cat_allow_ratings tinyint(2) NOT NULL default '1' AFTER cat_allow_file "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD cat_allow_comments tinyint(2) NOT NULL default '1' AFTER cat_allow_ratings "; ! ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_edit_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_view_file "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_delete_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_edit_file "; ! ! $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pm_notify', '0')"; ! } ! ! if ( $upgrade_201 == 1 ) ! { ! ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat ADD auth_approval tinyint(1) DEFAULT '0' NOT NULL AFTER auth_delete_comment "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth ADD auth_approval tinyint(2) DEFAULT '0' NOT NULL AFTER auth_delete_comment "; ! ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth MODIFY auth_edit_file tinyint(2) DEFAULT '0' NOT NULL "; ! $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_auth MODIFY auth_delete_file tinyint(2) DEFAULT '0' NOT NULL "; ! ! // 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 ) ! { ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; + } $message .= mx_do_install_upgrade( $sql ); |
Update of /cvsroot/mxbb/mx_pafiledb/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2875/modules/mx_pafiledb/templates/subSilver Modified Files: pa_category_body.tpl pa_file_add.tpl pa_file_body.tpl pa_header.tpl pa_mcp.tpl pa_toplist_body.tpl pa_viewall_body.tpl Log Message: finally upgrading this module/mod - merging phpBB mod, mxBB module (2.7.x and 2.8) -.permissions reviewed - pm notification added - and many many minor fixes all over the place Index: pa_mcp.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_mcp.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pa_mcp.tpl 9 Jan 2005 21:44:14 -0000 1.2 --- pa_mcp.tpl 11 Apr 2005 17:55:43 -0000 1.3 *************** *** 81,97 **** </script> <!-- INCLUDE pa_header.tpl --> ! <table width="100%" cellpadding="2" cellspacing="2"> ! <tr> ! <td valign="bottom"> ! <span class="nav"><a href="{U_DOWNLOAD}" class="nav">{DOWNLOAD}</a> » {L_MCP_TITLE}</span> ! </td> ! </tr> ! </table> ! <p>{L_MCP_EXPLAIN}</p> <body onLoad="disable_cat_list();"> <form method="post" action="{S_FILE_ACTION}" name="form"> <table width="100%" cellpadding="3" cellspacing="1"> <tr> ! <td><b><span class="genmed">{L_MODE}:</span></b> <select name="mode_js" onchange="disable_cat_list();">{S_MODE_SELECT}</select> <b><span class="genmed">{L_CATEGORY}:</span></b> {S_CAT_LIST}<input type="submit" class="liteoption" name="go" value="{L_GO}" /></td> </tr> </table> --- 81,91 ---- </script> <!-- INCLUDE pa_header.tpl --> ! <body onLoad="disable_cat_list();"> + <form method="post" action="{S_FILE_ACTION}" name="form"> <table width="100%" cellpadding="3" cellspacing="1"> <tr> ! <td><span class="gen">{L_MCP_EXPLAIN}</span><br /><b><span class="genmed">{L_MODE}:</span></b> <select name="mode_js" onchange="disable_cat_list();">{S_MODE_SELECT}</select> <b><span class="genmed">{L_CATEGORY}:</span></b> {S_CAT_LIST}<input type="submit" class="liteoption" name="go" value="{L_GO}" /></td> </tr> </table> *************** *** 99,102 **** --- 93,105 ---- </form> <form method="post" action="{S_FILE_ACTION}" name="file_ids" onsubmit="return check();"> + + <table width="100%" cellpadding="2" cellspacing="2"> + <tr> + <td valign="bottom"> + <span class="nav"><a href="{U_DOWNLOAD}" class="nav">{DOWNLOAD}</a> » {L_MCP_TITLE}</span> + </td> + </tr> + </table> + <!-- BEGIN file_mode --> <table width="100%" cellpadding="4" cellspacing="0" class="forumline"> Index: pa_header.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_header.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pa_header.tpl 9 Jan 2005 21:44:14 -0000 1.5 --- pa_header.tpl 11 Apr 2005 17:55:43 -0000 1.6 *************** *** 66,88 **** <table width="40%" cellpadding="3" cellspacing="1"> <tr> <!-- IF IS_AUTH_SEARCH --> ! <td align="center"><b> <a href="{U_PASEARCH}" class="gensmall"><img src="{SEARCH_IMG}" border="0" alt="{L_SEARCH}" align="middle" /></a> </b></td> <!-- ENDIF --> <!-- IF IS_AUTH_STATS --> ! <td align="center"><b> <a href="{U_PASTATS}" class="gensmall"><img src="{STATS_IMG}" border="0" alt="{L_STATS}" align="middle" /></a> </b></td> <!-- ENDIF --> <!-- IF IS_AUTH_TOPLIST --> ! <td align="center"><b> <a href="{U_TOPLIST}" class="gensmall"><img src="{TOPLIST_IMG}" border="0" alt="{L_TOPLIST}" align="middle" /></a> </b></td> <!-- ENDIF --> <!-- IF IS_AUTH_UPLOAD --> ! <td align="center"><b> <a href="{U_UPLOAD}" class="gensmall"><img src="{UPLOAD_IMG}" border="0" alt="{L_UPLOAD}" align="middle" /></a> </b></td> <!-- ENDIF --> <!-- IF IS_AUTH_VIEWALL --> ! <td align="center"><b> <a href="{U_VIEW_ALL}" class="gensmall"><img src="{VIEW_ALL_IMG}" border="0" alt="{L_VIEW_ALL}" align="middle" /></a> </b></td> <!-- ENDIF --> <!-- IF IS_AUTH_MCP --> ! <td align="center"><b> <a href="{U_MCP}" class="gensmall">{MCP_LINK}</a> </b></td> <!-- ENDIF --> ! </tr> </table> --- 66,91 ---- <table width="40%" cellpadding="3" cellspacing="1"> <tr> + <td align="center"> <!-- IF IS_AUTH_SEARCH --> ! <b> <a href="{U_PASEARCH}" class="gensmall"><img src="{SEARCH_IMG}" border="0" alt="{L_SEARCH}" align="middle" /></a> </b> <!-- ENDIF --> <!-- IF IS_AUTH_STATS --> ! <b> <a href="{U_PASTATS}" class="gensmall"><img src="{STATS_IMG}" border="0" alt="{L_STATS}" align="middle" /></a> </b> <!-- ENDIF --> <!-- IF IS_AUTH_TOPLIST --> ! <b> <a href="{U_TOPLIST}" class="gensmall"><img src="{TOPLIST_IMG}" border="0" alt="{L_TOPLIST}" align="middle" /></a> </b> <!-- ENDIF --> <!-- IF IS_AUTH_UPLOAD --> ! <b> <a href="{U_UPLOAD}" class="gensmall"><img src="{UPLOAD_IMG}" border="0" alt="{L_UPLOAD}" align="middle" /></a> </b> <!-- ENDIF --> <!-- IF IS_AUTH_VIEWALL --> ! <b> <a href="{U_VIEW_ALL}" class="gensmall"><img src="{VIEW_ALL_IMG}" border="0" alt="{L_VIEW_ALL}" align="middle" /></a> </b> <!-- ENDIF --> + <br /> <!-- IF IS_AUTH_MCP --> ! <b> <a href="{U_MCP}" class="gensmall">{MCP_LINK}</a> </b> <!-- ENDIF --> ! </td> ! </tr> </table> Index: pa_file_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_file_body.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pa_file_body.tpl 9 Jan 2005 21:44:14 -0000 1.4 --- pa_file_body.tpl 11 Apr 2005 17:55:43 -0000 1.5 *************** *** 71,79 **** <td class="row2" valign="middle"><span class="genmed">{L_SIZE}:</span></td> <td class="row1" valign="middle" colspan="2"><span class="genmed">{FILE_SIZE}</span></td> ! </tr> <tr> <td class="row2" valign="middle"><span class="genmed">{L_RATING}:</span></td> <td class="row1" valign="middle" colspan="2"><span class="genmed">{RATING} ({FILE_VOTES} {L_VOTES})</span></td> </tr> <tr> <td class="row2" valign="middle"><span class="genmed">{L_DLS}:</span></td> --- 71,81 ---- <td class="row2" valign="middle"><span class="genmed">{L_SIZE}:</span></td> <td class="row1" valign="middle" colspan="2"><span class="genmed">{FILE_SIZE}</span></td> ! </tr> ! <!-- BEGIN show_ratings --> <tr> <td class="row2" valign="middle"><span class="genmed">{L_RATING}:</span></td> <td class="row1" valign="middle" colspan="2"><span class="genmed">{RATING} ({FILE_VOTES} {L_VOTES})</span></td> </tr> + <!-- END show_ratings --> <tr> <td class="row2" valign="middle"><span class="genmed">{L_DLS}:</span></td> Index: pa_file_add.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_file_add.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pa_file_add.tpl 9 Jan 2005 21:44:14 -0000 1.5 --- pa_file_add.tpl 11 Apr 2005 17:55:43 -0000 1.6 *************** *** 126,138 **** </tr> <!-- ENDIF --> - <!-- - <tr> - <td class="row1"><span class="genmed">{L_FILE_APPROVED}</span><br><span class="gensmall">{L_FILE_APPROVED_INFO}</span></td> - <td class="row2"> - <input type="radio" name="approved" value="1" {APPROVED_CHECKED_YES}>{L_YES} - <input type="radio" name="approved" value="0" {APPROVED_CHECKED_NO}>{L_NO} - </td> - </tr> - --> <tr> <td class="cat" colspan="2" align="center"><span class="cattitle">{L_SCREENSHOT}</span></td> --- 126,129 ---- Index: pa_viewall_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_viewall_body.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pa_viewall_body.tpl 9 Jan 2005 21:44:14 -0000 1.3 --- pa_viewall_body.tpl 11 Apr 2005 17:55:43 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- + <!-- IF FILELIST --> <table width="100%" cellpadding="4" cellspacing="1" class="forumline"> <tr> *************** *** 16,20 **** --- 17,23 ---- <th class="thTop" width="15%">{L_DATE}</th> <th class="thTop" width="10%">{L_DOWNLOADS}</th> + <!-- IF SHOW_RATINGS --> <th class="thTop" width="10%">{L_RATING}</th> + <!-- ENDIF --> <th class="thCornerR" width="3%"> </th> </tr> *************** *** 27,31 **** --- 30,36 ---- <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{file_rows.DATE}</td> <td class="row2" align="center" valign="middle"><span class="postdetails">{file_rows.FILE_DLS}</td> + <!-- IF file_rows.SHOW_RATINGS --> <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{file_rows.RATING}</td> + <!-- ENDIF --> <td class="row2" align="center" valign="middle"> <!-- IF file_rows.HAS_SCREENSHOTS --> *************** *** 50,54 **** --- 55,61 ---- <option {SORT_NAME} value='file_name'>{L_NAME}</option> <option {SORT_TIME} value='file_time'>{L_DATE}</option> + <!-- IF SHOW_RATINGS --> <option {SORT_RATING} value='file_rating'>{L_RATING}</option> + <!-- ENDIF --> <option {SORT_DOWNLOADS} value='file_dls'>{L_DOWNLOADS}</option> <option {SORT_UPDATE_TIME} value='file_update_time'>{L_UPDATE_TIME}</option> *************** *** 72,74 **** --- 79,93 ---- </table> </form> + <!-- ENDIF --> + + <!-- IF NO_FILE --> + <table class="forumline" width="100%" cellspacing="0" cellpadding="4"> + <tr> + <th class="thHead">{L_NO_FILES}</th> + </tr> + <tr> + <td class="row1" align="center" height="30"><span class="genmed">{L_NO_FILES_CAT}</span></td> + </tr> + </table> + <!-- ENDIF --> <!-- INCLUDE pa_footer.tpl --> Index: pa_category_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_category_body.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pa_category_body.tpl 9 Jan 2005 21:44:14 -0000 1.3 --- pa_category_body.tpl 11 Apr 2005 17:55:43 -0000 1.4 *************** *** 46,50 **** --- 46,52 ---- <th class="thTop" width="15%"> {L_DATE} </th> <th class="thTop" width="10%"> {L_DOWNLOADS} </th> + <!-- IF SHOW_RATINGS --> <th class="thTop" width="10%"> {L_RATING} </th> + <!-- ENDIF --> <th class="thCornerR" width="3%"> </th> </tr> *************** *** 56,60 **** --- 58,64 ---- <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{file_rows.DATE}</td> <td class="row2" align="center" valign="middle"><span class="postdetails">{file_rows.FILE_DLS}</td> + <!-- IF file_rows.SHOW_RATINGS --> <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{file_rows.RATING}</td> + <!-- ENDIF --> <td class="row2" align="center" valign="middle"> <!-- IF file_rows.HAS_SCREENSHOTS --> *************** *** 70,75 **** --- 74,81 ---- </tr> <!-- END file_rows --> + </table> <form action="{S_ACTION_SORT}" method="post"> + <table width="100%" cellpadding="4" cellspacing="1" class="forumline"> <input type="hidden" name="action" value="category"> <input type="hidden" name="cat_id" value="{ID}"> *************** *** 80,84 **** --- 86,92 ---- <option {SORT_NAME} value='file_name'>{L_NAME}</option> <option {SORT_TIME} value='file_time'>{L_DATE}</option> + <!-- IF SHOW_RATINGS --> <option {SORT_RATING} value='file_rating'>{L_RATING}</option> + <!-- ENDIF --> <option {SORT_DOWNLOADS} value='file_dls'>{L_DOWNLOADS}</option> <option {SORT_UPDATE_TIME} value='file_update_time'>{L_UPDATE_TIME}</option> *************** *** 93,96 **** --- 101,105 ---- </tr> </table> + <table width="100%" cellspacing="2" border="0" cellpadding="2"> <tr> Index: pa_toplist_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/pa_toplist_body.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pa_toplist_body.tpl 9 Jan 2005 21:44:14 -0000 1.3 --- pa_toplist_body.tpl 11 Apr 2005 17:55:43 -0000 1.4 *************** *** 60,64 **** --- 60,66 ---- <td class="cat" align="center" nowrap="nowrap"><span class="cattitle"> {L_DATE} </span></td> <td class="cat" align="center" nowrap="nowrap"><span class="cattitle"> {L_DOWNLOADS} </span></td> + <!-- IF SHOW_RATINGS --> <td class="cat" align="center" nowrap="nowrap"><span class="cattitle"> {L_RATE} </span></td> + <!-- ENDIF --> </tr> <!-- BEGIN files_row --> *************** *** 70,74 **** --- 72,78 ---- <td class="row2" align="center" valign="middle"><span class="postdetails">{files_row.DATE}</span></td> <td class="row1" align="center" valign="middle"><span class="postdetails">{files_row.DOWNLOADS}</span></td> + <!-- IF files_row.SHOW_RATINGS --> <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{files_row.RATING}</span></td> + <!-- ENDIF --> </tr> <!-- END files_row --> *************** *** 78,80 **** --- 82,94 ---- <!-- ENDIF --> </table> + <!-- IF NO_FILE --> + <table class="forumline" width="100%" cellspacing="0" cellpadding="4"> + <tr> + <th class="thHead">{L_NO_FILES}</th> + </tr> + <tr> + <td class="row1" align="center" height="30"><span class="genmed">{L_NO_FILES_CAT}</span></td> + </tr> + </table> + <!-- ENDIF --> <!-- INCLUDE pa_footer.tpl --> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2005-04-11 17:55:53
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2875/modules/mx_pafiledb/pafiledb/docs Added Files: index.htm install.txt pafiledb_installer.php pafiledb_mysql.sql update.txt update_0.0.8_0.0.9a.txt update_0.0.8_0.0.9b.txt update_008_009d.sql update_009a_009d.sql update_009b_009d.sql update_009d_mx10.sql update_009d_mx201.sql update_to_0.0.9d.txt update_to_0.0.9d_mx_addon_1.0.txt Log Message: finally upgrading this module/mod - merging phpBB mod, mxBB module (2.7.x and 2.8) -.permissions reviewed - pm notification added - and many many minor fixes all over the place --- NEW FILE: update_009b_009d.sql --- 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) ); 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; ALTER TABLE phpbb_pa_cat ADD cat_files MEDIUMINT(8) DEFAULT '-1' NOT NULL AFTER cat_allow_file, ADD cat_last_file_id MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_files, ADD cat_last_file_name VARCHAR(255) NOT NULL AFTER cat_last_file_id, ADD cat_last_file_time INT(50) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_last_file_name; ALTER TABLE phpbb_pa_files ADD file_size INT(20) NOT NULL AFTER file_name, ADD unique_name VARCHAR(255) NOT NULL AFTER file_size, ADD real_name VARCHAR(255) NOT NULL AFTER unique_name, ADD file_dir VARCHAR(255) NOT NULL AFTER real_name, ADD file_broken TINYINT(1) DEFAULT '0' NOT NULL; 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'); --- NEW FILE: update_008_009d.sql --- CREATE TABLE phpbb_pa_download_info ( file_id MEDIUMINT(8) DEFAULT '0' NOT NULL, user_id MEDIUMINT(8) DEFAULT '0' NOT NULL, downloader_ip VARCHAR(8) NOT NULL, downloader_os VARCHAR(8) NOT NULL, downloader_browser VARCHAR(8) NOT NULL, browser_version VARCHAR(8) NOT NULL ); 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) ); 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 '', real_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; CREATE TABLE phpbb_pa_config ( config_name varchar(255) NOT NULL, config_value varchar(255) NOT NULL, PRIMARY KEY (config_name) ); 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'); ALTER TABLE phpbb_pa_cat DROP cat_files. ADD parents_data TEXT NOT NULL AFTER cat_parent, ADD cat_allow_file TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_view TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_read TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_view_file TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_upload TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_download TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_rate TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_email TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_view_comment TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_post_comment TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_edit_comment TINYINT(2) DEFAULT '0' NOT NULL, ADD auth_delete_comment TINYINT(2) DEFAULT '0' NOT NULL, ADD cat_files MEDIUMINT(8) NOT NULL default '-1' AFTER cat_allow_file, ADD cat_last_file_id MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_files, ADD cat_last_file_name VARCHAR(255) NOT NULL AFTER cat_last_file_id, ADD cat_last_file_time INT(50) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_last_file_name, DROP cat_1xid; ALTER TABLE phpbb_pa_files ADD user_id MEDIUMINT(8) DEFAULT '0' NOT NULL AFTER file_id, ADD poster_ip VARCHAR(8) NOT NULL AFTER user_id, ADD file_sshot_link TINYINT(2) DEFAULT '0' NOT NULL AFTER file_ssurl, ADD file_update_time INT(50) NOT NULL AFTER file_time, ADD file_approved TINYINT(2) DEFAULT '0' NOT NULL, ADD file_broken TINYINT(1) DEFAULT '0' NOT NULL, ADD file_size INT(20) NOT NULL AFTER file_name, ADD unique_name VARCHAR(255) NOT NULL AFTER file_size, ADD real_name VARCHAR(255) NOT NULL AFTER unique_name ADD file_dir VARCHAR(255) NOT NULL AFTER real_name, DROP file_rating, DROP file_totalvotes; ALTER TABLE phpbb_pa_votes ADD user_id MEDIUMINT(8) DEFAULT '0' NOT NULL FIRST, ADD rate_point tinyint(3) UNSIGNED NOT NULL AFTER votes_file, ADD voter_os VARCHAR(255) NOT NULL, ADD voter_browser VARCHAR(255) NOT NULL, ADD browser_version VARCHAR(8) NOT NULL; ALTER TABLE phpbb_pa_custom ADD data text NOT NULL, ADD regex VARCHAR(255) NOT NULL, ADD field_order INT(20) NOT NULL, ADD field_type TINYINT(2) NOT NULL; DROP TABLE phpbb_pa_settings; UPDATE phpbb_pa_files SET file_approved = 1, user_id = 2; UPDATE phpbb_pa_cat SET cat_allow_file = 1; DELETE FROM phpbb_pa_votes WHERE rate_point = '' OR rate_point = 0; --- NEW FILE: update_009d_mx10.sql --- ALTER TABLE phpbb_pa_cat ADD auth_edit_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_view_file, ADD auth_delete_file tinyint(1) DEFAULT '0' NOT NULL AFTER auth_edit_file, ADD cat_allow_ratings tinyint(2) NOT NULL default '1' AFTER cat_allow_file, ADD cat_allow_comments tinyint(2) NOT NULL default '1' AFTER cat_allow_ratings; ALTER TABLE phpbb_pa_auth ADD auth_edit_file tinyint(2) DEFAULT '0' NOT NULL AFTER auth_view_file, ADD auth_delete_file tinyint(2) DEFAULT '0' NOT NULL AFTER auth_edit_file; INSERT INTO phpbb_pa_config VALUES ('pm_notify', '0'); --- NEW FILE: update.txt --- if you already have the version 0.0.9d (mxBB addon) you have to run the pafiledb_installer.php Upload all new files, and run the installer from its location at pafiledb/docs/pafiledb_installer.php choose what version top update and you need to chmod the following!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ## Create and CHMOD (0777) THE FOLLOWING DIRECTORIES: ## - pafiledb/uploads/ ## - pafiledb/cache/ ## - pafiledb/cache/templates/subSilver/ ## - pafiledb/cache/templates/subSilver/admin ## - pafiledb/images/screenshots/ clear the directory pafiledb/cache/ from all the files but don't delete the folders in it // Jon --- NEW FILE: install.txt --- ############################################################## ## MOD Title: Download Manager (mxBB pafiledb) integration ## MOD Version: 0.0.9d + mxBB 2.01 ## MOD Original Author: squall < moh...@ya... > (Mohammed Al-Basri) www.mohd.tk ## MJ < mj...@ph... > www.phpbbfm.com ## MOD Current Author: _Haplo < jon...@ho... > www.mx-system.com ## MOD Description: Integration of pafiledb (Database download manager) with phpBB. ## pafiledb use header, footer, session, template, and database system ## of phpbb. ## Only for phpBB 2.0.x+! ## ## Installation Level: (easy) ## Installation Time: 10-15 Minutes ## Files To Edit (10) : ## admin/index.php ## admin/admin_db_utilities.php ## includes/page_header.php, ## language/lang_english/lang_main.php, ## templates/subSilver/admin/page_header.tpl, ## templates/subSilver/overall_header.tpl, ## ## Included Files: ## dload.php, ## admin/admin_*.php ( 8 ) ## language/*/lang_*.php ( 2 ) ## pafiledb/*.*, ## templates/subSilver/pa_*.tpl ( 22 ) ## templates/subSilver/admin/pa_*.tpl ( 23 ) ## templates/subSilver/images/icon_mini_download.gif ## templates/subSilver/images/lang_english/icon_pa_*.gif ( 9 ) ## ## ############################################################## ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ ############################################################## ############################################################## ## Author Note: ## follow all the instruction below first then upload and run from your browser, ## pafiledb/docs/pafiledb_installer.php (choose new installation) and if you have the table already installed, ## you won't need to change anything in them except that you won't need the admin table ## since you are going to use ACP. ## ## Create and CHMOD (0777) THE FOLLOWING DIRECTORIES: ## - pafiledb/uploads/ ## - pafiledb/cache/ ## - pafiledb/cache/templates/subSilver/ ## - pafiledb/cache/templates/subSilver/admin ## - pafiledb/images/screenshots/ ## ## Change History: ## 0.0.9d + mxBB 2.0.1 : ADD/Fixed: ## - bugfixes ## - PM/EMAIL notification done ## - Permissions reviewed and "secured" ## - Comments/ratings may be enabled/disabled ## - Approval level per category ## - ucp/mcp final ## ## 0.0.9d + mxBB 1.0.1-3 : ADD/Fixed: ## - bugfixes ## - need approval/validation on/off ## - validator select: admin/mod ## - PM notify to validator (not finished) ## - ucp: EDIT/DELETE buttons...and added permissions ## - mcp (experimental) ## - comments fix (now delete comments works...not edit) ## - and more ## ## 0.0.9 : ADD/Fixed: ## - THE WHOLE MOD IS RE WRITIEN ## - ADDED ALOT OF FEATURE ## - FIXING ALOT OF SECURITY BUGS ## 0.0.8 : Added/Fixed: ## - Fixed the global varaible problem. (you don't have to set global var to on) ## - Changed the whole coding structure in all file. ## - Comment viewing like the viewtopic. ## - Added the file checker feature (beware if this one or you will end up erasing all file.) ## - Changed some images and included them into templates/*/images/ folder. ## - Main Templates cleaned up, added clickable folder icons. ## - Fixed bug with category sort feature. ## - Added edit download count when editing file. ## - Added Dutch, German and Italian language support . ## ## 0.0.7 : Added/Fixed: ## - Fixed bug with screen shot upload. ## - Fixed bug with templates in ACP. ## - Removed Variable $str found in search.php. ## - Changed directory for images and icons. ## - Changed all url and action to append_sid. ## ## 0.0.6 : Added/Fixed: ## - Backupdb & restore to phpBB forum backup style ## - Changed tables to phpbb style ## - Show screenshots as image instead of link. (you may choose now either links or image). ## - Long Description - Multiple line text area. ## - Replaced pafiledb language with phpbb. ## - Unlimited subCategories. ## - Added Upload Screenshot feature (there is a small bugs on it) ## - Added Disable "View All" link ## - Added Disable Database feature ## - comment feature (only registered users can post) ## - Email is using phpBB class emailer. ## - New File indicator you can now set the number of day to show that the file is new ## - Added toplist file (you can now specify number of file that in toplist. ## - Removed the following bugs: ## * Replaced pafiledb Time Zone with phpbb. ## * Replaced pafiledb Language with phpbb. ## * Email fields can be left blank, but confirmation of email sent is returned. ## * Custom Field data not reading from db ## * Time on posted comment ## * Edit file (ACP), sub-cats & files not showing ## * Backup Database screwed ## * removing some un needed row from setting table like language and style. ## * fixing the problem of jumpmenu fix in pafiledb.php file because file send the $str instead of $lang ## * 'Comment Explain' text missing ## * Title on posted comment ## * max_comment_chars field in _settings table missing ## * Javascript error when posting or previewing comment ## * Email not actually sending to address ??? (Not for me anyway!) ## * Time on file page ## ## 0.0.5 : - Re-packing of all working files ## - Changed paFileDB_installer.php ## ## 0.0.4 : Fixed: ## - {dbname} showing in the email instead of the variable that should replace it. ## - Uploaded file not returning full URL. ## - Replaced pafiledb Time Zone with phpbb. ## - Email fields can be left blank, but confirmation of email sent is returned ## - Fixed sort for viewall.. (sort according to rating not yet due to php version) ## - Custom Field data not reading from db ## - Added support for view online when some one in download page. ## ## 0.0.3 : - Fixed the editing file bug in ACP ## - Fixed the the file in sub category bug. ## - Fixed the uploading file url bug when uploading ## - Changed message after rating or e-mail sending ## - Made copywrite with phpbb copywrite only if you are in download database ## ## 0.0.2 : All templates made to fit phpBB default, clean up of code. ## ## 0.0.1 : First release, I need just to modify the *.tpl file in admin ## section. ## ############################################################## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ COPY ]------------------------------------------ # copy dload.php to root copy admin/*.php to admin/ copy templates/subSilver/*.tpl to templates/subSilver/ copy templates/subSilver/images/*.gif to templates/subSilver/images copy templates/subSilver/images/lang_english*.gif to templates/subSilver/images/lang_english copy templates/subSilver/admin/*.tpl to templates/subSilver/admin/ copy pafiledb/*.* to pafiledb/ copy language/lang_english/* to language/lang_english/* # #-----[ OPEN ]------------------------------------------ # admin/index.php # #-----[ FIND ]------------------------------------------ # // // End functions // ------------- # #-----[ AFTER, ADD ]------------------------------------------ # include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_pafiledb.' . $phpEx); # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "index.$phpEx?pane=right"; break; # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_DOWNLOAD: $location = $lang['Viewing_Download']; $location_url = "../dload.$phpEx"; break; # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "index.$phpEx?pane=right"; break; # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_DOWNLOAD: $location = $lang['Viewing_Download']; $location_url = "../dload.$phpEx"; break; # #-----[ OPEN ]------------------------------------------ # admin/admin_db_utilities.php # #-----[ FIND ]------------------------------------------ # include('./page_footer_admin.'.$phpEx); } $tables = array('auth_access', 'banlist', 'categories'.... # #-----[ FIND IN LINE ]------------------------------------------ # 'forums', 'forum_prune', # #-----[ ADD INTO LINE ]------------------------------------------ # 'pa_cat', 'pa_comments', 'pa_custom', 'pa_customdata', 'pa_files', 'pa_license', 'pa_config', 'pa_votes', 'pa_download_info', 'pa_mirros', # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_header.tpl # #-----[ FIND ]------------------------------------------ # <tr> <td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a> <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a> <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a> </span></td> </tr> # #-----[ AFTER, ADD ]------------------------------------------ # <tr> <td height="25" align="center" nowrap class="mainmenu" valign="top"> <a href="{U_DOWNLOAD}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_download.gif" width="13" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" title="{PRIVATE_MESSAGE_INFO}" hspace="3" align="top" />{L_DOWNLOAD}</a> </td> </tr> # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['FAQ'] = 'FAQ'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['Download'] = 'Download'; # #-----[ FIND ]------------------------------------------ # $lang['Viewing_FAQ'] = 'Viewing FAQ'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['Viewing_Download'] = 'Viewing Download'; #-----[ OPEN ]------------------------------------------ # includes/page_header.php # #-----[ FIND ]------------------------------------------ # 'L_FAQ' => $lang['FAQ'], # #-----[ AFTER, ADD ]------------------------------------------ # 'L_DOWNLOAD' => $lang['Download'], # #-----[ FIND ]------------------------------------------ # 'U_FAQ' => append_sid('faq.'.$phpEx), # #-----[ AFTER, ADD ]------------------------------------------ # 'U_DOWNLOAD' => append_sid('dload.'.$phpEx), # #-----[ OPEN ]------------------------------------------ # viewonline.php # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "faq.$phpEx"; break; # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_DOWNLOAD: $location = $lang['Viewing_Download']; $location_url = "dload.$phpEx"; break; # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # #-----[ SQL ]------------------------------------------ # Log in as admin! run pafiledb/docs/pafiledb_installer.php or pafiledb_mysql.sql # EoM --- NEW FILE: update_009d_mx201.sql --- ALTER TABLE phpbb_pa_cat ADD auth_approval tinyint(1) DEFAULT '0' NOT NULL AFTER auth_delete_comment; ALTER TABLE phpbb_pa_auth ADD auth_approval tinyint(2) DEFAULT '0' NOT NULL AFTER auth_delete_comment, MODIFY auth_edit_file tinyint(2) DEFAULT '0' NOT NULL, MODIFY auth_delete_file tinyint(2) DEFAULT '0' NOT NULL; ALTER TABLE phpbb_kb_config MODIFY config_name VARCHAR(255) NOT NULL default '', MODIFY config_value VARCHAR(255) NOT NULL default '', DROP PRIMARY KEY, ADD PRIMARY KEY (config_name); --- NEW FILE: update_009a_009d.sql --- ALTER TABLE phpbb_pa_download_info CHANGE downloader_borwser downloader_browser VARCHAR(255) NOT NULL; ALTER TABLE phpbb_pa_votes CHANGE voter_borwser voter_browser VARCHAR(255) NOT NULL; 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) ); 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; ALTER TABLE phpbb_pa_cat ADD cat_files MEDIUMINT(8) DEFAULT '-1' NOT NULL AFTER cat_allow_file, ADD cat_last_file_id MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_files, ADD cat_last_file_name VARCHAR(255) NOT NULL AFTER cat_last_file_id, ADD cat_last_file_time INT(50) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_last_file_name; ALTER TABLE phpbb_pa_files ADD file_size INT(20) NOT NULL AFTER file_name, ADD unique_name VARCHAR(255) NOT NULL AFTER file_size, ADD real_name VARCHAR(255) NOT NULL AFTER unique_name ADD file_dir VARCHAR(255) NOT NULL AFTER real_name, ADD file_broken TINYINT(1) DEFAULT '0' NOT NULL; 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'); --- NEW FILE: update_to_0.0.9d.txt --- if you have the version 0.0.9c you don't have to run the pafiledb_installer.php Upload all new files, and run the installer from its location at pafiledb/docs/pafiledb_installer.php choose to update your version don't forget to see the new structure for the folders and you need to chmod the following ## Create and CHMOD (0777) THE FOLLOWING DIRECTORIES: ## - pafiledb/uploads/ ## - pafiledb/cache/ ## - pafiledb/cache/templates/subSilver/ ## - pafiledb/cache/templates/subSilver/admin ## - pafiledb/images/screenshots/ clear the directory pafiledb/cache/ from all the files but don't delete the folders on it --- NEW FILE: update_0.0.8_0.0.9a.txt --- ############################################################## ## MOD Title: pafiledb integration ## MOD Version: 0.0.9a ## MOD Author: squall < moh...@ya... > (Mohammed Al-Basri) www.mohd.tk ## MJ < mj...@ph... > www.phpbbfm.com ## MOD Description: Integration of pafiledb (Database download manager) with phpbb. ## pafiledb use header, footer, session, template, and database system ## of phpbb. ## Only for phpBB 2.0.4! ## ## Installation Level: (easy) ## Installation Time: 10-15 Minutes ## Files To Edit (10) : admin/index.php ## includes/constant.php ## admin/admin_db_utilities.php ## includes/page_header.php, ## language/lang_english/lang_main.php, ## templates/subSilver/admin/page_header.tpl, ## templates/subSilver/overall_header.tpl, ## templates/subSilver/subSilver.cfg ## ## Included Files: dload.php, ## admin/admin_pa_catauth.php ## admin/admin_pa_category.php, ## admin/admin_pa_custom.php, ## admin/admin_pa_file.php, ## admin/admin_pa_license.php, ## admin/admin_pa_settings.php, ## language/*/lang_admin_pafiledb.php ## language/*/lang_pafiledb.php ## pafiledb/*.*, ## templates/subSilver/pa_*.tpl ( 18 ) ## templates/subSilver/admin/pa_*.tpl ( 19 ) ## templates/subSilver/images/icon_mini_download.gif ## templates/subSilver/images/lang_english/icon_pa_*.gif ( 9 ) ## ## ############################################################## ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ ############################################################## ############################################################## ## Author Note: ## follow all the instruction below first then upload and run from your browser, ## pafiledb/docs/pafiledb_installer.php (choose update from 0.0.8) and if you have the table already installed, ## you won't need to change anything in them except that you won't need the admin table ## since you are going to use ACP. ## ## Create and CHMOD (0777) THE FOLLOWING DIRECTORIES: ## - pafiledb/uploads/ ## - pafiledb/cache/ ## - pafiledb/cache/file_size ## - pafiledb/cache/templates/subSilver/ ## - pafiledb/cache/templates/subSilver/admin ## - pafiledb/explain ## ## ## Change History: ## 0.0.9 : ADD/Fixed: ## - THE WHOLE MOD IS RE WRITIEN ## - ADDED ALOT OF FEATURE ## - FIXING ALOT OF SECURITY BUGS ## 0.0.8 : Added/Fixed: ## - Fixed the global varaible problem. (you don't have to set global var to on) ## - Changed the whole coding structure in all file. ## - Comment viewing like the viewtopic. ## - Added the file checker feature (beware if this one or you will end up erasing all file.) ## - Changed some images and included them into templates/*/images/ folder. ## - Main Templates cleaned up, added clickable folder icons. ## - Fixed bug with category sort feature. ## - Added edit download count when editing file. ## - Added Dutch, German and Italian language support . ## ## 0.0.7 : Added/Fixed: ## - Fixed bug with screen shot upload. ## - Fixed bug with templates in ACP. ## - Removed Variable $str found in search.php. ## - Changed directory for images and icons. ## - Changed all url and action to append_sid. ## ## 0.0.6 : Added/Fixed: ## - Backupdb & restore to phpBB forum backup style ## - Changed tables to phpbb style ## - Show screenshots as image instead of link. (you may choose now either links or image). ## - Long Description - Multiple line text area. ## - Replaced pafiledb language with phpbb. ## - Unlimited subCategories. ## - Added Upload Screenshot feature (there is a small bugs on it) ## - Added Disable "View All" link ## - Added Disable Database feature ## - comment feature (only registered users can post) ## - Email is using phpBB class emailer. ## - New File indicator you can now set the number of day to show that the file is new ## - Added toplist file (you can now specify number of file that in toplist. ## - Removed the following bugs: ## * Replaced pafiledb Time Zone with phpbb. ## * Replaced pafiledb Language with phpbb. ## * Email fields can be left blank, but confirmation of email sent is returned. ## * Custom Field data not reading from db ## * Time on posted comment ## * Edit file (ACP), sub-cats & files not showing ## * Backup Database screwed ## * removing some un needed row from setting table like language and style. ## * fixing the problem of jumpmenu fix in pafiledb.php file because file send the $str instead of $lang ## * 'Comment Explain' text missing ## * Title on posted comment ## * max_comment_chars field in _settings table missing ## * Javascript error when posting or previewing comment ## * Email not actually sending to address ??? (Not for me anyway!) ## * Time on file page ## ## 0.0.5 : - Re-packing of all working files ## - Changed paFileDB_installer.php ## ## 0.0.4 : Fixed: ## - {dbname} showing in the email instead of the variable that should replace it. ## - Uploaded file not returning full URL. ## - Replaced pafiledb Time Zone with phpbb. ## - Email fields can be left blank, but confirmation of email sent is returned ## - Fixed sort for viewall.. (sort according to rating not yet due to php version) ## - Custom Field data not reading from db ## - Added support for view online when some one in download page. ## ## 0.0.3 : - Fixed the editing file bug in ACP ## - Fixed the the file in sub category bug. ## - Fixed the uploading file url bug when uploading ## - Changed message after rating or e-mail sending ## - Made copywrite with phpbb copywrite only if you are in download database ## ## 0.0.2 : All templates made to fit phpBB default, clean up of code. ## ## 0.0.1 : First release, I need just to modify the *.tpl file in admin ## section. ## ############################################################## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ COPY ]------------------------------------------ # copy dload.php to root copy admin/*.php to admin/ copy templates/subSilver/*.tpl to templates/subSilver/ copy templates/subSilver/admin/*.tpl to templates/subSilver/admin/ copy pafiledb/*.* to pafiledb/ copy language/lang_english/* to language/lang_english/* # #-----[ SQL ]------------------------------------------ # run pafiledb/docs/pafiledb_installer.php or update.sql # #-----[ OPEN ]------------------------------------------ # includes/constants.php # #-----[ FIND ]------------------------------------------ # define('PA_CATEGORY_TABLE', $table_prefix.'pa_cat'); define('PA_COMMENTS_TABLE', $table_prefix.'pa_comments'); define('PA_CUSTOM_TABLE', $table_prefix.'pa_custom'); define('PA_CUSTOM_DATA_TABLE', $table_prefix.'pa_customdata'); define('PA_FILES_TABLE', $table_prefix.'pa_files'); define('PA_LICENSE_TABLE', $table_prefix.'pa_license'); define('PA_SETTINGS_TABLE', $table_prefix.'pa_settings'); define('PA_VOTES_TABLE', $table_prefix.'pa_votes'); # #-----[ REPLACE, WITH ]------------------------------------------ # //REMOVED # #-----[ OPEN ]------------------------------------------ # admin/index.php # #-----[ FIND ]------------------------------------------ # // // pafiledb // include_once($phpbb_root_path . 'pafiledb/includes/functions.' . $phpEx); $config = pafiledb_config(); include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_pafiledb.' . $phpEx); # #-----[ AFTER, ADD ]------------------------------------------ # // REMOVED # #-----[ OPEN ]------------------------------------------ # admin/admin_db_utilities.php # #-----[ FIND ]------------------------------------------ # include('./page_footer_admin.'.$phpEx); } $tables = array('auth_access', 'banlist', 'categories'.... # #-----[ FIND IN LINE ]------------------------------------------ # 'pa_cat', 'pa_comments', 'pa_custom', 'pa_customdata', 'pa_files', 'pa_license', 'pa_settings', 'pa_votes', # #-----[ REPLACE, WITH ]------------------------------------------ # 'pa_cat', 'pa_comments', 'pa_custom', 'pa_customdata', 'pa_files', 'pa_license', 'pa_config', 'pa_votes', 'pa_download_info' # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_header.tpl # #-----[ FIND ]------------------------------------------ # <script language="JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <SCRIPT LANGUAGE="JavaScript"> <!-- function mpFoto(img){ foto1= new Image(); foto1.src=(img); mpControl(img); } function mpControl(img){ if((foto1.width!=0)&&(foto1.height!=0)){ viewFoto(img); } else{ mpFunc="mpControl('"+img+"')"; intervallo=setTimeout(mpFunc,20); } } function viewFoto(img){ largh=foto1.width+20; altez=foto1.height+20; string="width="+largh+",height="+altez; finestra=window.open(img,"",string); } //--> </script> # #-----[ AFTER, ADD ]------------------------------------------ # <!-- removed --!> # #-----[ OPEN ]------------------------------------------ # includes/page_tail.php # #-----[ FIND ]------------------------------------------ # if ( defined('IN_DOWNLOAD') ) { $template->assign_block_vars("pa_copy", array()); } # #-----[ REPLACE, WITH ]------------------------------------------ # // Removed # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_footer.tpl # #-----[ FIND ]------------------------------------------ # <!-- BEGIN pa_copy --> & <a href="http://www.phparena.net/" target="_phparena" class="copyright">PHP Arena</a> paFileDB 3.1 © 2002, 2003 <!-- END pa_copy --> # #-----[ REPLACE, WITH ]------------------------------------------ # <!-- removed --> # #-----[ OPEN ]------------------------------------------ # templates/subSilver/subSilver.cfg # #-----[ FIND ]------------------------------------------ # $images['pa_search'] = "$current_template_images/{LANG}/icon_pa_search.gif"; $images['pa_stats'] = "$current_template_images/{LANG}/icon_pa_stats.gif"; $images['pa_toplist'] = "$current_template_images/{LANG}/icon_pa_toplist.gif"; $images['pa_download'] = "$current_template_images/icon_pa_download.gif"; $images['pa_rate'] = "$current_template_images/icon_pa_rate.gif"; $images['pa_email'] = "$current_template_images/icon_pa_email.gif"; # #-----[ REPLACE, WITH ]------------------------------------------ # $images['pa_search'] = "$current_template_images/{LANG}/icon_pa_search.gif"; $images['pa_stats'] = "$current_template_images/{LANG}/icon_pa_stats.gif"; $images['pa_toplist'] = "$current_template_images/{LANG}/icon_pa_toplist.gif"; $images['pa_upload'] = "$current_template_images/{LANG}/icon_pa_upload.gif"; $images['pa_viewall'] = "$current_template_images/{LANG}/icon_pa_viewall.gif"; $images['pa_download'] = "$current_template_images/{LANG}/icon_pa_download.gif"; $images['pa_rate'] = "$current_template_images/{LANG}/icon_pa_rate.gif"; $images['pa_email'] = "$current_template_images/{LANG}/icon_pa_email.gif"; $images['pa_comment_post'] = "$current_template_images/{LANG}/icon_pa_post_comment.gif"; $images['pa_file_new'] = "$current_template_images/icon_pa_new.gif"; # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM --- NEW FILE: pafiledb_installer.php --- <?php define( 'IN_PHPBB', true ); define( 'IN_DOWNLOAD', true ); $phpbb_root_path = './../../'; include( $phpbb_root_path . 'extension.inc' ); include( $phpbb_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); init_userprefs( $userdata ); // End session management if ( $userdata['user_level'] != ADMIN ) { message_die( GENERAL_MESSAGE, $lang['Not_admin'] ); } // Lets build a page ... ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"> </style> </head> <body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" width="100%" valign="middle"><span class="maintitle">Installing Download Manager (mxBB PaFileDB) for phpBB2</span></td> </tr> </table></td> </tr> </table> <br clear="all" /> <?php // Here we go include( $phpbb_root_path . 'includes/sql_parse.' . $phpEx ); $available_dbms = array( "mysql" => array( "SCHEMA" => "pafiledb_mysql", "UPDATE008" => "update_008_009d", "UPDATE009A" => "update_009a_009d", "UPDATE009B" => "update_009b_009d", "UPDATE009DMX10" => "update_009d_mx10", "UPDATE009DMX201" => "update_009d_mx201", "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_remarks" ), "mysql4" => array( "SCHEMA" => "pafiledb_mysql", "UPDATE008" => "update_008_009d", "UPDATE009A" => "update_009a_009d", "UPDATE009B" => "update_009b_009d", "UPDATE009DMX10" => "update_009d_mx10", "UPDATE009DMX201" => "update_009d_mx201", "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_remarks" ), "mssql" => array( "SCHEMA" => "pafiledb_mssql", "UPDATE008" => "update_008_009c", "UPDATE009A" => "update_009a_009c", "UPDATE009B" => "update_009b_009c", "UPDATE009DMX10" => "update_009d_mx10", "UPDATE009DMX201" => "update_009d_mx201", "DELIM" => "GO", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ), "mssql-odbc" => array( "SCHEMA" => "pafiledb_mssql", "UPDATE008" => "update_008_009c", "UPDATE009A" => "update_009a_009c", "UPDATE009B" => "update_009b_009c", "UPDATE009DMX10" => "update_009d_mx10", "UPDATE009DMX201" => "update_009d_mx201", "DELIM" => "GO", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ), "postgres" => array( "LABEL" => "PostgreSQL 7.x", "SCHEMA" => "pafiledb_postgres", "UPDATE008" => "update_008_009c", "UPDATE009A" => "update_009a_009c", "UPDATE009B" => "update_009b_009c", "UPDATE009DMX10" => "update_009d_mx10", "UPDATE009DMX201" => "update_009d_mx201", "DELIM" => ";", "DELIM_BASIC" => ";", "COMMENTS" => "remove_comments" ) ); if ( isset( $_REQUEST['action'] ) ) { if ( $_REQUEST['action'] == 'install' ) { $dbms_file = $available_dbms[$dbms]['SCHEMA'] . '.sql'; } elseif ( $_REQUEST['action'] == 'update008' ) { $dbms_file = $available_dbms[$dbms]['UPDATE0008'] . '.sql'; } elseif ( $_REQUEST['action'] == 'update009a' ) { $dbms_file = $available_dbms[$dbms]['UPDATE009A'] . '.sql'; } elseif ( $_REQUEST['action'] == 'update009b' ) { $dbms_file = $available_dbms[$dbms]['UPDATE009B'] . '.sql'; } elseif ( $_REQUEST['action'] == 'update009d_mx10' ) { $dbms_file = $available_dbms[$dbms]['UPDATE009DMX10'] . '.sql'; } elseif ( $_REQUEST['action'] == 'update009d_mx201' ) { $dbms_file = $available_dbms[$dbms]['UPDATE009DMX201'] . '.sql'; } else { die( 'INVALID ACTION' ); } $remove_remarks = $available_dbms[$dbms]['COMMENTS'];; $delimiter = $available_dbms[$dbms]['DELIM']; $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; if ( !( $fp = @fopen( $dbms_file, 'r' ) ) ) { message_die( GENERAL_MESSAGE, "Can't open " . $dbms_file ); } fclose( $fp ); // process db schema & basic $sql_query = @fread( @fopen( $dbms_file, 'r' ), @filesize( $dbms_file ) ); $sql_query = preg_replace( '/phpbb_/', $table_prefix, $sql_query ); $sql_query = $remove_remarks( $sql_query ); $sql_query = split_sql_file( $sql_query, $delimiter ); $sql_count = count( $sql_query ); for( $i = 0; $i < $sql_count; $i++ ) { echo "Running :: " . $sql_query[$i]; @flush(); if ( !( $result = $db->sql_query( $sql_query[$i] ) ) ) { $errored = true; $error = $db->sql_error(); echo " -> <b>FAILED</b> ---> <u>" . $error['message'] . "</u><br /><br />\n\n"; } else { echo " -> <b><span class=\"ok\">COMPLETED</span></b><br /><br />\n\n"; } } $message = ''; if ( $errored ) { $message .= '<br />Some queries failed. Please contact me at <a href="http://www.mx-system.com">www.mx-system.com</a> we may solve your problems...'; } else { $message .= '<br />Pafiledb Tables generated successfully.'; } echo "\n<br />\n<b>COMPLETE!</b><br />\n"; echo $message . "<br />"; echo "<br /><b>NOW DELETE THIS FILE</b><br />\n"; } else { echo '<center> <b><a href="pafiledb_installer.php?action=install">New Installation</a></b><br /> <b><a href="pafiledb_installer.php?action=update008">Update From pafiledb 0.0.8</a></b><br /> <b><a href="pafiledb_installer.php?action=update009a">Update From pafiledb 0.0.9a</a></b><br /> <b><a href="pafiledb_installer.php?action=update009b">Update From pafiledb 0.0.9b</a></b><br /> <b><a href="pafiledb_installer.php?action=update009d_mx10">Update From pafiledb 0.0.9d</a></b> <b><a href="pafiledb_installer.php?action=update009d_mx201">Update From pafiledb 0.0.9d + mxaddon 1.0.3</a></b> </center>'; } echo "</body>"; echo "</html>"; ?> --- NEW FILE: update_0.0.8_0.0.9b.txt --- ############################################################## ## MOD Title: pafiledb integration ## MOD Version: 0.0.9a ## MOD Author: squall < moh...@ya... > (Mohammed Al-Basri) www.mohd.tk ## MJ < mj...@ph... > www.phpbbfm.com ## MOD Description: Integration of pafiledb (Database download manager) with phpbb. ## pafiledb use header, footer, session, template, and database system ## of phpbb. ## Only for phpBB 2.0.4! ## ## Installation Level: (easy) ## Installation Time: 10-15 Minutes ## Files To Edit (10) : admin/index.php ## includes/constant.php ## admin/admin_db_utilities.php ## includes/page_header.php, ## language/lang_english/lang_main.php, ## templates/subSilver/admin/page_header.tpl, ## templates/subSilver/overall_header.tpl, ## templates/subSilver/subSilver.cfg ## ## Included Files: dload.php, ## admin/admin_pa_catauth.php ## admin/admin_pa_category.php, ## admin/admin_pa_custom.php, ## admin/admin_pa_file.php, ## admin/admin_pa_license.php, ## admin/admin_pa_settings.php, ## language/*/lang_admin_pafiledb.php ## language/*/lang_pafiledb.php ## pafiledb/*.*, ## templates/subSilver/pa_*.tpl ( 18 ) ## templates/subSilver/admin/pa_*.tpl ( 19 ) ## templates/subSilver/images/icon_mini_download.gif ## templates/subSilver/images/lang_english/icon_pa_*.gif ( 9 ) ## ## ############################################################## ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ ############################################################## ############################################################## ## Author Note: ## follow all the instruction below first then upload and run from your browser, ## pafiledb/docs/pafiledb_installer.php (choose update from 0.0.8) and if you have the table already installed, ## you won't need to change anything in them except that you won't need the admin table ## since you are going to use ACP. ## ## Create and CHMOD (0777) THE FOLLOWING DIRECTORIES: ## - pafiledb/uploads/ ## - pafiledb/cache/ ## - pafiledb/cache/file_size ## - pafiledb/cache/templates/subSilver/ ## - pafiledb/cache/templates/subSilver/admin ## - pafiledb/explain ## ## ## Change History: ## 0.0.9 : ADD/Fixed: ## - THE WHOLE MOD IS RE WRITIEN ## - ADDED ALOT OF FEATURE ## - FIXING ALOT OF SECURITY BUGS ## 0.0.8 : Added/Fixed: ## - Fixed the global varaible problem. (you don't have to set global var to on) ## - Changed the whole coding structure in all file. ## - Comment viewing like the viewtopic. ## - Added the file checker feature (beware if this one or you will end up erasing all file.) ## - Changed some images and included them into templates/*/images/ folder. ## - Main Templates cleaned up, added clickable folder icons. ## - Fixed bug with category sort feature. ## - Added edit download count when editing file. ## - Added Dutch, German and Italian language support . ## ## 0.0.7 : Added/Fixed: ## - Fixed bug with screen shot upload. ## - Fixed bug with templates in ACP. ## - Removed Variable $str found in search.php. ## - Changed directory for images and icons. ## - Changed all url and action to append_sid. ## ## 0.0.6 : Added/Fixed: ## - Backupdb & restore to phpBB forum backup style ## - Changed tables to phpbb style ## - Show screenshots as image instead of link. (you may choose now either links or image). ## - Long Description - Multiple line text area. ## - Replaced pafiledb language with phpbb. ## - Unlimited subCategories. ## - Added Upload Screenshot feature (there is a small bugs on it) ## - Added Disable "View All" link ## - Added Disable Database feature ## - comment feature (only registered users can post) ## - Email is using phpBB class emailer. ## - New File indicator you can now set the number of day to show that the file is new ## - Added toplist file (you can now specify number of file that in toplist. ## - Removed the following bugs: ## * Replaced pafiledb Time Zone with phpbb. ## * Replaced pafiledb Language with phpbb. ## * Email fields can be left blank, but confirmation of email sent is returned. ## * Custom Field data not reading from db ## * Time on posted comment ## * Edit file (ACP), sub-cats & files not showing ## * Backup Database screwed ## * removing some un needed row from setting table like language and style. ## * fixing the problem of jumpmenu fix in pafiledb.php file because file send the $str instead of $lang ## * 'Comment Explain' text missing ## * Title on posted comment ## * max_comment_chars field in _settings table missing ## * Javascript error when posting or previewing comment ## * Email not actually sending to address ??? (Not for me anyway!) ## * Time on file page ## ## 0.0.5 : - Re-packing of all working files ## - Changed paFileDB_installer.php ## ## 0.0.4 : Fixed: ## - {dbname} showing in the email instead of the variable that should replace it. ## - Uploaded file not returning full URL. ## - Replaced pafiledb Time Zone with phpbb. ## - Email fields can be left blank, but confirmation of email sent is returned ## - Fixed sort for viewall.. (sort according to rating not yet due to php version) ## - Custom Field data not reading from db ## - Added support for view online when some one in download page. ## ## 0.0.3 : - Fixed the editing file bug in ACP ## - Fixed the the file in sub category bug. ## - Fixed the uploading file url bug when uploading ## - Changed message after rating or e-mail sending ## - Made copywrite with phpbb copywrite only if you are in download database ## ## 0.0.2 : All templates made to fit phpBB default, clean up of code. ## ## 0.0.1 : First release, I need just to modify the *.tpl file in admin ## section. ## ############################################################## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ COPY ]------------------------------------------ # copy dload.php to root copy admin/*.php to admin/ copy templates/subSilver/*.tpl to templates/subSilver/ copy templates/subSilver/admin/*.tpl to templates/subSilver/admin/ copy pafiledb/*.* to pafiledb/ copy language/lang_english/* to language/lang_english/* # #-----[ SQL ]------------------------------------------ # run pafiledb/docs/pafiledb_installer.php or update.sql # #-----[ OPEN ]------------------------------------------ # includes/constants.php # #-----[ FIND ]------------------------------------------ # define('PA_CATEGORY_TABLE', $table_prefix.'pa_cat'); define('PA_COMMENTS_TABLE', $table_prefix.'pa_comments'); define('PA_CUSTOM_TABLE', $table_prefix.'pa_custom'); define('PA_CUSTOM_DATA_TABLE', $table_prefix.'pa_customdata'); define('PA_FILES_TABLE', $table_prefix.'pa_files'); define('PA_LICENSE_TABLE', $table_prefix.'pa_license'); define('PA_SETTINGS_TABLE', $table_prefix.'pa_settings'); define('PA_VOTES_TABLE', $table_prefix.'pa_votes'); # #-----[ REPLACE, WITH ]------------------------------------------ # //REMOVED # #-----[ OPEN ]------------------------------------------ # admin/index.php # #-----[ FIND ]------------------------------------------ # // // pafiledb // include_once($phpbb_root_path . 'pafiledb/includes/functions.' . $phpEx); $config = pafiledb_config(); include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_pafiledb.' . $phpEx); # #-----[ REPLACE, WITH ]------------------------------------------ # include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_pafiledb.' . $phpEx); # #-----[ OPEN ]------------------------------------------ # admin/admin_db_utilities.php # #-----[ FIND ]------------------------------------------ # include('./page_footer_admin.'.$phpEx); } $tables = array('auth_access', 'banlist', 'categories'.... # #-----[ FIND IN LINE ]------------------------------------------ # 'pa_cat', 'pa_comments', 'pa_custom', 'pa_customdata', 'pa_files', 'pa_license', 'pa_settings', 'pa_votes', # #-----[ REPLACE, WITH ]------------------------------------------ # 'pa_cat', 'pa_comments', 'pa_custom', 'pa_customdata', 'pa_files', 'pa_license', 'pa_config', 'pa_votes', 'pa_download_info', # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_header.tpl # #-----[ FIND ]------------------------------------------ # <script language="JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <SCRIPT LANGUAGE="JavaScript"> <!-- function mpFoto(img){ foto1= new Image(); foto1.src=(img); mpControl(img); } function mpControl(img){ if((foto1.width!=0)&&(foto1.height!=0)){ viewFoto(img); } else{ mpFunc="mpControl('"+img+"')"; intervallo=setTimeout(mpFunc,20); } } function viewFoto(img){ largh=foto1.width+20; altez=foto1.height+20; string="width="+largh+",height="+altez; finestra=window.open(img,"",string); } //--> </script> # #-----[ AFTER, ADD ]------------------------------------------ # <!-- removed --!> # #-----[ OPEN ]------------------------------------------ # includes/page_tail.php # #-----[ FIND ]------------------------------------------ # if ( defined('IN_DOWNLOAD') ) { $template->assign_block_vars("pa_copy", array()); } # #-----[ REPLACE, WITH ]------------------------------------------ # // Removed # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_footer.tpl # #-----[ FIND ]------------------------------------------ # <!-- BEGIN pa_copy --> & <a href="http://www.phparena.net/" target="_phparena" class="copyright">PHP Arena</a> paFileDB 3.1 © 2002, 2003 <!-- END pa_copy --> # #-----[ REPLACE, WITH ]------------------------------------------ # <!-- removed --> # #-----[ OPEN ]------------------------------------------ # templates/subSilver/subSilver.cfg # #-----[ FIND ]------------------------------------------ # $images['pa_search'] = "$current_template_images/{LANG}/icon_pa_search.gif"; $images['pa_stats'] = "$current_template_images/{LANG}/icon_pa_stats.gif"; $images['pa_toplist'] = "$current_template_images/{LANG}/icon_pa_toplist.gif"; $images['pa_download'] = "$current_template_images/icon_pa_download.gif"; $images['pa_rate'] = "$current_template_images/icon_pa_rate.gif"; $images['pa_email'] = "$current_template_images/icon_pa_email.gif"; # #-----[ REPLACE, WITH ]------------------------------------------ # $images['pa_search'] = "$current_template_images/{LANG}/icon_pa_search.gif"; $images['pa_stats'] = "$current_template_images/{LANG}/icon_pa_stats.gif"; $images['pa_toplist'] = "$current_template_images/{LANG}/icon_pa_toplist.gif"; $images['pa_upload'] = "$current_template_images/{LANG}/icon_pa_upload.gif"; $images['pa_viewall'] = "$current_template_images/{LANG}/icon_pa_viewall.gif"; $images['pa_download'] = "$current_template_images/{LANG}/icon_pa_download.gif"; $images['pa_rate'] = "$current_template_images/{LANG}/icon_pa_rate.gif"; $images['pa_email'] = "$current_template_images/{LANG}/icon_pa_email.gif"; $images['pa_comment_post'] = "$current_template_images/{LANG}/icon_pa_post_comment.gif"; $images['pa_file_new'] = "$current_template_images/icon_pa_new.gif"; # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM --- NEW FILE: pafiledb_mysql.sql --- # 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_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) ) TYPE=MyISAM; # -------------------------------------------------------- INSERT INTO phpbb_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 phpbb_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); 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_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 '0' 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 (grou... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2005-04-11 17:55:52
|
Update of /cvsroot/mxbb/mx_pafiledb/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2875/modules/mx_pafiledb/templates/subSilver/admin Modified Files: pa_admin_field.tpl pa_admin_settings.tpl Log Message: finally upgrading this module/mod - merging phpBB mod, mxBB module (2.7.x and 2.8) -.permissions reviewed - pm notification added - and many many minor fixes all over the place Index: pa_admin_settings.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/admin/pa_admin_settings.tpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pa_admin_settings.tpl 16 Sep 2004 20:04:14 -0000 1.6 --- pa_admin_settings.tpl 11 Apr 2005 17:55:43 -0000 1.7 *************** *** 53,57 **** </tr> <tr> ! <td class="row1"><span class="genmed">{L_DEFAULT_SORT_METHOD}</span></td> <td class="row2"> <select name="sort_method"> --- 53,57 ---- </tr> <tr> ! <td class="row1">{L_DEFAULT_SORT_METHOD}</td> <td class="row2"> <select name="sort_method"> *************** *** 65,69 **** </tr> <tr> ! <td class="row1"><span class="genmed">{L_DEFAULT_SORT_ORDER}</span></td> <td class="row2"> <select name="sort_order"> --- 65,69 ---- </tr> <tr> ! <td class="row1">{L_DEFAULT_SORT_ORDER}</td> <td class="row2"> <select name="sort_order"> *************** *** 174,177 **** --- 174,178 ---- <th colspan="2" class="thHead">{L_VALIDATION_SETTINGS}</th> </tr> + <!-- <tr> <td class="row1">{L_NEED_VALIDATION}</td> *************** *** 191,194 **** --- 192,196 ---- </td> </tr> + --> <tr> <td class="row1">{L_PM_NOTIFY}</td> Index: pa_admin_field.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/templates/subSilver/admin/pa_admin_field.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pa_admin_field.tpl 1 May 2004 23:29:16 -0000 1.2 --- pa_admin_field.tpl 11 Apr 2005 17:55:42 -0000 1.3 *************** *** 7,10 **** --- 7,19 ---- <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> + <th class="thHead">{L_SELECT_TITLE}</b></th> + </tr> + <tr> + <td align="center" class="row1" > + <input class="liteoption" type="submit" value="add" name="mode"> + <input class="liteoption" type="submit" value="edit" name="mode"> + <input class="liteoption" type="submit" value="delete" name="mode"></td> + </tr> + <tr> <th class="thHead">{L_FIELD_TITLE}</b></th> </tr> *************** *** 14,23 **** </tr> <!-- END field_row --> ! <tr> ! <td align="center" class="cat" > ! <input class="liteoption" type="submit" value="add" name="mode"> ! <input class="liteoption" type="submit" value="edit" name="mode"> ! <input class="liteoption" type="submit" value="delete" name="mode"></td> ! </tr> </table> </form> --- 23,27 ---- </tr> <!-- END field_row --> ! </table> </form> |
|
From: Markus P. <mar...@us...> - 2005-04-10 23:30:32
|
Update of /cvsroot/mxbb/core/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4270 Modified Files: mx_poll_ballot.tpl mx_poll_result.tpl Log Message: Removed unnecessary colspan attributes from poll related templates. Index: mx_poll_ballot.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/mx_poll_ballot.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_poll_ballot.tpl 6 Mar 2005 01:10:16 -0000 1.5 --- mx_poll_ballot.tpl 10 Apr 2005 23:30:23 -0000 1.6 *************** *** 1,5 **** <table width="{BLOCK_SIZE}" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> ! <td class="row1" colspan="2"><br clear="all" /> <form method="POST" action="{S_POLL_ACTION}"> <table cellspacing="0" cellpadding="4" border="0" align="center"> --- 1,5 ---- <table width="{BLOCK_SIZE}" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> ! <td class="row1"><br clear="all" /> <form method="POST" action="{S_POLL_ACTION}"> <table cellspacing="0" cellpadding="4" border="0" align="center"> *************** *** 31,33 **** </td> </tr> ! </table> --- 31,33 ---- </td> </tr> ! </table> \ No newline at end of file Index: mx_poll_result.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/mx_poll_result.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_poll_result.tpl 6 Mar 2005 01:10:16 -0000 1.5 --- mx_poll_result.tpl 10 Apr 2005 23:30:23 -0000 1.6 *************** *** 1,40 **** <table width="{BLOCK_SIZE}" cellpadding="4" cellspacing="0" border="0" class="forumline"> ! <tr> ! <td class="row1" colspan="2"><br clear="all" /> ! <table cellspacing="0" cellpadding="4" border="0" align="center"> ! <tr> ! <td colspan="4" align="center"><span class="gen"><b>{POLL_QUESTION}</b></span></td> ! </tr> ! <tr> ! <td align="center"> ! <table cellspacing="0" cellpadding="2" border="0"> ! <!-- BEGIN poll_option --> ! <tr> ! <td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td> ! </tr> ! <tr> ! <td> ! <table cellspacing="0" cellpadding="0" border="0"> ! <tr> ! <td><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}images/vote_lcap.gif" width="4" alt="" height="12" /></td> ! <td><img src="{U_PHPBB_ROOT_PATH}{poll_option.POLL_OPTION_IMG}" width="{poll_option.POLL_OPTION_IMG_WIDTH}" height="12" alt="{poll_option.POLL_OPTION_PERCENT}" /></td> ! <td><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}images/vote_rcap.gif" width="4" alt="" height="12" /></td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <td colspan="3" align="center"><span class="gensmall"> {poll_option.POLL_OPTION_PERCENT} [{poll_option.POLL_OPTION_RESULT}]</span></td> ! </tr> ! <!-- END poll_option --> ! </table> </td> ! </tr> ! <tr> ! <td colspan="4" align="center"><span class="gen"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></span></td> ! </tr> ! </table> ! <br clear="all" /> ! </td> ! </tr> ! </table> --- 1,40 ---- <table width="{BLOCK_SIZE}" cellpadding="4" cellspacing="0" border="0" class="forumline"> ! <tr> ! <td class="row1"><br clear="all" /> ! <table cellspacing="0" cellpadding="4" border="0" align="center"> ! <tr> ! <td align="center"><span class="gen"><b>{POLL_QUESTION}</b></span></td> ! </tr> ! <tr> ! <td align="center"> ! <table cellspacing="0" cellpadding="2" border="0"> ! <!-- BEGIN poll_option --> ! <tr> ! <td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td> ! </tr> ! <tr> ! <td> ! <table cellspacing="0" cellpadding="0" border="0"> ! <tr> ! <td><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}images/vote_lcap.gif" width="4" alt="" height="12" /></td> ! <td><img src="{U_PHPBB_ROOT_PATH}{poll_option.POLL_OPTION_IMG}" width="{poll_option.POLL_OPTION_IMG_WIDTH}" height="12" alt="{poll_option.POLL_OPTION_PERCENT}" /></td> ! <td><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}images/vote_rcap.gif" width="4" alt="" height="12" /></td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <td align="center"><span class="gensmall"> {poll_option.POLL_OPTION_PERCENT} [{poll_option.POLL_OPTION_RESULT}]</span></td> ! </tr> ! <!-- END poll_option --> ! </table> ! </td> ! </tr> ! <tr> ! <td align="center"><span class="gen"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></span></td> ! </tr> ! </table> ! <br clear="all" /> </td> ! </tr> ! </table> \ No newline at end of file |
|
From: Markus P. <mar...@us...> - 2005-04-10 23:02:31
|
Update of /cvsroot/mxbb/core/modules/mx_core_portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20679 Modified Files: mx_poll.php Log Message: Poll Block now based on posting.php and viewtopic.php from phpBB 2.0.13 Also, changed use of mx_block_info (removed) by the new mx_block_message function. Additionally, fixed a couple of bugs. One of them security related (a nice SQL injection vulnerability). Index: mx_poll.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_core_portal/mx_poll.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mx_poll.php 6 Mar 2005 01:10:14 -0000 1.16 --- mx_poll.php 10 Apr 2005 23:02:11 -0000 1.17 *************** *** 18,56 **** * (at your option) any later version. */ - - // Vote in a poll ! $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; ! $topic_id = $block_config[$block_id][Poll_Display]['parameter_value']; ! $forum_lst_poll = $block_config[$block_id][poll_forum]['parameter_value']; $auth_data_sql_poll = get_auth_forum(); ! if ( empty( $forum_lst_poll ) ) { $forum_lst_poll = $auth_data_sql_poll; } ! // mx_message_die(GENERAL_MESSAGE, $forum_lst_poll . '-' .$auth_data_sql_poll); // store current page to generate correct url ! $current_page = intval( isset( $HTTP_GET_VARS['page'] ) ? intval( $HTTP_GET_VARS['page'] ) : intval( $HTTP_POST_VARS['page'] ) ); if ( $topic_id == 0 ) { $sql = "SELECT vote.topic_id ! FROM " . VOTE_DESC_TABLE . " vote, ! " . TOPICS_TABLE . " topic ! WHERE vote.topic_id = topic.topic_id ! AND forum_id IN ( $forum_lst_poll ) ! AND forum_id IN ( $auth_data_sql_poll ) ! AND (vote_start + vote_length > " . time() . " ! OR vote_length = 0) ! ORDER BY vote_start DESC " ; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain vote data', '', __LINE__, __FILE__, $sql ); } ! if ( $poll_info = $db->sql_fetchrow( $result ) ) { $topic_id = $poll_info['topic_id']; --- 18,62 ---- * (at your option) any later version. */ ! // -------------------------------------------------------------------------------- ! // Poll Block - based on posting.php and viewtopic.php from phpBB 2.0.13 (see below) ! // ! // Please, do not reformat the code nor touch indentation. It has been left as ! // close to the original code as possible, intentionally. ;-) ! // -------------------------------------------------------------------------------- + $block_config = read_block_config($block_id); $title = $block_config[$block_id]['block_title']; ! $topic_id = $block_config[$block_id]['Poll_Display']['parameter_value']; ! $forum_lst_poll = $block_config[$block_id]['poll_forum']['parameter_value']; $auth_data_sql_poll = get_auth_forum(); ! if ( empty($forum_lst_poll) ) { $forum_lst_poll = $auth_data_sql_poll; } ! ! // // store current page to generate correct url ! // ! $current_page = $mx_request_vars->request('page', MX_TYPE_INT, 1); if ( $topic_id == 0 ) { $sql = "SELECT vote.topic_id ! FROM " . VOTE_DESC_TABLE . " vote, ! " . TOPICS_TABLE . " topic ! WHERE vote.topic_id = topic.topic_id ! AND forum_id IN ( $forum_lst_poll ) ! AND forum_id IN ( $auth_data_sql_poll ) ! AND (vote_start + vote_length > " . time() . " ! OR vote_length = 0) ! ORDER BY vote_start DESC "; ! if ( !( $result = $db->sql_query($sql) ) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain vote data', '', __LINE__, __FILE__, $sql); } ! if ( $poll_info = $db->sql_fetchrow($result) ) { $topic_id = $poll_info['topic_id']; *************** *** 58,262 **** } - // End Select Poll ! $vote_id_name = 'vote_id_' . $topic_id; ! if ( !empty( $HTTP_POST_VARS[$vote_id_name] ) ) ! { ! $vote_option_id = $HTTP_POST_VARS[$vote_id_name]; ! $sql = "SELECT vd.vote_id ! FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr ! WHERE vd.topic_id = $topic_id ! AND vr.vote_id = vd.vote_id ! AND vr.vote_option_id = $vote_option_id ! GROUP BY vd.vote_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql ); ! } ! if ( $vote_info = $db->sql_fetchrow( $result ) ) { ! $vote_id = $vote_info['vote_id']; ! $sql = "SELECT * ! FROM " . VOTE_USERS_TABLE . " ! WHERE vote_id = $vote_id ! AND vote_user_id = " . $userdata['user_id']; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql ); } ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) { ! $sql = "UPDATE " . VOTE_RESULTS_TABLE . " ! SET vote_result = vote_result + 1 WHERE vote_id = $vote_id ! AND vote_option_id = $vote_option_id"; ! if ( !$db->sql_query( $sql, BEGIN_TRANSACTION ) ) { ! message_die( GENERAL_ERROR, 'Could not update poll result', '', __LINE__, __FILE__, $sql ); } ! $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip) ! VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')"; ! if ( !$db->sql_query( $sql, END_TRANSACTION ) ) { ! message_die( GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql ); ! } ! $message = $lang['Vote_cast']; } else { ! $message = $lang['Already_voted']; } ! } ! else ! { ! $message = $lang['No_vote_option']; ! } ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id ) . '">' ) ); ! $message .= '<br /><br />' . sprintf( $lang['Click_view_voted'], '<a href="' . append_sid( PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id . "&page=$current_page" ) . '">', '</a>' ); ! mx_block_info( GENERAL_MESSAGE, $message ); ! } ! ! // contain a poll? ! $sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result ! FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr ! WHERE vd.topic_id = $topic_id ! AND vr.vote_id = vd.vote_id ! ORDER BY vr.vote_option_id ASC"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; ! return; ! message_die( GENERAL_ERROR, "Could not obtain vote data for this topic", '', __LINE__, __FILE__, $sql ); ! } ! if ( $vote_info = $db->sql_fetchrowset( $result ) ) { ! $db->sql_freeresult( $result ); ! $vote_options = count( $vote_info ); ! ! $vote_id = $vote_info[0]['vote_id']; ! $vote_title = $vote_info[0]['vote_text']; ! $sql = "SELECT vote_id ! FROM " . VOTE_USERS_TABLE . " ! WHERE vote_id = $vote_id ! AND vote_user_id = " . $userdata['user_id']; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! return; ! message_die( GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql ); } ! $user_voted = ( $row = $db->sql_fetchrow( $result ) ) ? true : 0; ! $db->sql_freeresult( $result ); ! // Fix by NPauly ! if ( ( isset( $HTTP_GET_VARS['vote'] ) || isset( $HTTP_POST_VARS['vote'] ) ) || ( !$userdata['session_logged_in'] ) ) ! { ! $view_result = ( ( ( ( isset( $HTTP_GET_VARS['vote'] ) ) ? $HTTP_GET_VARS['vote'] : $HTTP_POST_VARS['vote'] ) == 'viewresult' ) || ( !$userdata['session_logged_in'] ) ) ? true : 0; ! } ! else { ! $view_result = 0; ! } ! $poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? true : 0 ) : 0; ! // Fix by NPauly ! if ( $view_result || $poll_expired || $user_voted ) ! { ! $template->set_filenames( array( 'pollbox' => 'mx_poll_result.tpl' ) ! ); ! $vote_results_sum = 0; ! for( $i = 0; $i < $vote_options; $i++ ) { ! $vote_results_sum += $vote_info[$i]['vote_result']; } ! $vote_graphic = 0; ! $vote_graphic_max = count( $images['voting_graphic'] ); ! for( $i = 0; $i < $vote_options; $i++ ) { ! $vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0; ! // $vote_graphic_length = round($vote_percent * ($block_size - 50) ); ! $vote_graphic_length = is_numeric( $block_size ) ? round( $vote_percent * ( $block_size - 50 ) ) : $vote_percent * 400 ; ! $vote_graphic_img = $images['voting_graphic'][$vote_graphic]; ! $vote_graphic = ( $vote_graphic < $vote_graphic_max - 1 ) ? $vote_graphic + 1 : 0; ! if ( count( $orig_word ) ) { ! $vote_info[$i]['vote_option_text'] = preg_replace( $orig_word, $replacement_word, $vote_info[$i]['vote_option_text'] ); } ! $template->assign_block_vars( "poll_option", array( 'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'], 'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'], ! 'POLL_OPTION_PERCENT' => sprintf( "%.1d%%", ( $vote_percent * 100 ) ), 'POLL_OPTION_IMG' => $vote_graphic_img, ! 'POLL_OPTION_IMG_WIDTH' => $vote_graphic_length ) ); ! } ! $template->assign_vars( array( 'L_TITLE' => $lang['Surveys/Polls'], 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'L_TOTAL_VOTES' => $lang['Total_votes'], ! 'TOTAL_VOTES' => $vote_results_sum ) ! ); ! } ! else ! { ! $template->set_filenames( array( 'pollbox' => 'mx_poll_ballot.tpl' ) ); ! for( $i = 0; $i < $vote_options; $i++ ) { ! if ( count( $orig_word ) ) { ! $vote_info[$i]['vote_option_text'] = preg_replace( $orig_word, $replacement_word, $vote_info[$i]['vote_option_text'] ); ! } ! $template->assign_block_vars( "poll_option", array( 'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'], 'VOTE_ID' => $vote_id_name, ! 'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'] ) ); ! } ! $template->assign_vars( array( 'BLOCK_SIZE' => $block_size , 'L_TITLE' => $lang['Surveys/Polls'], 'L_SUBMIT_VOTE' => $lang['Submit_vote'], 'L_VIEW_RESULTS' => $lang['View_results'], ! 'U_VIEW_RESULTS' => append_sid( PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id . "&page=$current_page" ), ! 'U_URL' => append_sid( PHPBB_URL . "viewtopic.$phpEx?t=$topic_id" ) ) ); ! $s_hidden_fields = '<input type="hidden" name="topic_id" value="' . $topic_id . '"><input type="hidden" name="mode" value="vote">'; ! } ! if ( count( $orig_word ) ) ! { ! $vote_title = preg_replace( $orig_word, $replacement_word, $vote_title ); ! } ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'POLL_QUESTION' => $vote_title, ! 'S_HIDDEN_FIELDS' => ( !empty( $s_hidden_fields ) ) ? $s_hidden_fields : '', ! 'S_POLL_ACTION' => append_sid( PORTAL_URL . "index.$phpEx?" . POST_TOPIC_URL . "=$topic_id&block_id=" . $block_id . "&page=$current_page" ) ) ); ! $template->assign_var_from_handle( 'poll_submit', 'pollbox' ); ! $template->assign_var_from_handle( 'POLL_DISPLAY', 'pollbox' ); ! $template->pparse( 'pollbox' ); } else --- 64,295 ---- } ! // -------------------------------------------------------------------------------- ! // The following code is based on posting.php (around line 453) from phpBB 2.0.13 ! // ! $vote_id_name = 'vote_id_' . $topic_id; ! // ! // Vote in a poll ! // ! if ( !empty($HTTP_POST_VARS[$vote_id_name]) ) { ! $vote_option_id = intval($HTTP_POST_VARS[$vote_id_name]); ! $sql = "SELECT vd.vote_id ! FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr ! WHERE vd.topic_id = $topic_id ! AND vr.vote_id = vd.vote_id ! AND vr.vote_option_id = $vote_option_id ! GROUP BY vd.vote_id"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql); } ! if ( $vote_info = $db->sql_fetchrow($result) ) { ! $vote_id = $vote_info['vote_id']; ! ! $sql = "SELECT * ! FROM " . VOTE_USERS_TABLE . " WHERE vote_id = $vote_id ! AND vote_user_id = " . $userdata['user_id']; ! if ( !($result2 = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql); } ! if ( !($row = $db->sql_fetchrow($result2)) ) { ! $sql = "UPDATE " . VOTE_RESULTS_TABLE . " ! SET vote_result = vote_result + 1 ! WHERE vote_id = $vote_id ! AND vote_option_id = $vote_option_id"; ! if ( !$db->sql_query($sql, BEGIN_TRANSACTION) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not update poll result', '', __LINE__, __FILE__, $sql); ! } ! $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip) ! VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')"; ! if ( !$db->sql_query($sql, END_TRANSACTION) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not insert user_id for poll", '', __LINE__, __FILE__, $sql); ! } ! ! $message = $lang['Vote_cast']; ! } ! else ! { ! $message = $lang['Already_voted']; ! } ! $db->sql_freeresult($result2); } else { ! $message = $lang['No_vote_option']; } ! $db->sql_freeresult($result); ! $template->assign_vars(array( ! 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id) . '">') ); ! $message .= '<br /><br />' . sprintf($lang['Click_view_voted'], '<a href="' . append_sid(PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id . "&page=$current_page") . '">', '</a>'); ! mx_block_message($lang['Surveys/Polls'], $message); ! return; ! } ! // -------------------------------------------------------------------------------- ! // The following code is based on viewtopic.php (around line 674) from phpBB 2.0.13 ! // ! // ! // Does this topic contain a poll? ! // ! //if ( !empty($forum_topic_data['topic_vote']) ) { ! $s_hidden_fields = ''; ! $sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result ! FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr ! WHERE vd.topic_id = $topic_id ! AND vr.vote_id = vd.vote_id ! ORDER BY vr.vote_option_id ASC"; ! if ( !($result = $db->sql_query($sql)) ) { ! $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; ! return; //message_die(GENERAL_ERROR, "Could not obtain vote data for this topic", '', __LINE__, __FILE__, $sql); } ! if ( $vote_info = $db->sql_fetchrowset($result) ) { ! $db->sql_freeresult($result); ! $vote_options = count($vote_info); ! $vote_id = $vote_info[0]['vote_id']; ! $vote_title = $vote_info[0]['vote_text']; ! $sql = "SELECT vote_id ! FROM " . VOTE_USERS_TABLE . " ! WHERE vote_id = $vote_id ! AND vote_user_id = " . $userdata['user_id']; ! if ( !($result = $db->sql_query($sql)) ) ! { ! return; //message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql); ! } ! $user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0; ! $db->sql_freeresult($result); ! ! if ( ( isset($HTTP_GET_VARS['vote']) || isset($HTTP_POST_VARS['vote']) ) || ( !$userdata['session_logged_in'] ) ) { ! $view_result = ( ( ( ( isset($HTTP_GET_VARS['vote']) ) ? $HTTP_GET_VARS['vote'] : $HTTP_POST_VARS['vote'] ) == 'viewresult' ) || ( !$userdata['session_logged_in'] ) ) ? TRUE : 0; ! } ! else ! { ! $view_result = 0; } ! $poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0; ! if ( $user_voted || $view_result || $poll_expired ) { ! $template->set_filenames(array( ! 'pollbox' => 'mx_poll_result.tpl') ! ); ! $vote_results_sum = 0; ! for($i = 0; $i < $vote_options; $i++) { ! $vote_results_sum += $vote_info[$i]['vote_result']; } ! $vote_graphic = 0; ! $vote_graphic_max = count($images['voting_graphic']); ! ! for($i = 0; $i < $vote_options; $i++) ! { ! $vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0; ! $vote_graphic_length = is_numeric($block_size) ? round($vote_percent * ( $block_size - 50 )) : $vote_percent * 400; ! ! $vote_graphic_img = $images['voting_graphic'][$vote_graphic]; ! $vote_graphic = ($vote_graphic < $vote_graphic_max - 1) ? $vote_graphic + 1 : 0; ! ! if ( count($orig_word) ) ! { ! $vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']); ! } ! ! $template->assign_block_vars('poll_option', array( ! 'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'], 'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'], ! 'POLL_OPTION_PERCENT' => sprintf('%.1d%%', ( $vote_percent * 100 )), ! 'POLL_OPTION_IMG' => $vote_graphic_img, ! 'POLL_OPTION_IMG_WIDTH' => $vote_graphic_length) ); ! } ! $template->assign_vars(array( ! 'L_TITLE' => $lang['Surveys/Polls'], 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'L_TOTAL_VOTES' => $lang['Total_votes'], ! 'TOTAL_VOTES' => $vote_results_sum) ); ! } ! else { ! $template->set_filenames(array( ! 'pollbox' => 'mx_poll_ballot.tpl') ! ); ! ! for($i = 0; $i < $vote_options; $i++) { ! if ( count($orig_word) ) ! { ! $vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']); ! } ! $template->assign_block_vars("poll_option", array( 'VOTE_ID' => $vote_id_name, ! 'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'], ! 'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text']) ); ! } ! $template->assign_vars(array( ! 'BLOCK_SIZE' => $block_size, 'L_TITLE' => $lang['Surveys/Polls'], 'L_SUBMIT_VOTE' => $lang['Submit_vote'], 'L_VIEW_RESULTS' => $lang['View_results'], ! 'U_VIEW_RESULTS' => append_sid(PORTAL_URL . "index.$phpEx?" . "vote=viewresult&block_id=" . $block_id . "&page=$current_page"), ! 'U_URL' => append_sid(PHPBB_URL . "viewtopic.$phpEx?t=$topic_id")) ); ! $s_hidden_fields = '<input type="hidden" name="topic_id" value="' . $topic_id . '" /><input type="hidden" name="mode" value="vote" />'; ! } ! if ( count($orig_word) ) ! { ! $vote_title = preg_replace($orig_word, $replacement_word, $vote_title); ! } ! $s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'POLL_QUESTION' => $vote_title, ! 'S_HIDDEN_FIELDS' => ( !empty($s_hidden_fields) ? $s_hidden_fields : '' ), ! 'S_POLL_ACTION' => append_sid(PORTAL_URL . "index.$phpEx?" . POST_TOPIC_URL . "=$topic_id&block_id=" . $block_id . "&page=$current_page")) ); ! $template->pparse('pollbox'); ! } } else *************** *** 264,267 **** $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; ! } ?> \ No newline at end of file --- 297,301 ---- $block_rows[$block]['show_title'] = 0; $block_rows[$block]['show_block'] = 0; ! } ! ?> \ No newline at end of file |
|
From: Markus P. <mar...@us...> - 2005-04-10 20:40:50
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1769 Modified Files: mx_functions_phpbb.php Log Message: Removed mx_block_info function. This was only used by mx_poll.php. Added mx_block_message, which is basically a simple version of a mx_message_die kind of function. It allows to send a message without header/footer, which might break page layout. Usefull to send message from blocks, etc. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_functions_phpbb.php 21 Mar 2005 20:59:33 -0000 1.3 --- mx_functions_phpbb.php 10 Apr 2005 20:40:42 -0000 1.4 *************** *** 28,32 **** * - mx_setup_style (from functions.php) * - mx_message_die (from functions.php) ! * - mx_block_info (another message_die clone, from functions.php) * - mx_redirect (from functions_post.php) */ --- 28,32 ---- * - mx_setup_style (from functions.php) * - mx_message_die (from functions.php) ! * - mx_block_message (a message_die kind of function for blocks) * - mx_redirect (from functions_post.php) */ *************** *** 438,593 **** } ! function mx_block_info( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) { ! global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header; ! global $userdata, $user_ip, $session_length; ! global $starttime; ! ! $sql_store = $sql; ! // Get SQL error if we are debugging. Do this as soon as possible to prevent ! // subsequent queries from overwriting the status of sql_error() ! if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) ! { ! $sql_error = $db->sql_error(); ! ! $debug_text = ''; ! ! if ( $sql_error['message'] != '' ) ! { ! $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message']; ! } ! ! if ( $sql_store != '' ) ! { ! $debug_text .= "<br /><br />$sql_store"; ! } ! ! if ( $err_line != '' && $err_file != '' ) ! { ! $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file; ! } ! } ! ! if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) ! { ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! init_userprefs( $userdata ); ! } ! // If the header hasn't been output then do it ! if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) ! { ! if ( empty( $lang ) ) ! { ! if ( !empty( $board_config['default_lang'] ) ) ! { ! include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); ! } ! else ! { ! include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); ! } ! } ! ! if ( empty( $template ) ) ! { ! $template = new mx_Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); ! } ! if ( empty( $theme ) ) ! { ! $theme = setup_style( $board_config['default_style'] ); ! } ! // Load the Page Header ! if ( !defined( 'IN_ADMIN' ) ) ! { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! } ! else ! { ! include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); ! } ! } ! ! switch ( $msg_code ) ! { ! case GENERAL_MESSAGE: ! if ( $msg_title == '' ) ! { ! $msg_title = $lang['Information']; ! } ! break; ! ! case CRITICAL_MESSAGE: ! if ( $msg_title == '' ) ! { ! $msg_title = $lang['Critical_Information']; ! } ! break; ! ! case GENERAL_ERROR: ! if ( $msg_text == '' ) ! { ! $msg_text = $lang['An_error_occured']; ! } ! ! if ( $msg_title == '' ) ! { ! $msg_title = $lang['General_Error']; ! } ! break; ! ! case CRITICAL_ERROR: ! // Critical errors mean we cannot rely on _ANY_ DB information being ! // available so we're going to dump out a simple echo'd statement ! include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); ! ! if ( $msg_text == '' ) ! { ! $msg_text = $lang['A_critical_error']; ! } ! ! if ( $msg_title == '' ) ! { ! $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>'; ! } ! break; ! } ! // Add on DEBUG info if we've enabled debug mode and this is an error. This ! // prevents debug info being output for general messages should DEBUG be ! // set TRUE by accident (preventing confusion for the end user!) ! if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) ! { ! if ( $debug_text != '' ) ! { ! $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text; ! } ! } ! ! if ( $msg_code != CRITICAL_ERROR ) ! { ! if ( !empty( $lang[$msg_text] ) ) ! { ! $msg_text = $lang[$msg_text]; ! } ! ! if ( !defined( 'IN_ADMIN' ) ) ! { ! $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) ! ); ! } ! else ! { ! $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) ! ); ! } ! $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, ! 'MESSAGE_TEXT' => $msg_text ) ! ); ! $template->pparse( 'message_body' ); ! } ! else ! { ! echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; ! } } --- 438,458 ---- } ! // ! // mx_block_message is basically a simple version of a mx_message_die kind of function. ! // It allows to send a message without header/footer, which might break page layout. ! // Usefull to send message from blocks, etc. ! // ! function mx_block_message($title, $message) { ! global $template; ! $template->set_filenames(array( ! 'message_body' => 'message_body.tpl') ! ); ! $template->assign_vars(array( ! 'MESSAGE_TITLE' => $title, ! 'MESSAGE_TEXT' => $message ! )); ! $template->pparse('message_body'); } |
|
From: Markus P. <mar...@us...> - 2005-04-10 13:16:03
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv786 Modified Files: mx_functions.php Log Message: Fixed mx_request_vars class: fix MX_TYPE_NO_SQL condition and replace its name with MX_TYPE_SQL_QUOTED, which makes more sense. Thanks jaime ;-) Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mx_functions.php 3 Apr 2005 14:30:26 -0000 1.32 --- mx_functions.php 10 Apr 2005 13:15:27 -0000 1.33 *************** *** 1129,1133 **** define('MX_TYPE_NO_TAGS' , 8); // Be sure we get a request var of type STRING (strip_tags + htmlspecialchars). define('MX_TYPE_NO_STRIP' , 16); // By default strings are slash stripped, this flag avoids this. ! define('MX_TYPE_NO_SQL' , 32); // Be sure we get a request var of type STRING, safe for SQL statements (single quotes escaped) define('MX_TYPE_POST_VARS' , 64); // Read a POST variable. define('MX_TYPE_GET_VARS' , 128); // Read a GET variable. --- 1129,1133 ---- define('MX_TYPE_NO_TAGS' , 8); // Be sure we get a request var of type STRING (strip_tags + htmlspecialchars). define('MX_TYPE_NO_STRIP' , 16); // By default strings are slash stripped, this flag avoids this. ! define('MX_TYPE_SQL_QUOTED' , 32); // Be sure we get a request var of type STRING, safe for SQL statements (single quotes escaped) define('MX_TYPE_POST_VARS' , 64); // Read a POST variable. define('MX_TYPE_GET_VARS' , 128); // Read a GET variable. *************** *** 1138,1142 **** // More than one flag can specified by OR'ing the $type argument. Examples: // For instance, we could use ( MX_TYPE_POST_VARS | MX_TYPE_GET_VARS ), see method request(). ! // or we could use ( MX_TYPE_NO_TAGS | MX_TYPE_NO_SQL ). // However, MX_TYPE_NO_HTML and MX_TYPE_NO_TAGS can't be specified at a time (defaults to MX_TYPE_NO_TAGS which is more restritive). // Also, MX_TYPE_INT and MX_TYPE_FLOAT ignore flags MX_TYPE_NO_* --- 1138,1142 ---- // More than one flag can specified by OR'ing the $type argument. Examples: // For instance, we could use ( MX_TYPE_POST_VARS | MX_TYPE_GET_VARS ), see method request(). ! // or we could use ( MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED ). // However, MX_TYPE_NO_HTML and MX_TYPE_NO_TAGS can't be specified at a time (defaults to MX_TYPE_NO_TAGS which is more restritive). // Also, MX_TYPE_INT and MX_TYPE_FLOAT ignore flags MX_TYPE_NO_* *************** *** 1255,1259 **** } } ! if( !($type & MX_TYPE_NO_SQL) ) { if( is_array($val) ) --- 1255,1259 ---- } } ! if( $type & MX_TYPE_SQL_QUOTED ) { if( is_array($val) ) |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:46:29
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4883/modules/mx_kb Modified Files: install.txt Added Files: KnowledgeBase.pak Log Message: dev work is kept up in the dev forums... --- NEW FILE: KnowledgeBase.pak --- module=+:41=+:Knowledge Base=+:modules/mx_kb/=+:Knowledge Base module=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:41=+:42=+:KB=+:Knowledge Base Module=+:kb.php=+:modules/mx_kb/admin/kb_config.php parameter=+:42=+:79=+:kb_type_select=+:Text=+:array('init'=>'1')=+: option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - KB=+:Demo block=+:42=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:41=+:96=+:Article_reader=+:Block to display articles only. No category navigation. To be used with newssuite.=+:kb_article_reader.php=+:modules/mx_kb/admin/kb_config.php parameter=+:96=+:302=+:default_article_id=+:Text=+:1=+: option=+:0=+:0=+:0=+:endoflist=+: parameter=+:96=+:301=+:kb_type_select=+:Text=+:array('init'=>'1')=+: option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - Article_reader=+:Demo block=+:96=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 Index: install.txt =================================================================== RCS file: /cvsroot/mxbb/mx_kb/install.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.txt 9 Apr 2005 21:41:28 -0000 1.1 --- install.txt 9 Apr 2005 21:46:20 -0000 1.2 *************** *** 178,182 **** ## 3) Prepare the database by running the included install/upgrade-*.php file. ## - use install_kb_tables.php for a fresh installation, ! ## and upgrade_kb_tables.php if upgrading (even if from original kb 0.76 - works! ) ## 4) Delete install/upgrade files!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ## --- 178,182 ---- ## 3) Prepare the database by running the included install/upgrade-*.php file. ## - use install_kb_tables.php for a fresh installation, ! ## and upgrade_kb_tables.php if upgrading (even if from original kb 0.76 - supported! ) ## 4) Delete install/upgrade files!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ## |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:40
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/includes Modified Files: functions_kb.php functions_kb_mx.php kb_article.php kb_cat.php kb_constants.php kb_defs.php kb_footer.php kb_moderator.php kb_pages.php kb_post.php kb_stats.php Log Message: dev work is kept up in the dev forums... Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_stats.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_stats.php 2 Apr 2005 20:37:03 -0000 1.7 --- kb_stats.php 9 Apr 2005 21:41:28 -0000 1.8 *************** *** 29,39 **** // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); // End of auth check // ! $kb_quick_nav = get_kb_cat_list( '', 1, true, true ); if ( !$is_block ) --- 29,39 ---- // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); // End of auth check // ! $kb_quick_nav = get_kb_cat_list( 'auth_view', 0, 0, true, $kb_is_auth_all ); if ( !$is_block ) *************** *** 75,79 **** ) ); ! $total_articles = get_kb_stats( $stats, '1', 'articlerow', $start, $kb_config['art_pagination'], $kb_is_auth ); // Stats pagination is inactivated for now ;) --- 75,79 ---- ) ); ! $total_articles = get_kb_stats( $stats, '1', 'articlerow', $start, $kb_config['art_pagination'], $kb_is_auth_all ); // Stats pagination is inactivated for now ;) Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_post.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** kb_post.php 2 Apr 2005 20:37:03 -0000 1.8 --- kb_post.php 9 Apr 2005 21:41:28 -0000 1.9 *************** *** 39,44 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $category_id = $row['article_category_id']; } --- 39,44 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $category_id = $kb_row['article_category_id']; } *************** *** 162,170 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $old_approve = $row['approved']; ! $old_topic_id = $row['topic_id']; ! $old_category_id = $row['article_category_id']; $error_msg = ''; --- 162,170 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $old_approve = $kb_row['approved']; ! $old_topic_id = $kb_row['topic_id']; ! $old_category_id = $kb_row['article_category_id']; $error_msg = ''; *************** *** 214,217 **** --- 214,228 ---- mx_remove_search_post( $article_id, 'kb' ); + // Update kb_row + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE article_id = $article_id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + $kb_row = $db->sql_fetchrow( $result ); + break; *************** *** 242,246 **** } ! // Get old data first $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " --- 253,257 ---- } ! // Update kb_row $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " *************** *** 251,256 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $article_id = $row['article_id']; break; --- 262,267 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $article_id = $kb_row['article_id']; break; *************** *** 260,264 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata, $kb_post_mode); // Compose post header --- 271,275 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata, $kb_post_mode); // Compose post header *************** *** 284,291 **** $kb_custom_field->file_update_data( $article_id ); if ( $approve == 1 ) { - kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'] ); mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); --- 295,303 ---- $kb_custom_field->file_update_data( $article_id ); + $kb_notify_info = $kb_post_mode == 'add' ? 'new' : 'edited'; + kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], $kb_notify_info ); if ( $approve == 1 ) { mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); *************** *** 348,361 **** } ! $row = $db->sql_fetchrow( $result ); } ! $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $row['article_title']; ! $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $row['article_description']; ! $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $row['article_body']; ! $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $row['article_type']; ! $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $row['bbcode_uid']; ! $username = ( isset( $HTTP_POST_VARS['username'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['username'] ) ) ) : $row['username']; if ( $preview ) --- 360,373 ---- } ! $kb_row = $db->sql_fetchrow( $result ); } ! $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $kb_row['article_title']; ! $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $kb_row['article_description']; ! $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $kb_row['article_body']; ! $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $kb_row['article_type']; ! $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $kb_row['bbcode_uid']; ! $username = ( isset( $HTTP_POST_VARS['username'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['username'] ) ) ) : $kb_row['username']; if ( $preview ) *************** *** 588,593 **** get_kb_type_list( $type_id ); ! $template->assign_block_vars( 'switch_edit', array( ! 'CAT_LIST' => get_kb_cat_list( $category_id, 1, true ) ! ) ); ?> \ No newline at end of file --- 600,608 ---- get_kb_type_list( $type_id ); ! if ( $kb_post_mode == 'edit' ) ! { ! $template->assign_block_vars( 'switch_edit', array( ! 'CAT_LIST' => get_kb_cat_list( 'auth_edit', $category_id, $category_id, true ) ! ) ); ! } ?> \ No newline at end of file Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_moderator.php 2 Apr 2005 20:37:03 -0000 1.9 --- kb_moderator.php 9 Apr 2005 21:41:28 -0000 1.10 *************** *** 81,85 **** } ! $row = $db->sql_fetchrow( $results ); $topic_sql = ''; --- 81,85 ---- } ! $kb_row = $db->sql_fetchrow( $results ); $topic_sql = ''; *************** *** 88,92 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 88,92 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 99,103 **** if ( $kb_config['use_comments'] ) { ! if ( !$row['topic_id'] ) { // Post --- 99,103 ---- if ( $kb_config['use_comments'] ) { ! if ( !$kb_row['topic_id'] ) { // Post *************** *** 116,124 **** } ! $article_category_id = $row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'] ); ! mx_add_search_words( 'single', $article_id, stripslashes( $row['article_body'] ), stripslashes( $row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start" ) ) . '">', '</a>' ) ; --- 116,124 ---- } ! $article_category_id = $kb_row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); ! mx_add_search_words( 'single', $article_id, stripslashes( $kb_row['article_body'] ), stripslashes( $kb_row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start" ) ) . '">', '</a>' ) ; *************** *** 146,152 **** } ! if ( $row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $row['article_category_id']; } --- 146,152 ---- } ! if ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $kb_row['article_category_id']; } *************** *** 196,204 **** $count_sql = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $row['posts'] . " ! WHERE user_id = " . $row['poster_id']; } $db->sql_freeresult( $result ); --- 196,204 ---- $count_sql = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $kb_row['posts'] . " ! WHERE user_id = " . $kb_row['poster_id']; } $db->sql_freeresult( $result ); *************** *** 225,231 **** $forum_id = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $row['forum_id']; } $db->sql_freeresult( $result ); --- 225,231 ---- $forum_id = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $kb_row['forum_id']; } $db->sql_freeresult( $result ); *************** *** 242,249 **** $ii = 0; $post_id_sql = ''; ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id']; $ii++; } --- 242,249 ---- $ii = 0; $post_id_sql = ''; ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $kb_row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $kb_row['post_id']; $ii++; } Index: kb_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_defs.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_defs.php 28 Mar 2005 20:22:47 -0000 1.3 --- kb_defs.php 9 Apr 2005 21:41:28 -0000 1.4 *************** *** 19,23 **** * (at your option) any later version. */ ! // ---------------------------------------------------------------------START // This file defines specific constants for the module --- 19,28 ---- * (at your option) any later version. */ ! ! /** ! * THIS FILE IS USED ONLY WITHIN MXBB PORTAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! * If this MOD is used for phpBB alone, do not bother with this code ;) ! */ ! // ---------------------------------------------------------------------START // This file defines specific constants for the module Index: kb_pages.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_pages.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_pages.php 28 Mar 2005 20:22:47 -0000 1.3 --- kb_pages.php 9 Apr 2005 21:41:28 -0000 1.4 *************** *** 18,133 **** */ ! // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... ! // What it does? ! // Well if given a direct kb article link, it finds on what portal page the kb block is located. ! // Since we can have different kb blocks on different portal pages displaying different kb categories/articles, this check is needed ;) ! // Oh, do not blame markus for this code ;) ! if ( empty( $_SESSION['kb_setup'] ) ) ! { ! $news_setup = array(); ! $sql = "SELECT col.page_id, blk.block_id, sys.parameter_value, fnc.function_file ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . COLUMN_TABLE . " col, ! " . BLOCK_TABLE . " blk, ! " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . FUNCTION_TABLE . " fnc, ! " . PARAMETER_TABLE . " par ! WHERE col.column_id = bct.column_id ! AND blk.function_id = fnc.function_id ! AND par.function_id = fnc.function_id ! AND blk.block_id = bct.block_id ! AND blk.block_id = sys.block_id ! AND par.parameter_name = 'kb_type_select' ! ORDER BY page_id, block_id"; ! if ( !$kb_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql ); } ! ! while ( $kb_rows = $db->sql_fetchrow( $kb_result ) ) { ! $page_id = $kb_rows['page_id']; ! $block_id = $kb_rows['block_id']; ! ! $kb_select_par = $kb_rows['parameter_value']; ! ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $kb_select_par; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! $kb_config['news_mode_operate'] = true; ! ! if ( is_array($kb_type_select_data) ) ! { ! $news_setup[$page_id] = $kb_type_select_data; ! $news_mode[$page_id] = $kb_rows['function_file']; ! } ! } ! $page_to_kb = array(); ! while ( list( $page_idd, $news_setup_roww ) = each( $news_setup ) ) { ! while ( list( $cat_idd, $news_forum_roww ) = each( $news_setup_roww ) ) { ! if ( $news_forum_roww['forum_news'] == 1 ) { ! $page_to_kb[$cat_idd] = ( empty( $page_to_kb[$cat_idd] ) || $news_mode[$page_idd] == 'kb_article_reader.php' ) ? $page_idd : $page_to_kb[$cat_idd]; } } ! } - - $_SESSION['kb_setup'] = $page_to_kb; - } - - // Start initial var setup - - $cat_id = ''; - - if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) - { - $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); - } - else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) - { - - $sql = ''; - $article_id = 0; ! $article_id = intval( $HTTP_GET_VARS['k'] ); ! $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = $article_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "no info - error", '', __LINE__, __FILE__, $sql ); } ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) { ! //mx_message_die( GENERAL_MESSAGE, 'article_not_exist' ); } - $cat_id = $row['article_category_id']; - - } - - if ( !empty($cat_id) ) - { - $kb_pages = $_SESSION['kb_setup'][$cat_id]; - $kb_error = false; - } - else - { - $kb_error = true; } - - // -------------------------------------------------------------------------------- - // That's all Folks! - // -------------------------------------------------------------------------------- - ?> \ No newline at end of file --- 18,191 ---- */ ! /** ! * THIS FILE IS USED ONLY WITHIN MXBB PORTAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! * If this MOD is used for phpBB alone, do not bother with this code ;) ! */ ! ! if ( MXBB_27x ) ! { ! $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE function_file = 'kb.php' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query Activity Mod module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $function_id = $row['function_id']; ! ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE function_id = '$function_id' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query kb.php module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $search_item = $row['block_id']; ! // Generate page_blocks data ! $sql = "SELECT pag.page_id ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . PAGE_TABLE . " pag, ! " . COLUMN_TABLE . " col ! WHERE pag.page_id = col.page_id ! AND bct.column_id = col.column_id ! AND bct.block_id = '" . $search_item . "' ! ORDER BY pag.page_id"; ! if ( !$p_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql ); } ! ! $p_row = $db->sql_fetchrow( $p_result ); ! $return_key = $p_row['page_id']; ! ! if ( !empty( $return_key ) ) { ! $kb_pages = $return_key; ! $kb_error = false; ! } ! else ! { ! $kb_error = true; } ! // Start initial var setup ! ! $cat_id = $article_id = ''; ! if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { ! $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); ! } ! else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) ! { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval( $HTTP_GET_VARS['k'] ) : intval( $HTTP_POST_VARS['k'] ); ! } ! } ! else ! { ! // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... ! // What it does? ! // Well if given a direct kb article link, it finds on what portal page the kb block is located. ! // Since we can have different kb blocks on different portal pages displaying different kb categories/articles, this check is needed ;) ! // Oh, do not blame markus for this code ;) ! ! if ( empty( $_SESSION['kb_setup'] ) ) ! { ! $news_setup = array(); ! ! $sql = "SELECT col.page_id, blk.block_id, sys.parameter_value, fnc.function_file ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . COLUMN_TABLE . " col, ! " . BLOCK_TABLE . " blk, ! " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . FUNCTION_TABLE . " fnc, ! " . PARAMETER_TABLE . " par ! WHERE col.column_id = bct.column_id ! AND blk.function_id = fnc.function_id ! AND par.function_id = fnc.function_id ! AND blk.block_id = bct.block_id ! AND blk.block_id = sys.block_id ! AND par.parameter_name = 'kb_type_select' ! ORDER BY page_id, block_id"; ! ! if ( !$kb_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql ); ! } ! ! while ( $kb_rows = $db->sql_fetchrow( $kb_result ) ) ! { ! $page_id = $kb_rows['page_id']; ! $block_id = $kb_rows['block_id']; ! ! $kb_select_par = $kb_rows['parameter_value']; ! ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $kb_select_par; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! $kb_config['news_mode_operate'] = true; ! ! if ( is_array($kb_type_select_data) ) ! { ! $news_setup[$page_id] = $kb_type_select_data; ! $news_mode[$page_id] = $kb_rows['function_file']; ! } ! ! } ! ! $page_to_kb = array(); ! while ( list( $page_idd, $news_setup_roww ) = each( $news_setup ) ) ! { ! while ( list( $cat_idd, $news_forum_roww ) = each( $news_setup_roww ) ) { ! if ( $news_forum_roww['forum_news'] == 1 ) ! { ! $page_to_kb[$cat_idd] = ( empty( $page_to_kb[$cat_idd] ) || $news_mode[$page_idd] == 'kb_article_reader.php' ) ? $page_idd : $page_to_kb[$cat_idd]; ! } } + } ! ! $_SESSION['kb_setup'] = $page_to_kb; } ! // Start initial var setup ! $cat_id = $article_id = $sql = ''; ! if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { ! $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); } ! else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval( $HTTP_GET_VARS['k'] ) : intval( $HTTP_POST_VARS['k'] ); ! ! $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = $article_id"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "no info - error", '', __LINE__, __FILE__, $sql ); ! } ! ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) ! { ! //mx_message_die( GENERAL_MESSAGE, 'article_not_exist' ); ! } ! $cat_id = $row['article_category_id']; ! } ! ! if ( !empty($cat_id) ) ! { ! $kb_pages = $_SESSION['kb_setup'][$cat_id]; ! $kb_error = false; ! } ! else ! { ! $kb_error = true; } } ?> \ No newline at end of file Index: functions_kb_mx.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb_mx.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_kb_mx.php 2 Apr 2005 20:37:02 -0000 1.2 --- functions_kb_mx.php 9 Apr 2005 21:41:28 -0000 1.3 *************** *** 415,417 **** --- 415,469 ---- } } + + if ( !function_exists(mx_do_install_upgrade) ) + { + // Generating output + + function mx_do_install_upgrade( $sql = '', $main_install = false ) + { + global $table_prefix, $mx_table_prefix, $userdata, $phpEx, $template, $lang, $db, $board_config, $HTTP_POST_VARS; + + $inst_error = false; + $n = 0; + $message = "<b>This is the result list of the SQL queries needed for the install/upgrade</b><br /><br />"; + + while ( $sql[$n] ) + { + if ( !$result = $db->sql_query( $sql[$n] ) ) + { + $message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; + $inst_error = true; + } + else + { + $message .= '<b><font color=#0000fF>[Added/Updated]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; + } + $n++; + } + $message .= '<br /> If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules'; + + if ( $main_install ) + { + if ( !$inst_error ) + { + $message .= '-> no db errors :-)<br /><br /><b>Portal installed successfully! </b><hr><br /><br />'; + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + else + { + $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + } + return $message; + } + } ?> \ No newline at end of file Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** functions_kb.php 5 Apr 2005 20:52:30 -0000 1.28 --- functions_kb.php 9 Apr 2005 21:41:28 -0000 1.29 *************** *** 552,562 **** // email admin ! function kb_notify( $action, $message, $to_id, $from_id ) { global $lang, $board_config, $kb_config, $db, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata; if ( $action == 2 ) // Mail { ! $email_subject = $lang['KB_title'] . ' - ' . $lang['KB_notify_subject']; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; --- 552,581 ---- // email admin ! function kb_notify( $action, $message, $to_id, $from_id, $info = 'new' ) { global $lang, $board_config, $kb_config, $db, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata; + switch ( $info ) + { + case 'new': + $subject_tmp = $lang['KB_notify_subject_new']; + break; + + case 'edited': + $subject_tmp = $lang['KB_notify_subject_edited']; + break; + + case 'approved': + $subject_tmp = $lang['KB_notify_subject_approved']; + break; + + case 'unapproved': + $subject_tmp = $lang['KB_notify_subject_unapproved']; + break; + } + if ( $action == 2 ) // Mail { ! $email_subject = $lang['KB_title'] . ' - ' . $subject_tmp; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; *************** *** 566,570 **** else if ( $action == 1 ) // PM { ! $email_subject = $lang['KB_title'] . ' - ' . $lang['KB_notify_subject']; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; --- 585,589 ---- else if ( $action == 1 ) // PM { ! $email_subject = $lang['KB_title'] . ' - ' . $subject_tmp; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; *************** *** 596,599 **** --- 615,624 ---- $attach_sig = $userdata['user_attachsig']; + // Why send PM to yourself??? + if ( $to_id == $from_id ) + { + return; + } + //get to users info $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active *************** *** 850,864 **** } while ( $category = $db->sql_fetchrow( $result ) ) { - // Start auth check - // - $kb_is_cat_auth = array(); - $kb_is_cat_auth = kb_auth(AUTH_ALL, $category['category_id'], $userdata); - - // End of auth check - // - // Get number of articles in cat - newssuite addon $sql_num = "SELECT count(article_id) AS total --- 875,888 ---- } + // Start auth check + // + + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check while ( $category = $db->sql_fetchrow( $result ) ) { // Get number of articles in cat - newssuite addon $sql_num = "SELECT count(article_id) AS total *************** *** 893,897 **** $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_cat_auth['auth_view']) { $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category, --- 917,921 ---- $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_auth_all[$category_id]['auth_view']) { $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category, *************** *** 902,906 **** } ! $kb_quick_nav = get_kb_cat_list( '', 1, true, true ); return $template; --- 926,930 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', 0, 0, true, $kb_is_auth_all ); return $template; *************** *** 909,913 **** // get sub categories for articles ! function get_kb_cat_subs( $parent ) { global $db, $template, $phpbb_root_path, $mx_root_path, $module_root_path, $phpEx, $is_block, $page_id, $kb_config; --- 933,937 ---- // get sub categories for articles ! function get_kb_cat_subs( $parent, $kb_is_auth_all = false ) { global $db, $template, $phpbb_root_path, $mx_root_path, $module_root_path, $phpEx, $is_block, $page_id, $kb_config; *************** *** 927,937 **** } if ( $category2 = $db->sql_fetchrow( $result2 ) ) { - // fix for 0.76 if ( $category2['category_name'] != '' ) { // Newssuite operating mode ! if ( ns_auth_cat( $category2['category_id'] ) ) { $template->assign_block_vars( 'switch_sub_cats', array() ); --- 951,971 ---- } + if ( !$kb_is_auth_all ) + { + // Start auth check + // + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check + // + } + if ( $category2 = $db->sql_fetchrow( $result2 ) ) { if ( $category2['category_name'] != '' ) { // Newssuite operating mode ! if ( ns_auth_cat( $category2['category_id'] ) && $kb_is_auth_all[$category2['category_id']]['auth_view'] ) { $template->assign_block_vars( 'switch_sub_cats', array() ); *************** *** 939,942 **** --- 973,977 ---- } } + while ( $category = $db->sql_fetchrow( $result ) ) { *************** *** 971,976 **** $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) ) { $template->assign_block_vars( 'switch_sub_cats.catrow', array( 'CATEGORY' => $category, --- 1006,1012 ---- $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; + // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_auth_all[$category_id]['auth_view'] ) { $template->assign_block_vars( 'switch_sub_cats.catrow', array( 'CATEGORY' => $category, *************** *** 1057,1061 **** } ! function get_kb_cat_subs_list( $parent, $select = 1, $selected = false, $indent ) { global $db; --- 1093,1097 ---- } ! function get_kb_cat_subs_list( $auth_type, $parent, $select = 1, $selected = false, $is_admin = false, $kb_is_auth_all, $indent ) { global $db; *************** *** 1083,1088 **** while ( $category2 = $db->sql_fetchrow( $result ) ) ! { ! if ( $parent == $category2[$idfield] && $selected ) { $status = 'selected'; --- 1119,1124 ---- while ( $category2 = $db->sql_fetchrow( $result ) ) ! { ! if ( $select == $category2[$idfield] && $selected ) { $status = 'selected'; *************** *** 1092,1098 **** $status = ''; } ! $catlist .= "<option value=\"$category2[$idfield]\" $status>" . $indent . '--»'. $category2[$namefield] . "</option>\n"; ! $temp = $indent . ' '; ! $catlist .= get_kb_cat_subs_list( $category2[$idfield], $select, $selected, $temp ); } --- 1128,1138 ---- $status = ''; } ! ! if ( ( ns_auth_cat( $category2[$idfield] ) && $kb_is_auth_all[$category2[$idfield]][$auth_type] ) || $is_admin) ! { ! $catlist .= "<option value=\"$category2[$idfield]\" $status>" . $indent . '--»'. $category2[$namefield] . "</option>\n"; ! $temp = $indent . ' '; ! $catlist .= get_kb_cat_subs_list( $auth_type, $category2[$idfield], $select, $selected, $is_admin, $kb_is_auth_all, $temp ); ! } } *************** *** 1102,1106 **** // get category list for adding and editing articles ! function get_kb_cat_list( $id = 0, $select = 1, $selected = false, $is_admin = false ) { global $db, $userdata; --- 1142,1146 ---- // get category list for adding and editing articles ! function get_kb_cat_list( $auth_type, $id = 0, $select = 1, $selected = false, $kb_is_auth_all = false, $is_admin = false ) { global $db, $userdata; *************** *** 1125,1141 **** } - // Start auth check - // - $kb_is_auth = array(); - $kb_is_auth = kb_auth(AUTH_ALL, $id, $userdata, $cat_result); - - // End of auth check - // - $catlist = ""; while ( $category = $db->sql_fetchrow( $cat_result ) ) { ! if ( $id == $category[$idfield] && $selected) { $status = 'selected'; --- 1165,1185 ---- } $catlist = ""; + + if ( !$kb_is_auth_all ) + { + // Start auth check + // + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check + // + } while ( $category = $db->sql_fetchrow( $cat_result ) ) { ! ! if ( $select == $category[$idfield] && $selected) { $status = 'selected'; *************** *** 1146,1154 **** } ! if ( $kb_is_auth['auth_post'] || $is_admin) { $catlist .= "<option value=\"$category[$idfield]\" $status>" . $category[$namefield] . "</option>\n"; ! $catlist .= get_kb_cat_subs_list( $category[$idfield], $select, $selected, ' ' ); } } --- 1190,1198 ---- } ! if ( ( ns_auth_cat( $category[$idfield] ) && $kb_is_auth_all[$category[$idfield]][$auth_type] ) || $is_admin) { $catlist .= "<option value=\"$category[$idfield]\" $status>" . $category[$namefield] . "</option>\n"; ! $catlist .= get_kb_cat_subs_list( $auth_type, $category[$idfield], $select, $selected, $is_admin, $kb_is_auth_all, ' ' ); } } *************** *** 1283,1288 **** $smilies_on = 1 ) { ! global $db, $board_config, $user_ip, $kb_config, $lang, $userdata; // initialise some variables $topic_vote = 0; $poll_title = ''; --- 1327,1333 ---- $smilies_on = 1 ) { ! global $db, $phpbb_root_path, $phpEx, $board_config, $user_ip, $kb_config, $lang, $userdata; // initialise some variables + $topic_vote = 0; $poll_title = ''; *************** *** 1445,1449 **** if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); } else --- 1490,1494 ---- if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); } else *************** *** 1487,1521 **** } - // MX add-on - // Check if user $user_id belongs to group $group_id - // ...function based on original function written by AbelaJohnB :-) - function is_group_member( $group_id = '', $user_id = '' ) - { - global $db; - global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; - - if ( $user_id == '' || $group_id == '' ) - { - message_die( GENERAL_ERROR, "no valid function call, is_group_member...", '', '', '', '' ); - } - // Check if user is member of the proper group.. - $sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE group_id='" . $group_id . "' AND user_id='" . $user_id . "' LIMIT 1"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); - } - - if ( $db->sql_numrows( $result ) == 0 ) - { - $is_member = false; - } - else - { - $is_member = true; - } - - return $is_member; - } // Extract all post in the comments topic --- 1532,1535 ---- *************** *** 1642,1651 **** if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' ) { ! $user_sig = smilies_pass( $user_sig ); } if ( $postrow[$i]['enable_smilies'] ) { ! $message = smilies_pass( $message ); } } --- 1656,1665 ---- if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' ) { ! $user_sig = mx_smilies_pass( $user_sig ); } if ( $postrow[$i]['enable_smilies'] ) { ! $message = mx_smilies_pass( $message ); } } *************** *** 1689,1693 **** if ( empty( $row ) || empty( $userdata ) ) { ! die('kb_get_data - empty pars'); } --- 1703,1707 ---- if ( empty( $row ) || empty( $userdata ) ) { ! die('kb_get_data - empty pars' ); } Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_article.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** kb_article.php 2 Apr 2005 20:37:03 -0000 1.21 --- kb_article.php 9 Apr 2005 21:41:28 -0000 1.22 *************** *** 37,44 **** } ! $row = $db->sql_fetchrow( $result ); ! if ( count($row) > 0 ) { ! $article_title = $row['article_title'] ; // // Define censored word matches --- 37,45 ---- } ! $kb_row = $db->sql_fetchrow( $result ); ! ! if ( count($kb_row) > 0 ) { ! $article_title = $kb_row['article_title'] ; // // Define censored word matches *************** *** 49,60 **** obtain_word_list($orig_word, $replacement_word); ! $approved = $row['approved']; ! $article_category_id = $row['article_category_id']; // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, $article_category_id, $userdata); // End of auth check --- 50,63 ---- obtain_word_list($orig_word, $replacement_word); ! $approved = $kb_row['approved']; ! $article_category_id = $kb_row['article_category_id']; // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); ! $kb_is_auth = $kb_is_auth_all[$article_category_id]; ! // End of auth check *************** *** 76,80 **** } ! $kb_quick_nav = get_kb_cat_list( $article_category_id, 1, true, true ); $category = get_kb_cat( $article_category_id ); --- 79,83 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', $article_category_id, $article_category_id, true, $kb_is_auth_all ); $category = get_kb_cat( $article_category_id ); *************** *** 84,96 **** $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! $date = create_date( $board_config['default_dateformat'], $row['article_date'], $board_config['board_timezone'] ); // author information ! $author_id = $row['article_author_id']; if ( $author_id == -1 ) { ! $author_kb_art = ( $row['username'] == '' ) ? $lang['Guest'] : $row['username']; } else --- 87,99 ---- $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! $date = create_date( $board_config['default_dateformat'], $kb_row['article_date'], $board_config['board_timezone'] ); // author information ! $author_id = $kb_row['article_author_id']; if ( $author_id == -1 ) { ! $author_kb_art = ( $kb_row['username'] == '' ) ? $lang['Guest'] : $kb_row['username']; } else *************** *** 101,120 **** } ! $art_pages = explode( '[page]', stripslashes( $row['article_body'] ) ); $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = $row['article_description'] ; $article = article_formatting( $article ); ! $type_id = $row['article_type']; $type = get_kb_type( $type_id ); ! $topic_id = $row['topic_id']; ! $new_views = $row['views'] + 1; $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; ! if ( $row['article_rating'] == 0 || $row['article_totalvotes'] == 0 ) { $rating = 0; --- 104,123 ---- } ! $art_pages = explode( '[page]', stripslashes( $kb_row['article_body'] ) ); $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = $kb_row['article_description'] ; $article = article_formatting( $article ); ! $type_id = $kb_row['article_type']; $type = get_kb_type( $type_id ); ! $topic_id = $kb_row['topic_id']; ! $new_views = $kb_row['views'] + 1; $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; ! if ( $kb_row['article_rating'] == 0 || $kb_row['article_totalvotes'] == 0 ) { $rating = 0; *************** *** 125,130 **** else { ! $rating = round( $row['article_rating'] / $row['article_totalvotes'], 2 ); ! $rating_votes = $row['article_totalvotes']; $rating_message = $rating . '/10, ' . $rating_votes . ' ' . $lang['Votes'] ; $rate_message = '<b>' . $lang['Votes_label'] . '</b> ' . $rating_message; --- 128,133 ---- else { ! $rating = round( $kb_row['article_rating'] / $kb_row['article_totalvotes'], 2 ); ! $rating_votes = $kb_row['article_totalvotes']; $rating_message = $rating . '/10, ' . $rating_votes . ' ' . $lang['Votes'] ; $rate_message = '<b>' . $lang['Votes_label'] . '</b> ' . $rating_message; *************** *** 147,150 **** --- 150,154 ---- // + $original_highlight = ''; $highlight_match = $highlight = ''; if (isset($HTTP_GET_VARS['highlight'])) *************** *** 152,155 **** --- 156,160 ---- // Split words and phrases + $original_highlight = '&highlight='.trim(htmlspecialchars($HTTP_GET_VARS['highlight'])); $words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight']))); *************** *** 174,178 **** // Parse message ! $bbcode_uid = $row['bbcode_uid']; if ( $bbcode_on ) --- 179,183 ---- // Parse message ! $bbcode_uid = $kb_row['bbcode_uid']; if ( $bbcode_on ) *************** *** 238,244 **** if ( $print_version ) { ! $gen_simple_header = TRUE; } ! if ( !$is_block) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); --- 243,251 ---- if ( $print_version ) { ! $gen_simple_header = TRUE; ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! ! if ( !$is_block && !$print_version) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); *************** *** 299,305 **** { $kb_comment = array(); ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 306,312 ---- { $kb_comment = array(); ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 310,314 **** $kb_update_message = $message_temp['update_message']; ! $topic_id_tmp = $row['topic_id']; // // Check if this topic exists. It could have been deleted by accident ;) If so recreate it! --- 317,321 ---- $kb_update_message = $message_temp['update_message']; ! $topic_id_tmp = $kb_row['topic_id']; // // Check if this topic exists. It could have been deleted by accident ;) If so recreate it! *************** *** 513,521 **** if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; --- 520,528 ---- if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag . $original_highlight ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag . $original_highlight, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; *************** *** 562,570 **** if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; --- 569,577 ---- if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag . $original_highlight) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag . $original_highlight, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; Index: kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_cat.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kb_cat.php 2 Apr 2005 20:37:03 -0000 1.14 --- kb_cat.php 9 Apr 2005 21:41:28 -0000 1.15 *************** *** 38,43 **** // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, $category_id, $userdata); // End of auth check --- 38,44 ---- // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); ! $kb_is_auth = $kb_is_auth_all[$category_id]; // End of auth check *************** *** 60,64 **** } ! $kb_quick_nav = get_kb_cat_list( $category_id, 1, true, true ); if ( !$kb_is_auth['auth_view'] ) --- 61,65 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', $category_id, $category_id, true, $kb_is_auth_all ); if ( !$kb_is_auth['auth_view'] ) *************** *** 87,90 **** --- 88,93 ---- } + // load header + include ( $module_root_path . "includes/kb_header." . $phpEx ); $kb_news_sort_par = $kb_config['news_sort_par']; *************** *** 113,118 **** break; } - // load header - include ( $module_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_cat_body.tpl' ) --- 116,119 ---- *************** *** 128,132 **** { // get sub-cats ! get_kb_cat_subs( $category_id ); $path_kb = ' '; --- 129,133 ---- { // get sub-cats ! get_kb_cat_subs( $category_id, $kb_is_auth_all ); $path_kb = ' '; |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:37
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb Modified Files: db_install.php db_uninstall.php db_upgrade.php kb.php kb_article_reader.php kb_search.php Added Files: install.txt install_kb_tables.php upgrade_kb_tables.php Removed Files: KnowledgeBase (core 27x).pak Kopia av KnowledgeBase (core 28).pak Log Message: dev work is kept up in the dev forums... Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** kb.php 5 Apr 2005 20:52:30 -0000 1.17 --- kb.php 9 Apr 2005 21:41:28 -0000 1.18 *************** *** 20,143 **** * (at your option) any later version. */ ! // MX ! if ( !function_exists( 'read_block_config' ) ) { ! if ( MXBB_27x ) ! { ! mx_message_die(GENERAL_MESSAGE, 'This module does not support standalone usage. In the adminCP, add the kb block to a portal page'); ! } define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); // End session management ! ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); ! } ! ! if ( isset( $HTTP_GET_VARS['print'] ) ) ! { ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) ! { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'KB' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Could not query Smartor_Album module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; ! } ! $is_block = false; ! } ! else { ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); ! } ! if ( isset( $HTTP_POST_VARS['stats'] ) || isset( $HTTP_GET_VARS['stats'] ) ) ! { ! $stats = ( isset( $HTTP_POST_VARS['stats'] ) ) ? $HTTP_POST_VARS['stats'] : $HTTP_GET_VARS['stats']; ! $stats = htmlspecialchars( $stats ); ! } ! ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/kb_pages.' . $phpEx ); ! $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! $url = ''; ! if ( !$article_id ) ! { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=cat&cat=' . $cat_id; ! } ! else if ( $cat_id != '' && $article_id != '' ) ! { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=article&k=' . $article_id; ! } ! if ( !empty( $url ) && !$kb_error ) { ! if ( !empty( $db ) ) { ! $db->sql_close(); ! } ! ! if ( @preg_match( '/Microsoft|WebSTAR|Xitami/', getenv( 'SERVER_SOFTWARE' ) ) ) { ! header( 'Refresh: 0; URL=' . $url ); ! echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . "\n" . '<html><head>' . "\n" . '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' . "\n" . '<meta http-equiv="refresh" content="0; url=' . $url . '">' . "\n" . '<title>Redirect</title>' . "\n" . '<script language="javascript" type="text/javascript">' . "\n" . '<!--' . "\n" . 'if( document.images ) {' . "\n" . "\t" . 'parent.location.replace("' . $url . '");' . "\n" . '} else {' . "\n" . "\t" . 'parent.location.href = "' . $url . '";' . "\n" . '}' . "\n" . '// -->' . "\n" . '</script>' . "\n" . '</head>' . "\n" . '<body>' . "\n" . '<div align="center">If your browser does not support meta redirection please click ' . '<a href="' . $url . '">HERE</a> to be redirected</div>' . "\n" . '</body></html>'; ! exit; } - @header( 'Location: ' . $url ); - } - else - { - die('no article, no redirect'); } } ! } ! else ! { ! // Read block Configuration ! $block_config = read_block_config( $block_id ); ! $title = !empty( $block_config[$block_id]['block_title'] ) ? $block_config[$block_id]['block_title'] : $lang['KB_title']; ! $desc = $block_config[$block_id]['block_desc']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! ! $is_block = true; ! global $images; } ! define('MXBB_MODULE', true); ! define('MXBB_27x', true); ! ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $block_config[$block_id][kb_type_select]['parameter_value']; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // Instanciate custom fields --- 20,156 ---- * (at your option) any later version. */ ! ! // Switch for making this run as a phpBB MOD or mxBB module ! ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { ! define( 'MXBB_MODULE', false ); ! define( 'IN_PHPBB', true ); define( 'IN_PORTAL', true ); ! ! // When run as a phpBB mod these paths are identical ;) ! $phpbb_root_path = $module_root_path = $mx_root_path = './'; ! ! include( $phpbb_root_path . 'extension.inc' ); ! include( $phpbb_root_path . 'common.' . $phpEx ); ! ! define( 'PAGE_KB', -500 ); // If this id generates a conflict with other mods, change it ;) // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_KB ); ! init_userprefs( $userdata ); // End session management ! ! include( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! } ! else // --------------------------------------------------------------------------------- mxBB Module MODE ! { ! define( 'MXBB_MODULE', true ); ! ! if ( !function_exists( 'read_block_config' ) ) { ! define( 'IN_PORTAL', true ); ! $mx_root_path = './../../'; ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! // End session management ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! if ( !isset( $HTTP_GET_VARS['print'] ) ) { ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/kb_pages.' . $phpEx ); ! ! $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! ! $url = ''; ! if ( empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=cat&cat=' . $cat_id; ! } ! else if ( !empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=article&k=' . $article_id; ! } ! ! if ( !empty( $url ) && !$kb_error ) ! { ! if ( !empty( $db ) ) ! { ! $db->sql_close(); ! } ! ! if ( @preg_match( '/Microsoft|WebSTAR|Xitami/', getenv( 'SERVER_SOFTWARE' ) ) ) ! { ! header( 'Refresh: 0; URL=' . $url ); ! echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . "\n" . '<html><head>' . "\n" . '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' . "\n" . '<meta http-equiv="refresh" content="0; url=' . $url . '">' . "\n" . '<title>Redirect</title>' . "\n" . '<script language="javascript" type="text/javascript">' . "\n" . '<!--' . "\n" . 'if( document.images ) {' . "\n" . "\t" . 'parent.location.replace("' . $url . '");' . "\n" . '} else {' . "\n" . "\t" . 'parent.location.href = "' . $url . '";' . "\n" . '}' . "\n" . '// -->' . "\n" . '</script>' . "\n" . '</head>' . "\n" . '<body>' . "\n" . '<div align="center">If your browser does not support meta redirection please click ' . '<a href="' . $url . '">HERE</a> to be redirected</div>' . "\n" . '</body></html>'; ! exit; ! } ! @header( 'Location: ' . $url ); ! } ! else ! { ! if ( MXBB_27x ) ! { ! mx_message_die(GENERAL_MESSAGE, 'This module does not support standalone usage. In the adminCP, add the kb block to a portal page.'); ! } ! else ! { ! die('no article, no redirect'); ! } } } } ! else ! { ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! ! // Read block Configuration ! ! $block_config = read_block_config( $block_id ); ! $title = !empty( $block_config[$block_id]['block_title'] ) ? $block_config[$block_id]['block_title'] : $lang['KB_title']; ! $desc = $block_config[$block_id]['block_desc']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! $is_block = true; ! global $images; ! } ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $block_config[$block_id][kb_type_select]['parameter_value']; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } ! // ------------------------------------------------------------------------------------------------------------------------- ! // ------------------------------------------------------------------------------------------------------------------------- ! // ------------------------------------------------------------------------------------------------------------------------- ! // Start KB SCRIPT // Instanciate custom fields *************** *** 179,186 **** else { ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $config_name = $row['config_name']; ! $config_value = $row['config_value']; $kb_config[$config_name] = $config_value; } --- 192,199 ---- else { ! while ( $kb_config_row = $db->sql_fetchrow( $result ) ) { ! $config_name = $kb_config_row['config_name']; ! $config_value = $kb_config_row['config_value']; $kb_config[$config_name] = $config_value; } *************** *** 207,233 **** } ! // Newssuite operation mode? ! //------------------------------------------------------------------------- ! $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); ! ! $kb_config['news_operate_mode'] = ''; ! for( $blockk = 0; $blockk < $total_blockk; $blockk++ ) { ! if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'kb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) ! { ! $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; ! // Extract 'what posts to view info', the cool Array ;) ! $news_type_select_data = array(); ! $news_type_select_temp = $newssuite_select_par; ! $news_type_select_temp = stripslashes( $news_type_select_temp ); ! $news_type_select_data = eval( "return " . $news_type_select_temp . ";" ); ! $kb_config['news_operate_mode'] = true; ! } ! else { ! $kb_config['news_operate_mode'] = ''; ! } ! } ! // ------------------------------------------------------------------------- $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; --- 220,249 ---- } ! if ( MXBB_MODULE ) { ! // Newssuite operation mode? ! //------------------------------------------------------------------------- ! $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); ! ! $kb_config['news_operate_mode'] = ''; ! for( $blockk = 0; $blockk < $total_blockk; $blockk++ ) { ! if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'kb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) ! { ! $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; ! // Extract 'what posts to view info', the cool Array ;) ! $news_type_select_data = array(); ! $news_type_select_temp = $newssuite_select_par; ! $news_type_select_temp = stripslashes( $news_type_select_temp ); ! $news_type_select_data = eval( "return " . $news_type_select_temp . ";" ); ! $kb_config['news_operate_mode'] = true; ! } ! else ! { ! $kb_config['news_operate_mode'] = ''; ! } ! } ! // ------------------------------------------------------------------------- ! } $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; *************** *** 238,242 **** { $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars( $mode ); } --- 254,258 ---- { $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = ( htmlspecialchars( $mode ) != 'cat' || intval ($HTTP_GET_VARS['cat'] ) != 0 ) ? htmlspecialchars( $mode ) : ''; } *************** *** 305,309 **** // load footer ! include ( $module_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block && !$print_version ) --- 321,328 ---- // load footer ! if ( !$print_version ) ! { ! include ( $module_root_path . "includes/kb_footer." . $phpEx ); ! } if ( !$is_block && !$print_version ) --- NEW FILE: upgrade_kb_tables.php --- <?php /*************************************************************************** * install_kb_tables.php * ------------------- * begin : Wednesday, May 16, 2002 * copyright : Eric * email : er...@eg... * * $Id: install_kb_tables.php * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', 1); define( 'MXBB_MODULE', false ); // Switch for making this run as a phpBB mod or mxBB module $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); include($phpbb_root_path . 'includes/constants.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/db.'.$phpEx); include($phpbb_root_path . 'includes/kb_constants.'.$phpEx); // A few additional checks to avoid blunders during install/upgrade define( 'phpBBroot_ok', file_exists( $phpbb_root_path . 'viewtopic.php' ) ); define( 'kbconstants_ok', defined( 'KB_CUSTOM_TABLE' ) ); if ( !phpBBroot_ok ) { message_die(GENERAL_ERROR, "This install/upgrade script should be uploaded to the phpBB root."); } if ( !kbconstants_ok ) { message_die(GENERAL_ERROR, "You haven't uploaded latest kb_constants.php."); } $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); if ( $userdata['user_level'] != ADMIN ) { message_die(GENERAL_ERROR, "You must be an Administrator to use this page."); } define('KB_VERSION','KB MOD 2.0.1e'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <title>Install File for MOD's</title> <head> <meta http-equiv="Content-Type" content="text/html;"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"> </style> </head> <body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="./index.php"><img src="./templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></a></td> <td align="center" width="100%" valign="middle"><span class="maintitle">Installing Knowledge Base</span></td> </tr> </table></td> </tr> </table> <br clear="all" /> <h2>Information</h2> <?php // get the phpBB version $sql = "SELECT config_value FROM " . CONFIG_TABLE . " WHERE config_name = 'version'"; if ( !($result = $db->sql_query($sql)) ) { die("Couldn't obtain version info"); } $row = $db->sql_fetchrow($result); $phpBB_version = $row['config_value'] ; $sql = array(); // output some info echo '<p>Database type :: <b>' . SQL_LAYER . '</b><br />'; echo 'phpBB version :: <b>2' . $phpBB_version . '</b><br />'; echo 'Upgrading Knowledge Base to :: <b>' . KB_VERSION . '</b></p> From KB Beta 0.7.6 + mxaddon 1.x' ."\n"; ?> <br clear="all" /> <h3>What are you going to do ?</h3> This file is used to do the changes to your database (adding/modifying a table) to make the MOD working properly. If you have any problem during this part, you can contact me to get support. Now, if you are ready, click on the button. <br clear="all" /> <center> <form action="upgrade_kb_tables.php" method=POST> <input type="submit" name="submit" value="submit" class="liteoption" /> </form> </center> <?php $submit = ( isset($HTTP_POST_VARS['submit']) ) ? $HTTP_POST_VARS['submit'] : 0; $res_message = ""; // Upgrade checks $upgrade_101 = 0; $upgrade_102 = 0; $upgrade_103 = 0; $upgrade_200 = 0; $upgrade_201 = 0; // validate before 1.01 if( !$result = $db->sql_query("SELECT article_rating from ".KB_ARTICLES_TABLE)) { $upgrade_101 = 1; $res_message .= "Upgrading to v. 1.01...<br />"; } else { $res_message .= "v. 1.01 : installed<br />"; } // validate before 1.02 if( !$result = $db->sql_query("SELECT votes_userid from ".KB_VOTES_TABLE)) { $upgrade_102 = 1; $res_message .= "Upgrading to v. 1.02...<br />"; } else { $res_message .= "v. 1.02 : installed<br />"; } // validate before 1.03 $result = $db->sql_query( "SELECT config_value from " . KB_CONFIG_TABLE . " WHERE config_name = 'comments_pagination'" ); if ( $db->sql_numrows( $result ) == 0 ) { $upgrade_103 = 1; $res_message .= "Upgrading to v. 1.03...<br />"; } else { $res_message .= "v. 1.03 : installed <br />"; } // validate before 2.00 $result = $db->sql_query( "SELECT config_value from " . KB_CONFIG_TABLE . " WHERE config_name = 'wysiwyg'" ); if( $db->sql_numrows( $result ) == 0 ) { $upgrade_200 = 1; $res_message .= "Upgrading to v. 2.00...<br />"; } else { $res_message .= "v. 2.00 : installed <br />"; } // validate before 2.01 $result = $db->sql_query( "SELECT config_value from " . KB_CONFIG_TABLE . " WHERE config_name = 'wysiwyg_path'" ); if( $db->sql_numrows( $result ) == 0 ) { $upgrade_201 = 1; $res_message .= "Upgrading to v. 2.01...<br />"; } else { $res_message .= "v. 2.01 : installed <br />"; } if ( $submit ) { switch ( SQL_LAYER ) { case 'mysql': case 'mysql4': if ( $upgrade_101 == 1 ) { $sql[] = 'ALTER TABLE ' . KB_ARTICLES_TABLE . ' ADD article_rating double(6,4) NOT NULL default "0.0000" ;'; $sql[] = 'ALTER TABLE ' . KB_ARTICLES_TABLE . ' ADD article_totalvotes int(255) NOT NULL default "0" ;'; // Upgrade the config table to avoid duplicate entries $sql[] = 'ALTER TABLE '. KB_CONFIG_TABLE.' MODIFY config_name VARCHAR(255) NOT NULL default "" ;'; $sql[] = 'ALTER TABLE '. KB_CONFIG_TABLE.' MODIFY config_value VARCHAR(255) NOT NULL default "" ;'; $sql[] = 'ALTER TABLE '. KB_CONFIG_TABLE.' DROP PRIMARY KEY, ADD PRIMARY KEY (config_name) ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_rating", "0") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_anonymos_rating", "0") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("comments_show", "1") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("mod_group", "0") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("bump_post", "1") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("stats_list", "1") ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("header_banner", "1") ;'; $sql[] = 'CREATE TABLE '.KB_VOTES_TABLE.' ( votes_ip varchar(50) NOT NULL default "0", votes_userid int(50) NOT NULL default "0", votes_file int(50) NOT NULL default "0" ) TYPE=MyISAM'; } if ( $upgrade_102 == 1 ) { $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("votes_check_userid", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("votes_check_ip", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("art_pagination", "5");'; // $sql[] = 'ALTER TABLE ' . KB_VOTES_TABLE . ' ADD votes_userid int(50) NOT NULL default "0" AFTER votes_ip'; } if ( $upgrade_103 == 1 ) { $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("comments_pagination", "5");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("news_sort", "Alphabetic");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("news_sort_par", "ASC");'; } if ( $upgrade_200 == 1 ) { $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_view tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_post tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_rate tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_comment tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_edit tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_delete tinyint(3) NOT NULL DEFAULT "2" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_approval tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_approval_edit tinyint(3) NOT NULL DEFAULT "0" ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_view_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_post_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_rate_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_comment_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_edit_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_delete_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_approval_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_approval_edit_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD auth_moderator_groups varchar(255) ;'; $sql[] = 'ALTER TABLE ' . KB_CATEGORIES_TABLE . ' ADD comments_forum_id tinyint(3) NOT NULL DEFAULT "-1" ;'; $sql[] = 'UPDATE ' . KB_CONFIG_TABLE . ' SET config_name = "use_comments", config_value = "1" WHERE config_name = "comments" ;'; $sql[] = 'UPDATE ' . KB_CONFIG_TABLE . ' SET config_name = "use_ratings", config_value = "1" WHERE config_name = "allow_rating" ;'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("wysiwyg", "0");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_html", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_bbcode", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_smilies", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allowed_html_tags", "b,i,u,a");'; $sql[] = 'CREATE TABLE ' . KB_CUSTOM_TABLE . ' ( 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;'; $sql[] = 'CREATE TABLE ' . KB_CUSTOM_DATA_TABLE . ' ( customdata_file int(50) NOT NULL default "0", customdata_custom int(50) NOT NULL default "0", data text NOT NULL ) TYPE=MyISAM;'; } if ( $upgrade_201 == 1 ) { $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("wysiwyg_path", "modules/");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("formatting_fixup", "0");'; $sql[] = 'ALTER TABLE ' . KB_ARTICLES_TABLE . ' MODIFY article_author_id mediumint(8) NOT NULL ;'; } break; case 'mssql': case 'mssql-odbc': default: die("/!\ No Database Abstraction Layer (DBAL) found /!\\"); break; } echo("<h2>Adding/modifying tables to your database</h2>\n"); for ($i=0; $i < count($sql); $i++) { echo("Running query :: " . $sql[$i]); flush(); if ( !($result = $db->sql_query($sql[$i])) ) { $error_code = TRUE; $error = $db->sql_error(); echo(" -> <b><span class=\"error\">ERROR - QUERY FAILED</span></b> ----> <u>" . $error['message'] . "</u><br /><br />\n\n"); } else { echo(" -> <b><span class=\"ok\">GOOD - QUERY OK</span></b><br /><br />\n\n"); } } if ( $error_code ) { $res_message .= "<br />At least one query failed : check the error message and contact me if you need help to resolve the problem. <br />"; } else { $res_message .= "<br />All the queries have been successfully done - Enjoy. <br />"; } echo("\n<br />\n<b>COMPLETE - INSTALLATION IS ENDED</b><br />\n"); echo($res_message . "<br />"); echo("<br /><b>NOW, DELETE THIS FILE FROM YOUR SERVER</b><br />\n"); } ?> </body> </html> --- NEW FILE: install_kb_tables.php --- <?php /*************************************************************************** * install_kb_tables.php * ------------------- * begin : Wednesday, May 16, 2002 * copyright : Eric * email : er...@eg... * * $Id: install_kb_tables.php * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', 1); $phpbb_root_path = './'; define( 'MXBB_MODULE', false ); // Switch for making this run as a phpBB mod or mxBB module include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); include($phpbb_root_path . 'includes/constants.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/db.'.$phpEx); include($phpbb_root_path . 'includes/kb_constants.'.$phpEx); // A few additional checks to avoid blunders during install/upgrade define( 'phpBBroot_ok', file_exists( $phpbb_root_path . 'viewtopic.php' ) ); define( 'kbconstants_ok', defined( 'KB_CUSTOM_TABLE' ) ); if ( !phpBBroot_ok ) { message_die(GENERAL_ERROR, "This install/upgrade script should be uploaded to the phpBB root."); } if ( !kbconstants_ok ) { message_die(GENERAL_ERROR, "You haven't uploaded latest kb_constants.php."); } $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); if ( $userdata['user_level'] != ADMIN ) { message_die(GENERAL_ERROR, "You must be an Administrator to use this page."); } $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); if ( $userdata['user_level'] != ADMIN ) { message_die(GENERAL_ERROR, "You must be an Administrator to use this page."); } define('KB_VERSION','KB MOD 2.0.1e'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <title>Install File for MOD's</title> <head> <meta http-equiv="Content-Type" content="text/html;"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"> </style> </head> <body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="./index.php"><img src="./templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></a></td> <td align="center" width="100%" valign="middle"><span class="maintitle">Installing Knowledge Base</span></td> </tr> </table></td> </tr> </table> <br clear="all" /> <h2>Information</h2> <?php // get the phpBB version $sql = "SELECT config_value FROM " . CONFIG_TABLE . " WHERE config_name = 'version'"; if ( !($result = $db->sql_query($sql)) ) { die("Couldn't obtain version info"); } $row = $db->sql_fetchrow($result); $phpBB_version = $row['config_value'] ; $sql = array(); // output some info echo '<p>Database type :: <b>' . SQL_LAYER . '</b><br />'; echo 'phpBB version :: <b>2' . $phpBB_version . '</b><br />'; echo 'Knowledge Base MOD version :: <b>' . KB_VERSION . '</b></p>' ."\n"; ?> <br clear="all" /> <h3>What are you going to do ?</h3> This file is used to do the changes to your database (adding/modifying a table) to make the MOD working properly. If you have any problem during this part, you can contact me to get support. Now, if you are ready, click on the button. <br clear="all" /> <center> <form action="install_kb_tables.php" method=POST> <input type="submit" name="submit" value="submit" class="liteoption" /> </form> </center> <?php $submit = ( isset($HTTP_POST_VARS['submit']) ) ? $HTTP_POST_VARS['submit'] : 0; if ( $submit ) { switch ( SQL_LAYER ) { case 'mysql': case 'mysql4': $sql[]= 'CREATE TABLE '. KB_ARTICLES_TABLE .' ( article_id mediumint(8) unsigned NOT NULL auto_increment, article_category_id mediumint(8) unsigned NOT NULL default "0", article_title varchar(255) binary NOT NULL default "", article_description varchar(255) binary NOT NULL default "", article_date varchar(255) binary NOT NULL default "", article_author_id mediumint(8) NOT NULL, username VARCHAR(255), bbcode_uid varchar(10) binary NOT NULL default "", article_body text NOT NULL, article_type mediumint(8) unsigned NOT NULL default "0", approved tinyint(1) unsigned NOT NULL default "0", topic_id mediumint(8) unsigned NOT NULL default "0", views BIGINT(8) NOT NULL DEFAULT "0", article_rating double(6,4) NOT NULL default "0.0000", article_totalvotes int(255) NOT NULL default "0", KEY article_id (article_id) ) TYPE=MyISAM;'; $sql[] = 'INSERT INTO '. KB_ARTICLES_TABLE .' VALUES ( 1, 1, "Test Article", "This is a test article for your KB", "1057708235", 2, "", "93074f48a9", "This is a test article for your Knowledge Base. This MOD is based on code written by wGEric < er...@eg... > (Eric Faerber) - http://eric.best-1.biz/, now supervised by _Haplo < jon...@ho... > (Jon Ohlsson) - http://www.mx-system.com/ \r\n\r\nBe sure you add categories and article types in the ACP and also change the Configuration to your liking.\r\n\r\nHave fun and enjoy your new Knowledge Base! :D", 1, 1, 0, 0,0,0 );'; $sql[] = 'CREATE TABLE '.KB_CATEGORIES_TABLE.' ( category_id mediumint(8) unsigned NOT NULL auto_increment, category_name VARCHAR(255) binary NOT NULL, category_details VARCHAR(255) binary NOT NULL, number_articles mediumint(8) unsigned NOT NULL, parent mediumint(8) unsigned, cat_order mediumint(8) unsigned NOT NULL, auth_view tinyint(3) NOT NULL DEFAULT "0", auth_post tinyint(3) NOT NULL DEFAULT "0", auth_rate tinyint(3) NOT NULL DEFAULT "0", auth_comment tinyint(3) NOT NULL DEFAULT "0", auth_edit tinyint(3) NOT NULL DEFAULT "0", auth_delete tinyint(3) NOT NULL DEFAULT "2", auth_approval tinyint(3) NOT NULL DEFAULT "0", auth_approval_edit tinyint(3) NOT NULL DEFAULT "0", auth_view_groups varchar(255), auth_post_groups varchar(255), auth_rate_groups varchar(255), auth_comment_groups varchar(255), auth_edit_groups varchar(255), auth_delete_groups varchar(255), auth_approval_groups varchar(255), auth_approval_edit_groups varchar(255), auth_moderator_groups varchar(255), comments_forum_id tinyint(3) NOT NULL DEFAULT "-1", KEY category_id (category_id) ) TYPE=MyISAM'; $sql[] = 'INSERT INTO '.KB_CATEGORIES_TABLE.' VALUES (1, "Test Category 1", "This is a test category", "0", "0", "10", "0", "0", "0", "0", "0", "2", "0", "0", "", "", "", "", "", "", "", "", "", "0" );'; $sql[] = 'CREATE TABLE '.KB_CONFIG_TABLE.' ( config_name VARCHAR(255) NOT NULL default "", config_value varchar(255) NOT NULL default "", PRIMARY KEY (config_name) ) TYPE=MyISAM'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_new", "1")'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("notify", "1")'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("admin_id", "2")'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) values("show_pretext",0);'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) values("pt_header","Article Submission Instructions");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) values("pt_body","Please check your references and include as much information as you can.");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("use_comments", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("del_topic", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("use_ratings", "0");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("comments_show", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("bump_post", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("stats_list", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("header_banner", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("votes_check_userid", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("votes_check_ip", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("art_pagination", "5");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("comments_pagination", "5");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("news_sort", "Alphabetic");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("news_sort_par", "ASC");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("wysiwyg", "0");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("wysiwyg_path", "modules/");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_html", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_bbcode", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allow_smilies", "1");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("formatting_fixup", "0");'; $sql[] = 'INSERT INTO '.KB_CONFIG_TABLE.' (config_name, config_value) VALUES ("allowed_html_tags", "b,i,u,a");'; $sql[] = 'CREATE TABLE ' . KB_TYPES_TABLE . ' ( id mediumint(8) unsigned NOT NULL auto_increment, type varchar(255) binary DEFAULT "" NOT NULL, KEY id (id) ) TYPE=MyISAM'; $sql[] = 'INSERT INTO '. KB_TYPES_TABLE . ' VALUES (1, "Test Type 1")'; $sql[] = 'CREATE TABLE '. KB_VOTES_TABLE . ' ( votes_ip varchar(50) NOT NULL default "0", votes_userid int(50) NOT NULL default "0", votes_file int(50) NOT NULL default "0" ) TYPE=MyISAM'; $sql[] = 'CREATE TABLE ' . KB_SEARCH_TABLE . ' ( search_id int(11) unsigned NOT NULL default "0", session_id varchar(32) NOT NULL default "", search_array text NOT NULL, PRIMARY KEY (search_id), KEY session_id (session_id) ) TYPE=MyISAM;'; $sql[] = 'CREATE TABLE ' . KB_WORD_TABLE . ' ( word_text varchar(50) binary NOT NULL default "", word_id mediumint(8) unsigned NOT NULL auto_increment, word_common tinyint(1) unsigned NOT NULL default "0", PRIMARY KEY (word_text), KEY word_id (word_id) ) TYPE=MyISAM;'; $sql[] = 'CREATE TABLE ' . KB_MATCH_TABLE . ' ( article_id mediumint(8) unsigned NOT NULL default "0", word_id mediumint(8) unsigned NOT NULL default "0", title_match tinyint(1) NOT NULL default "0", KEY post_id (article_id), KEY word_id (word_id) ) TYPE=MyISAM;'; $sql[] = 'CREATE TABLE ' . KB_CUSTOM_TABLE . ' ( 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;'; $sql[] = 'CREATE TABLE ' . KB_CUSTOM_DATA_TABLE . ' ( customdata_file int(50) NOT NULL default "0", customdata_custom int(50) NOT NULL default "0", data text NOT NULL ) TYPE=MyISAM;'; break; case 'mssql': case 'mssql-odbc': default: die("/!\ No Database Abstraction Layer (DBAL) found /!\\"); break; } echo("<h2>Adding/modifying tables to your database</h2>\n"); for ($i=0; $i < count($sql); $i++) { echo("Running query :: " . $sql[$i]); flush(); if ( !($result = $db->sql_query($sql[$i])) ) { $error_code = TRUE; $error = $db->sql_error(); echo(" -> <b><span class=\"error\">ERROR - QUERY FAILED</span></b> ----> <u>" . $error['message'] . "</u><br /><br />\n\n"); } else { echo(" -> <b><span class=\"ok\">GOOD - QUERY OK</span></b><br /><br />\n\n"); } } $error_message = ""; if ( $error_code ) { $error_message .= "<br />At least one query failed : check the error message and contact me if you need help to resolve the problem. <br />"; } else { $error_message .= "<br />All the queries have been successfully done - Enjoy. <br />"; } echo("\n<br />\n<b>COMPLETE - INSTALLATION IS ENDED</b><br />\n"); echo($error_message . "<br />"); echo("<br /><b>NOW, DELETE THIS FILE FROM YOUR SERVER</b><br />\n"); } ?> </body> </html> Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_upgrade.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** db_upgrade.php 2 Apr 2005 22:03:20 -0000 1.19 --- db_upgrade.php 9 Apr 2005 21:41:27 -0000 1.20 *************** *** 20,79 **** * (at your option) any later version. */ - if ( !function_exists(mx_do_install_upgrade) ) - { - // Generating output - - function mx_do_install_upgrade( $sql = '', $main_install = false ) - { - global $table_prefix, $mx_table_prefix, $userdata, $phpEx, $template, $lang, $db, $board_config, $HTTP_POST_VARS; - - $inst_error = false; - $n = 0; - $message = "<b>This is the result list of the SQL queries needed for the install/upgrade</b><br /><br />"; - - while ( $sql[$n] ) - { - if ( !$result = $db->sql_query( $sql[$n] ) ) - { - $message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; - $inst_error = true; - } - else - { - $message .= '<b><font color=#0000fF>[Added/Updated]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; - } - $n++; - } - $message .= '<br /> If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules'; - - if ( $main_install ) - { - if ( !$inst_error ) - { - $message .= '-> no db errors :-)<br /><br /><b>Portal installed successfully! </b><hr><br /><br />'; - $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; - $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; - $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; - - $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; - } - else - { - $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; - $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; - $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; - $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; - - $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; - } - } - return $message; - } - - define('MXBB_27x', 1); - - } define( 'IN_PORTAL', true ); $mx_module_version = 'mxBB Knowledge Base Module v. 2.0.0'; --- 20,26 ---- * (at your option) any later version. */ define( 'IN_PORTAL', true ); + $mx_root_path = './../'; $mx_module_version = 'mxBB Knowledge Base Module v. 2.0.0'; *************** *** 82,86 **** if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = '../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); --- 29,33 ---- if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); *************** *** 101,104 **** --- 48,59 ---- } + // For compatibility with core 2.7.+ + define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); + + if ( MXBB_27x ) + { + include_once( $mx_root_path . 'modules/mx_kb/includes/functions_kb_mx.' . $phpEx ); + } + $sql = array(); // Precheck *************** *** 183,187 **** $message .= "<b>Validating v. 2.00...ok</b><br/><br/>"; } ! // validate before 2.01 $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "kb_config WHERE config_name = 'wysiwyg_path'" ); --- 138,142 ---- $message .= "<b>Validating v. 2.00...ok</b><br/><br/>"; } ! // validate before 2.01 $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "kb_config WHERE config_name = 'wysiwyg_path'" ); *************** *** 194,199 **** { $message .= "<b>Validating v. 2.01...ok</b><br/><br/>"; ! } ! // ------------------------------------------------------------------------------------------------------ if ( $upgrade_105 == 1 ) --- 149,154 ---- { $message .= "<b>Validating v. 2.01...ok</b><br/><br/>"; ! } ! // ------------------------------------------------------------------------------------------------------ if ( $upgrade_105 == 1 ) *************** *** 239,244 **** } - - if ( $upgrade_109 == 1 ) { --- 194,197 ---- *************** *** 300,311 **** data text NOT NULL )"; } ! if ( $upgrade_201 == 1 ) ! { ! $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('wysiwyg_path', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('formatting_fixup', '0')"; $sql[] = "ALTER TABLE " . $mx_table_prefix . "kb_articles MODIFY article_author_id mediumint(8) NOT NULL "; ! } else { --- 253,266 ---- data text NOT NULL )"; + } ! if ( $upgrade_201 == 1 ) ! { ! $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('wysiwyg_path', 'modules/')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('formatting_fixup', '0')"; $sql[] = "ALTER TABLE " . $mx_table_prefix . "kb_articles MODIFY article_author_id mediumint(8) NOT NULL "; ! ! } else { --- NEW FILE: install.txt --- ############################################################## ## MOD Title: Knowledge Base ## MOD Original Author: wGEric < er...@ww... > (Eric Faerber) http://eric.best-1.biz ## MOD Addon Author: Haplo < jon...@ho... > (Jon Ohlsson) http://www.mx-system.com ## MOD Description: This mod adds a Knowledge Base manager to your board ## MOD Version: KB MOD 2.0.1(abc...) ## ## Installation Level: easy ## Installation Time: 5 Minutes ## Files To Edit: (5) ## - viewonline.php ## - admin/index.php, ## - includes/page_header.php, ## - language/lang_english/lang_main.php, ## - templates/subSilver/overall_header.tpl, ## ## Included Files: (58) ## - kb.php, ## - kb_search.php, ## - admin/admin_kb_*.php (7), ## - includes/functions_.php (4), ## - includes/kb_.php, (9) ## - language/lang_english/lang_.php (2), ## - templates/subSilver/kb_*.tpl (14), ## - templates/subSilver/admin/kb_*.tpl (17), ## - templates/subSilver/images/lang_english/*.gif (1), ## - templates/subSilver/images/*.gif (2) ## ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/ ############################################################## ## ## ## MOD History: ## ## 2005/04/09 - Version KB MOD 2.0.1e. ## - Category jumpbox ## - Permissions revised and less db queries needed ## - More information in PM - subject ## - Category PRIVATE settings for 'approval' removed. Approvals settings are now INACTIVATED, MOD, ADMIN ## - Fix for kb_search - now also articles titles are searchable ;) ## - "All" reported bugs/fixes/addons in dev thread fixed (implemented) ## 2005/03/29 - Version KB MOD 2.0.1abcd... ## - Name changed, since much (most) is rewritten ;) ## - Updated with latest phpBB security patches ## - Category (PRIVATE) permissions ## - Subcategories ## - "Comments phpBB forum" set per category ## - Regenerate search tables adminCP ## - Rewritten PM/MAIL handling ## - Text reformatting options: img, link and linewidth controls ## - Rewritten BBcode/html handling (once more yes) ## - Custom fields added ## - wysiwyg feature (tinymce), ## you can simply download latest version from http://tinymce.moxiecode.com/ and upload into phpbbroot/modules/ ## - "All" reported bugs/fixes/addons in dev thread fixed (implemented) ## 2004/09/14 - Version 0.7.6 + MX Addon 1.03 ## - Comments pagination added (new db entry) ## - Advanced sorting options (2 new db entries) ## - Rewritten BBcode/html handling ## - Improved Moderator features ## - some tpl bugs fixed ## - All reported bugs in dev thread fixed ## 2004/07/05 - Version 0.7.6 + MX Addon 1.02 ## - Article pagination added (new db entry) ## - rate check vs ip and userid added (2 new db entries) ## - add comments/rate links added ## - some tpl bugs fixed ## 2004/06/15 - Version 0.7.6 + MX Addon 1.01 ## - Bugfixes ## 2004/06/05 - Version 0.7.6 + MX Addon 1.0 ## - Ratings added ## - 'Printable version' added ## - Moderator group ## - Admin switch for 'bumping' reply post in comment thread whenever the article is edited ## - Admin switch for showing kb stats ## - Rewritten EDIT function ## - Switch for show comments in portal page ## - Additional stats: latest articles, toprated articles and most popular articles ## - [page] and [toc] feature for pages and table of contents entries ## - Fixed lots of bugs ## ## 2003/08/08 - Version 0.7.6 ## - Fixed some typos, Thanks to Gary for pointing these out ## - Fixed lots of bugs ## ## 2003/07/26 - Version 0.7.5 ## - Multiple paged articles ## - Quick Stats ## - Minor changes ## ## 2003/07/17 - Version 0.7.1 ## - Fixed a bug that could empty your topics table ## ## 2003/07/14 - Version 0.7.0 ## - Sub Categories added ## - Order Categories ## - Delete Topic when deleting article ## - Makes sure all articles has a topic if comments are on ## - Users not logged in can post articles ## ## 2003/07/09 - Version 0.6.3 ## - Works with MSSQL ## - Topic uses boards language instead of English ## ## 2003/07/08 - Version 0.6.2 ## - Fixed email_kb_admin() in kb.php ## - View counter is fixed when viewing a cateogory ## - Fixed it so amount of articles in a category decrease after ## deleting an article ## - All editing article bugs have been fixed ## - Install script has been fixed. ## ## 07/02/03 - Version 0.6.1 ## - Fixed bugs (ACP Type manager, HTML when viewing ## article, Anyone could edit article if they changed the URL) ## - Added a view counter for the articles. ## ## 06/30/03 - Version 0.6.0 ## - Added Search ## - Fixed a couple of bugs ## - Changed the way the posts look ## ## 06/12/03 - Beta - 0.5.1 ## - Fixed a bug in the functions. Forgot to put $phpEx as a global. ## ## 06/11/03 - Beta 2 - 0.5.0 ## - Rewrote most of the code. This made some of the files smaller ## - Comments on articles feature ## - Fixed most of the known bugs ## - Dutch Translation by NL Web Hebbies ## ## 05/13/03 - Beta 0.4.3 ## - FIX: Check for empty category and type by ZapZap ## ## 05/10/03 - Beta 0.4.2 ## - FIX: preview fixed by wGEric ## - FIX: html parsed even if html of fixed by wGEric ## - FIX: missing text for category on some forms ## ## 05/06/03 - Beta 0.4.1 ## - Removed pretext table and moved pretext fields to config table ## - Added entry to viewonline list ## ## 05/01/03 - Beta 0.4.0 ## - Added Pretext Mod by Palamedes < pal...@ro... > (Jason Ellis) http://www.randomstringofwords.com ## ## 04/28/03 - Beta 0.3.2 ## - Added Spanish Files ## - Used cleaned up code from MJ - Thanks! ## ## 04/19/03 - Beta 0.3.1 - Fixed some bugs ## ## 04/18/03 - Beta 0.3.0 ## - Added, 'Preview Articles' before posting them. ## - Added, Admin's and Moderator's articles are automatically approved. ## - Added, the ability to change the article types ## ## 04/12/03 - Beta 0.2.0 ## - Added, the ability to edit articles ## - Added, E-mail or PM Notification of a new article ## - Added. configuration file in the admin panel. In there you can allow new articles to be posted, allow edits, and choose whether to be PM, e-mailed, or get no notification. ## ## 04/05/03 - Beta 0.1.0 ## - First Release ## ## 1) Edit the Original phpBB2 Code. ## 2) Upload all Remaining Files. ## 3) Prepare the database by running the included install/upgrade-*.php file. ## - use install_kb_tables.php for a fresh installation, ## and upgrade_kb_tables.php if upgrading (even if from original kb 0.76 - works! ) ## 4) Delete install/upgrade files!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ COPY ]------------------------------------------ # copy mx_kb/install_kb_tables.php to phpbbroot/install_kb_tables.php or copy mx_kb/upgrade_kb_tables.php to phpbbroot/upgrade_kb_tables.php copy mx_kb/kb.php to kb.php copy mx_kb/kb_search.php to phpbbroot/kb_search.php copy mx_kb/admin/admin__.php to phpbbroot/admin/admin__.php copy mx_kb/includes/functions_.php to phpbbroot/includes/functions_.php copy mx_kb/includes/kb_.php to phpbbroot/includes/kb_.php copy mx_kb/language/lang_english/lang_kb.php to phpbbroot/language/lang_english/lang_kb.php copy mx_kb/templates/print_version.css to phpbbroot/templates/print_version.css copy mx_kb/templates/subSilver/kb_.tpl to phpbbroot/templates/subSilver/kb_.tpl copy mx_kb/templates/subSilver/admin/kb_.tpl to phpbbroot/templates/subSilver/admin/kb_.tpl copy mx_kb/templates/subSilver/images/icon_.gif to phpbbroot/templates/subSilver/images/icon_.gif copy mx_kb/templates/subSilver/images/lang_english/kb.gif to phpbbroot/templates/subSilver/images/lang_english/kb.gif Notes: Files distributed in this zip, NOT used by the phpBB version of the KB MOD - kb_pages.php - kb_defs.php - admin/mx_config.php - kb_article_reader.php If they have been included by accident, simply remove. They are only used for the mxBB version of the mod!! # #-----[ OPEN ]------------------------------------------ # viewonline.php # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "faq.$phpEx"; break; # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_KB: $location = $lang['Viewing_KB']; $location_url = "kb.$phpEx"; break; # #-----[ OPEN ]------------------------------------------ # admin/index.php # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "index.$phpEx?pane=right"; break; # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_KB: $location = $lang['Viewing_KB']; $location_url = "kb.$phpEx"; break; # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "index.$phpEx?pane=right"; break # #-----[ AFTER, ADD ]------------------------------------------ # case PAGE_KB: $location = $lang['Viewing_KB']; $location_url = "kb.$phpEx"; break; # #-----[ OPEN ]------------------------------------------ # includes/page_header.php # #-----[ FIND ]------------------------------------------ # 'L_FAQ' => $lang['FAQ'], # #-----[ AFTER, ADD ]------------------------------------------ # 'L_KB' => $lang['KB_title'], # #-----[ FIND ]------------------------------------------ # 'U_FAQ' => append_sid('faq.'.$phpEx), # #-----[ AFTER, ADD ]------------------------------------------ # 'U_KB' => append_sid('kb.'.$phpEx), # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['FAQ'] = 'FAQ'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['KB_title'] = 'Knowledge Base'; # #-----[ FIND ]------------------------------------------ # $lang['Viewing_FAQ'] = 'Viewing FAQ'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['Viewing_KB'] = 'Viewing KB'; # #-----[ OPEN ]------------------------------------------ # templates/subSilver/overall_header.tpl # #-----[ FIND ]------------------------------------------ # <td align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu"> <a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a> <a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a> <a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a> # #-----[ IN-LINE FIND ]------------------------------------------ # <a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu"> # #-----[ IN-LINE AFTER, ADD ]------------------------------------------ # &nb... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:37
|
Update of /cvsroot/mxbb/mx_kb/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/language/lang_english Modified Files: lang_admin_rebuild_search.php lang_kb.php Log Message: dev work is kept up in the dev forums... Index: lang_admin_rebuild_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/language/lang_english/lang_admin_rebuild_search.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lang_admin_rebuild_search.php 29 Mar 2005 20:02:10 -0000 1.1 --- lang_admin_rebuild_search.php 9 Apr 2005 21:41:28 -0000 1.2 *************** *** 2,6 **** $lang['Rebuild_search'] = 'Rebuild Search'; ! $lang['Rebuild_search_desc'] = 'This will index every post in your phpBB, rebuilding the search tables. It may take a long time to process, so please do not move from this page until it is complete.'; $lang['Post_limit'] = 'Post limit'; $lang['Time_limit'] = 'Time limit'; --- 2,6 ---- $lang['Rebuild_search'] = 'Rebuild Search'; ! $lang['Rebuild_search_desc'] = 'This will index every post in your Knowledge Base, rebuilding the search tables. It may take a long time to process, so please do not move from this page until it is complete.'; $lang['Post_limit'] = 'Post limit'; $lang['Time_limit'] = 'Time limit'; Index: lang_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/language/lang_english/lang_kb.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** lang_kb.php 2 Apr 2005 20:37:03 -0000 1.18 --- lang_kb.php 9 Apr 2005 21:41:28 -0000 1.19 *************** *** 149,154 **** $lang['KB_config_updated'] = 'Knowledge Base Configuration Updated Successfully.'; ! $lang['KB_notify_subject'] = 'New (or edited) Article!'; ! $lang['KB_notify_body'] = 'A new article has been submitted or edited.'; $lang['Category_Permissions'] = 'Category Permissions'; --- 149,157 ---- $lang['KB_config_updated'] = 'Knowledge Base Configuration Updated Successfully.'; ! $lang['KB_notify_subject_new'] = 'New Article!'; ! $lang['KB_notify_subject_edited'] = 'Edited Article!'; ! $lang['KB_notify_subject_approved'] = 'Approved Article!'; ! $lang['KB_notify_subject_unapproved'] = 'Unapproved Article!'; ! $lang['KB_notify_body'] = 'An article has been submitted or modified:'; $lang['Category_Permissions'] = 'Category Permissions'; |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:37
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_config.php admin_kb_custom.php admin_kb_rebuild_search.php admin_kb_types.php kb_config.php Log Message: dev work is kept up in the dev forums... Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** admin_kb_art.php 5 Apr 2005 20:52:20 -0000 1.19 --- admin_kb_art.php 9 Apr 2005 21:41:27 -0000 1.20 *************** *** 43,51 **** include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else { define( 'IN_PORTAL', 1 ); if ( !empty( $setmodules ) ) --- 43,55 ---- include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); } else { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 60,68 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 79,86 **** else { ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $config_name = $row['config_name']; ! $config_value = $row['config_value']; $kb_config[$config_name] = $config_value; } --- 86,93 ---- else { ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $config_name = $kb_row['config_name']; ! $config_value = $kb_row['config_value']; $kb_config[$config_name] = $config_value; } *************** *** 125,129 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $results ); $topic_sql = ''; --- 132,136 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $results ); $topic_sql = ''; *************** *** 132,136 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 139,143 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 144,148 **** if ( $kb_config['use_comments'] ) { ! if ( !$row['topic_id'] ) { // Post --- 151,155 ---- if ( $kb_config['use_comments'] ) { ! if ( !$kb_row['topic_id'] ) { // Post *************** *** 161,169 **** } ! $article_category_id = $row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'] ); ! mx_add_search_words( 'single', $article_id, stripslashes( $row['article_body'] ), stripslashes( $row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); --- 168,176 ---- } ! $article_category_id = $kb_row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); ! mx_add_search_words( 'single', $article_id, stripslashes( $kb_row['article_body'] ), stripslashes( $kb_row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); *************** *** 191,197 **** } ! if ( $row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $row['article_category_id']; } --- 198,204 ---- } ! if ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $kb_row['article_category_id']; } *************** *** 240,248 **** $count_sql = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $row['posts'] . " ! WHERE user_id = " . $row['poster_id']; } $db->sql_freeresult( $result ); --- 247,255 ---- $count_sql = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $kb_row['posts'] . " ! WHERE user_id = " . $kb_row['poster_id']; } $db->sql_freeresult( $result ); *************** *** 269,275 **** $forum_id = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $row['forum_id']; } $db->sql_freeresult( $result ); --- 276,282 ---- $forum_id = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $kb_row['forum_id']; } $db->sql_freeresult( $result ); *************** *** 286,293 **** $ii = 0; $post_id_sql = ''; ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id']; $ii++; } --- 293,300 ---- $ii = 0; $post_id_sql = ''; ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $kb_row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $kb_row['post_id']; $ii++; } Index: kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/kb_config.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_config.php 18 Feb 2005 10:07:43 -0000 1.7 --- kb_config.php 9 Apr 2005 21:41:27 -0000 1.8 *************** *** 19,29 **** * (at your option) any later version. */ define( 'IN_PORTAL', true ); - $mx_root_path = '../../../'; - $module_root_path = "../"; require( $mx_root_path . 'admin/pagestart.php' ); if ( !empty( $HTTP_POST_VARS['mode'] ) || !empty( $HTTP_GET_VARS['mode'] ) ) --- 19,36 ---- * (at your option) any later version. */ + + $mx_root_path = './../../../'; + $module_root_path = "./../"; define( 'IN_PORTAL', true ); + define( 'MXBB_MODULE', true ); + define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); require( $mx_root_path . 'admin/pagestart.php' ); + if ( MXBB_27x ) + { + mx_message_die(GENERAL_MESSAGE, 'Sorry, but this feature is only available for core 2.8.+. In older versions you cannot create several instances of kb blocks.'); + } if ( !empty( $HTTP_POST_VARS['mode'] ) || !empty( $HTTP_GET_VARS['mode'] ) ) Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_config.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_kb_config.php 2 Apr 2005 22:03:19 -0000 1.18 --- admin_kb_config.php 9 Apr 2005 21:41:27 -0000 1.19 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_kb_cat.php 2 Apr 2005 22:03:19 -0000 1.11 --- admin_kb_cat.php 9 Apr 2005 21:41:27 -0000 1.12 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 154,158 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( 0, 0, 0, true ), 'L_FORUM_ID' => $lang['Forum_id'], --- 158,162 ---- 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( '', 0, 0, 0, 0, true ), 'L_FORUM_ID' => $lang['Forum_id'], *************** *** 290,294 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( $parent, 1, true, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), --- 294,298 ---- 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( '', $parent, $parent, true, 0, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), *************** *** 442,446 **** 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => get_kb_cat_list( $cat_id, 0, true, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), --- 446,450 ---- 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => get_kb_cat_list( '', $cat_id, 0, true, 0, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), Index: admin_kb_rebuild_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_rebuild_search.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_kb_rebuild_search.php 2 Apr 2005 22:03:19 -0000 1.4 --- admin_kb_rebuild_search.php 9 Apr 2005 21:41:27 -0000 1.5 *************** *** 43,46 **** --- 43,47 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 51,56 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 52,60 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_auth.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_kb_auth.php 2 Apr 2005 22:03:19 -0000 1.5 --- admin_kb_auth.php 9 Apr 2005 21:41:27 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 55,60 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 56,64 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 70,74 **** if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_kb_cat_list = get_kb_cat_list( 0, 0, 0, true ); $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); --- 74,78 ---- if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_kb_cat_list = get_kb_cat_list( '', 0, 0, 0, 0, true ); $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); *************** *** 108,113 **** 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], ! 'L_APPROVAL' => $lang['Approval'], ! 'L_APPROVAL_EDIT' => $lang['Approval_edit'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], --- 112,117 ---- 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], ! // 'L_APPROVAL' => $lang['Approval'], ! // 'L_APPROVAL_EDIT' => $lang['Approval_edit'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], *************** *** 125,131 **** } ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $groupdata[] = $row; } // Get info of this cat --- 129,135 ---- } ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $groupdata[] = $kb_row; } // Get info of this cat *************** *** 146,151 **** $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); ! $approval_groups = @explode( ',', $thiscat['auth_approval_groups'] ); ! $approval_edit_groups = @explode( ',', $thiscat['auth_approval_edit_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); --- 150,155 ---- $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); ! // $approval_groups = @explode( ',', $thiscat['auth_approval_groups'] ); ! // $approval_edit_groups = @explode( ',', $thiscat['auth_approval_edit_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); *************** *** 168,174 **** 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! 'APPROVAL_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_groups ) ) ? 'checked="checked"' : '', ! 'APPROVAL_EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_edit_groups ) ) ? 'checked="checked"' : '', 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) --- 172,178 ---- 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! // 'APPROVAL_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_groups ) ) ? 'checked="checked"' : '', ! // 'APPROVAL_EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_edit_groups ) ) ? 'checked="checked"' : '', 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) *************** *** 190,195 **** $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! $approval_groups = @implode( ',', $HTTP_POST_VARS['approval'] ); ! $approval_edit_groups = @implode( ',', $HTTP_POST_VARS['approval_edit'] ); $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); --- 194,199 ---- $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! // $approval_groups = @implode( ',', $HTTP_POST_VARS['approval'] ); ! // $approval_edit_groups = @implode( ',', $HTTP_POST_VARS['approval_edit'] ); $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_kb_types.php 2 Apr 2005 22:03:19 -0000 1.10 --- admin_kb_types.php 9 Apr 2005 21:41:27 -0000 1.11 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_custom.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_custom.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_kb_custom.php 2 Apr 2005 22:03:19 -0000 1.4 --- admin_kb_custom.php 9 Apr 2005 21:41:27 -0000 1.5 *************** *** 39,42 **** --- 39,43 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 47,52 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 48,56 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 61,64 **** --- 65,85 ---- // =================================================== + // addslashes to vars if magic_quotes_gpc is off + // =================================================== + if ( !@function_exists( 'slash_input_data' ) ) + { + function slash_input_data( &$data ) + { + if ( is_array( $data ) ) + { + foreach ( $data as $k => $v ) + { + $data[$k] = ( is_array( $v ) ) ? slash_input_data( $v ) : addslashes( $v ); + } + } + return $data; + } + } + // =================================================== // to make it work with php version under 4.1 and other stuff // =================================================== |
|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:37
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/templates/subSilver/admin Modified Files: kb_cat_auth_body.tpl Log Message: dev work is kept up in the dev forums... Index: kb_cat_auth_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/admin/kb_cat_auth_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_cat_auth_body.tpl 1 Feb 2005 20:45:45 -0000 1.1 --- kb_cat_auth_body.tpl 9 Apr 2005 21:41:29 -0000 1.2 *************** *** 13,18 **** <th class="thTop" nowrap="nowrap">{L_EDIT}</th> <th class="thTop" nowrap="nowrap">{L_DELETE}</th> ! <th class="thTop" nowrap="nowrap">{L_APPROVAL}</th> ! <th class="thTop" nowrap="nowrap">{L_APPROVAL_EDIT}</th> <th class="thCornerR" nowrap="nowrap">{L_IS_MODERATOR}</th> </tr> --- 13,18 ---- <th class="thTop" nowrap="nowrap">{L_EDIT}</th> <th class="thTop" nowrap="nowrap">{L_DELETE}</th> ! <!-- <th class="thTop" nowrap="nowrap">{L_APPROVAL}</th> ! <th class="thTop" nowrap="nowrap">{L_APPROVAL_EDIT}</th> --> <th class="thCornerR" nowrap="nowrap">{L_IS_MODERATOR}</th> </tr> *************** *** 38,41 **** --- 38,42 ---- <input name="delete[]" type="checkbox" {grouprow.DELETE_CHECKED} value="{grouprow.GROUP_ID}" /> </td> + <!-- <td class="row2" align="center"> <input name="approval[]" type="checkbox" {grouprow.APPROVAL_CHECKED} value="{grouprow.GROUP_ID}" /> *************** *** 44,47 **** --- 45,49 ---- <input name="approval_edit[]" type="checkbox" {grouprow.APPROVAL_EDIT_CHECKED} value="{grouprow.GROUP_ID}" /> </td> + --> <td class="row2" align="center"> <input name="moderator[]" type="checkbox" {grouprow.MODERATOR_CHECKED} value="{grouprow.GROUP_ID}" /> *************** *** 50,54 **** <!-- END grouprow --> <tr> ! <td class="catBottom" height="25" align="center" colspan="10"><input type="reset" value="{L_RESET}" class="liteoption" /> <input name="submit" type="submit" value="{L_SUBMIT}" class="mainoption" /></td> </tr> </table> --- 52,56 ---- <!-- END grouprow --> <tr> ! <td class="catBottom" height="25" align="center" colspan="8"><input type="reset" value="{L_RESET}" class="liteoption" /> <input name="submit" type="submit" value="{L_SUBMIT}" class="mainoption" /></td> </tr> </table> |
|
From: Markus P. <mar...@us...> - 2005-04-09 16:21:54
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16739 Modified Files: mx_install.php Log Message: Fixed problems when the PHP function realpath() has been disabled. Yeah, it seems it happens on some servers such as Lycos. Just wanted to mention what they try to avoid is, IMHO, useless. Also they have introduced a path disclosure vulnerability with the warning message PHP generates when an application tried to use the realpath function (without @ of course). :p Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mx_install.php 6 Apr 2005 06:35:00 -0000 1.40 --- mx_install.php 9 Apr 2005 16:21:44 -0000 1.41 *************** *** 702,706 **** $document_root = './'; } ! $document_root = str_replace('\\', '/', realpath($document_root)); // --- 702,706 ---- $document_root = './'; } ! $document_root = str_replace('\\', '/', mx_realpath($document_root)); // *************** *** 742,746 **** // Let's see whether we have read access to our parent directory // ! $parent_path = realpath($mx_absolute_path.'../'); if( is_readable($parent_path) ) { --- 742,746 ---- // Let's see whether we have read access to our parent directory // ! $parent_path = mx_realpath($mx_absolute_path.'../'); if( is_readable($parent_path) ) { *************** *** 1686,1688 **** --- 1686,1710 ---- } + // + // FYI: This is our easy workaround to the PHP realpath function, which might be disabled + // on some servers (Lycos and maybe others) ...they say it's for "security" reasons, heh. + // + // When the PHP realpath function is disabled it returns false and generates a message like: + // + // Warning: realpath (and maybe other functions) has been disabled for security reasons in + // path-to-your/install/mx_install.php on line XXX + // + // This "security" measure seems somehow stupid since information of the filesystem layout + // can be easily retrieved from PHP (and Apache) global variables ...as well as from the + // same PHP generated warning message! :P + // + // Just wanted to mention I already saw the phpBB guys also created their own phpbb_realpath + // function (in includes/functions.php). I never understood why they did it. Only if they + // had documented the correct reason in their source code. ;-) + // + function mx_realpath($path) + { + return ( @function_exists('realpath') && @realpath(__FILE__) ? realpath($path) : $path ); + } + ?> \ No newline at end of file |
|
From: Markus P. <mar...@us...> - 2005-04-06 21:48:33
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15207 Modified Files: admin_mx_block.php Log Message: Fixed auth_delete being inserted/updated as emtpy string, now using intval. Gave problems with PostgreSQL. Index: admin_mx_block.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** admin_mx_block.php 17 Mar 2005 11:30:34 -0000 1.23 --- admin_mx_block.php 6 Apr 2005 21:48:21 -0000 1.24 *************** *** 248,252 **** auth_view = '" . $HTTP_POST_VARS['auth_view'] . "' , auth_edit = '" . $HTTP_POST_VARS['auth_edit'] . "' , ! auth_delete = '" . $HTTP_POST_VARS['auth_delete'] . "', show_block = '" . $HTTP_POST_VARS['show_block'] . "', show_title = '" . $HTTP_POST_VARS['show_block'] . "', --- 248,252 ---- auth_view = '" . $HTTP_POST_VARS['auth_view'] . "' , auth_edit = '" . $HTTP_POST_VARS['auth_edit'] . "' , ! auth_delete = '" . intval($HTTP_POST_VARS['auth_delete']) . "', show_block = '" . $HTTP_POST_VARS['show_block'] . "', show_title = '" . $HTTP_POST_VARS['show_block'] . "', *************** *** 397,401 **** '" . $HTTP_POST_VARS['auth_view'] . "' , '" . $HTTP_POST_VARS['auth_edit'] . "' , ! '" . $HTTP_POST_VARS['auth_delete'] . "' )"; if ( !$result = $db->sql_query( $sql ) ) --- 397,401 ---- '" . $HTTP_POST_VARS['auth_view'] . "' , '" . $HTTP_POST_VARS['auth_edit'] . "' , ! '" . intval($HTTP_POST_VARS['auth_delete']) . "' )"; if ( !$result = $db->sql_query( $sql ) ) |
|
From: Markus P. <mar...@us...> - 2005-04-06 20:45:42
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv741 Modified Files: admin_mx_meta.php Log Message: Fixed Extra Meta Settings. We need to allow HTML Tags here! Index: admin_mx_meta.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_meta.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** admin_mx_meta.php 4 Apr 2005 00:42:37 -0000 1.8 --- admin_mx_meta.php 6 Apr 2005 20:45:24 -0000 1.9 *************** *** 69,73 **** $pragma = $mx_request_vars->post('pragma', (MX_TYPE_NO_TAGS | MX_TYPE_NO_STRIP), ''); $icon = $mx_request_vars->post('icon', (MX_TYPE_NO_TAGS | MX_TYPE_NO_STRIP), ''); ! $header = $mx_request_vars->post('header', (MX_TYPE_NO_TAGS | MX_TYPE_NO_STRIP), ''); $config_data = '<?php'; --- 69,75 ---- $pragma = $mx_request_vars->post('pragma', (MX_TYPE_NO_TAGS | MX_TYPE_NO_STRIP), ''); $icon = $mx_request_vars->post('icon', (MX_TYPE_NO_TAGS | MX_TYPE_NO_STRIP), ''); ! ! // Note we need to allow HTML Tags for the Extra Meta Settings!!! ! $header = $mx_request_vars->post('header', (MX_TYPE_NO_STRIP), ''); $config_data = '<?php'; *************** *** 147,151 **** 'ROBOTS_FOLLOW' => generate_meta_select($follow, 'follow'), 'ICON' => $icon, ! 'HEADER' => $header, 'PRAGMA' => ( $pragma == 1 ) ? ' checked="checked"' : '', )); --- 149,153 ---- 'ROBOTS_FOLLOW' => generate_meta_select($follow, 'follow'), 'ICON' => $icon, ! 'HEADER' => htmlspecialchars($header), 'PRAGMA' => ( $pragma == 1 ) ? ' checked="checked"' : '', )); |
|
From: Markus P. <mar...@us...> - 2005-04-06 06:35:10
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25583/install Modified Files: mx_install.php Log Message: The installer is now able to detect and deal with more that one phpBB board installed on the target system (it was already, but...) even if they're *using different DB engines*. The upgrade cache code is now able to deal with 2.8.0 and previous versions. Added references to the mxBB-News mailing list (a new message in last install/upgrade panels) and a link to the new Welcome Package in page footer. Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** mx_install.php 3 Apr 2005 12:34:04 -0000 1.39 --- mx_install.php 6 Apr 2005 06:35:00 -0000 1.40 *************** *** 54,58 **** // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.8'); define('INSTALLER_NAME', 'mxBB-Installer'); --- 54,58 ---- // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.9'); define('INSTALLER_NAME', 'mxBB-Installer'); *************** *** 61,68 **** --- 61,75 ---- // define('U_RELEASE_NOTES', 'http://www.mx-system.com/forum/viewtopic.php?t=1224'); + define('U_WELCOME_PACK', 'http://www.mx-system.com/forum/viewtopic.php?t=6445'); define('U_ONLINE_FAQ', 'http://www.mx-system.com/index.php?page=117'); define('U_ONLINE_SUPPORT', 'http://www.mx-system.com/'); define('U_TERMS_OF_USE', 'http://www.mx-system.com/index.php?page=126&dynamic_block=133'); + // + // These URLs are used in the last installation/upgrade panels. + // + define('U_MXBB_NEWS_INFO', 'http://www.mx-system.com/forum/viewtopic.php?t=6295'); + define('U_MXBB_NEWS_NOW', 'http://lists.sourceforge.net/lists/listinfo/mxbb-news'); + // *************** *** 241,245 **** 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'remove_remarks' ), 'mysql4' => array( --- 248,252 ---- 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'mx_remove_remarks' ), 'mysql4' => array( *************** *** 248,252 **** 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'remove_remarks' ), 'postgres' => array( --- 255,259 ---- 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'mx_remove_remarks' ), 'postgres' => array( *************** *** 255,259 **** 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'remove_comments' ), // 'mssql' => array( --- 262,266 ---- 'DELIM' => ';', 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'mx_remove_comments' ), // 'mssql' => array( *************** *** 262,266 **** // 'DELIM' => 'GO', // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'remove_comments' // ), // 'msaccess' => array( --- 269,273 ---- // 'DELIM' => 'GO', // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'mx_remove_comments' // ), // 'msaccess' => array( *************** *** 276,280 **** // 'DELIM' => 'GO', // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'remove_comments' // ), ); --- 283,287 ---- // 'DELIM' => 'GO', // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'mx_remove_comments' // ), ); *************** *** 305,309 **** // Send file -------------------------------------------------- // ! if ( $HTTP_POST_VARS['send_file'] == 1 ) { header( "Content-Type: text/x-delimtext; name=\"config.$phpEx\"" ); --- 312,316 ---- // Send file -------------------------------------------------- // ! if ( isset($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 ) { header( "Content-Type: text/x-delimtext; name=\"config.$phpEx\"" ); *************** *** 350,354 **** include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); page_header_install($lang['Welcome_install'], $lang['Choose_lang_explain']); $template->set_filenames(array('language' => 'mx_install_language.tpl')); --- 357,361 ---- include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); page_header_install($lang['Welcome_install'], $lang['Choose_lang_explain']); $template->set_filenames(array('language' => 'mx_install_language.tpl')); *************** *** 466,470 **** include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); page_header_install($lang['Welcome_install'], $instruction_text); $template->set_filenames(array('button' => 'mx_install_button.tpl')); --- 473,477 ---- include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); page_header_install($lang['Welcome_install'], $instruction_text); $template->set_filenames(array('button' => 'mx_install_button.tpl')); *************** *** 564,577 **** if( $install_mode == 'upgrade' && count($schemas) > 0 ) { ! // ! // FYI: update_session_cache() needs $portal_config to be filled. ! // ! $sql = 'SELECT * FROM '.PORTAL_TABLE.' WHERE portal_id = 1'; ! if( ($result = $db->sql_query($sql)) ) { ! $portal_config = $db->sql_fetchrow($result); ! include($mx_root_path . "includes/mx_cache.$phpEx"); ! update_session_cache(); ! $process_msgs[] = $lang['Cache_generate']; } } --- 571,599 ---- if( $install_mode == 'upgrade' && count($schemas) > 0 ) { ! if( version_compare($mx_portal_version, '2.8.0', '<') ) { ! // ! // FYI: This is how the cache worked before 2.8.0. ! // ! if( @file_exists($mx_root_path . 'cache/block_config.xml') ) ! { ! include($mx_root_path . "cache/mx_cache.$phpEx"); ! write_cache_config(); ! $process_msgs[] = $lang['Cache_generate']; ! } ! } ! else ! { ! // ! // FYI: update_session_cache() needs $portal_config to be filled. ! // ! $sql = 'SELECT * FROM '.PORTAL_TABLE.' WHERE portal_id = 1'; ! if( ($result = $db->sql_query($sql)) ) ! { ! $portal_config = $db->sql_fetchrow($result); ! include($mx_root_path . "includes/mx_cache.$phpEx"); ! update_session_cache(); ! $process_msgs[] = $lang['Cache_generate']; ! } } } *************** *** 589,597 **** $message .= '<span' . ( $process_errors > 0 ? ' style="color:orange;"' : '' ) . '>' . $warning . '</span><br />'; $message .= '<hr />'; $message .= '<p><b>' . ( $install_mode == 'install' ? $lang['Portal_intalled'] : $lang['Portal_upgraded'] ) . '</b></p>'; ! $message .= $lang['Portal_install_done'] . '<br /><br />'; include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); page_header_install($install_title, $message); $template->set_filenames(array('button' => 'mx_install_button.tpl')); --- 611,625 ---- $message .= '<span' . ( $process_errors > 0 ? ' style="color:orange;"' : '' ) . '>' . $warning . '</span><br />'; $message .= '<hr />'; + $message .= '<p>' . sprintf($lang['Subscribe_mxBB_News_now'], '<a href="'.U_MXBB_NEWS_INFO.'" target="_blank">', '</a>', '<a href="'.U_MXBB_NEWS_NOW.'" target="_blank">', '</a>') . '</p>'; + $message .= '<hr />'; $message .= '<p><b>' . ( $install_mode == 'install' ? $lang['Portal_intalled'] : $lang['Portal_upgraded'] ) . '</b></p>'; ! for( $i=0; $i < count($lang['Portal_install_done']); $i++ ) ! { ! $message .= ($i+1) . ') ' . $lang['Portal_install_done'][$i] . '<br />'; ! } ! $message .= ' <br /> <br />' . $lang['Thanks_for_choosing'] . '<br /> <br />'; include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); page_header_install($install_title, $message); $template->set_filenames(array('button' => 'mx_install_button.tpl')); *************** *** 616,620 **** // include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); --- 644,648 ---- // include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); *************** *** 824,845 **** // ! // Validate db // ! switch ( $phpbb_info['dbms'] ) ! { ! case 'mysql': ! include($phpbb_root_path . "db/mysql.$phpEx"); ! break; ! case 'mysql4': ! include($phpbb_root_path . "db/mysql4.$phpEx"); ! break; ! case 'postgres': ! include($phpbb_root_path . "db/postgres7.$phpEx"); ! break; ! default: ! continue; ! } ! $db = new sql_db($phpbb_info['dbhost'], $phpbb_info['dbuser'], $phpbb_info['dbpasswd'], $phpbb_info['dbname'], false); ! if ( !$db->db_connect_id ) { $phpbb_failed = true; --- 852,858 ---- // ! // Try to Connect to this phpBB Database // ! if( !open_phpbb_db($db, $phpbb_info) ) { $phpbb_failed = true; *************** *** 976,979 **** --- 989,993 ---- $install_moreinfo = sprintf($lang['Install_moreinfo'], '<a href="'.U_RELEASE_NOTES.'" target="_blank">', '</a>', + '<a href="'.U_WELCOME_PACK.'" target="_blank">', '</a>', '<a href="'.U_ONLINE_FAQ.'" target="_blank">', '</a>', '<a href="'.U_ONLINE_SUPPORT.'" target="_blank">', '</a>', *************** *** 1025,1029 **** { include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); page_header_install($lang['Installation_error'], $message); } --- 1039,1043 ---- { include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); page_header_install($lang['Installation_error'], $message); } *************** *** 1273,1277 **** // ! // Connect to a phpBB Database to get its full URL // function get_phpbb_url($table_prefix) --- 1287,1291 ---- // ! // Get the full phpBB URL by reading its config table. // function get_phpbb_url($table_prefix) *************** *** 1297,1300 **** --- 1311,1348 ---- } + // + // Connecting to a phpBB Database. + // + function open_phpbb_db(&$db, &$phpbb_info) + { + global $mx_root_path, $phpEx; + + if( !defined('BEGIN_TRANSACTION') ) + { + define('BEGIN_TRANSACTION', 1); + define('END_TRANSACTION', 2); + } + + switch ( $phpbb_info['dbms'] ) + { + case 'mysql': + include($mx_root_path . "install/db/mysql.$phpEx"); + break; + case 'mysql4': + include($mx_root_path . "install/db/mysql4.$phpEx"); + break; + case 'postgres': + include($mx_root_path . "install/db/postgres7.$phpEx"); + break; + default: + return false; + } + + $class = 'sql_db_'.$phpbb_info['dbms']; + $db = new $class($phpbb_info['dbhost'], $phpbb_info['dbuser'], $phpbb_info['dbpasswd'], $phpbb_info['dbname'], false); + + return $db->db_connect_id; + } + // *************** *** 1368,1372 **** // include($mx_root_path . "includes/template.$phpEx"); ! $template = new mx_Template($mx_root_path . 'install/templates'); page_header_install('phpInfo()'); $template->set_filenames(array('phpinfo' => 'mx_install_phpinfo.tpl')); --- 1416,1420 ---- // include($mx_root_path . "includes/template.$phpEx"); ! $template = new Template($mx_root_path . 'install/templates'); page_header_install('phpInfo()'); $template->set_filenames(array('phpinfo' => 'mx_install_phpinfo.tpl')); *************** *** 1426,1429 **** --- 1474,1488 ---- } + // + // Commands Processor (very simple parser, but still useful) + // + function mx_remove_remarks(&$sql) + { + return preg_replace('/(\n){2,}/', "\n", preg_replace('/^#.*/m', "\n", $sql)); + } + function mx_remove_comments(&$sql) + { + return preg_replace('/(\n){2,}/', "\n", preg_replace('/^--.*/m', "\n", $sql)); + } // *************** *** 1434,1438 **** global $dbms, $available_dbms, $mx_table_prefix; ! $remove_remarks = $available_dbms[$dbms]['COMMENTS'];; $delimiter = $available_dbms[$dbms]['DELIM']; $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; --- 1493,1497 ---- global $dbms, $available_dbms, $mx_table_prefix; ! $remove_remarks = $available_dbms[$dbms]['COMMENTS']; $delimiter = $available_dbms[$dbms]['DELIM']; $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; *************** *** 1441,1445 **** // Read the schemas file and build an array of statements // ! $commands_ary = @fread(@fopen($schema, 'r'), @filesize($schema)); $commands_ary = preg_replace('/mx_table_/', $mx_table_prefix, $commands_ary); $commands_ary = $remove_remarks($commands_ary); --- 1500,1504 ---- // Read the schemas file and build an array of statements // ! $commands_ary = @file_get_contents($schema); $commands_ary = preg_replace('/mx_table_/', $mx_table_prefix, $commands_ary); $commands_ary = $remove_remarks($commands_ary); |
|
From: Markus P. <mar...@us...> - 2005-04-06 06:35:09
|
Update of /cvsroot/mxbb/core/install/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25583/install/db Added Files: mysql.php mysql4.php postgres7.php Log Message: The installer is now able to detect and deal with more that one phpBB board installed on the target system (it was already, but...) even if they're *using different DB engines*. The upgrade cache code is now able to deal with 2.8.0 and previous versions. Added references to the mxBB-News mailing list (a new message in last install/upgrade panels) and a link to the new Welcome Package in page footer. --- NEW FILE: mysql.php --- <?php /*************************************************************************** * mysql.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: mysql.php,v 1.1 2005/04/06 06:35:00 markus_petrux Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if(!defined("SQL_LAYER_mysql")) { define("SQL_LAYER_mysql","mysql"); class sql_db_mysql { var $db_connect_id; var $query_result; var $row = array(); var $rowset = array(); var $num_queries = 0; // // Constructor // function sql_db_mysql($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; $this->user = $sqluser; $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database; if($this->persistency) { $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password); } else { $this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password); } if($this->db_connect_id) { if($database != "") { $this->dbname = $database; $dbselect = @mysql_select_db($this->dbname); if(!$dbselect) { @mysql_close($this->db_connect_id); $this->db_connect_id = $dbselect; } } return $this->db_connect_id; } else { return false; } } // // Other base methods // function sql_close() { if($this->db_connect_id) { if($this->query_result) { @mysql_free_result($this->query_result); } $result = @mysql_close($this->db_connect_id); return $result; } else { return false; } } // // Base query method // function sql_query($query = "", $transaction = FALSE) { // Remove any pre-existing queries unset($this->query_result); if($query != "") { $this->num_queries++; $this->query_result = @mysql_query($query, $this->db_connect_id); } if($this->query_result) { unset($this->row[$this->query_result]); unset($this->rowset[$this->query_result]); return $this->query_result; } else { return ( $transaction == END_TRANSACTION ) ? true : false; } } // // Other query methods // function sql_numrows($query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $result = @mysql_num_rows($query_id); return $result; } else { return false; } } function sql_affectedrows() { if($this->db_connect_id) { $result = @mysql_affected_rows($this->db_connect_id); return $result; } else { return false; } } function sql_numfields($query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $result = @mysql_num_fields($query_id); return $result; } else { return false; } } function sql_fieldname($offset, $query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $result = @mysql_field_name($query_id, $offset); return $result; } else { return false; } } function sql_fieldtype($offset, $query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $result = @mysql_field_type($query_id, $offset); return $result; } else { return false; } } function sql_fetchrow($query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $this->row[$query_id] = @mysql_fetch_array($query_id); return $this->row[$query_id]; } else { return false; } } function sql_fetchrowset($query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { unset($this->rowset[$query_id]); unset($this->row[$query_id]); while($this->rowset[$query_id] = @mysql_fetch_array($query_id)) { $result[] = $this->rowset[$query_id]; } return $result; } else { return false; } } function sql_fetchfield($field, $rownum = -1, $query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if($query_id) { if($rownum > -1) { $result = @mysql_result($query_id, $rownum, $field); } else { if(empty($this->row[$query_id]) && empty($this->rowset[$query_id])) { if($this->sql_fetchrow()) { $result = $this->row[$query_id][$field]; } } else { if($this->rowset[$query_id]) { $result = $this->rowset[$query_id][$field]; } else if($this->row[$query_id]) { $result = $this->row[$query_id][$field]; } } } return $result; } else { return false; } } function sql_rowseek($rownum, $query_id = 0){ if(!$query_id) { $query_id = $this->query_result; } if($query_id) { $result = @mysql_data_seek($query_id, $rownum); return $result; } else { return false; } } function sql_nextid(){ if($this->db_connect_id) { $result = @mysql_insert_id($this->db_connect_id); return $result; } else { return false; } } function sql_freeresult($query_id = 0){ if(!$query_id) { $query_id = $this->query_result; } if ( $query_id ) { unset($this->row[$query_id]); unset($this->rowset[$query_id]); @mysql_free_result($query_id); return true; } else { return false; } } function sql_error($query_id = 0) { $result["message"] = @mysql_error($this->db_connect_id); $result["code"] = @mysql_errno($this->db_connect_id); return $result; } } // class sql_db } // if ... define ?> --- NEW FILE: mysql4.php --- <?php /*************************************************************************** * mysql4.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : supportphpbb.com * * $Id: mysql4.php,v 1.1 2005/04/06 06:35:00 markus_petrux Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if(!defined("SQL_LAYER_mysql4")) { define("SQL_LAYER_mysql4","mysql4"); class sql_db_mysql4 { var $db_connect_id; var $query_result; var $row = array(); var $rowset = array(); var $num_queries = 0; var $in_transaction = 0; // // Constructor // function sql_db_mysql4($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; $this->user = $sqluser; $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database; $this->db_connect_id = ($this->persistency) ? mysql_pconnect($this->server, $this->user, $this->password) : mysql_connect($this->server, $this->user, $this->password); if( $this->db_connect_id ) { if( $database != "" ) { $this->dbname = $database; $dbselect = mysql_select_db($this->dbname); if( !$dbselect ) { mysql_close($this->db_connect_id); $this->db_connect_id = $dbselect; } } return $this->db_connect_id; } else { return false; } } // // Other base methods // function sql_close() { if( $this->db_connect_id ) { // // Commit any remaining transactions // if( $this->in_transaction ) { mysql_query("COMMIT", $this->db_connect_id); } return mysql_close($this->db_connect_id); } else { return false; } } // // Base query method // function sql_query($query = "", $transaction = FALSE) { // // Remove any pre-existing queries // unset($this->query_result); if( $query != "" ) { $this->num_queries++; if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction ) { $result = mysql_query("BEGIN", $this->db_connect_id); if(!$result) { return false; } $this->in_transaction = TRUE; } $this->query_result = mysql_query($query, $this->db_connect_id); } else { if( $transaction == END_TRANSACTION && $this->in_transaction ) { $result = mysql_query("COMMIT", $this->db_connect_id); } } if( $this->query_result ) { unset($this->row[$this->query_result]); unset($this->rowset[$this->query_result]); if( $transaction == END_TRANSACTION && $this->in_transaction ) { $this->in_transaction = FALSE; if ( !mysql_query("COMMIT", $this->db_connect_id) ) { mysql_query("ROLLBACK", $this->db_connect_id); return false; } } return $this->query_result; } else { if( $this->in_transaction ) { mysql_query("ROLLBACK", $this->db_connect_id); $this->in_transaction = FALSE; } return false; } } // // Other query methods // function sql_numrows($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? mysql_num_rows($query_id) : false; } function sql_affectedrows() { return ( $this->db_connect_id ) ? mysql_affected_rows($this->db_connect_id) : false; } function sql_numfields($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? mysql_num_fields($query_id) : false; } function sql_fieldname($offset, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? mysql_field_name($query_id, $offset) : false; } function sql_fieldtype($offset, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? mysql_field_type($query_id, $offset) : false; } function sql_fetchrow($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if( $query_id ) { $this->row[$query_id] = mysql_fetch_array($query_id, MYSQL_ASSOC); return $this->row[$query_id]; } else { return false; } } function sql_fetchrowset($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if( $query_id ) { unset($this->rowset[$query_id]); unset($this->row[$query_id]); while($this->rowset[$query_id] = mysql_fetch_array($query_id, MYSQL_ASSOC)) { $result[] = $this->rowset[$query_id]; } return $result; } else { return false; } } function sql_fetchfield($field, $rownum = -1, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if( $query_id ) { if( $rownum > -1 ) { $result = mysql_result($query_id, $rownum, $field); } else { if( empty($this->row[$query_id]) && empty($this->rowset[$query_id]) ) { if( $this->sql_fetchrow() ) { $result = $this->row[$query_id][$field]; } } else { if( $this->rowset[$query_id] ) { $result = $this->rowset[$query_id][$field]; } else if( $this->row[$query_id] ) { $result = $this->row[$query_id][$field]; } } } return $result; } else { return false; } } function sql_rowseek($rownum, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? mysql_data_seek($query_id, $rownum) : false; } function sql_nextid() { return ( $this->db_connect_id ) ? mysql_insert_id($this->db_connect_id) : false; } function sql_freeresult($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if ( $query_id ) { unset($this->row[$query_id]); unset($this->rowset[$query_id]); mysql_free_result($query_id); return true; } else { return false; } } function sql_error() { $result['message'] = mysql_error($this->db_connect_id); $result['code'] = mysql_errno($this->db_connect_id); return $result; } } // class sql_db } // if ... define ?> --- NEW FILE: postgres7.php --- <?php /*************************************************************************** * postgres7.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : supportphpbb.com * * $Id: postgres7.php,v 1.1 2005/04/06 06:35:00 markus_petrux Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if(!defined("SQL_LAYER_postgres")) { define("SQL_LAYER_postgres","postgresql"); class sql_db_postgres { var $db_connect_id; var $query_result; var $in_transaction = 0; var $row = array(); var $rowset = array(); var $rownum = array(); var $num_queries = 0; // // Constructor // function sql_db_postgres($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->connect_string = ""; if( $sqluser ) { $this->connect_string .= "user=$sqluser "; } if( $sqlpassword ) { $this->connect_string .= "password=$sqlpassword "; } if( $sqlserver ) { if( ereg(":", $sqlserver) ) { list($sqlserver, $sqlport) = split(":", $sqlserver); $this->connect_string .= "host=$sqlserver port=$sqlport "; } else { if( $sqlserver != "localhost" ) { $this->connect_string .= "host=$sqlserver "; } } } if( $database ) { $this->dbname = $database; $this->connect_string .= "dbname=$database"; } $this->persistency = $persistency; $this->db_connect_id = ( $this->persistency ) ? pg_pconnect($this->connect_string) : pg_connect($this->connect_string); return ( $this->db_connect_id ) ? $this->db_connect_id : false; } // // Other base methods // function sql_close() { if( $this->db_connect_id ) { // // Commit any remaining transactions // if( $this->in_transaction ) { @pg_exec($this->db_connect_id, "COMMIT"); } if( $this->query_result ) { @pg_freeresult($this->query_result); } return @pg_close($this->db_connect_id); } else { return false; } } // // Query method // function sql_query($query = "", $transaction = false) { // // Remove any pre-existing queries // unset($this->query_result); if( $query != "" ) { $this->num_queries++; $query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query); if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction ) { $this->in_transaction = TRUE; if( !@pg_exec($this->db_connect_id, "BEGIN") ) { return false; } } $this->query_result = @pg_exec($this->db_connect_id, $query); if( $this->query_result ) { if( $transaction == END_TRANSACTION ) { $this->in_transaction = FALSE; if( !@pg_exec($this->db_connect_id, "COMMIT") ) { @pg_exec($this->db_connect_id, "ROLLBACK"); return false; } } $this->last_query_text[$this->query_result] = $query; $this->rownum[$this->query_result] = 0; unset($this->row[$this->query_result]); unset($this->rowset[$this->query_result]); return $this->query_result; } else { if( $this->in_transaction ) { @pg_exec($this->db_connect_id, "ROLLBACK"); } $this->in_transaction = FALSE; return false; } } else { if( $transaction == END_TRANSACTION && $this->in_transaction ) { $this->in_transaction = FALSE; if( !@pg_exec($this->db_connect_id, "COMMIT") ) { @pg_exec($this->db_connect_id, "ROLLBACK"); return false; } } return true; } } // // Other query methods // function sql_numrows($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_numrows($query_id) : false; } function sql_numfields($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_numfields($query_id) : false; } function sql_fieldname($offset, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_fieldname($query_id, $offset) : false; } function sql_fieldtype($offset, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_fieldtype($query_id, $offset) : false; } function sql_fetchrow($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if($query_id) { $this->row = @pg_fetch_array($query_id, $this->rownum[$query_id]); if( $this->row ) { $this->rownum[$query_id]++; return $this->row; } } return false; } function sql_fetchrowset($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if( $query_id ) { unset($this->rowset[$query_id]); unset($this->row[$query_id]); $this->rownum[$query_id] = 0; while( $this->rowset = @pg_fetch_array($query_id, $this->rownum[$query_id], PGSQL_ASSOC) ) { $result[] = $this->rowset; $this->rownum[$query_id]++; } return $result; } return false; } function sql_fetchfield($field, $row_offset=-1, $query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } if( $query_id ) { if( $row_offset != -1 ) { $this->row = @pg_fetch_array($query_id, $row_offset, PGSQL_ASSOC); } else { if( $this->rownum[$query_id] ) { $this->row = @pg_fetch_array($query_id, $this->rownum[$query_id]-1, PGSQL_ASSOC); } else { $this->row = @pg_fetch_array($query_id, $this->rownum[$query_id], PGSQL_ASSOC); if( $this->row ) { $this->rownum[$query_id]++; } } } return $this->row[$field]; } return false; } function sql_rowseek($offset, $query_id = 0) { if(!$query_id) { $query_id = $this->query_result; } if( $query_id ) { if( $offset > -1 ) { $this->rownum[$query_id] = $offset; return true; } else { return false; } } return false; } function sql_nextid() { $query_id = $this->query_result; if($query_id && $this->last_query_text[$query_id] != "") { if( preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text[$query_id], $tablename) ) { $query = "SELECT currval('" . $tablename[1] . "_id_seq') AS last_value"; $temp_q_id = @pg_exec($this->db_connect_id, $query); if( !$temp_q_id ) { return false; } $temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC); return ( $temp_result ) ? $temp_result['last_value'] : false; } } return false; } function sql_affectedrows($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_cmdtuples($query_id) : false; } function sql_freeresult($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } return ( $query_id ) ? @pg_freeresult($query_id) : false; } function sql_error($query_id = 0) { if( !$query_id ) { $query_id = $this->query_result; } $result['message'] = @pg_errormessage($this->db_connect_id); $result['code'] = -1; return $result; } } // class ... db_sql } // if ... defined ?> |
|
From: Markus P. <mar...@us...> - 2005-04-06 06:27:39
|
Update of /cvsroot/mxbb/core/install/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23960/db Log Message: Directory /cvsroot/mxbb/core/install/db added to the repository |
|
From: Markus P. <mar...@us...> - 2005-04-06 06:11:40
|
Update of /cvsroot/mxbb/core/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20685 Modified Files: lang_admin.php Log Message: Changed a couple of lang entries related to the mxBB Installer. Index: lang_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/language/lang_english/lang_admin.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** lang_admin.php 4 Apr 2005 00:18:55 -0000 1.33 --- lang_admin.php 6 Apr 2005 06:11:31 -0000 1.34 *************** *** 192,196 **** $lang['Install_Instruction'] = "Please, fill out the details requested below. This installation program will create your personalized config.php (in the Portal root directory) and the Portal database with default settings. Once this is done, you'll see a report of all the steps taken (please note mxBB-Portal does not modify your phpBB database in any way). Then, you should login to your board with your administrator username and password and go to the Administration Control Panel to configure your portal upon your own needs. Please note mxBB-Portal will not work by itself, phpBB must already be installed and configured. Thank you for choosing mxBB-Portal."; $lang['Upgrade_Instruction'] = "mxBB-Portal is already installed. Please, make backups of your database now !<br /><br />The next step will modify the structure of your database (please note mxBB-Portal does not modify your phpBB database in any way). If for whatever reason this upgrade procedure fails, there would be no other way to return to your current state. Please, make backups of your database BEFORE proceeding !<br /><br />Once done, click the button below to start the upgrade procedure."; ! $lang['Install_moreinfo'] = "%sRelease Notes%s | %sOnline FAQ%s | %sSupport Forums%s | %sTerms Of Use%s"; $lang['Install_settings'] = "Installation Settings"; $lang['Choose_lang_explain'] = "Please, use the form below to select the language you wish to use thoughtout the installation panels."; --- 192,196 ---- $lang['Install_Instruction'] = "Please, fill out the details requested below. This installation program will create your personalized config.php (in the Portal root directory) and the Portal database with default settings. Once this is done, you'll see a report of all the steps taken (please note mxBB-Portal does not modify your phpBB database in any way). Then, you should login to your board with your administrator username and password and go to the Administration Control Panel to configure your portal upon your own needs. Please note mxBB-Portal will not work by itself, phpBB must already be installed and configured. Thank you for choosing mxBB-Portal."; $lang['Upgrade_Instruction'] = "mxBB-Portal is already installed. Please, make backups of your database now !<br /><br />The next step will modify the structure of your database (please note mxBB-Portal does not modify your phpBB database in any way). If for whatever reason this upgrade procedure fails, there would be no other way to return to your current state. Please, make backups of your database BEFORE proceeding !<br /><br />Once done, click the button below to start the upgrade procedure."; ! $lang['Install_moreinfo'] = "%sRelease Notes%s | %sWelcome Pack%s | %sOnline FAQ%s | %sSupport Forums%s | %sTerms Of Use%s"; $lang['Install_settings'] = "Installation Settings"; $lang['Choose_lang_explain'] = "Please, use the form below to select the language you wish to use thoughtout the installation panels."; *************** *** 231,235 **** $lang['Install_warning'] = "There was 1 warning updating the database"; $lang['Install_warnings'] = "There were %d warnings updating the database"; ! $lang['Portal_install_done'] = "1) At this point your basic installation is complete.<br />2) Please, delete the /install and /contrib folders BEFORE proceeding!!!<br />3) Remember to make backups as often as possible ;-)<br />4) Press the button below and use your Administrator username and password to login to the system.<br />5) Please be sure to check the Portal Configurations and make any required changes.<br /><br />Thank you for choosing mxBB-Portal.<br />"; $lang['Critical_Error'] = "CRITICAL ERROR"; $lang['Error_loading_config'] = "Sorry, could not load mxBB-Portal config.php"; --- 231,241 ---- $lang['Install_warning'] = "There was 1 warning updating the database"; $lang['Install_warnings'] = "There were %d warnings updating the database"; ! $lang['Subscribe_mxBB_News_now'] = "We recommend that you subscribe to the %smxBB-News Mailing List%s to receive information about important news and release announcements.<br /> <br />%sSubscribe to mxBB-News, now!%s"; ! $lang['Portal_install_done'][0] = "At this point your basic installation is complete."; ! $lang['Portal_install_done'][1] = "Please, delete the /install and /contrib folders BEFORE proceeding!!!"; ! $lang['Portal_install_done'][2] = "Remember to make backups as often as possible ;-)"; ! $lang['Portal_install_done'][3] = "Press the button below and use your Administrator username and password to login to the system."; ! $lang['Portal_install_done'][4] = "Please be sure to check the Portal Configurations and make any required changes."; ! $lang['Thanks_for_choosing'] = "Thank you for choosing mxBB-Portal."; $lang['Critical_Error'] = "CRITICAL ERROR"; $lang['Error_loading_config'] = "Sorry, could not load mxBB-Portal config.php"; |
|
From: Jon O. <jon...@us...> - 2005-04-05 20:52:40
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/modules/mx_kb/templates/subSilver Modified Files: kb_footer.tpl Log Message: forgot a bunch of switches for the core 2.7.x branch :( Index: kb_footer.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_footer.tpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** kb_footer.tpl 2 Apr 2005 20:37:03 -0000 1.6 --- kb_footer.tpl 5 Apr 2005 20:52:30 -0000 1.7 *************** *** 14,19 **** {QUICK_NAV} </select> ! <!-- <input type="hidden" name="sid" value="{SID}" /> --> ! <input type="hidden" name="mode" value="cat" /> <input type="submit" value="{L_QUICK_JUMP}" class="liteoption" /></span> </td> --- 14,18 ---- {QUICK_NAV} </select> ! {S_HIDDEN_VARS} <input type="submit" value="{L_QUICK_JUMP}" class="liteoption" /></span> </td> |
|
From: Jon O. <jon...@us...> - 2005-04-05 20:52:39
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/modules/mx_kb/includes Modified Files: functions_kb.php kb_constants.php kb_footer.php Log Message: forgot a bunch of switches for the core 2.7.x branch :( Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** functions_kb.php 2 Apr 2005 20:37:02 -0000 1.27 --- functions_kb.php 5 Apr 2005 20:52:30 -0000 1.28 *************** *** 1837,1841 **** global $news_type_select_data, $kb_type_select_data, $kb_config; ! if ( !MXBB_MODULE ) { return true; --- 1837,1841 ---- global $news_type_select_data, $kb_type_select_data, $kb_config; ! if ( !MXBB_MODULE || MXBB_27x ) { return true; *************** *** 1857,1861 **** global $news_type_select_data, $kb_config; ! if ( !MXBB_MODULE ) { return true; --- 1857,1861 ---- global $news_type_select_data, $kb_config; ! if ( !MXBB_MODULE || MXBB_27x) { return true; Index: kb_footer.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_footer.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_footer.php 2 Apr 2005 20:37:03 -0000 1.4 --- kb_footer.php 5 Apr 2005 20:52:30 -0000 1.5 *************** *** 39,43 **** } ! if ( !MXBB_MODULE ) { $template->assign_block_vars( 'copy_footer', array() ); --- 39,43 ---- } ! if ( !MXBB_MODULE ||MXBB_27x ) { $template->assign_block_vars( 'copy_footer', array() ); *************** *** 45,51 **** --- 45,53 ---- $quick_nav_action = this_kb_mxurl(); + $s_hidden_vars = '<input type="hidden" name="mode" value="cat"><input type="hidden" name="page" value="' . $page_id . '">'; $template->assign_vars( array( 'QUICK_JUMP_ACTION' => $quick_nav_action, + 'S_HIDDEN_VARS' => $s_hidden_vars, //'SID' => $userdata['session_id'], Index: kb_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_constants.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** kb_constants.php 2 Apr 2005 20:37:03 -0000 1.23 --- kb_constants.php 5 Apr 2005 20:52:30 -0000 1.24 *************** *** 109,113 **** } ! if ( !MXBB_MODULE ) { $kb_module_version = "Knowledge Base v. 2.0"; --- 109,113 ---- } ! if ( !MXBB_MODULE || MXBB_27x ) { $kb_module_version = "Knowledge Base v. 2.0"; |
|
From: Jon O. <jon...@us...> - 2005-04-05 20:52:39
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/modules/mx_kb Modified Files: kb.php Log Message: forgot a bunch of switches for the core 2.7.x branch :( Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** kb.php 1 Apr 2005 23:33:52 -0000 1.16 --- kb.php 5 Apr 2005 20:52:30 -0000 1.17 *************** *** 23,26 **** --- 23,30 ---- if ( !function_exists( 'read_block_config' ) ) { + if ( MXBB_27x ) + { + mx_message_die(GENERAL_MESSAGE, 'This module does not support standalone usage. In the adminCP, add the kb block to a portal page'); + } define( 'IN_PORTAL', true ); $mx_root_path = '../../'; *************** *** 120,123 **** --- 124,128 ---- } + define('MXBB_MODULE', true); define('MXBB_27x', true); |
|
From: Jon O. <jon...@us...> - 2005-04-05 20:52:38
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/modules/mx_kb/admin Modified Files: admin_kb_art.php Log Message: forgot a bunch of switches for the core 2.7.x branch :( Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_kb_art.php 2 Apr 2005 22:03:19 -0000 1.18 --- admin_kb_art.php 5 Apr 2005 20:52:20 -0000 1.19 *************** *** 112,116 **** $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; - $article_id = intval( $HTTP_GET_VARS['a'] ); --- 112,115 ---- *************** *** 119,122 **** --- 118,123 ---- case 'approve': + $kb_custom_field = new kb_custom_field(); + $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; if ( !( $results = $db->sql_query( $sql ) ) ) |