1 頁 (共 1 頁)

[問題]★安裝 phpBB 2.0.10 卻發現一堆大問題★

發表於 : 2004-09-02 19:38
eva7141
我從 phpBB 2.0.3 版
改成 phpBB 2.0.10 版
改好多次才改成功

結果興高采烈的進了:系統管理控制台\r

卻發現左邊的選單列表...

中英參半~"~

英文的選項點了全部都出現一般錯誤

中文的都顯示正常...

錯誤訊息將在以下發表...........

選項:Attachments
(上面這個是指...XX區塊,例如:系統管理區塊內有控制台首頁,討論區首頁,預覽討論區)

瞭解嗎?就是這個選項請如何翻譯成中文@@?

在Attachments選項下的Control Panel (如何翻成中文)

按下去會顯示

代碼: 選擇全部


一般錯誤

Error getting total attachments

DEBUG MODE
\r
SQL Error : 1146 Table 'phpbb2.attachments_desc_table' doesn't exist

SELECT count(*) AS total FROM ATTACHMENTS_DESC_TABLE

Line : 369
File : c:\appserv\www\phpbb2\admin\admin_attach_cp.php
這該如何解決~?
而同在Attachments下之Shadow attachments(如何翻中文?)

代碼: 選擇全部


一般錯誤

Could not find Attachment Config Table

DEBUG MODE

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist

SELECT * FROM ATTACH_CONFIG_TABLE

Line : 96
File : c:\appserv\www\phpbb2\admin\admin_attachments.php

仔細看~都是大同小異...但是不是相同錯誤~因為數字不同..還有部分地方都些微不同
中場休息時間:不好意思麻煩各位了>"<~錯誤太多...又都不同~"~

在Extensions選項下之Extension control

代碼: 選擇全部

一般錯誤
Could not query attachment information

DEBUG MODE

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist

SELECT * FROM ATTACH_CONFIG_TABLE

Line : 82
File : c:\appserv\www\phpbb2\admin\admin_extensions.php
同在Extensions下之Extension group manage

代碼: 選擇全部

一般錯誤
Could not query attachment information

DEBUG MODE

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist

SELECT * FROM ATTACH_CONFIG_TABLE

Line : 82
File : c:\appserv\www\phpbb2\admin\admin_extensions.php
又在Extensions下之Forbidden extensions

代碼: 選擇全部

一般錯誤
Could not query attachment information

DEBUG MODE

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist

SELECT * FROM ATTACH_CONFIG_TABLE

Line : 82
File : c:\appserv\www\phpbb2\admin\admin_extensions.php
還是在Extensions下之Special categories

代碼: 選擇全部

一般錯誤
Could not find Attachment Config Table

DEBUG MODE

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist

SELECT * FROM ATTACH_CONFIG_TABLE

Line : 96
File : c:\appserv\www\phpbb2\admin\admin_attachments.php
在會員管理下之Prune users (這個幫忙改成中文就好)

點下去是顯示正常的...

整體簡單來說...就是需要翻譯成中文跟解決錯誤訊息~"~

我實在對各位感到非常抱歉...我知道我的問題很多又很亂>"<

但是我需要各位的協助...

至於我是怎麼架起來的...老實說我忘了~"~

因為是在失敗好幾次後才成功的~

我到底下載了哪些東西...我自己也不清楚~"~

感謝大家協助~感謝各位

發表於 : 2004-09-02 20:07
messagebox
SQL Error : 1146 Table 'phpbb2.attachments_desc_table' doesn't exist
資料庫phpbb2裡沒有attachments_desc_table這個資料表\r

SQL Error : 1146 Table 'phpbb2.attach_config_table' doesn't exist
資料庫phpbb2裡沒有attach_config_table這個資料表\r

SELECT count(*) AS total FROM ATTACHMENTS_DESC_TABLE
這是你下的SQL~

其中~ATTACHMENTS_DESC_TABLE 應該是這個MOD必須宣告的常數部分~

需要的資料為~你的MOD來源連結~
你的c:\appserv\www\phpbb2\admin\admin_attach_cp.php

還有~includes/constants.php

我在猜~應該是你忘了定義常數

發表於 : 2004-09-02 20:12
eva7141
ㄜ...
我剛剛看了一下~
她顯示的檔案我都有耶~"~

那我需要PO出什麼東西給您幫忙查看呢>"<?

發表於 : 2004-09-02 20:14
messagebox
eva7141 寫:我剛剛看了一下~
她顯示的檔案我都有耶~"~
如果你沒有那個檔案~怎麼有可能會在那個沒有的檔案發生錯誤呢~
當然是有檔案才會發生錯誤在那個檔案上~

需要的文件第2篇說的非常詳細~請在仔細看一下~

以下是自己猜的原因~
includes/constants.php 沒定義該MOD需要用的常數\r
EX.
define('ATTACHMENTS_DESC_TABLE', $table_prefix.'attachments_desc');

發表於 : 2004-09-02 20:30
eva7141
嗯.....對不起...
不過我還是不會修改耶~"~

能不能請您幫忙呢@@?

發表於 : 2004-09-02 20:38
messagebox
第2篇 寫:需要的資料為~你的MOD來源連結~
你的c:\appserv\www\phpbb2\admin\admin_attach_cp.php

還有~includes/constants.php
我上面2次回文章都有說到我需要這些資料~
你沒看到??

發表於 : 2004-09-02 20:57
eva7141
喔喔!?
是要我把這2個文件PO出來給您檢查就對了@@?

admin_attach_cp.php

代碼: 選擇全部

<?php
/***************************************************************************
 *							admin_attach_cp.php
 *							-------------------
 *	begin				: Saturday, Feb 09, 2002
 *	copyright			: (C) 2002 Meik Sievertsen
 *	email				: acyd.burn@gmx.de
 *
 *	$Id: admin_attach_cp.php,v 1.6 2002/08/31 13:33:41 meik 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.
 *
 ***************************************************************************/

define('IN_PHPBB', true);

if( !empty($setmodules) )
{
	$filename = basename(__FILE__);
	$module['Attachments']['Control_Panel'] = $filename;
	return;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);

include($phpbb_root_path . 'attach_mod/includes/functions_selects.' . $phpEx);
include($phpbb_root_path . 'attach_mod/includes/functions_admin.' . $phpEx);

//
// Init Variables
//
$start = ( isset($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;

if(isset($HTTP_POST_VARS['order']))
{
	$sort_order = ($HTTP_POST_VARS['order'] == 'ASC') ? 'ASC' : 'DESC';
}
else if(isset($HTTP_GET_VARS['order']))
{
	$sort_order = ($HTTP_GET_VARS['order'] == 'ASC') ? 'ASC' : 'DESC';
}
else
{
	$sort_order = '';
}

if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
{
	$mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
	$mode = '';
}

if( isset($HTTP_GET_VARS['view']) || isset($HTTP_POST_VARS['view']) )
{
	$view = ( isset($HTTP_POST_VARS['view']) ) ? $HTTP_POST_VARS['view'] : $HTTP_GET_VARS['view'];
}
else
{
	$view = '';
}

if(isset($HTTP_GET_VARS['uid']) || isset($HTTP_POST_VARS['u_id']))
{
	$uid = (isset($HTTP_POST_VARS['u_id'])) ? $HTTP_POST_VARS['u_id'] : $HTTP_GET_VARS['uid'];
}
else
{
	$uid = '';
}

$view = ( $HTTP_POST_VARS['search'] ) ? 'attachments' : $view;

//
// process modes based on view
//
if ($view == 'username')
{
	$mode_types_text = array($lang['Sort_Username'], $lang['Sort_Attachments'], $lang['Sort_Size']);
	$mode_types = array('username', 'attachments', 'filesize');

	if (empty($mode))
	{
		$mode = 'attachments';
		$sort_order = 'DESC';
	}
}
else if ($view == 'attachments')
{
	$mode_types_text = array($lang['Sort_Filename'], $lang['Sort_Comment'], $lang['Sort_Extension'], $lang['Sort_Size'], $lang['Sort_Downloads'], $lang['Sort_Posttime'], /*$lang['Sort_Posts']*/);
	$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time'/*, 'posts'*/);

	if (empty($mode))
	{
		$mode = 'real_filename';
		$sort_order = 'ASC';
	}
}
else if ($view == 'search')
{
	$mode_types_text = array($lang['Sort_Filename'], $lang['Sort_Comment'], $lang['Sort_Extension'], $lang['Sort_Size'], $lang['Sort_Downloads'], $lang['Sort_Posttime'], /*$lang['Sort_Posts']*/);
	$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time'/*, 'posts'*/);

	$sort_order = 'DESC';
}
else
{
	$view = 'stats';
	$mode_types_text = array();
	$sort_order = '';
}


//
// Pagination ?
//
$do_pagination = ( ($view != 'stats') && ($view != 'search') ) ? TRUE : FALSE;

//
// Set Order
//
$order_by = '';

if ($view == 'username')
{
	switch($mode)
	{
		case 'username':
			$order_by = 'ORDER BY u.username ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'attachments':
			$order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'filesize':
			$order_by = 'ORDER BY total_size ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		default:
			$mode = 'attachments';
			$sort_order = 'DESC';
			$order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
	}
}
else if ($view == 'attachments')
{
	switch($mode)
	{
		case 'filename':
			$order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'comment':
			$order_by = 'ORDER BY a.comment ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'extension':
			$order_by = 'ORDER BY a.extension ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'filesize':
			$order_by = 'ORDER BY a.filesize ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
\n		case 'downloads':
			$order_by = 'ORDER BY a.download_count ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		case 'post_time':
			$order_by = 'ORDER BY a.filetime ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
		default:
			$mode = 'a.real_filename';
			$sort_order = 'ASC';
			$order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['topics_per_page'];
			break;
	}
}

//
// Set select fields
//
$view_types_text = array($lang['View_Statistic'], $lang['View_Search'], $lang['View_Username'], $lang['View_Attachments']);
$view_types = array('stats', 'search', 'username', 'attachments');

$select_view = '<select name="view">';

for($i = 0; $i < count($view_types_text); $i++)
{
	$selected = ($view == $view_types[$i]) ? ' selected="selected"' : '';
	$select_view .= '<option value="' . $view_types[$i] . '"' . $selected . '>' . $view_types_text[$i] . '</option>';
}
$select_view .= '</select>';

if (count($mode_types_text) > 0)
{
	$select_sort_mode = '<select name="mode">';

	for($i = 0; $i < count($mode_types_text); $i++)
	{
		$selected = ($mode == $mode_types[$i]) ? ' selected="selected"' : '';
		$select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>';
	}
	$select_sort_mode .= '</select>';
}

if (!empty($sort_order))
{
	$select_sort_order = '<select name="order">';
	if($sort_order == 'ASC')
	{
		$select_sort_order .= '<option value="ASC" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="DESC">' . $lang['Sort_Descending'] . '</option>';
	}
	else
	{
		$select_sort_order .= '<option value="ASC">' . $lang['Sort_Ascending'] . '</option><option value="DESC" selected="selected">' . $lang['Sort_Descending'] . '</option>';
	}
	$select_sort_order .= '</select>';
}

$submit_change = ( isset($HTTP_POST_VARS['submit_change']) ) ? TRUE : FALSE;
$delete = ( isset($HTTP_POST_VARS['delete']) ) ? TRUE : FALSE;
$delete_id_list = ( isset($HTTP_POST_VARS['delete_id_list']) ) ?  $HTTP_POST_VARS['delete_id_list'] : array();

$confirm = ( $HTTP_POST_VARS['confirm'] ) ? TRUE : FALSE;

if ( ($confirm) && (count($delete_id_list) > 0) )
{
	$attachments = array();

	delete_attachment(-1, $delete_id_list);
}
else if ( ($delete) && (count($delete_id_list)) > 0 )
{
	//
	// Not confirmed, show confirmation message
	//	
	$hidden_fields = '<input type="hidden" name="view" value="' . $view . '" />';
	$hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
	$hidden_fields .= '<input type="hidden" name="order" value="' . $sort_order . '" />';
	$hidden_fields .= '<input type="hidden" name="u_id" value="' . $uid . '" />';
	$hidden_fields .= '<input type="hidden" name="start" value="' . $start . '" />';

	for($i = 0; $i < count($delete_id_list); $i++)
	{
		$hidden_fields .= '<input type="hidden" name="delete_id_list[]" value="' . $delete_id_list[$i] . '" />';
	}

	$template->set_filenames(array(
		'confirm' => 'confirm_body.tpl')
	);

	$template->assign_vars(array(
		'MESSAGE_TITLE' => $lang['Confirm'],
		'MESSAGE_TEXT' => $lang['Confirm_delete_attachments'],

		'L_YES' => $lang['Yes'],
		'L_NO' => $lang['No'],

		'S_CONFIRM_ACTION' => append_sid('admin_attach_cp.' . $phpEx),
		'S_HIDDEN_FIELDS' => $hidden_fields)
	);

	$template->pparse('confirm');
	
	include('page_footer_admin.'.$phpEx);

	exit;
}

//
// Assign Default Template Vars
//
$template->assign_vars(array(
	'L_VIEW' => $lang['View'],
	'L_SUBMIT' => $lang['Submit'],
	'L_CONTROL_PANEL_TITLE' => $lang['Control_panel_title'],
	'L_CONTROL_PANEL_EXPLAIN' => $lang['Control_panel_explain'],

	'S_VIEW_SELECT' => $select_view,
	'S_MODE_ACTION' => append_sid('admin_attach_cp.' . $phpEx))
);

if ($submit_change && $view == 'attachments')
{
	$attach_change_list = ( isset($HTTP_POST_VARS['attach_id_list']) ) ? $HTTP_POST_VARS['attach_id_list'] : array();
	$attach_comment_list = ( isset($HTTP_POST_VARS['attach_comment_list']) ) ? $HTTP_POST_VARS['attach_comment_list'] : array();
	$attach_count_list = ( isset($HTTP_POST_VARS['attach_count_list']) ) ? $HTTP_POST_VARS['attach_count_list'] : array();

	//
	// Generate correct Change List
	//
	$attachments = array();

	for ($i = 0; $i < count($attach_change_list); $i++)
	{
		$attachments['_' . $attach_change_list[$i]]['comment'] = stripslashes(htmlspecialchars($attach_comment_list[$i]));
		$attachments['_' . $attach_change_list[$i]]['count'] = intval($attach_count_list[$i]);
	}

	$sql = "SELECT *
	FROM " . ATTACHMENTS_DESC_TABLE . "
	ORDER BY attach_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Couldn\'t get Attachment informations', '', __LINE__, __FILE__, $sql);
	}

	if ( ($db->sql_numrows($result)) > 0 )
	{
		$attachrow = $db->sql_fetchrowset($result);

		for ($i = 0; $i < count($attachrow); $i++)
		{
			if ( ($attachrow[$i]['comment'] != $attachments['_' . $attachrow[$i]['attach_id']]['comment']) || (intval($attachrow[$i]['download_count']) != intval($attachments['_' . $attachrow[$i]['attach_id']]['count'])) )
			{
				$sql = "UPDATE " . ATTACHMENTS_DESC_TABLE . " 
				SET comment = '" . $attachments['_' . $attachrow[$i]['attach_id']]['comment'] . "', download_count = " . $attachments['_' . $attachrow[$i]['attach_id']]['count'] . "
				WHERE attach_id = " . $attachrow[$i]['attach_id'];
				
				if (!$db->sql_query($sql))
				{
					message_die(GENERAL_ERROR, 'Couldn\'t update Attachments Informations', '', __LINE__, __FILE__, $sql);
				}
			}
		}
	}
}

//
// Statistics
//
if ($view == 'stats')
{

	$template->set_filenames(array(
		'body' => 'admin/attach_cp_body.tpl')
	);

	$upload_dir_size = get_formatted_dirsize();

	if ($attach_config['attachment_quota'] >= 1048576)
	{
		$attachment_quota = round($attach_config['attachment_quota'] / 1048576 * 100) / 100 . ' ' . $lang['MB'];
	}
	else if ($attach_config['attachment_quota'] >= 1024)
	{
		$attachment_quota = round($attach_config['attachment_quota'] / 1024 * 100) / 100 . ' ' . $lang['KB'];
	}
	else
	{
		$attachment_quota = $attach_config['attachment_quota'] . ' ' . $lang['Bytes'];
	}

	$sql = "SELECT count(*) AS total
	FROM " . ATTACHMENTS_DESC_TABLE;

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total attachments', '', __LINE__, __FILE__, $sql);
	}

	$total = $db->sql_fetchrow($result);
	$number_of_attachments = $total['total'];

	$sql = "SELECT post_id
	FROM " . ATTACHMENTS_TABLE . "
	WHERE post_id <> 0
	GROUP BY post_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total posts', '', __LINE__, __FILE__, $sql);
	}

	$number_of_posts = $db->sql_numrows($result);

	$sql = "SELECT privmsgs_id
	FROM " . ATTACHMENTS_TABLE . "
	WHERE privmsgs_id <> 0
	GROUP BY privmsgs_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total private messages', '', __LINE__, __FILE__, $sql);
	}

	$number_of_pms = $db->sql_numrows($result);

	$sql = "SELECT p.topic_id
	FROM " . ATTACHMENTS_TABLE . " a, " . POSTS_TABLE . " p
	WHERE a.post_id = p.post_id
	GROUP BY p.topic_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total topics', '', __LINE__, __FILE__, $sql);
	}

	$number_of_topics = $db->sql_numrows($result);

	$sql = "SELECT user_id_1
	FROM " . ATTACHMENTS_TABLE . "
	WHERE (post_id <> 0)
	GROUP BY user_id_1";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
	}

	$number_of_users = $db->sql_numrows($result);

	$template->assign_vars(array(
		'L_STATISTIC' => $lang['Statistic'],
		'L_VALUE' => $lang['Value'],
		'L_NUMBER_OF_ATTACHMENTS' => $lang['Number_of_attachments'],
		'L_TOTAL_FILESIZE' => $lang['Total_filesize'],
		'L_ATTACH_QUOTA' => $lang['Attach_quota'],
		'L_NUMBER_OF_POSTS' => $lang['Number_posts_attach'],
		'L_NUMBER_OF_PMS' => $lang['Number_pms_attach'],
		'L_NUMBER_OF_TOPICS' => $lang['Number_topics_attach'],
		'L_NUMBER_OF_USERS' => $lang['Number_users_attach'],
		
		'TOTAL_FILESIZE' => $upload_dir_size,
		'ATTACH_QUOTA' => $attachment_quota,
		'NUMBER_OF_ATTACHMENTS' => $number_of_attachments,
		'NUMBER_OF_POSTS' => $number_of_posts,
		'NUMBER_OF_PMS' => $number_of_pms,
		'NUMBER_OF_TOPICS' => $number_of_topics,
		'NUMBER_OF_USERS' => $number_of_users)
	);

}

//
// Search
//
if ($view == 'search')
{

	//
	// Get Forums and Categories
	//
	$sql = "SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id  
	FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
	WHERE f.cat_id = c.cat_id 
	ORDER BY c.cat_id, f.forum_order";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain forum_name/forum_id', '', __LINE__, __FILE__, $sql);
	}

	$s_forums = '';
	while ($row = $db->sql_fetchrow($result))
	{
		$s_forums .= '<option value="' . $row['forum_id'] . '">' . $row['forum_name'] . '</option>';

		if( empty($list_cat[$row['cat_id']]) )
		{
			$list_cat[$row['cat_id']] = $row['cat_title'];
		}
	}

	if( $s_forums != '' )
	{
		$s_forums = '<option value="-1">' . $lang['All_available'] . '</option>' . $s_forums;

		//
		// Category to search
		//
		$s_categories = '<option value="-1">' . $lang['All_available'] . '</option>';
		while( list($cat_id, $cat_title) = @each($list_cat))
		{
			$s_categories .= '<option value="' . $cat_id . '">' . $cat_title . '</option>';
		}
	}
	else
	{
		message_die(GENERAL_MESSAGE, $lang['No_searchable_forums']);
	}
	
	$template->set_filenames(array(
		'body' => 'admin/attach_cp_search.tpl')
	);

	$template->assign_vars(array(
		'L_ATTACH_SEARCH_QUERY' => $lang['Attach_search_query'],
		'L_FILENAME' => $lang['File_name'],
		'L_COMMENT' => $lang['File_comment'],
		'L_SEARCH_OPTIONS' => $lang['Search_options'],
		'L_SEARCH_AUTHOR' => $lang['Search_author'],
		'L_WILDCARD_EXPLAIN' => $lang['Search_wildcard_explain'],
		'L_SIZE_SMALLER_THAN' => $lang['Size_smaller_than'],		
		'L_SIZE_GREATER_THAN' => $lang['Size_greater_than'],
		'L_COUNT_SMALLER_THAN' => $lang['Count_smaller_than'],		
		'L_COUNT_GREATER_THAN' => $lang['Count_greater_than'],
		'L_MORE_DAYS_OLD' => $lang['More_days_old'],
		'L_CATEGORY' => $lang['Category'], 
		'L_ORDER' => $lang['Order'],
		'L_SORT_BY' => $lang['Select_sort_method'],
		'L_FORUM' => $lang['Forum'],
		'L_SEARCH' => $lang['Search'],

		'S_FORUM_OPTIONS' => $s_forums, 
		'S_CATEGORY_OPTIONS' => $s_categories,
		'S_SORT_OPTIONS' => $select_sort_mode,
		'S_SORT_ORDER' => $select_sort_order)
	);
}

//
// Username
//
if ($view == 'username')
{

	$template->set_filenames(array(
		'body' => 'admin/attach_cp_user.tpl')
	);

	$template->assign_vars(array(
		'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
		'L_ORDER' => $lang['Order'],
		'L_USERNAME' => $lang['Username'],
		'L_TOTAL_SIZE' => $lang['Size_in_kb'],
		'L_ATTACHMENTS' => $lang['Attachments'],

		'S_MODE_SELECT' => $select_sort_mode,
		'S_ORDER_SELECT' => $select_sort_order)
	);


	//
	// Get all Users with their respective total attachments amount
	//
	$sql = "SELECT u.username, a.user_id_1 as user_id, count(*) as total_attachments
	FROM " . ATTACHMENTS_TABLE . " a, " . USERS_TABLE . " u
	WHERE (a.user_id_1 = u.user_id)
	GROUP BY a.user_id_1, u.username"; 

	if ($mode != 'filesize')
	{
		$sql .= ' ' . $order_by;
	}
	
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
	}

	$members = $db->sql_fetchrowset($result);
	$num_members = $db->sql_numrows($result);

	if ( $num_members > 0 )
	{
		for ($i = 0; $i < $num_members; $i++)
		{
			//
			// Get all attach_id's the specific user posted
			//
			$sql = "SELECT attach_id 
			FROM " . ATTACHMENTS_TABLE . "
			WHERE (user_id_1 = " . $members[$i]['user_id'] . ") 
			GROUP BY attach_id";
		
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
			}
		
			$attach_ids = $db->sql_fetchrowset($result);
			$num_attach_ids = $db->sql_numrows($result);
			$attach_id = array();

			for ($j = 0; $j < $num_attach_ids; $j++)
			{
				$attach_id[] = $attach_ids[$j]['attach_id'];
			}
			
			//
			// Now get the total filesize
			//
			$sql = "SELECT sum(filesize) as total_size
			FROM " . ATTACHMENTS_DESC_TABLE . "
			WHERE attach_id IN (" . implode(', ', $attach_id) . ")";

			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
			}

			$row = $db->sql_fetchrow($result);
			$members[$i]['total_size'] = $row['total_size'];
		}
		
		if ($mode == 'filesize')
		{
			$members = sort_multi_array($members, 'total_size', $sort_order, FALSE);
			$members = limit_array($members, $start, $board_config['topics_per_page']);
		}
		
		for ($i = 0; $i < count($members); $i++)
		{
			$username = $members[$i]['username'];
			$total_attachments = $members[$i]['total_attachments'];
			$total_size = $members[$i]['total_size'];

			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

			$template->assign_block_vars('memberrow', array(
				'ROW_NUMBER' => $i + ( $HTTP_GET_VARS['start'] + 1 ),
				'ROW_COLOR' => '#' . $row_color,
				'ROW_CLASS' => $row_class,
				'USERNAME' => $username,
				'TOTAL_ATTACHMENTS' => $total_attachments,
				'TOTAL_SIZE' => round(($total_size / MEGABYTE), 2),
				'U_VIEW_MEMBER' => append_sid('admin_attach_cp.' . $phpEx . '?view=attachments&uid=' . $members[$i]['user_id']))
			);
		}
	}

	$sql = "SELECT user_id_1
	FROM " . ATTACHMENTS_TABLE . "
	GROUP BY user_id_1";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
	}

	$total_rows = $db->sql_numrows($result);
}

//
// Attachments
//
if ($view == 'attachments')
{
	$user_based = ( !empty($uid) ) ? TRUE : FALSE;
	$search_based = ( $HTTP_POST_VARS['search'] ) ? TRUE : FALSE;
	
	$hidden_fields = '';
	
	$template->set_filenames(array(
		'body' => 'admin/attach_cp_attachments.tpl')
	);

	$template->assign_vars(array(
		'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
		'L_ORDER' => $lang['Order'],

		'L_FILENAME' => $lang['File_name'],
		'L_FILECOMMENT' => $lang['File_comment_cp'],
		'L_EXTENSION' => $lang['Extension'],
		'L_SIZE' => $lang['Size_in_kb'],
		'L_DOWNLOADS' => $lang['Downloads'],
		'L_POST_TIME' => $lang['Post_time'],
		'L_POSTED_IN_TOPIC' => $lang['Posted_in_topic'],
		'L_DELETE' => $lang['Delete'],
		'L_DELETE_MARKED' => $lang['Delete_marked'],
		'L_SUBMIT_CHANGES' => $lang['Submit_changes'],
		'L_MARK_ALL' => $lang['Mark_all'],
		'L_UNMARK_ALL' => $lang['Unmark_all'],

		'S_MODE_SELECT' => $select_sort_mode,
		'S_ORDER_SELECT' => $select_sort_order)
	);

	$total_rows = 0;
	
	// 
	// Are we called from Username ?
	//
	if ($user_based)
	{
		$sql = "SELECT username 
		FROM " . USERS_TABLE . " 
		WHERE user_id = " . $uid;

		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Error getting username', '', __LINE__, __FILE__, $sql);
		}

		$row = $db->sql_fetchrow($result);
		$username = $row['username'];

		$s_hidden = '<input type="hidden" name="u_id" value="' . $uid . '">';
	
		$template->assign_block_vars('switch_user_based', array());

		$template->assign_vars(array(
			'S_USER_HIDDEN' => $s_hidden,
			'L_STATISTICS_FOR_USER' => sprintf($lang['Statistics_for_user'], $username))
		);

		$sql = "SELECT attach_id 
		FROM " . ATTACHMENTS_TABLE . "
		WHERE user_id_1 = " . $uid . "
		GROUP BY attach_id";
		
		if ( !($result = $db->sql_query($sql)) )
		{\r
			message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
		}
		
		$attach_ids = $db->sql_fetchrowset($result);
		$num_attach_ids = $db->sql_numrows($result);

		if ($num_attach_ids == 0)
		{
			message_die(GENERAL_MESSAGE, 'For some reason no Attachments are assigned to the User "' . $username . '".');
		}
		
		$total_rows = $num_attach_ids;

		$attach_id = array();

		for ($j = 0; $j < $num_attach_ids; $j++)
		{
			$attach_id[] = $attach_ids[$j]['attach_id'];
		}
			
		$sql = "SELECT a.*
		FROM " . ATTACHMENTS_DESC_TABLE . " a
		WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " .
		$order_by;
		
	}
	else if ($search_based)
	{
		//
		// we are called from search
		//
		$attachments = search_attachments($order_by, $total_rows);
	}
	else
	{
		$sql = "SELECT a.*
		FROM " . ATTACHMENTS_DESC_TABLE . " a " .
		$order_by;
	}

	if (!$search_based)
	{
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
		}

		$attachments = $db->sql_fetchrowset($result);
		$num_attach = $db->sql_numrows($result);
	}
	
	if (count($attachments) > 0)
	{
		for ($i = 0; $i < count($attachments); $i++)
		{
			$delete_box = '<input type="checkbox" name="delete_id_list[]" value="' . $attachments[$i]['attach_id'] . '" />';

			for ($j = 0; $j < count($delete_id_list); $j++)
			{
				if ($delete_id_list[$j] == $attachments[$i]['attach_id'])
				{
					$delete_box = '<input type="checkbox" name="delete_id_list[]" value="' . $attachments[$i]['attach_id'] . '" checked />';
					break;
				}
			}

			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

			//
			// Is the Attachment assigned to more than one post ?
			// If it's not assigned to any post, it's an private message thingy. ;)
			//
			$post_titles = array();

			$sql = "SELECT *
			FROM " . ATTACHMENTS_TABLE . "
			WHERE attach_id = " . $attachments[$i]['attach_id'];

			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
			}

			$ids = $db->sql_fetchrowset($result);
			$num_ids = $db->sql_numrows($result);

			for ($j = 0; $j < $num_ids; $j++)
			{
				if ($ids[$j]['post_id'] != 0)
				{
					$sql = "SELECT t.topic_title
					FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
					WHERE p.post_id = " . $ids[$j]['post_id'] . " AND p.topic_id = t.topic_id
					GROUP BY t.topic_id, t.topic_title";

					if ( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Couldn\'t query topic', '', __LINE__, __FILE__, $sql);
					}

					$row = $db->sql_fetchrow($result);
					$post_title = $row['topic_title'];

					if (strlen($post_title) > 32)
					{
						$post_title = substr($post_title, 0, 30) . '...';
					}

					$view_topic = append_sid('../viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $ids[$j]['post_id'] . '#' . $ids[$j]['post_id']);

					$post_titles[] = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $post_title . '</a>';
				}
				else
				{
					$post_titles[] = $lang['Private_Message'];
				}
			}

			$post_titles = implode('<br />', $post_titles);

			$hidden_field = '<input type="hidden" name="attach_id_list[]" value="' . $attachments[$i]['attach_id'] . '">';

			$template->assign_block_vars('attachrow', array(
				'ROW_NUMBER' => $i + ( $HTTP_GET_VARS['start'] + 1 ),
				'ROW_COLOR' => '#' . $row_color,
				'ROW_CLASS' => $row_class,

				'FILENAME' => $attachments[$i]['real_filename'],
				'COMMENT' => $attachments[$i]['comment'],
				'EXTENSION' => $attachments[$i]['extension'],
				'SIZE' => round(($attachments[$i]['filesize'] / MEGABYTE), 2),
				'DOWNLOAD_COUNT' => $attachments[$i]['download_count'],
				'POST_TIME' => create_date($board_config['default_dateformat'], $attachments[$i]['filetime'], $board_config['board_timezone']),
				'POST_TITLE' => $post_titles,

				'S_DELETE_BOX' => $delete_box,
				'S_HIDDEN' => $hidden_field,
				'U_VIEW_ATTACHMENT' => append_sid('../download.' . $phpEx . '?id=' . $attachments[$i]['attach_id']))
//				'U_VIEW_POST' => ($attachments[$i]['post_id'] != 0) ? append_sid("../viewtopic." . $phpEx . "?" . POST_POST_URL . "=" . $attachments[$i]['post_id'] . "#" . $attachments[$i]['post_id']) : '')
			);
			
		}
	}

	if ( (!$search_based) && (!$user_based) )
	{
		if ($total_attachments == 0)
		{
			$sql = "SELECT attach_id FROM " . ATTACHMENTS_DESC_TABLE;

			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not query Attachment Description Table', '', __LINE__, __FILE__, $sql);
			}

			$total_rows = $db->sql_numrows($result);
		}
	}
}

//
// Generate Pagination
//
if ( ($do_pagination) && ($total_rows > $board_config['topics_per_page']) )
{
	$pagination = generate_pagination('admin_attach_cp.' . $phpEx . '?view=' . $view . '&mode=' . $mode . '&order=' . $sort_order . '&uid=' . $uid, $total_rows, $board_config['topics_per_page'], $start).' ';

	$template->assign_vars(array(
		'PAGINATION' => $pagination,
		'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_rows / $board_config['topics_per_page'] )), 

		'L_GOTO_PAGE' => $lang['Goto_page'])
	);
}

$template->pparse('body');

include('page_footer_admin.'.$phpEx);

?>
 

includes/constants.php

代碼: 選擇全部

<?php
/***************************************************************************
 *                               constants.php
 *                            -------------------
 *   begin                : Saturday', Feb 13', 2001
 *   copyright            : ('C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: constants.php,v 1.47.2.4 2003/06/10 00:39:51 psotfx 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('IN_PHPBB') )
{
	die("Hacking attempt");
}

// Debug Level
//define('DEBUG', 1); // Debugging on
define('DEBUG', 1); // Debugging off


// User Levels <- Do not change the values of USER or ADMIN
define('DELETED', -1);
define('ANONYMOUS', -1);

define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);


// User related
define('USER_ACTIVATION_NONE', 0);
define('USER_ACTIVATION_SELF', 1);
define('USER_ACTIVATION_ADMIN', 2);

define('USER_AVATAR_NONE', 0);
define('USER_AVATAR_UPLOAD', 1);
define('USER_AVATAR_REMOTE', 2);
define('USER_AVATAR_GALLERY', 3);


// Group settings
define('GROUP_OPEN', 0);
define('GROUP_CLOSED', 1);
define('GROUP_HIDDEN', 2);


// Forum state
define('FORUM_UNLOCKED', 0);
define('FORUM_LOCKED', 1);


// Topic status
define('TOPIC_UNLOCKED', 0);
define('TOPIC_LOCKED', 1);
define('TOPIC_MOVED', 2);
define('TOPIC_WATCH_NOTIFIED', 1);
define('TOPIC_WATCH_UN_NOTIFIED', 0);


// Topic types
define('POST_NORMAL', 0);
define('POST_STICKY', 1);
define('POST_ANNOUNCE', 2);
define('POST_GLOBAL_ANNOUNCE', 3);


// SQL codes
define('BEGIN_TRANSACTION', 1);
define('END_TRANSACTION', 2);


// Error codes
define('GENERAL_MESSAGE', 200);
define('GENERAL_ERROR', 202);
define('CRITICAL_MESSAGE', 203);
define('CRITICAL_ERROR', 204);


// Private messaging
define('PRIVMSGS_READ_MAIL', 0);
define('PRIVMSGS_NEW_MAIL', 1);
define('PRIVMSGS_SENT_MAIL', 2);
define('PRIVMSGS_SAVED_IN_MAIL', 3);
define('PRIVMSGS_SAVED_OUT_MAIL', 4);
define('PRIVMSGS_UNREAD_MAIL', 5);


// URL PARAMETERS
define('POST_TOPIC_URL', 't');
define('POST_CAT_URL', 'c');
define('POST_FORUM_URL', 'f');
define('POST_USERS_URL', 'u');
define('POST_POST_URL', 'p');
define('POST_GROUPS_URL', 'g');

// Session parameters
define('SESSION_METHOD_COOKIE', 100);
define('SESSION_METHOD_GET', 101);


// Page numbers for session handling
define('PAGE_INDEX', 0);
define('PAGE_LOGIN', -1);
define('PAGE_SEARCH', -2);
define('PAGE_REGISTER', -3);
define('PAGE_PROFILE', -4);
define('PAGE_VIEWONLINE', -6);
define('PAGE_VIEWMEMBERS', -7);
define('PAGE_FAQ', -8);
define('PAGE_POSTING', -9);
define('PAGE_PRIVMSGS', -10);
define('PAGE_GROUPCP', -11);
define('PAGE_TOPIC_OFFSET', 5000);


// Auth settings
define('AUTH_LIST_ALL', 0);
define('AUTH_ALL', 0);

define('AUTH_REG', 1);
define('AUTH_ACL', 2);
define('AUTH_MOD', 3);
define('AUTH_ADMIN', 5);

define('AUTH_VIEW', 1);
define('AUTH_READ', 2);
define('AUTH_POST', 3);
define('AUTH_REPLY', 4);
define('AUTH_EDIT', 5);
define('AUTH_DELETE', 6);
define('AUTH_ANNOUNCE', 7);
define('AUTH_STICKY', 8);
define('AUTH_POLLCREATE', 9);
define('AUTH_VOTE', 10);
define('AUTH_ATTACH', 11);


// Table names
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
define('BANLIST_TABLE', $table_prefix.'banlist');
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('CONFIG_TABLE', $table_prefix.'config');
define('DISALLOW_TABLE', $table_prefix.'disallow');
define('FORUMS_TABLE', $table_prefix.'forums');
define('GROUPS_TABLE', $table_prefix.'groups');
define('POSTS_TABLE', $table_prefix.'posts');
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');
define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');
define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
define('PRUNE_TABLE', $table_prefix.'forum_prune');
define('RANKS_TABLE', $table_prefix.'ranks');
define('SEARCH_TABLE', $table_prefix.'search_results');
define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');
define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');
define('SESSIONS_TABLE', $table_prefix.'sessions');
define('SMILIES_TABLE', $table_prefix.'smilies');
define('THEMES_TABLE', $table_prefix.'themes');
define('THEMES_NAME_TABLE', $table_prefix.'themes_name');
define('TOPICS_TABLE', $table_prefix.'topics');
define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');
define('USER_GROUP_TABLE', $table_prefix.'user_group');
define('USERS_TABLE', $table_prefix.'users');
define('WORDS_TABLE', $table_prefix.'words');
define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');

?>
這樣吧@@?
還是我會錯意了~"~?

發表於 : 2004-09-02 21:00
messagebox
ATTACHMENTS_DESC_TABLE
ATTACH_CONFIG_TABLE
這兩個常數沒在includes/constants.php裡宣告

需要的資料為~你的MOD來源連結~
前3篇回覆都有說到~第4次提醒

發表於 : 2004-09-02 21:06
eva7141
我知道您一直再提醒...
也對您感抱歉給您帶來困擾~
問題是要怎麼修改...我不會修改>"<a

來源連結........來源連結....來源連結是指什麼@@?

是說mod資料夾位置嗎@@?

C:\AppServ\www\phpbb2\attach_mod

發表於 : 2004-09-02 21:07
eva7141
來源連結........來源連結....來源連結是指什麼@@?

發表於 : 2004-09-02 21:10
eva7141
是說mod資料夾位置嗎@@?

C:\AppServ\www\phpbb2\attach_mod

發表於 : 2004-09-02 21:11
dener
你一開始就把測試的文章刪了?
這樣版面會建立不起來喔
建議你去抓appserv2.40版
然後重新安裝全新的phpbb2
http://www.appservnetwork.com/?modules=&applang=tw
請不要去抓2.50版~因為目前phpbb不支援phpbb5= =

發表於 : 2004-09-02 21:18
eva7141
測試文章是指?

架好論壇的那一篇嗎= =?

那一篇是英文的...

所以就把它刪了.......

您是指這一篇@@?

發表於 : 2004-09-03 10:41
dener
eva7141 寫:測試文章是指?

架好論壇的那一篇嗎= =?

那一篇是英文的...

所以就把它刪了.......

您是指這一篇@@?
沒錯\r
前陣子我剛裝phpbb2.10版時
就先刪了
結果去後台怎麼建版面\r
首頁就是沒有
還有phpbb的網域不能用localhost
請用你的ip
或申請dns轉址...
你還是去抓appserv2.40版吧\r
祝你使用愉快