Fixed incorrect config names in phpbb_fetch_posts
This commit is contained in:
@@ -60,7 +60,7 @@ function set_portal_config($config_name, $config_value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fetch post for news & announce
|
// fetch post for news & announce
|
||||||
function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0, $invert = false)
|
function phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0, $invert = false)
|
||||||
{
|
{
|
||||||
global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config;
|
global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config;
|
||||||
|
|
||||||
@@ -127,16 +127,16 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
|
|||||||
case "news":
|
case "news":
|
||||||
$topic_type = 't.topic_type = ' . POST_NORMAL;
|
$topic_type = 't.topic_type = ' . POST_NORMAL;
|
||||||
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
||||||
$user_link = ($config['board3_news_style']) ? 't.topic_poster = u.user_id' : (($config['board3_news_show_last']) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
$user_link = ($config['board3_news_style_' . $module_id]) ? 't.topic_poster = u.user_id' : (($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
||||||
$post_link = ($config['board3_news_style']) ? 't.topic_first_post_id = p.post_id' : (($config['board3_news_show_last']) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
$post_link = ($config['board3_news_style_' . $module_id]) ? 't.topic_first_post_id = p.post_id' : (($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
||||||
$topic_order = ($config['board3_news_show_last']) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
$topic_order = ($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
||||||
break;
|
break;
|
||||||
case "news_all":
|
case "news_all":
|
||||||
$topic_type = '(t.topic_type <> ' . POST_ANNOUNCE . ') AND (t.topic_type <> ' . POST_GLOBAL . ')';
|
$topic_type = '(t.topic_type <> ' . POST_ANNOUNCE . ') AND (t.topic_type <> ' . POST_GLOBAL . ')';
|
||||||
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
||||||
$user_link = ($config['board3_news_style']) ? 't.topic_poster = u.user_id' : (($config['board3_news_show_last']) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
$user_link = ($config['board3_news_style_' . $module_id]) ? 't.topic_poster = u.user_id' : (($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
||||||
$post_link = ($config['board3_news_style']) ? 't.topic_first_post_id = p.post_id' : (($config['board3_news_show_last']) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
$post_link = ($config['board3_news_style_' . $module_id]) ? 't.topic_first_post_id = p.post_id' : (($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
||||||
$topic_order = ($config['board3_news_show_last']) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
$topic_order = ($config['board3_news_show_last_' . $module_id]) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class portal_announcements_module
|
|||||||
|
|
||||||
// Fetch announcements from portal/includes/functions.php with check if "read full" is requested.
|
// Fetch announcements from portal/includes/functions.php with check if "read full" is requested.
|
||||||
$portal_announcement_length = ($announcement < 0) ? $config['board3_announcements_length_' . $module_id] : 0;
|
$portal_announcement_length = ($announcement < 0) ? $config['board3_announcements_length_' . $module_id] : 0;
|
||||||
$fetch_news = phpbb_fetch_posts($config['board3_global_announcements_forum_' . $module_id], $config['board3_announcements_permissions_' . $module_id], $config['board3_number_of_announcements_' . $module_id], $portal_announcement_length, $config['board3_announcements_day_' . $module_id], 'announcements', $start, $config['board3_announcements_forum_exclude_' . $module_id]);
|
$fetch_news = phpbb_fetch_posts($module_id, $config['board3_global_announcements_forum_' . $module_id], $config['board3_announcements_permissions_' . $module_id], $config['board3_number_of_announcements_' . $module_id], $portal_announcement_length, $config['board3_announcements_day_' . $module_id], 'announcements', $start, $config['board3_announcements_forum_exclude_' . $module_id]);
|
||||||
|
|
||||||
// Any announcements present? If not terminate it here.
|
// Any announcements present? If not terminate it here.
|
||||||
if (sizeof($fetch_news) == 0)
|
if (sizeof($fetch_news) == 0)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class portal_news_module
|
|||||||
|
|
||||||
// Fetch news from portal/includes/functions.php with check if "read full" is requested.
|
// Fetch news from portal/includes/functions.php with check if "read full" is requested.
|
||||||
$portal_news_length = ($news < 0) ? $config['board3_news_length_' . $module_id] : 0;
|
$portal_news_length = ($news < 0) ? $config['board3_news_length_' . $module_id] : 0;
|
||||||
$fetch_news = phpbb_fetch_posts($config['board3_news_forum_' . $module_id], $config['board3_news_permissions_' . $module_id], $config['board3_number_of_news_' . $module_id], $portal_news_length, 0, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news', $start, $config['board3_news_exclude_' . $module_id]);
|
$fetch_news = phpbb_fetch_posts($module_id, $config['board3_news_forum_' . $module_id], $config['board3_news_permissions_' . $module_id], $config['board3_number_of_news_' . $module_id], $portal_news_length, 0, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news', $start, $config['board3_news_exclude_' . $module_id]);
|
||||||
|
|
||||||
|
|
||||||
// Any news present? If not terminate it here.
|
// Any news present? If not terminate it here.
|
||||||
|
|||||||
Reference in New Issue
Block a user