diff options
Diffstat (limited to 'phpBB/includes/functions_content.php')
-rw-r--r-- | phpBB/includes/functions_content.php | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index faff9dd0de..086734eb1d 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -762,7 +762,9 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, global $template, $cache, $user; global $extensions, $config, $phpbb_root_path, $phpEx; - + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + global $phpbb_seo; + // www.phpBB-SEO.com SEO TOOLKIT END // $compiled_attachments = array(); @@ -937,7 +939,25 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, $display_cat = ATTACHMENT_CATEGORY_NONE; } - $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + //$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); + $download_link = "{$phpbb_root_path}download/file.$phpEx?id=" . $attachment['attach_id']; + $comment_clean = preg_replace('`<[^>]*>`Ui', ' ', $comment); + $block_array += array( + 'COMMENT_CLEAN' => $comment_clean, + ); + if (!empty($phpbb_seo->seo_opt['rewrite_files'])) { + if (empty($phpbb_seo->seo_url['file'][$attachment['attach_id']])) { + if (($_pos = utf8_strpos($comment, '<br')) !== false) { + $comment_url = strip_tags(utf8_substr($comment, 0, $_pos)); + } else { + $comment_url = $comment_clean; + } + $comment_url = utf8_strlen($comment_url) > 60 ? utf8_substr($comment_url, 0, 60) : $comment_url; + $phpbb_seo->seo_url['file'][$attachment['attach_id']] = $phpbb_seo->format_url($comment_url, $phpbb_seo->seo_static['file'][$display_cat]); + } + } + // www.phpBB-SEO.com SEO TOOLKIT END switch ($display_cat) { @@ -1013,7 +1033,9 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, 'S_FLASH_FILE' => true, 'WIDTH' => $width, 'HEIGHT' => $height, - 'U_VIEW_LINK' => $download_link . '&view=1', + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + 'U_VIEW_LINK' => append_sid($download_link . '&view=1'), + // www.phpBB-SEO.com SEO TOOLKIT END ); // Viewed/Heared File ... update the download count @@ -1028,7 +1050,9 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, ); break; } - + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + $download_link = append_sid($download_link); + // www.phpBB-SEO.com SEO TOOLKIT END $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'])); $block_array += array( @@ -1237,7 +1261,16 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', // For anonymous the link leads to a login page. if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile'))) { - $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']); + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']); + global $phpbb_seo, $phpbb_root_path, $phpEx; + $phpbb_seo->set_user_url( $username, $user_id ); + if ($custom_profile_url !== false) { + $profile_url = reapply_sid($custom_profile_url . (strpos($custom_profile_url, '?') !== false ? '&' : '?' ) . 'u=' . (int) $user_id); + } else { + $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); + } + // www.phpBB-SEO.com SEO TOOLKIT END } else { |