diff options
Diffstat (limited to 'phpBB/includes/functions_content.php')
| -rw-r--r-- | phpBB/includes/functions_content.php | 21 | 
1 files changed, 8 insertions, 13 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b7650ecd6a..3a0124934e 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -2,9 +2,8 @@  /**  *  * @package phpBB3 -* @version $Id$  * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2  *  */ @@ -938,12 +937,12 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  			}  			$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); +			$l_downloaded_viewed = 'VIEWED_COUNTS';  			switch ($display_cat)  			{  				// Images  				case ATTACHMENT_CATEGORY_IMAGE: -					$l_downloaded_viewed = 'VIEWED_COUNT';  					$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);  					$download_link .= '&mode=view'; @@ -957,7 +956,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				// Images, but display Thumbnail  				case ATTACHMENT_CATEGORY_THUMB: -					$l_downloaded_viewed = 'VIEWED_COUNT';  					$thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1');  					$download_link .= '&mode=view'; @@ -971,7 +969,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				// Windows Media Streams  				case ATTACHMENT_CATEGORY_WM: -					$l_downloaded_viewed = 'VIEWED_COUNT';  					// Giving the filename directly because within the wm object all variables are in local context making it impossible  					// to validate against a valid session (all params can differ) @@ -990,7 +987,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				// Real Media Streams  				case ATTACHMENT_CATEGORY_RM:  				case ATTACHMENT_CATEGORY_QUICKTIME: -					$l_downloaded_viewed = 'VIEWED_COUNT';  					$block_array += array(  						'S_RM_FILE'			=> ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, @@ -1007,8 +1003,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				case ATTACHMENT_CATEGORY_FLASH:  					list($width, $height) = @getimagesize($filename); -					$l_downloaded_viewed = 'VIEWED_COUNT'; -  					$block_array += array(  						'S_FLASH_FILE'	=> true,  						'WIDTH'			=> $width, @@ -1021,7 +1015,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				break;  				default: -					$l_downloaded_viewed = 'DOWNLOAD_COUNT'; +					$l_downloaded_viewed = 'DOWNLOAD_COUNTS';  					$block_array += array(  						'S_FILE'		=> true, @@ -1029,11 +1023,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,  				break;  			} -			$l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $attachment['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $attachment['download_count'])); +			if (!isset($attachment['download_count'])) +			{ +				$attachment['download_count'] = 0; +			}  			$block_array += array(  				'U_DOWNLOAD_LINK'		=> $download_link, -				'L_DOWNLOAD_COUNT'		=> $l_download_count +				'L_DOWNLOAD_COUNT'		=> $user->lang($l_downloaded_viewed, (int) $attachment['download_count']),  			);  		} @@ -1354,5 +1351,3 @@ class bitfield  		$this->data = $this->data | $bitfield->get_blob();  	}  } - -?>
\ No newline at end of file  | 
