diff --git a/root/portal/block/announcements.php b/root/portal/block/announcements.php
index 63ee9186..2def4736 100644
--- a/root/portal/block/announcements.php
+++ b/root/portal/block/announcements.php
@@ -168,7 +168,18 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_foru
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
+ 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
));
+
+ if( !empty($fetch_news[$i]['attachments']) )
+ {
+ foreach ($fetch_news[$i]['attachments'] as $attachment)
+ {
+ $template->assign_block_vars('announcements_row.attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ }
if ($portal_config['portal_number_of_announcements'] <> 0 && $portal_config['portal_announcements_archive'])
{
@@ -221,8 +232,19 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_foru
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
+ 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? 'yes' : 'no',
));
+ if( !empty($fetch_news[$i]['attachments']) )
+ {
+ foreach ($fetch_news[$i]['attachments'] as $attachment)
+ {
+ $template->assign_block_vars('announcements_row.attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ }
+
if ($portal_config['portal_number_of_announcements'] <> 0 && $portal_config['portal_announcements_archive'])
{
$template->assign_vars(array(
diff --git a/root/portal/block/news.php b/root/portal/block/news.php
index 6f2cec30..9d282020 100644
--- a/root/portal/block/news.php
+++ b/root/portal/block/news.php
@@ -147,6 +147,7 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_con
'REPLIES' => $fetch_news[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
'N_ID' => $i,
+ 'BAD' => 'BOOBS',
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
@@ -160,8 +161,19 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_con
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
+ 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
));
+ if( !empty($fetch_news[$i]['attachments']) )
+ {
+ foreach ($fetch_news[$i]['attachments'] as $attachment)
+ {
+ $template->assign_block_vars('news_row.attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ }
+
if ($portal_config['portal_number_of_news'] <> 0 && $portal_config['portal_news_archive'])
{
$template->assign_vars(array(
@@ -213,8 +225,19 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_con
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
+ 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
));
+ if( !empty($fetch_news[$i]['attachments']) )
+ {
+ foreach ($fetch_news[$i]['attachments'] as $attachment)
+ {
+ $template->assign_block_vars('news_row.attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ }
+
if ($portal_config['portal_number_of_news'] <> 0 && $portal_config['portal_news_archive'])
{
$template->assign_vars(array(
diff --git a/root/portal/includes/functions.php b/root/portal/includes/functions.php
index d2b92d1a..335877d5 100644
--- a/root/portal/includes/functions.php
+++ b/root/portal/includes/functions.php
@@ -254,6 +254,7 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
while ( $row = $db->sql_fetchrow($result) )
{
+ $attachments = array();
if( $config['allow_attachments'] )
{
// Pull attachment data
@@ -301,7 +302,7 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
{
$global_f = $row['forum_id'];
}
-
+
$posts[$i] = array_merge($posts[$i], array(
'post_text' => ap_validate($message),
'topic_id' => $row['topic_id'],
@@ -319,7 +320,8 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
'poll' => ($row['poll_title']) ? true : false,
'attachment' => ($row['topic_attachment']) ? true : false,
'topic_views' => $row['topic_views'],
- 'forum_name' => $row['forum_name']
+ 'forum_name' => $row['forum_name'],
+ 'attachments' => (!empty($attachments)) ? $attachments : array(),
));
$posts['global_id'] = $global_f;
diff --git a/root/styles/prosilver/template/portal/block/announcements.html b/root/styles/prosilver/template/portal/block/announcements.html
index 38c853e8..d492c733 100644
--- a/root/styles/prosilver/template/portal/block/announcements.html
+++ b/root/styles/prosilver/template/portal/block/announcements.html
@@ -34,6 +34,14 @@
{announcements_row.TEXT}
+
+
+ - {L_ATTACHMENTS}
+
+ - {announcements_row.attachment.DISPLAY_ATTACHMENT}
+
+
+
{L_TOPIC_VIEWS}: {announcements_row.TOPIC_VIEWS} • {L_COMMENTS}: {announcements_row.REPLIES} • {L_POST_REPLY}
{announcements_row.OPEN}{announcements_row.L_READ_FULL}{announcements_row.CLOSE}
diff --git a/root/styles/prosilver/template/portal/block/news.html b/root/styles/prosilver/template/portal/block/news.html
index 38c84362..47e3d527 100644
--- a/root/styles/prosilver/template/portal/block/news.html
+++ b/root/styles/prosilver/template/portal/block/news.html
@@ -19,7 +19,7 @@
- - {POSTED_BY_TEXT} {L_POST_BY_AUTHOR}: {news_row.POSTER_FULL} {L_POSTED_ON_DATE} {news_rownews_row.TIME}
+ - {POSTED_BY_TEXT} {L_POST_BY_AUTHOR}: {news_row.POSTER_FULL} {L_POSTED_ON_DATE} {news_row.TIME}
- {L_FORUM}: {news_row.FORUM_NAME}
@@ -28,6 +28,14 @@
{news_row.TEXT}
+
+
+ - {L_ATTACHMENTS}
+
+ - {news_row.attachment.DISPLAY_ATTACHMENT}
+
+
+
{L_TOPIC_VIEWS}: {news_row.TOPIC_VIEWS} • {L_COMMENTS}: {news_row.REPLIES} • {L_POST_REPLY}
{news_row.OPEN}{news_row.L_READ_FULL}{news_row.CLOSE}
diff --git a/root/styles/subsilver2/template/portal/block/announcements.html b/root/styles/subsilver2/template/portal/block/announcements.html
index b547a2d1..d6265bd3 100644
--- a/root/styles/subsilver2/template/portal/block/announcements.html
+++ b/root/styles/subsilver2/template/portal/block/announcements.html
@@ -30,6 +30,20 @@
{announcements_row.TEXT}
+
+
+
+
+
+ | {L_ATTACHMENTS}: |
+
+
+
+ | {announcements_row.attachment.DISPLAY_ATTACHMENT} |
+
+
+
+
[ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {announcements_row.PAGINATION} ]
diff --git a/root/styles/subsilver2/template/portal/block/news.html b/root/styles/subsilver2/template/portal/block/news.html
index cc2f1bda..fa15f09a 100644
--- a/root/styles/subsilver2/template/portal/block/news.html
+++ b/root/styles/subsilver2/template/portal/block/news.html
@@ -25,6 +25,20 @@
{news_row.TEXT}
+
+
+
+
+
+ | {L_ATTACHMENTS}: |
+
+
+
+ | {news_row.attachment.DISPLAY_ATTACHMENT} |
+
+
+
+
[ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {news_row.PAGINATION} ]