diff options
-rw-r--r-- | phpBB/includes/functions.php | 37 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_basic.sql | 86 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/templates/subSilver/viewforum_body.html | 4 | ||||
-rw-r--r-- | phpBB/viewforum.php | 1 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 23 |
6 files changed, 93 insertions, 59 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ac15245922..f526eb8416 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -200,7 +200,7 @@ function gen_forum_rules($mode, &$forum_id) { global $SID, $template, $auth, $user; - $rules = array('post', 'reply', 'edit', 'delete', 'attach'); + $rules = array('post', 'reply', 'edit', 'delete', 'attach', 'download'); foreach ($rules as $rule) { @@ -773,6 +773,41 @@ function obtain_icons(&$icons) return; } +// Obtain allowed extensions +function obtain_attach_extensions(&$extensions) +{ + global $db, $cache; + + if ($cache->exists('extensions')) + { + $extensions = $cache->get('extensions'); + } + else + { + // Don't count on forbidden extensions table, because it is not allowed to allow forbidden extensions at all + $sql = "SELECT e.extension, g.cat_id, g.download_mode, g.upload_icon + FROM " . EXTENSIONS_TABLE . " e, " . EXTENSION_GROUPS_TABLE . " g + WHERE e.group_id = g.group_id + AND g.allow_group = 1"; + $result = $db->sql_query($sql); + + $extensions = array(); + while ($row = $db->sql_fetchrow($result)) + { + $extension = strtolower(trim($row['extension'])); + + $extensions[$extension]['display_cat'] = intval($row['cat_id']); + $extensions[$extension]['download_mode'] = intval($row['download_mode']); + $extensions[$extension]['upload_icon'] = trim($row['upload_icon']); + } + $db->sql_freeresult($result); + + $cache->put('extensions', $extensions); + } + + return; +} + function generate_board_url() { global $config; diff --git a/phpBB/install/schemas/mysql_basic.sql b/phpBB/install/schemas/mysql_basic.sql index 847acf6dca..5a8f2704c8 100644 --- a/phpBB/install/schemas/mysql_basic.sql +++ b/phpBB/install/schemas/mysql_basic.sql @@ -196,7 +196,7 @@ INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('u_search', 1); INSERT INTO phpbb_styles (style_id, template_id, theme_id, imageset_id, style_name) VALUES (1, 1, 1, 1, 'subSilver'); # -- phpbb_styles_imageset -INSERT INTO phpbb_styles_imageset (imageset_id, imageset_name, imageset_path, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_ip, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_no_email, btn_no_www, btn_no_icq, btn_no_aim, btn_no_yim, btn_no_msnm, btn_online, btn_offline, btn_topic_watch, btn_topic_unwatch, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, sub_forum, sub_forum_new, folder, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, poll_left, poll_center, poll_right) VALUES (1, 'subSilver © phpBB Group', 'subSilver', '"imagesets/subSilver/{LANG}/btn_post.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_post_pm.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_reply.gif" width="88" height="25" border="0"', '"imagesets/subSilver/{LANG}/reply.gif" width="88" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_locked.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_profile.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_pm.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_delete.gif" width="16" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_ip.gif" width="16" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_quote.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_search.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_edit.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_report.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_email.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_www.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_icq.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_aim.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_yim.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_msnm.gif" width="59" height="18" border="0"', '', '', '', '', '', '', '"imagesets/subSilver/{LANG}/btn_online.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_offline.gif" width="59" height="18" border="0"', NULL, NULL, '"imagesets/subSilver/icon_unapproved.gif" width="19" height="18" border="0"', '"imagesets/subSilver/icon_reported.gif" width="19" height="18" border="0"', '"imagesets/subSilver/icon_minipost.gif" width="14" height="18" border="0"', '"imagesets/subSilver/icon_minipost.gif" width="12" height="9" border="0"', '"imagesets/subSilver/icon_minipost_new.gif" width="12" height="9" border="0"', '"imagesets/subSilver/icon_latest_reply.gif" width="18" height="9" border="0"', '"imagesets/subSilver/icon_newest_reply.gif" width="18" height="9" border="0"', '"imagesets/subSilver/folder_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder_new_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder_locked_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/subfolder_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/subfolder_new_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_hot.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_hot_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_hot.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_hot_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/voting_lcap.gif" width="4" height="12" border="0"', '"imagesets/subSilver/voting_bar.gif" height="12" border="0"', '"imagesets/subSilver/voting_rcap.gif" width="4" height="12" border="0"'); +INSERT INTO phpbb_styles_imageset (imageset_id, imageset_name, imageset_path, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_ip, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_no_email, btn_no_www, btn_no_icq, btn_no_aim, btn_no_yim, btn_no_msnm, btn_online, btn_offline, btn_topic_watch, btn_topic_unwatch, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, sub_forum, sub_forum_new, folder, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, poll_left, poll_center, poll_right) VALUES (1, 'subSilver © phpBB Group', 'subSilver', '"imagesets/subSilver/{LANG}/btn_post.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_post_pm.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_reply.gif" width="88" height="25" border="0"', '"imagesets/subSilver/{LANG}/reply.gif" width="88" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_locked.gif" width="82" height="25" border="0"', '"imagesets/subSilver/{LANG}/btn_profile.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_pm.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_delete.gif" width="16" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_ip.gif" width="16" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_quote.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_search.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_edit.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_report.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_email.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_www.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_icq.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_aim.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_yim.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_msnm.gif" width="59" height="18" border="0"', '', '', '', '', '', '', '"imagesets/subSilver/{LANG}/btn_online.gif" width="59" height="18" border="0"', '"imagesets/subSilver/{LANG}/btn_offline.gif" width="59" height="18" border="0"', NULL, NULL, '"imagesets/subSilver/icon_unapproved.gif" width="19" height="18" border="0"', '"imagesets/subSilver/icon_reported.gif" width="19" height="18" border="0"', '"imagesets/subSilver/icon_attach.gif" width="14" height="18" border="0"', '"imagesets/subSilver/icon_minipost.gif" width="12" height="9" border="0"', '"imagesets/subSilver/icon_minipost_new.gif" width="12" height="9" border="0"', '"imagesets/subSilver/icon_latest_reply.gif" width="18" height="9" border="0"', '"imagesets/subSilver/icon_newest_reply.gif" width="18" height="9" border="0"', '"imagesets/subSilver/folder_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder_new_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder_locked_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/subfolder_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/subfolder_new_big.gif" width="46" height="25" border="0"', '"imagesets/subSilver/folder.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_hot.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_hot_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_hot.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_new_hot_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_lock_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_sticky_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_new.gif" width="19" height="18" border="0"', '"imagesets/subSilver/folder_announce_new_posted.gif" width="19" height="18" border="0"', '"imagesets/subSilver/voting_lcap.gif" width="4" height="12" border="0"', '"imagesets/subSilver/voting_bar.gif" height="12" border="0"', '"imagesets/subSilver/voting_rcap.gif" width="4" height="12" border="0"'); # -- phpbb_styles_template INSERT INTO phpbb_styles_template (template_id, template_name, template_path, poll_length, pm_box_length) VALUES (1, 'subSilver © phpBB Group', 'subSilver', 205, 175); @@ -358,50 +358,48 @@ INSERT INTO phpbb_reports_reasons (reason_id, reason_priority, reason_name, reas INSERT INTO phpbb_reports_reasons (reason_id, reason_priority, reason_name, reason_description) VALUES ( 2, 1, 'other', 'The reported post does not fit into any other category, please use the description field.' ); # -- forbidden_extensions -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (1,'php'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (2,'php3'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (3,'php4'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (4,'phtml'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (5,'pl'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (6,'asp'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (7,'cgi'); -INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (8,'aspx'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (1, 'php'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (2, 'php3'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (3, 'php4'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (4, 'phtml'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (5, 'pl'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (6, 'asp'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (7, 'cgi'); +INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (8, 'aspx'); # -- extension_groups -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (1,'Images',1,1,1,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (2,'Archives',0,1,1,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (3,'Plain Text',0,0,1,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (4,'Documents',0,0,1,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (5,'Real Media',0,0,2,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (6,'Streams',2,0,1,0); -INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, max_filesize) VALUES (7,'Flash Files',3,0,1,0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (1, 'Images', 1, 1, 1, '', 0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (2, 'Archives', 0, 1, 1, '', 0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (3, 'Plain Text', 0, 0, 1, '', 0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (4, 'Documents', 0, 0, 1, '', 0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (5, 'Real Media', 0, 0, 2, '', 0); +INSERT INTO phpbb_extension_groups (group_id, group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize) VALUES (6, 'Streams', 2, 0, 1, '', 0); # -- extensions -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (1, 1,'gif', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (2, 1,'png', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (3, 1,'jpeg', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (4, 1,'jpg', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (5, 1,'tif', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (6, 1,'tga', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (7, 2,'gtar', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (8, 2,'gz', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (9, 2,'tar', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (10, 2,'zip', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (11, 2,'rar', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (12, 2,'ace', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (13, 3,'txt', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (14, 3,'c', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (15, 3,'h', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (16, 3,'cpp', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (17, 3,'hpp', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (18, 3,'diz', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (19, 4,'xls', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (20, 4,'doc', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (21, 4,'dot', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (22, 4,'pdf', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (23, 4,'ai', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (24, 4,'ps', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (25, 4,'ppt', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (26, 5,'rm', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (27, 6,'wma', ''); -INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (28, 7,'swf', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (1, 1, 'gif', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (2, 1, 'png', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (3, 1, 'jpeg', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (4, 1, 'jpg', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (5, 1, 'tif', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (6, 1, 'tga', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (7, 2, 'gtar', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (8, 2, 'gz', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (9, 2, 'tar', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (10, 2, 'zip', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (11, 2, 'rar', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (12, 2, 'ace', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (13, 3, 'txt', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (14, 3, 'c', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (15, 3, 'h', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (16, 3, 'cpp', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (17, 3, 'hpp', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (18, 3, 'diz', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (19, 4, 'xls', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (20, 4, 'doc', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (21, 4, 'dot', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (22, 4, 'pdf', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (23, 4, 'ai', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (24, 4, 'ps', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (25, 4, 'ppt', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (26, 5, 'rm', ''); +INSERT INTO phpbb_extensions (extension_id, group_id, extension, comment) VALUES (27, 6, 'wma', ''); diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 78c1fb4442..ea2d0cede9 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -193,6 +193,7 @@ CREATE TABLE phpbb_extension_groups ( cat_id tinyint(2) DEFAULT '0' NOT NULL, allow_group tinyint(1) DEFAULT '0' NOT NULL, download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + upload_icon varchar(100) DEFAULT '', max_filesize int(20) DEFAULT '0' NOT NULL, PRIMARY KEY (group_id) ); diff --git a/phpBB/templates/subSilver/viewforum_body.html b/phpBB/templates/subSilver/viewforum_body.html index f81beb1a0c..8e5aa18014 100644 --- a/phpBB/templates/subSilver/viewforum_body.html +++ b/phpBB/templates/subSilver/viewforum_body.html @@ -58,11 +58,11 @@ <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align="left" valign="middle"> <td><!-- IF topicrow.S_TOPIC_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a> <!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> <!-- ENDIF --></td> - <td width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</td> + <td width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</td> </tr> </table> <!-- ELSE --> - <span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span> + <span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span> <!-- ENDIF --> </td> <td class="row2" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td> diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 147583472c..eb1a640ba3 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -461,6 +461,7 @@ if ($forum_data['forum_postable']) 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '', 'S_ROW_COUNT' => $i, 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7065518d75..6e27b533d2 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -715,7 +715,7 @@ if ($row = $db->sql_fetchrow($result)) // Does post have an attachment? If so, add it to the list - if ($row['post_attach']) + if ($row['post_attachment']) { $attach_list[] = $post_id; } @@ -890,25 +890,21 @@ else trigger_error($user->lang['NO_TOPIC']); } - -// If we have attachments, grab them ... based on Acyd Burns 2.0.x Mod +// If we have attachments, grab them ... if (sizeof($attach_list)) { $sql = "SELECT a.post_id, d.* FROM " . ATTACHMENTS_TABLE . " a, " . ATTACHMENTS_DESC_TABLE . " d - WHERE a.post_id IN (" . implode(', ', $attach_list) . ") + WHERE a.post_id IN (" . implode(', ', $attach_list) . ") AND a.attach_id = d.attach_id - ORDER BY d.filetime " . $display_order; + ORDER BY d.filetime " . ((!$config['display_order']) ? "ASC" : "DESC"); $result = $db->sql_query($sql); + $extensions = array(); + obtain_attach_extensions($extensions); + if ($db->sql_fetchrow($result)) { - $template->assign_vars(array( - 'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'], - 'L_KILOBYTE' => $lang['KB']) - ); - - $i = 0; do { @@ -920,9 +916,12 @@ if (sizeof($attach_list)) // No attachments exist, but post table thinks they do // so go ahead and reset post_attach flags $sql = "UPDATE " . POSTS_TABLE . " - SET post_attach = 0 + SET post_attachment = 0 WHERE post_id IN (" . implode(', ', $attach_list) . ")"; $db->sql_query($sql); + + // We need to update the topic indicator too if the + // complete topic is now without an attachment } $db->sql_freeresult($result); } |