Wicher Site Admin
Joined: 16 Dec 2005 Posts: 1144 User's local time: 2023 Sep 30 - 2:38 PM Country IP :  Country of choice: 
Was This Post Helpful?

Users postingpoints:
Posts points:
Post gradiation:
|
Posted: Wed Dec 21, 2005 6:42 pm Post subject: |
Wicher
*Delete this user
Items with prefix * are permanent. | Close |
|
|
I changed some code in the viewattachment mod so it now displayes no longer only the links to the attachments but shows the images that are attached.
This only works oke with images that are attached, not with zips or txt or whatever.
The attachments can be show user by user by clicking on the users name.
For the rest: USE AT OWN RISK AND MAKE BACKUPS!!!!
(with thanks to thoul for pointing me in some right directions without knowing where is was for.)
You can view an example at: http://www.wichersmods.nl/attachments.php
When your there, click on a username at the right of the image to see the attachments from that user only.
Before u can use this u willl have to install also:
http://www.phpbbhacks.com/download/4863
Also download the attachment at the bottom of this posting, extract the zip in your images folder.
ATTACHMENTS.PHP:
Code: |
-
- <?php
- /***************************************************************************
- * attachments.php
- * -------------------
- * begin : Friday, Aug 23, 2002
- * copyright : (C) 2002 Meik Sievertsen
- * email : acyd.burn@gmx.de
- *
- * $Id: attachments.php,v 1.0.2 2003/08/31 meik Exp $
- *
- * This version of attachments.php is heavely adjusted for my own needs.
- * Use at own risk.
- *
- ***************************************************************************/
-
- /***************************************************************************
- *
- * 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);
- $phpbb_root_path = './';
- include($phpbb_root_path . 'extension.inc');
- include($phpbb_root_path . 'common.'.$phpEx);
-
- //
- // Start session management
- //
- $userdata = session_pagestart($user_ip, PAGE_INDEX);
- init_userprefs($userdata);
- //
- // End session management
- //
-
-
- if( !$userdata['session_logged_in'] || !isset($userdata))
- {
- redirect("login.$phpEx?redirect=attachments.$phpEx");
- }
-
-
- $attachment_mod_installed = ( defined('ATTACH_CONFIG_TABLE') ) ? TRUE : FALSE;
-
- if (!$attachment_mod_installed)
- {
- message_die(GENERAL_MESSAGE, "The Attachment Mod have to be installed in order to see the Attachment List.");
- }
-
- $sql = 'SELECT config_value
- FROM ' . ATTACH_CONFIG_TABLE . "
- WHERE config_name = 'attach_version'";
-
- if (!($result = $db->sql_query($sql)))
- {
- message_die(GENERAL_ERROR, "Unable to query config table.", '', __LINE__, __FILE__, $sql);
- }
-
- if (!($row = $db->sql_fetchrow($result)))
- {
- message_die(GENERAL_MESSAGE, 'Wrong Attachment Version detected.<br />Please update your Attachment Mod (V' . ATTACH_VERSION . ') to at least Version 3.0.0.');
- }
-
- $attachment_version = $row['config_value'];
-
- $real_filename = 'real_filename';
- $attach_table = ATTACHMENTS_TABLE;
- $attach_desc_table = ATTACHMENTS_DESC_TABLE;
-
- $sql = 'SELECT config_value
- FROM ' . CONFIG_TABLE . "
- WHERE config_name = 'default_lang'";
-
- if (!($result = $db->sql_query($sql)))
- {
- message_die(GENERAL_ERROR, "Unable to query config table.", '', __LINE__, __FILE__, $sql);
- }
-
- $default_lang = $db->sql_fetchrow($result);
- $default_lang = $default_lang['config_value'];
-
- $language = $board_config['default_lang'];
-
- if( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_admin_attach.'.$phpEx) )
- {
- $language = $default_lang;
- }
-
- include($phpbb_root_path . 'language/lang_' . $language . '/lang_admin_attach.' . $phpEx);
-
- //
- // Start user modifiable variables
- //
-
- //
- // Define the default forum by forum-id OR by Forum Name
- // If both are set, the forum id is used
- // To display the Attachments of all Forums, please set the display_all variable to true
- //
- $default_forum_id = '';
- $default_forum_name = '';
-
- // Set this to FALSE or fill the above values for a specific forum to be displayed
- $display_all_forums = TRUE;
-
- //
- // File extensions to show
- // If not present here, viewattachments will show an empty tablecell
- $image_files = array(
- 'bmp',
- 'jpg',
- 'png',
- 'tga',
- 'gif',
- 'peg');
- $flash_files = array(
- 'swf');
- $zip_files = array(
- 'tar',
- 'ace',
- 'zip',
- 'rar',
- '.gz');
- $doc_files = array(
- 'doc',
- 'xls',
- 'dot',
- 'pdf',
- '.ps',
- '.ai',
- 'pps',
- 'ppt');
- $txt_files = array(
- 'txt',
- 'cpp',
- 'diz',
- 'inf',
- 'hpp');
- $video_files = array(
- 'avi',
- 'mpg',
- '.rm',
- 'wma',
- 'wmv');
- $sound_files = array(
- 'mp3',
- 'wav',
- 'mid');
-
- //
- // Define the default Sort.
- // Valid values are: filename, comment, filesize, downloads, post_time
- //
- $default_sort_method = 'filename';
-
- //
- // Default Sort Order: ASC or DESC
- //
- $default_sort_order = 'ASC';
- //
- // End user modifiable variables
- //
-
- //
- // Determine the variables we need for sorting and such
- //
- $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($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 = $default_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 = $default_sort_method;
- }
-
- // Sort and Mode Select
- $mode_types_text = array($lang['Sort_Filename'], $lang['Sort_Comment'], $lang['Sort_Size'], $lang['Sort_Downloads'], $lang['Sort_Posttime']);
- $mode_types = array('filename', 'comment', 'filesize', 'downloads', 'post_time');
-
- $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>';
-
- $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>';
-
- switch ($mode)
- {
- case 'filename':
- $order_by = '' . $real_filename . ' ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['posts_per_page'];
- break;
- case 'comment':
- $order_by = 'comment ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['posts_per_page'];
- break;
- case 'filesize':
- $order_by = 'filesize ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['posts_per_page'];
- break;
- case 'downloads':
- $order_by = 'download_count ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['posts_per_page'];
- break;
- case 'post_time':
- $order_by = 'filetime ' . $sort_order . ' LIMIT ' . $start . ', ' . $board_config['posts_per_page'];
- break;
- default:
- message_die(GENERAL_MESSAGE, "Please have a look at the attachments.php file and define valid sort order default values.");
- break;
- }
-
- // Forum Select
- if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]))
- {
- $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL];
- if ($forum_id == -1)
- {
- $forum_id = '*';
- $display_all_forums = true;
- }
- }
- else
- {
- $default_forum_id = intval($default_forum_id);
- if ($default_forum_id)
- {
- $forum_id = intval($default_forum_id);
- }
- else if ($default_forum_name != '')
- {
- $sql = "SELECT forum_id
- FROM " . FORUMS_TABLE . "
- WHERE forum_name='" . $default_forum_name . "'";
-
- if ( !($result = $db->sql_query($sql) ))
- {
- message_die(GENERAL_MESSAGE, "Please specify a valid Forum Name.'" . $default_forum_name . "' could not be found.");
- }
-
- $row = $db->sql_fetchrow($result);
- $forum_id = $row['forum_id'];
- }
- else if (!$display_all_forums)
- {
- message_die(GENERAL_MESSAGE, "Please have a look at the attachments.php file and define valid forum default values.");
- }
-
- if ($forum_id)
- {
- $sql = "SELECT forum_id
- FROM " . FORUMS_TABLE . "
- WHERE forum_id = $forum_id
- LIMIT 1";
-
- if ( !($result = $db->sql_query($sql) ))
- {
- message_die(GENERAL_ERROR, "Couldn't query forums table.", '', __LINE__, __FILE__, $sql);
- }
-
- if ($db->sql_numrows($result) == 0)
- {
- message_die(GENERAL_MESSAGE, "The default forum id/name does not exist, please check your default values.");
- }
- }
- }
-
- //
- // Search forum - first delete those the user have not access to and then those the user have no permission to download to.
- //
- $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);
- }
-
- $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
- $is_download_auth_ary = auth(AUTH_DOWNLOAD, AUTH_LIST_ALL, $userdata);
-
- $forum_ids = array();
- $select_forums = '';
- while( $row = $db->sql_fetchrow($result) )
- {
- if ( ( $is_auth_ary[$row['forum_id']]['auth_read'] ) && ( $is_download_auth_ary[$row['forum_id']]['auth_download'] ) )
- {
- $selected = ( $forum_id == $row['forum_id'] ) ? ' selected="selected"' : '';
- $select_forums .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $row['forum_name'] . '</option>';
- $forum_ids[] = $row['forum_id'];
- }
- }
-
- if ( $select_forums != '' )
- {
- $select_forums = '<select name="' . POST_FORUM_URL . '"><option value="-1">' . $lang['All_available'] . '</option>' . $select_forums . '</select>';
- }
-
- else
- {
- message_die(GENERAL_MESSAGE, "You are not authorized to view Attachments at all.");
- }
-
- $forum_id = intval($forum_id);
-
- $page_title = $lang['Statistics'];
- include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-
- $template->set_filenames(array(
- 'body' => 'attachments.tpl')
- );
- $sql = '';
-
- $user = ( isset($_REQUEST['gebruiker']) ) ? htmlspecialchars(strip_tags(trim($_REQUEST['gebruiker']))) : '';
- if ($user != '')
- {
- if (!$forum_id && $display_all_forums)
- {
- $sql = "SELECT a.*, t.topic_title, d.*, u.*
- FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
- WHERE (a.post_id = p.post_id)
- AND (p.forum_id IN (" . implode(', ', $forum_ids) . "))
- AND (p.topic_id = t.topic_id)
- AND (a.attach_id = d.attach_id)
- AND (a.user_id_1 = u.user_id)
- AND (u.username = '" . $user . "')
- ORDER BY $order_by";
- }
- else if (($is_auth_ary[$forum_id]['auth_read']) && ($is_download_auth_ary[$forum_id]['auth_download']))
- {
- $sql = "SELECT a.*, t.topic_title, d.*, u.*
- FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
- WHERE (a.post_id = p.post_id)
- AND (p.forum_id = " . $forum_id . ")
- AND (p.topic_id = t.topic_id)
- AND (a.attach_id = d.attach_id)
- AND (a.user_id_1 = u.user_id)
- AND (u.username = '" . $user . "')
- ORDER BY $order_by";
- }
- $backtobegin = '<a href="attachments.php">' . $lang['BackToAll'] . '</a>';
- $useronly = $lang['Attachmentsfrom'] . $user;
- }
- else
- {
- if (!$forum_id && $display_all_forums)
- {
- $sql = "SELECT a.*, t.topic_title, d.*, u.*
- FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
- WHERE (a.post_id = p.post_id)
- AND (p.forum_id IN (" . implode(', ', $forum_ids) . "))
- AND (p.topic_id = t.topic_id)
- AND (a.attach_id = d.attach_id)
- AND (a.user_id_1 = u.user_id)
- ORDER BY $order_by";
- }
- else if (($is_auth_ary[$forum_id]['auth_read']) && ($is_download_auth_ary[$forum_id]['auth_download']))
- {
- $sql = "SELECT a.*, t.topic_title, d.*, u.*
- FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
- WHERE (a.post_id = p.post_id)
- AND (p.forum_id = " . $forum_id . ")
- AND (p.topic_id = t.topic_id)
- AND (a.attach_id = d.attach_id)
- AND (a.user_id_1 = u.user_id)
- ORDER BY $order_by";
- }
- $backtobegin = '';
- $useronly = $lang['AllAttachments'];
- }
-
- $tussen = '»';
- $nodesc = $lang['no_desc'];
-
- $template->set_filenames(array(
- 'body' => 'attachments.tpl')
- );
-
- $template->assign_vars(array(
- 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
- 'L_ORDER' => $lang['Order'],
- 'L_SORT' => $lang['Sort'],
- 'L_SUBMIT' => $lang['Submit'],
- 'L_FORUM' => $lang['Forum'],
-
- 'L_ATTACHMENTS' => $lang['Attachments'],
- 'L_FILENAME' => $lang['File_name'],
- 'L_FILECOMMENT' => $lang['File_comment'],
- 'L_SIZE' => $lang['Size_in_kb'],
- 'L_DOWNLOADS' => $lang['Downloads'],
- 'L_POST_TIME' => $lang['Post_time'],
- 'L_POSTED_IN_TOPIC' => $lang['Posted_in_topic'],
-
- 'S_MODE_SELECT' => $select_sort_mode,
- 'S_ORDER_SELECT' => $select_sort_order,
- 'S_FORUM_SELECT' => $select_forums,
- 'USERONLY' => $useronly,
- 'BYUSER' => $lang['From'],
- 'IMG_NUM' => $lang['number'],
- 'SEEN' => $lang['seen'],
- 'POSTED_IN' => $lang['posted_in'],
- 'DESC_IMG' => $lang['desc_img'],
- 'CLICKTOENLARGE' => $lang['click_to_enlarge'],
- 'IMG_' => $lang['img_'],
- 'TUSSEN' => $tussen,
- 'ONLYUSERATTACH' => $lang['only_user_attach'],
- 'FILE_NAME' => $lang['file_name'],
- 'FILE_NAME' => $lang['file_name'],
- 'S_MODE_ACTION' => append_sid("attachments.$phpEx"))
- );
-
-
- if ($sql != '')
- {
- if (!($result = $db->sql_query($sql)))
- {
- message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
- }
-
- $attachments = $db->sql_fetchrowset($result);
- $num_attachments = $db->sql_numrows($result);
- }
- else
- {
- $attachments = array();
- $num_attachments = 0;
- }
-
- for ($i = 0; $i < $num_attachments; $i++)
- {
- $class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $filename = $attachments[$i][$real_filename];
- $file_ext = substr($filename, (strlen($filename) - 3), strlen($filename));
- $file_ext = strtolower($file_ext);
-
- $post_title = $attachments[$i]['topic_title'];
- $post_title_2 = '';
-
- if (strlen($post_title) > 32)
- {
- $post_title_2 = substr($post_title, 0, 30) . '...';
- }
-
- $view_topic = append_sid('viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $attachments[$i]['post_id'] . '#' . $attachments[$i]['post_id']);
- if ($post_title_2 != '')
- {
- $post_title = '<a href="' . $view_topic . '" class="gen" title="' . $post_title . '" target="_blank">' . $post_title_2 . '</a>';
- }
- else
- {
- $post_title = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $post_title . '</a>';
- }
-
- $comment = htmlspecialchars($attachments[$i]['comment']);
- $comment_2 = '';
-
- if (strlen($comment) > 298)
- {
- $comment_2 = substr($comment, 0, 300) . '...';
- }
-
- if ($comment_2 != '')
- {
- $comment_field = '<span title="' . $comment . '">' . $comment_2 . '</span>';
- }
- else
- {
- $comment_field = $comment;
- }
-
- if (strlen($comment) < 1)
- {
- $comment_field = $nodesc;
- }
-
-
-
- // $filename = $attachments[$i][$real_filename];
- $filename_2 = '';
-
- if (strlen($filename) > 25)
- {
- $filename = strrev($filename);
- $filename_2 = substr($filename, 0, 23) . '...';
- $filename_2 = strrev($filename_2);
- $filename = strrev($filename);
- }
- else
- {
- $filename_2 = $filename;
- }
-
- $view_attachment = 'files/' . ($attachments[$i]['physical_filename']);
-
-
- if ( in_array($file_ext, $image_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="size.php?pic=' . $view_attachment . '"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="size.php?pic=' . $view_attachment . '"></a>';
- }
- }
- else
- {
- if ( in_array($file_ext, $flash_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/flash.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/flash.gif"></a>';
- }
- }
- elseif ( in_array($file_ext, $zip_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/zip.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/zip.gif"></a>';
- }
- }
- elseif ( in_array($file_ext, $txt_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/txt.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/txt.gif"></a>';
- }
- }
- elseif ( in_array($file_ext, $doc_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/doc.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/doc.gif"></a>';
- }
- }
- elseif ( in_array($file_ext, $video_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/mpg.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/mpg.gif"></a>';
- }
- }
- elseif ( in_array($file_ext, $sound_files) )
- {
- if ($filename_2 != '')
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" title="' . $filename . '" target="_blank"><img src="images/mp3.gif"></a>';
- }
- else
- {
- $filename_link = '<a href="' . $view_attachment . '" class="gen" target="_blank"><img src="images/mp3.gif"></a>';
- }
- }
- }
-
-
- $userfinds = '<a href="attachments.php?gebruiker=' . $attachments[$i]['username'] . '">' . $attachments[$i]['username'] . '</a>';
-
- $template->assign_block_vars('attachrow', array(
- 'ROW_NUMBER' => $i + ( $HTTP_GET_VARS['start'] + 1 ),
- 'ROW_CLASS' => $class,
-
- 'FILENAME' => $filename,
- 'FILENAME_2' => $filename_2,
- 'COMMENT' => $comment_field,
- 'SIZE' => round(($attachments[$i]['filesize'] / 1024), 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_title,
-
- 'VIEW_ATTACHMENT' => $filename_link,
- 'BACKTOBEGIN' => $backtobegin,
- 'BY_USER' => $userfinds)
- );
- }
-
- $sql = '';
-
-
- if ($user != '')
- {
- if (!$forum_id && $display_all_forums)
- {
- $sql = "SELECT count(*) AS total
- FROM " . $attach_table . " a, " . USERS_TABLE . " u
- WHERE (a.user_id_1 = u.user_id)
- AND (u.username = '" . $user . "')";
- }
- else if ( ( $is_auth_ary[$forum_id]['auth_read'] ) && ( $is_download_auth_ary[$forum_id]['auth_download'] ) && ($num_attachments > 0) )
- {
- $sql = "SELECT count(*) AS total
- FROM " . $attach_table . " a, " . USERS_TABLE . " u
- WHERE (a.user_id_1 = u.user_id)
- AND (u.username = '" . $user . "')";
- }
-
- if ($sql != '')
- {
- if (!($result = $db->sql_query($sql)))
- {
- message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
- }
-
- if ( $total = $db->sql_fetchrow($result) )
- {
- $total = $total['total'];
- $total = $total-2;
- $pagination = generate_pagination("{$phpbb_root_path}attachments.$phpEx?mode=$mode&gebruiker=" . $user . "&order=$sort_order&" . POST_FORUM_URL . "=$forum_id", $total, $board_config['posts_per_page'], $start). ' ';
- }
-
- $template->assign_vars(array(
- 'PAGINATION' => $pagination,
- 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['posts_per_page'] ) + 1 ), ceil( $total / $board_config['posts_per_page'] )),
- 'USER_ID' => 'User ID',
- 'L_GOTO_PAGE' => $lang['Goto_page'])
- );
- }
- }
- else
- {
- if (!$forum_id && $display_all_forums)
- {
- $sql = "SELECT count(*) AS total
- FROM " . $attach_table . " a, " . POSTS_TABLE . " p
- WHERE (a.post_id = p.post_id) AND (p.forum_id IN (" . implode(', ', $forum_ids) . "))";
- }
- else if ( ( $is_auth_ary[$forum_id]['auth_read'] ) && ( $is_download_auth_ary[$forum_id]['auth_download'] ) && ($num_attachments > 0) )
- {
- $sql = "SELECT count(*) AS total
- FROM " . $attach_table . " a, " . POSTS_TABLE . " p
- WHERE (a.post_id = p.post_id) AND (p.forum_id = " . $forum_id . ")";
- }
-
- if ($sql != '')
- {
- if (!($result = $db->sql_query($sql)))
- {
- message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
- }
-
- if ( $total = $db->sql_fetchrow($result) )
- {
- $total = $total['total'];
- $total = $total-2;
- $pagination = generate_pagination("{$phpbb_root_path}attachments.$phpEx?mode=$mode&order=$sort_order&" . POST_FORUM_URL . "=$forum_id", $total, $board_config['posts_per_page'], $start). ' ';
- }
-
- $template->assign_vars(array(
- 'PAGINATION' => $pagination,
- 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['posts_per_page'] ) + 1 ), ceil( $total / $board_config['posts_per_page'] )),
- 'USER_ID' => 'User ID',
- 'L_GOTO_PAGE' => $lang['Goto_page'])
- );
- }
- }
-
-
-
-
- $template->pparse('body');
-
- include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-
- ?>
|
ATTACHMENTS.TPL:
Code: |
-
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td><span class="nav">{PAGE_NUMBER}</span></td>
- <td align="right"><span class="nav">{PAGINATION}</span></td>
- </tr>
- </table>
- <form method="post" action="{S_MODE_ACTION}">
- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> {TUSSEN} {USERONLY}</span></td>
- </tr>
- <tr>
- <td align="right" nowrap="nowrap"><span class="genmed">{L_SELECT_SORT_METHOD}: {S_MODE_SELECT} {L_ORDER} {S_ORDER_SELECT} {L_FORUM} {S_FORUM_SELECT}
- <input type="submit" name="submit" value="{L_SUBMIT}" class="liteoption" />
- </span></td>
- </tr>
- </table>
-
- {ERROR_BOX}
-
- {USERONLY}
-
- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
- <tr>
- <th width="610" class="thTop" nowrap="nowrap">{IMG_}</th>
- <th class="thCornerR" nowrap="nowrap">{L_POSTED_IN_TOPIC}</th>
- </tr>
-
- <!-- BEGIN attachrow -->
- <tr>
- <td class="row" align="center"><span class="gen">{attachrow.VIEW_ATTACHMENT}</span></td>
- <td valign="top" class="row4" align="left" valign="middle"><span class="gen">
- <br><br>{IMG_NUM} <b>{attachrow.ROW_NUMBER}</b>
- <br />{FILE_NAME} <b>{attachrow.FILENAME_2}</b>
- <br />{BYUSER}: <b>{attachrow.BY_USER}</b>
- <br />{ONLYUSERATTACH}
- <br />{SEEN} <b>{attachrow.DOWNLOAD_COUNT}</b>
- <br />{POSTED_IN} <b>{attachrow.POST_TITLE}</b>
- <br /><br />{DESC_IMG} <b>{attachrow.COMMENT}</b>
- <br /><br />{CLICKTOENLARGE}
- <br /><br />{attachrow.BACKTOBEGIN}</span></td>
- </tr>
- <!-- END attachrow -->
- <tr>
- <td class="catbottom" colspan="8" height="28"> </td>
- </tr>
- </table>
-
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td><span class="nav">{PAGE_NUMBER}</span></td>
- <td align="right"><span class="nav">{PAGINATION}</span></td>
- </tr>
- </table>
- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td align="right" nowrap="nowrap"><span class="genmed">{L_SELECT_SORT_METHOD}: {S_MODE_SELECT} {L_ORDER} {S_ORDER_SELECT} {L_FORUM} {S_FORUM_SELECT}
- <input type="submit" name="submit" value="{L_SUBMIT}" class="liteoption" />
- </span></td>
- </tr>
- <tr>
- <td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> {TUSSEN} {USERONLY}</span></td>
- </tr>
- </table>
-
- </form>
|
LANGMAIN.PHP INSERTS:
If English:
Code: |
-
- // View_Attachments_with_image
- $lang['number'] = 'Number:';
- $lang['seen'] = 'Seen:';
- $lang['posted_in'] = 'Posted in:';
- $lang['desc_img'] = 'Description:';
- $lang['click_to_enlarge'] = 'Click the image to see it at original size.';
- $lang['img_'] = 'Image';
- $lang['only_user_attach'] = '(Click to see only this users attachments)';
- $lang['AllAttachments'] = 'All Attachments';
- $lang['Attachmentsfrom'] = 'Attachments from ';
- $lang['BackToAll'] = 'To all Attachments';
- $lang['file_name'] = 'Filename';
- $lang['no_desc'] = 'No description availible';
|
If Dutch
Code: |
-
- // View_Attachments_with_image
- $lang['number'] = 'Nummer:';
- $lang['seen'] = 'Maal bekeken:';
- $lang['posted_in'] = 'Gepost in:';
- $lang['desc_img'] = 'Beschrijving:';
- $lang['click_to_enlarge'] = 'Klik op de afbeelding om de afbeelding op de <br />originele grootte te bekijken.';
- $lang['img_'] = 'Afbeelding';
- $lang['only_user_attach'] = '(klik om de vondsten van deze gebruiker te bekijken)';
- $lang['AllAttachments'] = 'Alle Vondsten';
- $lang['Attachmentsfrom'] = 'Vondsten van ';
- $lang['BackToAll'] = 'Naar alle vondsten.';
- $lang['file_name'] = 'Bestandsnaam: ';
- $lang['no_desc'] = 'Geen beschrijving aanwezig';
|
_________________
Wicher's phpBB2 Mods | Wicher's phpBB3 Mods | Statistics Mod 4.x.x
Last edited by Wicher on Mon Feb 19, 2007 12:28 pm; edited 5 times in total |
|