[外掛] pafiledb integration (下載管理資料庫) (Update 2.0.1)

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
rokk
星球普通子民
星球普通子民
文章: 14
註冊時間: 2003-08-14 17:37

[外掛] pafiledb integration (下載管理資料庫) (Update 2.0.1)

文章 rokk »

代碼: 選擇全部

############################################################## 
## MOD Title: pafiledb integration
## MOD Version: 0.0.9c
## MOD Author: squall < mohdalbasri@yahoo.com > (Mohammed Al-Basri) www.mohd.tk 
##	       MJ < mj@phpbbfm.net > 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 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.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 
############################################################## 
按此下載中文化版本

demo:http://www.rokk.us/phpBB/dload.php

這個模組是整合pafiledb跟phpbb功能的一個強大的下載模組
作者已經將pafiledb0.08整個改寫架構,所以用過0.08版的不用擔心
比之前的版本好太多了@@"
可在分區內設定下載權限(後台控制畫面跟版面權限類似)
並可由使用者上傳檔案,再經由後台核準。
總之是個強大的下載模組。
竹貓這都沒看到人發表出來,所以小弟就獻醜了 :oops:

我只有翻譯語系檔而已,有些scipt上的英文我還沒去改。
感謝竹子大提供中文圖檔,我已經包起來了^^"

歡迎至本站討論此模組,讓他更加完美@@!!
http://www.rokk.us/phpBB/viewforum.php?f=6
最後由 rokk 於 2004-01-10 02:35 編輯,總共編輯了 2 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[建議] 升級 2.0.1

文章 心靈捕手 »

因為這個原始版本 (0.0.9d) 討論的主題, 在官方 phpbb 論壇已經被鎖定.
也就是說, 您將很難獲得日後的支援和協助.
http://www.phpbb.com/phpBB/viewtopic.php?t=56035
所以建議您, 下載其他網友所重新改寫的版本 2.0.1

以下是檔頭說明擷取.

代碼: 選擇全部

############################################################## 
## MOD Title: Download Manager (mxBB pafiledb) integration
## MOD Version: 0.0.9d + mxBB 2.0.1
## MOD Original Author: squall < mohdalbasri@yahoo.com > (Mohammed Al-Basri) www.mohd.tk 
##	       			MJ < mj@phpbbfm.net > www.phpbbfm.com
## MOD Current Author: _Haplo < jonohlsson@hotmail.com > 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.+!
## 
## 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 )
##
##
############################################################## 
目前, 支援網站如下.
http://www.mx-system.com/

下載連結:
http://www.mx-system.com/index.php?page ... file_id=27
http://files.filefront.com/pafiledb_mod ... einfo.html (含正體中文化)

[分享] 0.0.9d 升級 2.0.1 方法:
1. 上傳 / 覆蓋所有舊版的附加檔案
2. 先以系統管理員身分登入論壇, 再以瀏覽器執行 pafiledb/docs/pafiledb_installer.php
http://YOUR_WEBSITE/PHPBB_ROOT/pafiledb/docs/pafiledb_installer.php
點選 Update From pafiledb 0.0.9d
圖檔
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[建議] 中文化以及其他問題修正

文章 心靈捕手 »

相關問題資料來源:
http://phpbb-tw.net/phpbb/viewtopic.php?t=46036
  1. 新版 (2.0.1) 的控制台沒有中文化
    1. 請先確定您下載的版本 (含正體中文化)
    2. 解決後台沒有中文化, 請更改語言檔的檔名
    由 language/lang_chinese_traditional_taiwan/lang_pafiledb_admin.php
    改成 language/lang_chinese_traditional_taiwan/lang_admin_pafiledb.php
    或者, 更改底下檔案.
    #
    #-----[ OPEN ]-----
    #
    admin/index.php

    #
    #-----[ FIND ]-----
    #

    代碼: 選擇全部

    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_pafiledb_admin.' . $phpEx);
    
  2. 猶記進入後台, 左框架頁會出現錯誤訊息.
    如果您有相同的問題, 那麼以下的修改, 提供您參考.
    #
    #-----[ OPEN ]-----
    #
    admin/admin_pa_ug_auth.php

    #
    #-----[ FIND ]-----
    #

    代碼: 選擇全部

    function admin_display_cat_auth( $cat_parent = 0, $depth = 0 )
    {
    	global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx;
    	global $cat_auth_fields, $optionlist_mod, $optionlist_acl_adv;
    	$pre = str_repeat( '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $depth );
    	if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) )
    	{
    		foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data )
    		{
    			$pafiledb_template->assign_block_vars( 'cat_row', array( 'CAT_NAME' => $cat_data['cat_name'],
    					'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true,
    					'PRE' => $pre,
    
    					'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_id=$sub_cat_id" ),
    
    					'S_MOD_SELECT' => $optionlist_mod[$sub_cat_id] ) 
    				);
    
    			for( $j = 0; $j < count( $cat_auth_fields ); $j++ )
    			{
    				$pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) 
    					);
    			}
    			admin_display_cat_auth( $sub_cat_id, $depth + 1 );
    		}
    		return;
    	}
    	return;
    }
    
    #
    #-----[ REPLACE WITH ]-----
    #

    代碼: 選擇全部

    /*function admin_display_cat_auth( $cat_parent = 0, $depth = 0 )
    {
    	global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx;
    	global $cat_auth_fields, $optionlist_mod, $optionlist_acl_adv;
    	$pre = str_repeat( '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $depth );
    	if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) )
    	{
    		foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data )
    		{
    			$pafiledb_template->assign_block_vars( 'cat_row', array( 'CAT_NAME' => $cat_data['cat_name'],
    					'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true,
    					'PRE' => $pre,
    
    					'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_id=$sub_cat_id" ),
    
    					'S_MOD_SELECT' => $optionlist_mod[$sub_cat_id] ) 
    				);
    
    			for( $j = 0; $j < count( $cat_auth_fields ); $j++ )
    			{
    				$pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) 
    					);
    			}
    			admin_display_cat_auth( $sub_cat_id, $depth + 1 );
    		}
    		return;
    	}
    	return;
    }*/
    
    #
    #-----[ SAVE & CLOSE ]-----
    #
  3. 新版 (2.0.1) 控制台左框架頁, 新增選項中文化參考.
    #
    #-----[ OPEN ]-----
    #
    language/lang_chinese_traditional_taiwan/lang_admin.php

    #
    #-----[ FIND ]-----
    #

    代碼: 選擇全部

    ?>
    
    #
    #-----[ BEFORE, ADD ]-----
    #

    代碼: 選擇全部

    // pafiledb 2.0.1
    $lang['pafileDB_Download'] = '下載管理資料庫';
    $lang['Configuration_title'] = '基本組態';
    $lang['Custom_manage_title'] = '慣用欄位';
    $lang['Fchecker_title'] = '檔案維護';
    $lang['Permissions_title'] = '權限設定';
    
    #
    #-----[ SAVE & CLOSE ]-----
    #
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[補充說明] 全新安裝 2.0.1 版注意事項

文章 心靈捕手 »

前言:

因為個人論壇資料庫, 升級到 5.0.x 以上後,
針對此外掛, 發生了一些錯誤訊息-無法搜尋以及上傳檔案.
http://wang5555.dyndns.org/phpbb2/viewt ... 0588#40588

因此在測試論壇全新安裝 2.0.1 版,
也在同時, 發現了這個版本的幾個錯誤.
http://files.filefront.com/pafiledb_mod ... einfo.html (含正體中文化)

茲將相關的解決方法, 提供分享:
1. 該版的 pafiledb_mysql.sql 有遺漏一個資料表的建立.

解決之道: 手動更新

代碼: 選擇全部

#
#-----[ SQL ]-----
#
CREATE TABLE phpbb_pa_files (
  file_id int(10) NOT NULL auto_increment,
  user_id mediumint(8) NOT NULL default '0',
  poster_ip varchar(8) NOT NULL default '',
  file_name text,
  file_size int(20) NOT NULL default '0',
  unique_name varchar(255) NOT NULL default '',
  real_name VARCHAR(255) NOT NULL,
  file_dir VARCHAR(255) NOT NULL,
  file_desc text,
  file_creator text,
  file_version text,
  file_longdesc text,
  file_ssurl text,
  file_sshot_link tinyint(2) NOT NULL default '0',
  file_dlurl text,
  file_time int(50) default NULL,
  file_update_time int(50) NOT NULL default '0',
  file_catid int(10) default NULL,
  file_posticon text,
  file_license int(10) default NULL,
  file_dls int(10) default NULL,
  file_last int(50) default NULL,
  file_pin int(2) default NULL,
  file_docsurl text,
  file_approved TINYINT(1) DEFAULT '1' NOT NULL,
  file_broken TINYINT(1) DEFAULT '0' NOT NULL,
  PRIMARY KEY  (file_id)
) TYPE=MyISAM;
ps.
我重新回原作者網站下載, 發現已經無誤!
http://www.mx-system.com/index.php?page ... file_id=27

2. 缺少置頂選項連結 '圖檔' (icon_mini_download.gif)
ps. 目前, 上述兩個連結下載的版本, 都缺少此檔.

解決方法:
下載此圖 -> 圖檔
儲存路徑: templates/YOUR_THEME/images/icon_mini_download.gif
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[轉貼] [修正] 下載大型檔案出錯 & (utf-8) 下載中文檔名為亂碼

文章 心靈捕手 »

Source: http://phpbb-tw.net/phpbb/viewtopic.php?p=246305#246305

--
tentsy01 寫:履試不成功下又回到心靈老師介紹的網站總算發現了解決方法

代碼: 選擇全部

# ---[ OPEN ]---------- 
# 
../pafiledb/modules/pa_download.php 
# 
# ---[ DELETE ]---------- 
# 
      if ( $size > ( 1048575 * 6 ) ) 
      { 
         return false; 
      } 
我也改了標題分享給可能會發生同樣問題的人
也再次感謝心靈老師指引明燈^^
另外...好像無法傳超過10M的檔案
我也改過php.ini的相關設定
目前就以在伺服器本機上傳為解決之道>_<
看來, 我又胡亂猜錯了. :oops:

依我的個人經驗, 若有較大的檔案 (3M~) 分享, 則直接利用 FTP 伺服器較適宜;
否則, 除了必須調整控制台 (pafiledb) 基本組態的設定值之外,
即使調整 php.ini 的設定值, 也恐怕不易達到預期的目標.

剛才到您的論壇, 測試下載 6100K8MB 顯卡更新DRIVER (29.3 MB)
試了幾次, 都無法完全下載. (大約只有下載 6 MB 左右)
http://bbs.jinnyoung.com.tw/dload.php?a ... file_id=20

原本我在論壇分享的檔案, 通通都只是以 '檔案網址' 的方式分享;
直到要測試您主文提到的 '路徑' 情況, 我才改以 '檔案上傳' 的方式.

--
不過, 倒也讓我發現了一個新的問題:
我的論壇語系編碼為 utf-8, 若上傳檔案的檔名原為中文的話, 則下載後將變為 '亂碼';
這個情況, 似乎與 attach mod (附加檔案) 雷同.

因此, 我參考了 wasabi 的修改方法, 也成功修正了 '亂碼' 的問題. :-D
以下的修改, 提供大家參考:
#
#-----[ OPEN ]-----
#
pafiledb/modules/pa_download.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

	// Send out the Headers
	
	if ( $browser_agent == 'ie' )
	{
		header( 'Content-Type: ' . $mimetype . '; name="' . $real_filename . '"' );
		header( 'Content-Disposition: inline; filename="' . $real_filename . '"' );
	}
	else
	{
		header( 'Content-Type: ' . $mimetype . '; name="' . $real_filename . '"' );
		header( 'Content-Disposition: attachment; filename=' . $real_filename );
	} 
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

   // UTF-8 參考 http://phpbb-tw.net/phpbb/viewtopic.php?p=229051#229051 因應
   // Send out the Headers
   if($browser_agent == 'ie') { 
      header('Content-Type: ' . $mimetype . '; name="' . urlencode($real_filename) . '"'); 
      header('Content-Disposition: inline; filename="' . urlencode($real_filename) . '"'); 
   } else { 
      header('Content-Type: ' . $mimetype . '; name="' . $real_filename . '"'); 
      header('Content-Disposition: inline; filename="' . $real_filename . '"'); 
   }
#
#-----[ SAVE & CLOSE ]-----
#
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「非官方認證外掛」