[ticket/418] Correctly assign pagination in compact news and announcements

The repsonsiveness of those two blocks has also been improved.

B3P-418
This commit is contained in:
Marc Alexander
2015-01-24 16:43:51 +01:00
parent 102a4b0e22
commit b2b8c9a948
5 changed files with 25 additions and 9 deletions

View File

@@ -350,7 +350,7 @@ class announcements extends module_base
'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
));
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'ap_' . $module_id, $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
if(!empty($fetch_news[$i]['attachments']))
{

View File

@@ -309,8 +309,6 @@ class news extends module_base
// Grab icons
$icons = $this->cache->obtain_icons();
$this->pagination->generate_template_pagination($view_topic_url, 'pagination', 'np_' . $module_id, $fetch_news[$i]['topic_replies'], $this->config['board3_number_of_news_' . $module_id], $start);
$this->template->assign_block_vars('news.news_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $this->config['allow_attachments']) ? $this->user->img('icon_topic_attach', $this->user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
@@ -348,6 +346,9 @@ class news extends module_base
'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
));
// Assign pagination
$this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1);
if(!empty($fetch_news[$i]['attachments']))
{
foreach ($fetch_news[$i]['attachments'] as $attachment)