delete trunk for B3P v2
This commit is contained in:
@@ -1,341 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$announcement = request_var('announcement', -1);
|
||||
$announcement = ($announcement > $portal_config['portal_number_of_announcements'] -1) ? -1 : $announcement;
|
||||
$start = request_var('ap', 0);
|
||||
$start = ($start < 0) ? 0 : $start;
|
||||
|
||||
// Fetch announcements from portal/includes/functions.php with check if "read full" is requested.
|
||||
$portal_announcement_length = ($announcement < 0) ? $portal_config['portal_announcements_length'] : 0;
|
||||
$fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_forum'], $portal_config['portal_announcements_permissions'], $portal_config['portal_number_of_announcements'], $portal_announcement_length, $portal_config['portal_announcements_day'], 'announcements', $start);
|
||||
|
||||
// Any announcements present? If not terminate it here.
|
||||
if (sizeof($fetch_news) == 0)
|
||||
{
|
||||
$template->assign_block_vars('announcements_row', array(
|
||||
'S_NO_TOPICS' => true,
|
||||
'S_NOT_LAST' => false
|
||||
));
|
||||
|
||||
$template->assign_var('S_CAN_READ', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Count number of posts for announcements archive, considering if permission check is dis- or enabled.
|
||||
if ( $portal_config['portal_announcements_archive'] )
|
||||
{
|
||||
$permissions = $portal_config['portal_announcements_permissions'];
|
||||
$forum_from = $portal_config['portal_global_announcements_forum'];
|
||||
$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
||||
|
||||
$time = ( $portal_config['portal_announcements_day'] == 0 ) ? 0 : $portal_config['portal_announcements_day'];
|
||||
$post_time = ($time == 0) ? '' : 'AND topic_time > ' . (time() - $time * 86400);
|
||||
|
||||
$str_where = '';
|
||||
|
||||
if( $permissions == TRUE )
|
||||
{
|
||||
$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
|
||||
} else {
|
||||
$disallow_access = array();
|
||||
}
|
||||
|
||||
$global_f = 0;
|
||||
|
||||
if( sizeof($forum_from) )
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if( !sizeof($disallow_access) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach( $disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id = $acc_id OR ";
|
||||
if( $global_f < 1 && $acc_id > 0 )
|
||||
{
|
||||
$global_f = $acc_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $disallow_access as $acc_id )
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id <> $acc_id AND ";
|
||||
}
|
||||
}
|
||||
|
||||
$str_where = ( strlen($str_where) > 0 ) ? 'AND (forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
|
||||
|
||||
$sql = 'SELECT COUNT(topic_id) AS num_topics
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ((topic_type = ' . POST_GLOBAL . ')
|
||||
OR topic_type = ' . POST_ANNOUNCE . ')
|
||||
AND topic_approved = 1
|
||||
AND topic_moved_id = 0
|
||||
' . $post_time . '
|
||||
' . $str_where;
|
||||
$result = $db->sql_query($sql);
|
||||
$total_announcements = (int) $db->sql_fetchfield('num_topics');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
if($announcement < 0)
|
||||
// Show the announcements overview
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if( isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true )
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
$read_full = $user->lang['READ_FULL'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$open_bracket = '';
|
||||
$close_bracket = '';
|
||||
$read_full = '';
|
||||
}
|
||||
// unread?
|
||||
$forum_id = $fetch_news[$i]['forum_id'];
|
||||
$topic_id = $fetch_news[$i]['topic_id'];
|
||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
|
||||
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
|
||||
|
||||
$real_forum_id = ( $forum_id == 0 ) ? $fetch_news['global_id']: $forum_id;
|
||||
|
||||
$read_full_url = (isset($_GET['ap'])) ? 'ap='. $start . '&announcement=' . $i . '#a' . $i : 'announcement=' . $i . '#a' . $i;
|
||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||
if ( $portal_config['portal_announcements_archive'] )
|
||||
{
|
||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $portal_config['portal_number_of_announcements'], $start, 'announcements');
|
||||
}
|
||||
|
||||
|
||||
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
||||
$folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
|
||||
switch ($fetch_news[$i]['topic_type'])
|
||||
{
|
||||
case POST_GLOBAL:
|
||||
$folder = 'global_read';
|
||||
$folder_new = 'global_unread';
|
||||
break;
|
||||
case POST_ANNOUNCE:
|
||||
$folder = 'announce_read';
|
||||
$folder_new = 'announce_unread';
|
||||
break;
|
||||
default:
|
||||
$folder = 'topic_read';
|
||||
$folder_new = 'topic_unread';
|
||||
if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $fetch_news[$i]['topic_status'] != ITEM_LOCKED)
|
||||
{
|
||||
$folder .= '_hot';
|
||||
$folder_new .= '_hot';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($fetch_news[$i]['topic_status'] == ITEM_LOCKED)
|
||||
{
|
||||
$folder .= '_locked';
|
||||
$folder_new .= '_locked';
|
||||
}
|
||||
if ($fetch_news[$i]['topic_type'] == POST_GLOBAL)
|
||||
{
|
||||
$global_announce_list[$fetch_news[$i]['topic_id']] = true;
|
||||
}
|
||||
if ($fetch_news[$i]['topic_posted'])
|
||||
{
|
||||
$folder .= '_mine';
|
||||
$folder_new .= '_mine';
|
||||
}
|
||||
$folder_img = ($unread_topic) ? $folder_new : $folder;
|
||||
$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
|
||||
|
||||
// Grab icons
|
||||
$icons = $cache->obtain_icons();
|
||||
|
||||
$template->assign_block_vars('announcements_row', array(
|
||||
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'],
|
||||
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'LAST_POST_TIME' => $user->format_date($fetch_news[$i]['topic_last_post_time']),
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
'REPLIES' => $fetch_news[$i]['topic_replies'],
|
||||
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
|
||||
'A_ID' => $i,
|
||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
||||
'FOLDER_IMG' => $user->img('topic_read', 'NO_NEW_POSTS'),
|
||||
'TOPIC_ICON_IMG' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
|
||||
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
|
||||
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
|
||||
'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", (($real_forum_id) ? 'f=' . $real_forum_id . '&' : '') . 't=' . $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", (($real_forum_id) ? 'f=' . $real_forum_id . '&' : '') . 't=' . $topic_id),
|
||||
'U_VIEW_UNREAD' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", (($real_forum_id) ? 'f=' . $real_forum_id . '&' : '') . 't=' . $topic_id . '&view=unread#unread'),
|
||||
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&' . (($real_forum_id) ? 'f=' . $real_forum_id . '&' : '') . 't=' . $topic_id),
|
||||
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
|
||||
'L_READ_FULL' => $read_full,
|
||||
'OPEN' => $open_bracket,
|
||||
'CLOSE' => $close_bracket,
|
||||
'S_NOT_LAST' => ($i < sizeof($fetch_news) - 1) ? true : false,
|
||||
'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'])
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'AP_PAGINATION' => $pagination,
|
||||
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
||||
'AP_PAGE_NUMBER' => on_page($total_announcements, $portal_config['portal_number_of_announcements'], $start))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// Show "read full" page
|
||||
{
|
||||
$i = $announcement;
|
||||
$forum_id = $fetch_news[$i]['forum_id'];
|
||||
$topic_id = $fetch_news[$i]['topic_id'];
|
||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
|
||||
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
$read_full = $user->lang['BACK'];
|
||||
|
||||
$read_full_url = (isset($_GET['ap'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "ap=$start#a$i") : append_sid("{$phpbb_root_path}portal.$phpEx#a$i");
|
||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||
if ( $portal_config['portal_announcements_archive'] )
|
||||
{
|
||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $portal_config['portal_number_of_announcements'], $start, 'announcements');
|
||||
}
|
||||
|
||||
$template->assign_block_vars('announcements_row', array(
|
||||
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
'REPLIES' => $fetch_news[$i]['topic_replies'],
|
||||
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
|
||||
'A_ID' => $i,
|
||||
'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", (($forum_id) ? 'f=' . $forum_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", 't=' . $topic_id),
|
||||
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&' . (($forum_id) ? 'f=' . $forum_id . '&' : '') . 't=' . $topic_id),
|
||||
'S_POLL' => $fetch_news[$i]['poll'],
|
||||
'S_UNREAD_INFO' => $unread_topic,
|
||||
'U_READ_FULL' => $read_full_url,
|
||||
'L_READ_FULL' => $read_full,
|
||||
'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('announcements_row.attachment', array(
|
||||
'DISPLAY_ATTACHMENT' => $attachment)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($portal_config['portal_number_of_announcements'] <> 0 && $portal_config['portal_announcements_archive'])
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
|
||||
'AP_PAGINATION' => $pagination,
|
||||
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
||||
'AP_PAGE_NUMBER' => on_page($total_announcements, $portal_config['portal_number_of_announcements'], $start))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$topic_icons = false;
|
||||
if( !empty($fetch_news['topic_icons']) )
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
|
||||
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
'S_DISPLAY_ANNOUNCEMENTS_RVS' => ( $portal_config['portal_show_announcements_replies_views'] ) ? true : false,
|
||||
'S_TOPIC_ICONS' => $topic_icons,
|
||||
));
|
||||
|
||||
if( $portal_config['portal_announcements_style'] )
|
||||
{
|
||||
$template_file = 'portal/block/announcements_compact.html';
|
||||
} else {
|
||||
$template_file = 'portal/block/announcements.html';
|
||||
}
|
||||
|
||||
if (!isset($template->filename['announcements_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'announcements_block' => $template_file)
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('announcements_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$attach_forums = false;
|
||||
$where = '';
|
||||
|
||||
if( $portal_config['portal_attachments_forum_ids'] !== '' )
|
||||
{
|
||||
$attach_forums_config = ( strpos($portal_config['portal_attachments_forum_ids'], ',') !== FALSE ) ? explode(',', $portal_config['portal_attachments_forum_ids']) : array($portal_config['portal_attachments_forum_ids']);
|
||||
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
||||
|
||||
$forum_list = array_unique( array_intersect($attach_forums_config, $forum_list) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
||||
}
|
||||
|
||||
if( sizeof($forum_list) )
|
||||
{
|
||||
foreach($forum_list as $af )
|
||||
{
|
||||
$af = (int) trim($af);
|
||||
$attach_forums = true;
|
||||
$where .= 't.forum_id = \''.$af.'\' OR ';
|
||||
}
|
||||
}
|
||||
|
||||
if( $where != '' )
|
||||
{
|
||||
$where = 'AND (' . substr($where, 0, -4) . ')';
|
||||
}
|
||||
|
||||
if( $attach_forums === TRUE )
|
||||
{
|
||||
// Just grab all attachment info from database
|
||||
$sql = 'SELECT
|
||||
a.*,
|
||||
t.forum_id
|
||||
FROM
|
||||
' . ATTACHMENTS_TABLE . ' a,
|
||||
' . TOPICS_TABLE . ' t
|
||||
WHERE
|
||||
a.topic_id <> 0
|
||||
AND a.topic_id = t.topic_id
|
||||
' . $where . '
|
||||
ORDER BY
|
||||
filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_attachments_number']);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MIB'] : (($row['filesize'] >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
|
||||
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
|
||||
|
||||
$replace = str_replace(array('_','.zip','.jpg','.gif','.png','.ZIP','.JPG','.GIF','.PNG','.','-'), ' ', $row['real_filename']);
|
||||
|
||||
$template->assign_block_vars('attach', array(
|
||||
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
|
||||
'FILETIME' => $user->format_date($row['filetime']),
|
||||
'DOWNLOAD_COUNT' => (int) $row['download_count'], // grab downloads count
|
||||
'REAL_FILENAME' => $replace,
|
||||
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
|
||||
'ATTACH_ID' => $row['attach_id'],
|
||||
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
|
||||
'POST_MSG_ID' => $row['post_msg_id'], // grab post ID to redirect to post
|
||||
'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $row['attach_id']),
|
||||
'U_TOPIC' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx, 'p='.$row['post_msg_id'].'#p'.$row['post_msg_id']),
|
||||
));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['attachments_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'attachments_block' => 'portal/block/attachments.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('attachments_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
?>
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// Generate birthday list if required ... / borrowed from index.php (RC4)
|
||||
$birthday_list = '';
|
||||
$birthday_ahead_list = '';
|
||||
if ($config['load_birthdays'] && $config['allow_birthdays'])
|
||||
{
|
||||
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
|
||||
$today = (mktime(0, 0, 0, $now['mon'], $now['mday'], $now['year']));
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_birthday <> ''
|
||||
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ') ORDER BY user_birthday ASC';
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_birthday <> ''
|
||||
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ') ORDER BY SUBSTRING(user_birthday FROM 4 FOR 2) ASC, SUBSTRING(user_birthday FROM 1 FOR 2) ASC, username_clean ASC';
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$birthdaydate = (gmdate('Y') . '-' . trim(substr($row['user_birthday'],3,-5)) . '-' . trim(substr($row['user_birthday'],0,-8) ));
|
||||
$user_birthday = strtotime($birthdaydate);
|
||||
|
||||
if( $user_birthday < $today )
|
||||
{
|
||||
$birthdaydate = (gmdate('Y')+1 . '-' . trim(substr($row['user_birthday'],3,-5)) . '-' . trim(substr($row['user_birthday'],0,-8) ));
|
||||
$user_birthday = strtotime($birthdaydate);
|
||||
}
|
||||
|
||||
if($user_birthday == $today)
|
||||
{
|
||||
$birthday_list .= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
|
||||
if ($age = (int) substr($row['user_birthday'], -4))
|
||||
{
|
||||
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
|
||||
}
|
||||
$birthday_list .= '<br />'."\n";
|
||||
}
|
||||
|
||||
if( $portal_config['portal_birthdays_ahead'] > 0 )
|
||||
{
|
||||
if ( $user_birthday >= ($today + 86400) && $user_birthday <= ($today + ($portal_config['portal_birthdays_ahead'] * 86400) ) )
|
||||
{
|
||||
$birthday_ahead_list .= '<span title="' . $user->format_date($user_birthday, 'd M') . '">' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . '</span>';
|
||||
if ( $age = (int) substr($row['user_birthday'], -4) )
|
||||
{
|
||||
$birthday_ahead_list .= ' (' . ($now['year'] - $age) . ')';
|
||||
}
|
||||
$birthday_ahead_list .= '<br />'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Assign index specific vars
|
||||
$template->assign_vars(array(
|
||||
'BIRTHDAY_LIST' => $birthday_list,
|
||||
'BIRTHDAYS_AHEAD_LIST' => ( $portal_config['portal_birthdays_ahead'] > 0 ) ? $birthday_ahead_list : '',
|
||||
'L_BIRTHDAYS_AHEAD' => sprintf($user->lang['BIRTHDAYS_AHEAD'], $portal_config['portal_birthdays_ahead']),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['birthday_list_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'birthday_list_block' => 'portal/block/birthday_list.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('birthday_list_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
?>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$style = request_var('style', 0);
|
||||
|
||||
$sql = 'SELECT style_id, style_name, style_copyright
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1
|
||||
ORDER BY style_name ASC';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
$style_select = '<option selected="selected" disabled="disabled">' . $user->lang['STYLE_CHOOSE'] . '</option>';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$selected = ( $style == $row['style_id'] ) ? ' selected="selected"' : '';
|
||||
$style_value = append_sid("{$phpbb_root_path}portal.$phpEx", 'style=' . $row['style_id']);
|
||||
$style_select .= '<option value="' . $style_value . '"' . $selected . '> ' . $row['style_name'] . ' </option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// style info
|
||||
$sql2 = 'SELECT style_id, style_name, style_copyright
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1
|
||||
AND style_id = ' . $style;
|
||||
|
||||
$result = $db->sql_query($sql2);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_STYLE_ACTION'=> append_sid("{$phpbb_root_path}portal.$phpEx"),
|
||||
'STYLE_NAME' => $row['style_name'],
|
||||
'STYLE_COPY' => $row['style_copyright'],
|
||||
'STYLE_SELECT' => $style_select,
|
||||
));
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($user->data['user_style']),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['change_style_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'change_style_block' => 'portal/block/change_style.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('change_style_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($template->filename['clock_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'clock_block' => 'portal/block/clock.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('clock_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,117 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$allow_bbcode = 1;
|
||||
$allow_urls = 1;
|
||||
$allow_smilies = 1;
|
||||
|
||||
if ($block_type == '')
|
||||
{
|
||||
// Center Box
|
||||
if ($portal_config['portal_custom_center_bbcode'])
|
||||
{
|
||||
$message_parser = new parse_message($portal_config['portal_custom_code_center']);
|
||||
$message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies);
|
||||
|
||||
$text_center = $message_parser->message;
|
||||
$bbcode_uid = $message_parser->bbcode_uid;
|
||||
$bbcode_bitfield = $message_parser->bbcode_bitfield;
|
||||
|
||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||
$text_center = censor_text($text_center);
|
||||
$bbcode->bbcode_second_pass($text_center, $bbcode_uid, $bbcode_bitfield);
|
||||
$text_center = bbcode_nl2br($text_center);
|
||||
$text_center = smiley_text($text_center);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_CENTER_CODE' => $text_center,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_CENTER_CODE' => htmlspecialchars_decode($portal_config['portal_custom_code_center'],ENT_QUOTES),
|
||||
));
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_CENTER_HEADLINE' => $portal_config['portal_custom_center_headline'],
|
||||
));
|
||||
|
||||
if (!isset($template->filename['custom_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'custom_block' => 'portal/block/custom_center.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('custom_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
} else {
|
||||
// Small Box
|
||||
if ($portal_config['portal_custom_small_bbcode'])
|
||||
{
|
||||
$message_parser = new parse_message($portal_config['portal_custom_code_small']);
|
||||
$message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies);
|
||||
|
||||
$text_small = $message_parser->message;
|
||||
$bbcode_uid = $message_parser->bbcode_uid;
|
||||
$bbcode_bitfield = $message_parser->bbcode_bitfield;
|
||||
|
||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||
$text_small = censor_text($text_small);
|
||||
$bbcode->bbcode_second_pass($text_small, $bbcode_uid, $bbcode_bitfield);
|
||||
$text_small = bbcode_nl2br($text_small);
|
||||
$text_small = smiley_text($text_small);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_SMALL_CODE' => $text_small,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_SMALL_CODE' => htmlspecialchars_decode($portal_config['portal_custom_code_small'],ENT_QUOTES),
|
||||
));
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_CUSTOM_SMALL_HEADLINE' => $portal_config['portal_custom_small_headline'],
|
||||
));
|
||||
|
||||
if (!isset($template->filename['custom_side_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'custom_side_block' => 'portal/block/custom_small.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('custom_side_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
?>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($block_type == '')
|
||||
{
|
||||
if (!isset($template->filename['donate_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'donate_block' => 'portal/block/donation.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('donate_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($template->filename['donate_side_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'donate_side_block' => 'portal/block/donation_small.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('donate_side_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'PAY_ACC' => $portal_config['portal_pay_acc'],
|
||||
));
|
||||
|
||||
?>
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
display_forums('');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
|
||||
'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
|
||||
'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
'S_DISPLAY_PORTAL_FORUM_INDEX' => true,
|
||||
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
|
||||
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
|
||||
);
|
||||
|
||||
if (!isset($template->filename['forum_index_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'forum_index_block' => 'portal/block/forum_index.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('forum_index_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$s_display_friends = false;
|
||||
|
||||
// Output listing of friends online
|
||||
$update_time = $config['load_online_time'] * 60;
|
||||
|
||||
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline',
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
ZEBRA_TABLE => 'z'
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(SESSIONS_TABLE => 's'),
|
||||
'ON' => 's.session_user_id = z.zebra_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => 'z.user_id = ' . $user->data['user_id'] . '
|
||||
AND z.friend = 1
|
||||
AND u.user_id = z.zebra_id',
|
||||
'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline, u.user_colour',
|
||||
'ORDER_BY' => 'u.username_clean ASC',
|
||||
));
|
||||
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_online_friends']);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$which = (time() - $update_time < $row['online_time'] && $row['viewonline'] && $row['user_allow_viewonline']) ? 'online' : 'offline';
|
||||
$s_display_friends = ($row['user_id']) ? true : false;
|
||||
|
||||
$template->assign_block_vars("friends_{$which}", array(
|
||||
'USER_ID' => $row['user_id'],
|
||||
'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']))
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
//if( $s_display_friends )
|
||||
//{
|
||||
if (!isset($template->filename['friends_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'friends_block' => 'portal/block/online_friends.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('friends_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
//}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($template->filename['jumpbox_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'jumpbox_block' => 'portal/block/jumpbox.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('jumpbox_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// Last x visited bots
|
||||
$sql = 'SELECT username, user_colour, user_lastvisit
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . USER_IGNORE . '
|
||||
ORDER BY user_lastvisit DESC';
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_last_visited_bots_number']);
|
||||
$first = true;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['user_lastvisit'] && $first == TRUE)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_LAST_BOTS' => false,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_LAST_BOTS' => true,
|
||||
));
|
||||
|
||||
if( $row['user_lastvisit'] > 0 )
|
||||
{
|
||||
$template->assign_block_vars('last_visited_bots', array(
|
||||
'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']),
|
||||
'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']),
|
||||
));
|
||||
}
|
||||
}
|
||||
$first = false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $portal_config['portal_last_visited_bots_number']),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['latest_bots_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'latest_bots_block' => 'portal/block/latest_bots.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('latest_bots_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id, username, user_regdate, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_inactive_time = 0
|
||||
ORDER BY user_regdate DESC';
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_last_member']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['username']) )
|
||||
{
|
||||
$template->assign_block_vars('latest_members', array(
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'JOINED' => $user->format_date($row['user_regdate'], $format = 'd M'),
|
||||
));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['latest_members_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'latest_members_block' => 'portal/block/latest_members.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('latest_members_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,156 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// Display a listing of board admins, moderators
|
||||
$user->add_lang('groups');
|
||||
|
||||
$user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false);
|
||||
|
||||
$admin_id_ary = $mod_id_ary = $forum_id_ary = array();
|
||||
foreach ($user_ary as $forum_id => $forum_ary)
|
||||
{
|
||||
foreach ($forum_ary as $auth_option => $id_ary)
|
||||
{
|
||||
if (!$forum_id && $auth_option == 'a_')
|
||||
{
|
||||
$admin_id_ary = array_merge($admin_id_ary, $id_ary);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mod_id_ary = array_merge($mod_id_ary, $id_ary);
|
||||
}
|
||||
|
||||
if ($forum_id)
|
||||
{
|
||||
foreach ($id_ary as $id)
|
||||
{
|
||||
$forum_id_ary[$id][] = $forum_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$admin_id_ary = array_unique($admin_id_ary);
|
||||
$mod_id_ary = array_unique($mod_id_ary);
|
||||
|
||||
// Admin group id...
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
WHERE group_name = 'ADMINISTRATORS'";
|
||||
$result = $db->sql_query($sql);
|
||||
$admin_group_id = (int) $db->sql_fetchfield('group_id');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$forums = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forums[$row['forum_id']] = $row['forum_name'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', array(
|
||||
'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
GROUPS_TABLE => 'g'
|
||||
),
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(USER_GROUP_TABLE => 'ug'),
|
||||
'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id']
|
||||
)),
|
||||
'WHERE' => $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary))) . '
|
||||
AND u.group_id = g.group_id',
|
||||
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
|
||||
));
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
|
||||
|
||||
// We sort out admins not having the admin group as default
|
||||
// The drawback is that only those admins are displayed which are within
|
||||
// the special group 'Administrators' and also having it assigned as their default group.
|
||||
// - might change
|
||||
if ($which_row == 'admin' && $row['default_group'] != $admin_group_id)
|
||||
{
|
||||
// Remove from admin_id_ary, because the user may be a mod instead
|
||||
unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
|
||||
|
||||
if (!in_array($row['user_id'], $mod_id_ary))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$which_row = 'mod';
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
|
||||
{
|
||||
$group_name = $user->lang['GROUP_UNDISCLOSED'];
|
||||
$u_group = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
$u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
|
||||
}
|
||||
|
||||
$template->assign_block_vars($which_row, array(
|
||||
'USER_ID' => $row['user_id'],
|
||||
'GROUP_NAME' => $group_name,
|
||||
'GROUP_COLOR' => $row['group_colour'],
|
||||
|
||||
'U_GROUP' => $u_group,
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['leaders_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'leaders_block' => 'portal/block/leaders.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('leaders_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,126 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// Display a listing of board admins, moderators
|
||||
$user->add_lang('groups');
|
||||
|
||||
$legends = array();
|
||||
$groups = array();
|
||||
|
||||
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
||||
{
|
||||
$sql = 'SELECT group_id, group_name, group_colour, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_legend = 1
|
||||
ORDER BY group_name ASC';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
|
||||
FROM ' . GROUPS_TABLE . ' g
|
||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
|
||||
ON (
|
||||
g.group_id = ug.group_id
|
||||
AND ug.user_id = ' . $user->data['user_id'] . '
|
||||
AND ug.user_pending = 0
|
||||
)
|
||||
WHERE g.group_legend = 1
|
||||
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
|
||||
ORDER BY g.group_name ASC';
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups[$row['group_id']] = array(
|
||||
'group_name' => $row['group_name'],
|
||||
'group_colour' => $row['group_colour'],
|
||||
'group_type' => $row['group_type'],
|
||||
'group_users' => array(),
|
||||
);
|
||||
$legends[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if( sizeof($legends) )
|
||||
{
|
||||
$sql = 'SELECT
|
||||
u.user_id, u.username, u.user_colour, u.group_id
|
||||
FROM
|
||||
' . USERS_TABLE . ' AS u
|
||||
WHERE
|
||||
'. $db->sql_in_set('u.group_id', $legends) . '
|
||||
ORDER BY u.username ASC';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups[$row['group_id']]['group_users'][] = array(
|
||||
'user_id' => $row['user_id'],
|
||||
'username' => $row['username'],
|
||||
'user_colour' => $row['user_colour'],
|
||||
);
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if( sizeof($groups) )
|
||||
{
|
||||
foreach($groups as $group_id => $group)
|
||||
{
|
||||
if( sizeof($group['group_users']) )
|
||||
{
|
||||
$group_name = ($group['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group['group_name']] : $group['group_name'];
|
||||
$u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $group_id);
|
||||
|
||||
$template->assign_block_vars('group', array(
|
||||
'GROUP_NAME' => $group_name,
|
||||
'GROUP_COLOUR' => $group['group_colour'],
|
||||
'U_GROUP' => $u_group,
|
||||
));
|
||||
|
||||
foreach($group['group_users'] as $group_user)
|
||||
{
|
||||
$template->assign_block_vars('group.member', array(
|
||||
'USER_ID' => $group_user['user_id'],
|
||||
'USERNAME_FULL' => get_username_string('full', $group_user['user_id'], $group_user['username'], $group_user['user_colour']),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($template->filename['leaders_ext_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'leaders_ext_block' => 'portal/block/leaders_ext.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('leaders_ext_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
//doing the easy way ;)
|
||||
$u_link = $config['server_protocol'] . $config['server_name'] . $config['script_path'];
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'LINK_US_TXT' => sprintf($user->lang['LINK_US_TXT'], $config['sitename']),
|
||||
'U_LINK_US' => '<a href="' . $u_link . '" ' . (($config['site_desc']) ? 'title="' . $config['site_desc'] . '"' : '' ) . '>' . (($config['sitename']) ? $config['sitename'] : $u_link ) . '</a>',
|
||||
));
|
||||
|
||||
if (!isset($template->filename['link_us_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'link_us_block' => 'portal/block/link_us.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('link_us_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$links = ( strlen($portal_config['portal_links_array']) > 0 ) ? unserialize($portal_config['portal_links_array']) : array();
|
||||
|
||||
ksort( $links );
|
||||
reset( $links );
|
||||
|
||||
foreach( $links as $link_id => $link_data )
|
||||
{
|
||||
$template->assign_block_vars('link', array(
|
||||
'URL' => $link_data['url'],
|
||||
'TEXT' => $link_data['text'],
|
||||
));
|
||||
}
|
||||
|
||||
if (!isset($template->filename['links_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'links_block' => 'portal/block/links.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('links_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$s_display = true;
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),
|
||||
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
|
||||
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
|
||||
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
|
||||
));
|
||||
|
||||
?>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_M_BBCODE' => append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode'),
|
||||
'U_M_TERMS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
|
||||
'U_M_PRV' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
|
||||
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '',
|
||||
));
|
||||
|
||||
if (!isset($template->filename['main_menu_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'main_menu_block' => 'portal/block/main_menu.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('main_menu_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,136 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// 0 = Sunday first - 1 = Monday first. ;-)
|
||||
if ($portal_config['portal_sunday_first'])
|
||||
{
|
||||
define('MINI_CAL_FDOW', 0);
|
||||
} else {
|
||||
define('MINI_CAL_FDOW', 1);
|
||||
}
|
||||
|
||||
// get the calendar month
|
||||
$mini_cal_month = 0;
|
||||
if( isset($_GET['m']) || isset($_POST['m']) )
|
||||
{
|
||||
$mini_cal_month = ( isset($_POST['m']) ) ? intval($_POST['m']) : intval($_GET['m']);
|
||||
}
|
||||
|
||||
// initialise our calendarsuite class
|
||||
$mini_cal = new calendar();
|
||||
/*
|
||||
// setup our mini_cal template
|
||||
$template->set_filenames(array(
|
||||
'mini_cal_body' => 'portal/block/mini_cal_body.html'
|
||||
));
|
||||
*/
|
||||
// initialise some variables
|
||||
$mini_cal_today = date('Ymd', time() + $user->timezone + $user->dst - date('Z'));
|
||||
$s_cal_month = ($mini_cal_month != 0) ? $mini_cal_month . ' month' : $mini_cal_today;
|
||||
$mini_cal->getMonth($s_cal_month);
|
||||
$mini_cal_count = MINI_CAL_FDOW;
|
||||
$mini_cal_this_year = $mini_cal->dateYYYY;
|
||||
$mini_cal_this_month = $mini_cal->dateMM;
|
||||
$mini_cal_this_day = $mini_cal->dateDD;
|
||||
$mini_cal_month_days = $mini_cal->daysMonth;
|
||||
|
||||
|
||||
// output the days for the current month
|
||||
for($i=0; $i < $mini_cal_month_days;)
|
||||
{
|
||||
// is this the first day of the week?
|
||||
if($mini_cal_count == MINI_CAL_FDOW)
|
||||
{
|
||||
$template->assign_block_vars('mini_cal_row', array());
|
||||
}
|
||||
|
||||
// is this a valid weekday?
|
||||
if($mini_cal_count == ($mini_cal->day[$i][3]))
|
||||
{
|
||||
$mini_cal_this_day = $mini_cal->day[$i][0];
|
||||
|
||||
$d_mini_cal_today = $mini_cal_this_year . ( ($mini_cal_this_month <= 9) ? '0' . $mini_cal_this_month : $mini_cal_this_month ) . ( ($mini_cal_this_day <= 9) ? '0' . $mini_cal_this_day : $mini_cal_this_day );
|
||||
$mini_cal_day = ( $mini_cal_today == $d_mini_cal_today ) ? '<span style="font-weight: bold; color: ' . $portal_config['portal_minicalendar_today_color'] . ';">' . $mini_cal_this_day . '</span>' : $mini_cal_this_day;
|
||||
|
||||
$template->assign_block_vars('mini_cal_row.mini_cal_days', array(
|
||||
'MINI_CAL_DAY' => ($mini_cal_count == 0) ? '<span style="color: ' . $portal_config['portal_minicalendar_sunday_color'] . ';">' . $mini_cal_day . '</span>' : $mini_cal_day)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
// no day
|
||||
else
|
||||
{
|
||||
$template->assign_block_vars('mini_cal_row.mini_cal_days', array(
|
||||
'MINI_CAL_DAY' => ' ')
|
||||
);
|
||||
}
|
||||
|
||||
// is this the last day of the week?
|
||||
if ($mini_cal_count == 6)
|
||||
{
|
||||
// if so then reset the count
|
||||
$mini_cal_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise increment the count
|
||||
$mini_cal_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// output our general calendar bits
|
||||
$down = $mini_cal_month - 1;
|
||||
$up = $mini_cal_month + 1;
|
||||
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$down#minical") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_left_arrow.png' . '" title="' . $user->lang['VIEW_PREVIOUS_MONTH'] . '" height="16" width="16" alt="<<" /></a>';
|
||||
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$up#minical") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_right_arrow.png' . '" title="' . $user->lang['VIEW_NEXT_MONTH'] . '" height="16" width="16" alt=">>" /></a>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_MINICAL' => true,
|
||||
'S_SUNDAY_FIRST' => ($portal_config['portal_sunday_first']) ? true : false,
|
||||
'L_MINI_CAL_MONTH' => (($portal_config['portal_long_month']) ? $user->lang['mini_cal']['long_month'][$mini_cal->day[0][1]] : $user->lang['mini_cal']['month'][$mini_cal->day[0][1]]) . " " . $mini_cal->day[0][2],
|
||||
'L_MINI_CAL_SUN' => '<span style="color: ' . $portal_config['portal_minicalendar_sunday_color'] . ';">' . $user->lang['mini_cal']['day'][1] . '</span>',
|
||||
'L_MINI_CAL_MON' => $user->lang['mini_cal']['day'][2],
|
||||
'L_MINI_CAL_TUE' => $user->lang['mini_cal']['day'][3],
|
||||
'L_MINI_CAL_WED' => $user->lang['mini_cal']['day'][4],
|
||||
'L_MINI_CAL_THU' => $user->lang['mini_cal']['day'][5],
|
||||
'L_MINI_CAL_FRI' => $user->lang['mini_cal']['day'][6],
|
||||
'L_MINI_CAL_SAT' => $user->lang['mini_cal']['day'][7],
|
||||
'U_PREV_MONTH' => $prev_month,
|
||||
'U_NEXT_MONTH' => $next_month)
|
||||
);
|
||||
|
||||
if (!isset($template->filename['mini_cal_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'mini_cal_block' => 'portal/block/mini_calendar.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('mini_cal_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,330 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$news = request_var('news', -1);
|
||||
$news = ($news > $portal_config['portal_number_of_news'] -1) ? -1 : $news;
|
||||
$user->add_lang('viewforum');
|
||||
$start = request_var('np', 0);
|
||||
$start = ($start < 0) ? 0 : $start;
|
||||
|
||||
// Fetch news from portal/includes/functions.php with check if "read full" is requested.
|
||||
$portal_news_length = ($news < 0) ? $portal_config['portal_news_length'] : 0;
|
||||
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_news_permissions'], $portal_config['portal_number_of_news'], $portal_news_length, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news', $start);
|
||||
|
||||
|
||||
// Any news present? If not terminate it here.
|
||||
if (sizeof($fetch_news) == 0)
|
||||
{
|
||||
$template->assign_block_vars('news_row', array(
|
||||
'S_NO_TOPICS' => true,
|
||||
'S_NOT_LAST' => false,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Count number of posts for news archive, considering if permission check is dis- or enabled.
|
||||
if ( $portal_config['portal_news_archive'] )
|
||||
{
|
||||
$permissions = $portal_config['portal_news_permissions'];
|
||||
$forum_from = $portal_config['portal_news_forum'];
|
||||
|
||||
$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
||||
|
||||
$str_where = '';
|
||||
|
||||
if( $permissions == TRUE )
|
||||
{
|
||||
$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
|
||||
} else {
|
||||
$disallow_access = array();
|
||||
}
|
||||
|
||||
if( sizeof($forum_from) )
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if( !sizeof($disallow_access) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach( $disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id = $acc_id OR ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $disallow_access as $acc_id )
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id <> $acc_id AND ";
|
||||
}
|
||||
}
|
||||
|
||||
$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
||||
|
||||
$topic_type = ($portal_config['portal_show_all_news']) ? '( topic_type <> ' . POST_ANNOUNCE . ' ) AND ( topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;
|
||||
|
||||
$sql = 'SELECT COUNT(topic_id) AS num_topics
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $topic_type . '
|
||||
AND topic_approved = 1
|
||||
AND topic_moved_id = 0
|
||||
' . $str_where;
|
||||
$result = $db->sql_query($sql);
|
||||
$total_news = (int) $db->sql_fetchfield('num_topics');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if($news < 0)
|
||||
// Show the news overview
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if( isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true )
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
$read_full = $user->lang['READ_FULL'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$open_bracket = '';
|
||||
$close_bracket = '';
|
||||
$read_full = '';
|
||||
}
|
||||
// unread?
|
||||
$forum_id = $fetch_news[$i]['forum_id'];
|
||||
$topic_id = $fetch_news[$i]['topic_id'];
|
||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
|
||||
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
|
||||
|
||||
$read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
|
||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||
if ( $portal_config['portal_news_archive'] )
|
||||
{
|
||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $portal_config['portal_number_of_news'], $start, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
|
||||
}
|
||||
|
||||
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
||||
$folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
|
||||
switch ($fetch_news[$i]['topic_type'])
|
||||
{
|
||||
case POST_STICKY:
|
||||
$folder = 'sticky_read';
|
||||
$folder_new = 'sticky_unread';
|
||||
break;
|
||||
case POST_ANNOUNCE:
|
||||
$folder = 'announce_read';
|
||||
$folder_new = 'announce_unread';
|
||||
break;
|
||||
default:
|
||||
$folder = 'topic_read';
|
||||
$folder_new = 'topic_unread';
|
||||
if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $fetch_news[$i]['topic_status'] != ITEM_LOCKED)
|
||||
{
|
||||
$folder .= '_hot';
|
||||
$folder_new .= '_hot';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($fetch_news[$i]['topic_status'] == ITEM_LOCKED)
|
||||
{
|
||||
$folder .= '_locked';
|
||||
$folder_new .= '_locked';
|
||||
}
|
||||
if ($fetch_news[$i]['topic_posted'])
|
||||
{
|
||||
$folder .= '_mine';
|
||||
$folder_new .= '_mine';
|
||||
}
|
||||
|
||||
$folder_img = ($unread_topic) ? $folder_new : $folder;
|
||||
$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
|
||||
|
||||
// Grab icons
|
||||
$icons = $cache->obtain_icons();
|
||||
|
||||
$template->assign_block_vars('news_row', array(
|
||||
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'],
|
||||
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'LAST_POST_TIME' => $user->format_date($fetch_news[$i]['topic_last_post_time']),
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
'REPLIES' => $fetch_news[$i]['topic_replies'],
|
||||
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
|
||||
'N_ID' => $i,
|
||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
||||
'TOPIC_ICON_IMG' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
|
||||
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
|
||||
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
|
||||
'FOLDER_IMG' => $user->img('topic_read', 'NO_NEW_POSTS'),
|
||||
'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']),
|
||||
'U_VIEW_UNREAD' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&view=unread#unread'),
|
||||
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
|
||||
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
|
||||
'L_READ_FULL' => $read_full,
|
||||
'OPEN' => $open_bracket,
|
||||
'CLOSE' => $close_bracket,
|
||||
'S_NOT_LAST' => ($i < sizeof($fetch_news) - 1) ? true : false,
|
||||
'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(
|
||||
'NP_PAGINATION' => $pagination,
|
||||
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
||||
'NP_PAGE_NUMBER' => on_page($total_news, $portal_config['portal_number_of_news'], $start))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// Show "read full" page
|
||||
{
|
||||
$i = $news;
|
||||
$forum_id = $fetch_news[$i]['forum_id'];
|
||||
$topic_id = $fetch_news[$i]['topic_id'];
|
||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
|
||||
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
$read_full = $user->lang['BACK'];
|
||||
|
||||
$read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
|
||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||
if ( $portal_config['portal_news_archive'] )
|
||||
{
|
||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $portal_config['portal_number_of_news'], $start, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
|
||||
}
|
||||
|
||||
$template->assign_block_vars('news_row', array(
|
||||
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
'REPLIES' => $fetch_news[$i]['topic_replies'],
|
||||
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
|
||||
'N_ID' => $i,
|
||||
'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", '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']),
|
||||
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
|
||||
'S_POLL' => $fetch_news[$i]['poll'],
|
||||
'S_UNREAD_INFO' => $unread_topic,
|
||||
'U_READ_FULL' => $read_full_url,
|
||||
'L_READ_FULL' => $read_full,
|
||||
'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(
|
||||
'NP_PAGINATION' => $pagination,
|
||||
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
||||
'NP_PAGE_NUMBER' => on_page($total_news, $portal_config['portal_number_of_news'], $start))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$topic_icons = false;
|
||||
if( !empty($fetch_news['topic_icons']) )
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
|
||||
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
'S_NEWEST_OR_FIRST' => ( $portal_config['portal_news_show_last'] ) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
|
||||
'POSTED_BY_TEXT' => ( $portal_config['portal_news_show_last'] ) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
|
||||
'S_DISPLAY_NEWS' => true,
|
||||
'S_DISPLAY_NEWS_RVS' => ( $portal_config['portal_show_news_replies_views'] ) ? true : false,
|
||||
'S_TOPIC_ICONS' => $topic_icons,
|
||||
));
|
||||
|
||||
if( $portal_config['portal_news_style'] )
|
||||
{
|
||||
$template_file = 'portal/block/news_compact.html';
|
||||
} else {
|
||||
$template_file = 'portal/block/news.html';
|
||||
}
|
||||
|
||||
if (!isset($template->filename['news_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'news_block' => $template_file)
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('news_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,409 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
$user->add_lang('viewtopic');
|
||||
|
||||
$view = request_var('view', '');
|
||||
$update = request_var('update', false);
|
||||
$poll_view = request_var('polls', '');
|
||||
|
||||
$poll_view_ar = ( strpos(urldecode($poll_view), ',') !== FALSE ) ? explode(',', urldecode($poll_view)) : (($poll_view != '') ? array($poll_view) : array());
|
||||
|
||||
if ($update && $portal_config['portal_poll_allow_vote'])
|
||||
{
|
||||
$up_topic_id = request_var('t', 0);
|
||||
$up_forum_id = request_var('f', 0);
|
||||
$voted_id = request_var('vote_id', array('' => 0));
|
||||
|
||||
$cur_voted_id = array();
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql = 'SELECT poll_option_id
|
||||
FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . $up_topic_id . '
|
||||
AND vote_user_id = ' . $user->data['user_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$cur_voted_id[] = $row['poll_option_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cookie based guest tracking ... I don't like this but hum ho
|
||||
// it's oft requested. This relies on "nice" users who don't feel
|
||||
// the need to delete cookies to mess with results.
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $up_topic_id]))
|
||||
{
|
||||
$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $up_topic_id]);
|
||||
$cur_voted_id = array_map('intval', $cur_voted_id);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'SELECT t.poll_length, t.poll_start, t.poll_vote_change, t.topic_status, f.forum_status, t.poll_max_options
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
|
||||
WHERE t.forum_id = f.forum_id AND t.topic_id = " . (int) $up_topic_id . " AND t.forum_id = " . (int) $up_forum_id;
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$topic_data = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$s_can_up_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $up_forum_id)) ||
|
||||
($auth->acl_get('f_votechg', $up_forum_id) && $topic_data['poll_vote_change'])) &&
|
||||
(($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
|
||||
$topic_data['topic_status'] != ITEM_LOCKED &&
|
||||
$topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
|
||||
if( $s_can_up_vote )
|
||||
{
|
||||
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
|
||||
{
|
||||
$redirect_url = append_sid("./portal.$phpEx");
|
||||
|
||||
meta_refresh(5, $redirect_url);
|
||||
if (!sizeof($voted_id))
|
||||
{
|
||||
$message = 'NO_VOTE_OPTION';
|
||||
}
|
||||
else if (sizeof($voted_id) > $topic_data['poll_max_options'])
|
||||
{
|
||||
$message = 'TOO_MANY_VOTE_OPTIONS';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = 'VOTE_CONVERTED';
|
||||
}
|
||||
|
||||
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_PORTAL'], '<a href="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
foreach ($voted_id as $option)
|
||||
{
|
||||
if (in_array($option, $cur_voted_id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
|
||||
SET poll_option_total = poll_option_total + 1
|
||||
WHERE poll_option_id = ' . (int) $option . '
|
||||
AND topic_id = ' . (int) $up_topic_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql_ary = array(
|
||||
'topic_id' => (int) $up_topic_id,
|
||||
'poll_option_id' => (int) $option,
|
||||
'vote_user_id' => (int) $user->data['user_id'],
|
||||
'vote_user_ip' => (string) $user->ip,
|
||||
);
|
||||
|
||||
$sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($cur_voted_id as $option)
|
||||
{
|
||||
if (!in_array($option, $voted_id))
|
||||
{
|
||||
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
|
||||
SET poll_option_total = poll_option_total - 1
|
||||
WHERE poll_option_id = ' . (int) $option . '
|
||||
AND topic_id = ' . (int) $up_topic_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . (int) $up_topic_id . '
|
||||
AND poll_option_id = ' . (int) $option . '
|
||||
AND vote_user_id = ' . (int) $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot'])
|
||||
{
|
||||
$user->set_cookie('poll_' . $up_topic_id, implode(',', $voted_id), time() + 31536000);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET poll_last_vote = ' . time() . "
|
||||
WHERE topic_id = $up_topic_id";
|
||||
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
|
||||
$db->sql_query($sql);
|
||||
|
||||
$redirect_url = append_sid("./portal.$phpEx");
|
||||
|
||||
meta_refresh(5, $redirect_url);
|
||||
trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_PORTAL'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
}
|
||||
|
||||
$where = '';
|
||||
$poll_forums = false;
|
||||
|
||||
if( $portal_config['portal_poll_topic_id'] !== '' )
|
||||
{
|
||||
$poll_forums_config = explode(',' ,$portal_config['portal_poll_topic_id']);
|
||||
foreach($poll_forums_config as $poll_forum )
|
||||
{
|
||||
if ( is_numeric(trim($poll_forum)) === TRUE )
|
||||
{
|
||||
$poll_forum = (int) trim($poll_forum);
|
||||
if( $auth->acl_get('f_read', $poll_forum) )
|
||||
{
|
||||
$poll_forums = true;
|
||||
$where .= ($where == "") ? "t.forum_id = '{$poll_forum}'" : " OR t.forum_id = '{$poll_forum}'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_list = $auth->acl_getf('f_read', true);
|
||||
|
||||
foreach($forum_list as $pf => $pf_data )
|
||||
{
|
||||
$pf = (int) trim($pf);
|
||||
$poll_forums = true;
|
||||
$where .= ($where == "") ? "t.forum_id = '{$pf}'" : " OR t.forum_id = '{$pf}'";
|
||||
}
|
||||
}
|
||||
|
||||
$where = ($where !== '') ? "AND ({$where})" : '';
|
||||
|
||||
if( $poll_forums === TRUE )
|
||||
{
|
||||
|
||||
$sql = 'SELECT t.poll_title, t.poll_start, t.topic_id, t.topic_first_post_id, t.forum_id, t.poll_length, t.poll_vote_change, t.poll_max_options, t.topic_status, f.forum_status, p.bbcode_bitfield, p.bbcode_uid
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . " f
|
||||
WHERE t.forum_id = f.forum_id AND t.topic_approved = 1 AND t.poll_start > 0
|
||||
{$where}
|
||||
AND t.topic_moved_id = 0
|
||||
AND p.post_id = t.topic_first_post_id
|
||||
ORDER BY t.poll_start DESC";
|
||||
|
||||
$limit = ( isset($portal_config['portal_poll_limit']) ) ? $portal_config['portal_poll_limit'] : 3;
|
||||
|
||||
$result = $db->sql_query_limit($sql, $limit);
|
||||
|
||||
$has_poll = false;
|
||||
|
||||
if ($result)
|
||||
{
|
||||
|
||||
while( $data = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$has_poll = true;
|
||||
$poll_has_options = false;
|
||||
|
||||
$topic_id = (int) $data['topic_id'];
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
|
||||
$cur_voted_id = array();
|
||||
if( $portal_config['portal_poll_allow_vote'] )
|
||||
{
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$vote_sql = 'SELECT poll_option_id
|
||||
FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . $topic_id . '
|
||||
AND vote_user_id = ' . $user->data['user_id'];
|
||||
$vote_result = $db->sql_query($vote_sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($vote_result))
|
||||
{
|
||||
$cur_voted_id[] = $row['poll_option_id'];
|
||||
}
|
||||
$db->sql_freeresult($vote_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cookie based guest tracking ... I don't like this but hum ho
|
||||
// it's oft requested. This relies on "nice" users who don't feel
|
||||
// the need to delete cookies to mess with results.
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
|
||||
{
|
||||
$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
|
||||
$cur_voted_id = array_map('intval', $cur_voted_id);
|
||||
}
|
||||
}
|
||||
|
||||
$s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
|
||||
($auth->acl_get('f_votechg', $forum_id) && $data['poll_vote_change'])) &&
|
||||
(($data['poll_length'] != 0 && $data['poll_start'] + $data['poll_length'] > time()) || $data['poll_length'] == 0) &&
|
||||
$data['topic_status'] != ITEM_LOCKED &&
|
||||
$data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
} else {
|
||||
$s_can_vote = false;
|
||||
}
|
||||
|
||||
$s_display_results = ( !$s_can_vote || ( $s_can_vote && sizeof($cur_voted_id) ) || ( $view == 'viewpoll' && in_array($topic_id, $poll_view_ar) ) ) ? true : false;
|
||||
|
||||
$poll_sql = 'SELECT po.poll_option_id, po.poll_option_text, po.poll_option_total
|
||||
FROM ' . POLL_OPTIONS_TABLE . " po
|
||||
WHERE po.topic_id = {$topic_id}
|
||||
ORDER BY po.poll_option_id";
|
||||
|
||||
$poll_result = $db->sql_query($poll_sql);
|
||||
|
||||
$poll_total_votes = 0;
|
||||
|
||||
$poll_data = array();
|
||||
|
||||
if ($poll_result)
|
||||
{
|
||||
while( $polls_data = $db->sql_fetchrow($poll_result) )
|
||||
{
|
||||
$poll_has_options = true;
|
||||
$poll_data[] = $polls_data;
|
||||
$poll_total_votes += $polls_data['poll_option_total'];
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($poll_result);
|
||||
|
||||
$make_poll_view = array();
|
||||
|
||||
if( in_array($topic_id, $poll_view_ar) === FALSE )
|
||||
{
|
||||
$make_poll_view[] = $topic_id;
|
||||
$make_poll_view = array_merge($poll_view_ar, $make_poll_view);
|
||||
}
|
||||
|
||||
$poll_view_str = urlencode( implode(',', $make_poll_view) );
|
||||
|
||||
$portalpoll_url= append_sid("./portal.$phpEx", "polls=$poll_view_str");
|
||||
$portalvote_url= append_sid("./portal.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
|
||||
$poll_end = $data['poll_length'] + $data['poll_start'];
|
||||
|
||||
// Parse BBCode title
|
||||
|
||||
if ($data['bbcode_bitfield'])
|
||||
{
|
||||
$poll_bbcode = new bbcode();
|
||||
}
|
||||
else
|
||||
{
|
||||
$poll_bbcode = false;
|
||||
}
|
||||
|
||||
$data['poll_title'] = censor_text($data['poll_title']);
|
||||
|
||||
if ($poll_bbcode !== false)
|
||||
{
|
||||
$poll_bbcode->bbcode_second_pass($data['poll_title'], $data['bbcode_uid'], $data['bbcode_bitfield']);
|
||||
}
|
||||
|
||||
$data['poll_title'] = bbcode_nl2br($data['poll_title']);
|
||||
$data['poll_title'] = smiley_text($data['poll_title']);
|
||||
unset($poll_bbcode);
|
||||
|
||||
$template->assign_block_vars('poll', array(
|
||||
'S_POLL_HAS_OPTIONS' => $poll_has_options,
|
||||
'POLL_QUESTION' => $data['poll_title'],
|
||||
'U_POLL_TOPIC' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $topic_id . '&f=' . $forum_id),
|
||||
'POLL_LENGTH' => $data['poll_length'],
|
||||
'TOPIC_ID' => $topic_id,
|
||||
|
||||
'TOTAL_VOTES' => $poll_total_votes,
|
||||
|
||||
'L_MAX_VOTES' => ($data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $data['poll_max_options']),
|
||||
'L_POLL_LENGTH' => ($data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
|
||||
|
||||
'S_CAN_VOTE' => $s_can_vote,
|
||||
'S_DISPLAY_RESULTS' => $s_display_results,
|
||||
'S_IS_MULTI_CHOICE' => ($data['poll_max_options'] > 1) ? true : false,
|
||||
'S_POLL_ACTION' => $portalvote_url,
|
||||
|
||||
'U_VIEW_RESULTS' => $portalpoll_url . '&view=viewpoll#viewpoll',
|
||||
'U_VIEW_TOPIC' => $viewtopic_url
|
||||
));
|
||||
|
||||
foreach($poll_data as $pd)
|
||||
{
|
||||
$option_pct = ($poll_total_votes > 0) ? $pd['poll_option_total'] / $poll_total_votes : 0;
|
||||
$option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
|
||||
|
||||
// Parse BBCode option text
|
||||
|
||||
if ($data['bbcode_bitfield'])
|
||||
{
|
||||
$poll_bbcode = new bbcode();
|
||||
}
|
||||
else
|
||||
{
|
||||
$poll_bbcode = false;
|
||||
}
|
||||
|
||||
$pd['poll_option_text'] = censor_text($pd['poll_option_text']);
|
||||
|
||||
if ($poll_bbcode !== false)
|
||||
{
|
||||
$poll_bbcode->bbcode_second_pass($pd['poll_option_text'], $data['bbcode_uid'], $data['bbcode_bitfield']);
|
||||
}
|
||||
|
||||
$pd['poll_option_text'] = bbcode_nl2br($pd['poll_option_text']);
|
||||
$pd['poll_option_text'] = smiley_text($pd['poll_option_text']);
|
||||
unset($poll_bbcode);
|
||||
|
||||
$template->assign_block_vars('poll.poll_option', array(
|
||||
'POLL_OPTION_ID' => $pd['poll_option_id'],
|
||||
'POLL_OPTION_CAPTION' => $pd['poll_option_text'],
|
||||
'POLL_OPTION_RESULT' => $pd['poll_option_total'],
|
||||
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
||||
'POLL_OPTION_PCT' => round($option_pct * 100),
|
||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
|
||||
'POLL_OPTION_VOTED' => (in_array($pd['poll_option_id'], $cur_voted_id)) ? true : false
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_HAS_POLL' => $has_poll,
|
||||
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
|
||||
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
|
||||
));
|
||||
if (!isset($template->filename['poll_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'poll_block' => 'portal/block/poll.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('poll_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'postgres':
|
||||
$sql = 'SELECT *
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_type <> ' . USER_INACTIVE . '
|
||||
ORDER BY RANDOM()';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$sql = 'SELECT *
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_type <> ' . USER_INACTIVE . '
|
||||
ORDER BY NEWID()';
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = 'SELECT *
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_type <> ' . USER_INACTIVE . '
|
||||
ORDER BY RAND()';
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);
|
||||
|
||||
$rank_title = $rank_img = '';
|
||||
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
|
||||
$username = $row['username'];
|
||||
$user_id = (int) $row['user_id'];
|
||||
$colour = $row['user_colour'];
|
||||
|
||||
$template->assign_block_vars('random_member', array(
|
||||
'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
|
||||
'USERNAME' => get_username_string('username', $user_id, $username, $colour),
|
||||
'USER_COLOR' => get_username_string('colour', $user_id, $username, $colour),
|
||||
'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour),
|
||||
|
||||
'RANK_TITLE' => $rank_title,
|
||||
'RANK_IMG' => $rank_img,
|
||||
'RANK_IMG_SRC' => $rank_img_src,
|
||||
|
||||
'USER_POSTS' => (int) $row['user_posts'],
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
'JOINED' => $user->format_date($row['user_regdate'], 'd.M.Y'),
|
||||
'USER_OCC' => censor_text($row['user_occ']),
|
||||
'USER_FROM' => censor_text($row['user_from']),
|
||||
'U_WWW' => censor_text($row['user_website']),
|
||||
));
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['random_member_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'random_member_block' => 'portal/block/random_member.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('random_member_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,151 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
//
|
||||
// Exclude forums
|
||||
//
|
||||
$sql_where = '';
|
||||
if ($portal_config['portal_exclude_forums'])
|
||||
{
|
||||
$exclude_forums = explode(',', $portal_config['portal_exclude_forums']);
|
||||
foreach ($exclude_forums as $i => $id)
|
||||
{
|
||||
if ($id > 0)
|
||||
{
|
||||
$sql_where .= ' AND forum_id <> ' . trim($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get a list of forums the user cannot read
|
||||
$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));
|
||||
|
||||
// Determine first forum the user is able to read (must not be a category)
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST;
|
||||
|
||||
if (sizeof($forum_ary))
|
||||
{
|
||||
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
|
||||
}
|
||||
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$g_forum_id = (int) $db->sql_fetchfield('forum_id');
|
||||
|
||||
//
|
||||
// Recent announcements
|
||||
//
|
||||
$sql = 'SELECT topic_title, forum_id, topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_status <> ' . FORUM_LINK . '
|
||||
AND topic_approved = 1
|
||||
AND ( topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ' )
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '
|
||||
ORDER BY topic_time DESC';
|
||||
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
|
||||
{
|
||||
// auto auth
|
||||
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
|
||||
{
|
||||
$template->assign_block_vars('latest_announcements', array(
|
||||
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
|
||||
'FULL_TITLE' => censor_text($row['topic_title']),
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . ( ($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id'] ) . '&t=' . $row['topic_id'])
|
||||
));
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//
|
||||
// Recent hot topics
|
||||
//
|
||||
$sql = 'SELECT topic_title, forum_id, topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_approved = 1
|
||||
AND topic_replies >=' . $config['hot_threshold'] . '
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '
|
||||
ORDER BY topic_time DESC';
|
||||
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
|
||||
{
|
||||
// auto auth
|
||||
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
|
||||
{
|
||||
$template->assign_block_vars('latest_hot_topics', array(
|
||||
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
|
||||
'FULL_TITLE' => censor_text($row['topic_title']),
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . ( ($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id'] ) . '&t=' . $row['topic_id'])
|
||||
));
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//
|
||||
// Recent topic (only show normal topic)
|
||||
//
|
||||
$sql = 'SELECT topic_title, forum_id, topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_status <> ' . ITEM_MOVED . '
|
||||
AND topic_approved = 1
|
||||
AND topic_type = ' . POST_NORMAL . '
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '
|
||||
ORDER BY topic_time DESC';
|
||||
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
|
||||
{
|
||||
// auto auth
|
||||
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
|
||||
{
|
||||
$template->assign_block_vars('latest_topics', array(
|
||||
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
|
||||
'FULL_TITLE' => censor_text($row['topic_title']),
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
|
||||
));
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['recent_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'recent_block' => 'portal/block/recent.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('recent_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
?>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['search_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'search_block' => 'portal/block/search.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('search_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,159 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// switch idea from phpBB2 :p
|
||||
function get_db_stat($mode)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
switch( $mode )
|
||||
{
|
||||
case 'announcementtotal':
|
||||
$sql = 'SELECT COUNT(distinct t.topic_id) AS announcement_total
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
|
||||
WHERE t.topic_type = ' . POST_ANNOUNCE . '
|
||||
AND p.post_id = t.topic_first_post_id';
|
||||
break;
|
||||
case 'stickytotal':
|
||||
$sql = 'SELECT COUNT(distinct t.topic_id) AS sticky_total
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
|
||||
WHERE t.topic_type = ' . POST_STICKY . '
|
||||
AND p.post_id = t.topic_first_post_id';
|
||||
break;
|
||||
case 'attachmentstotal':
|
||||
$sql = 'SELECT COUNT(attach_id) AS attachments_total
|
||||
FROM ' . ATTACHMENTS_TABLE;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
switch ( $mode )
|
||||
{
|
||||
case 'announcementtotal':
|
||||
return $row['announcement_total'];
|
||||
break;
|
||||
case 'stickytotal':
|
||||
return $row['sticky_total'];
|
||||
break;
|
||||
case 'attachmentstotal':
|
||||
return $row['attachments_total'];
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
|
||||
$total_posts = $config['num_posts'];
|
||||
$total_topics = $config['num_topics'];
|
||||
$total_users = $config['num_users'];
|
||||
|
||||
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
|
||||
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
|
||||
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
|
||||
|
||||
// avarage stat
|
||||
$board_days = ( time() - $config['board_startdate'] ) / 86400;
|
||||
|
||||
$topics_per_day = ($total_topics) ? round($total_topics / $board_days, 0) : 0;
|
||||
$posts_per_day = ($total_posts) ? round($total_posts / $board_days, 0) : 0;
|
||||
$users_per_day = round($total_users / $board_days, 0);
|
||||
$topics_per_user = ($total_topics) ? round($total_topics / $total_users, 0) : 0;
|
||||
$posts_per_user = ($total_posts) ? round($total_posts / $total_users, 0) : 0;
|
||||
$posts_per_topic = ($total_topics) ? round($total_posts / $total_topics, 0) : 0;
|
||||
|
||||
if ($topics_per_day > $total_topics)
|
||||
{
|
||||
$topics_per_day = $total_topics;
|
||||
}
|
||||
|
||||
if ($posts_per_day > $total_posts)
|
||||
{
|
||||
$posts_per_day = $total_posts;
|
||||
}
|
||||
|
||||
if ($users_per_day > $total_users)
|
||||
{
|
||||
$users_per_day = $total_users;
|
||||
}
|
||||
|
||||
if ($topics_per_user > $total_topics)
|
||||
{
|
||||
$topics_per_user = $total_topics;
|
||||
}
|
||||
|
||||
if ($posts_per_user > $total_posts)
|
||||
{
|
||||
$posts_per_user = $total_posts;
|
||||
}
|
||||
|
||||
if ($posts_per_topic > $total_posts)
|
||||
{
|
||||
$posts_per_topic = $total_posts;
|
||||
}
|
||||
|
||||
$l_topics_per_day_s = ($total_topics == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
|
||||
$l_posts_per_day_s = ($total_posts == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
|
||||
$l_users_per_day_s = ($total_users == 0) ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER';
|
||||
$l_topics_per_user_s = ($total_topics == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
|
||||
$l_posts_per_user_s = ($total_posts == 0) ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER';
|
||||
$l_posts_per_topic_s = ($total_posts == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
|
||||
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
|
||||
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
|
||||
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
|
||||
'S_ANN' => get_db_stat('announcementtotal'),
|
||||
'S_SCT' => get_db_stat('stickytotal'),
|
||||
'S_TOT_ATTACH' => ($config['allow_attachments']) ? get_db_stat('attachmentstotal') : 0,
|
||||
|
||||
// avarage stat
|
||||
'TOPICS_PER_DAY' => sprintf($user->lang[$l_topics_per_day_s], $topics_per_day),
|
||||
'POSTS_PER_DAY' => sprintf($user->lang[$l_posts_per_day_s], $posts_per_day),
|
||||
'USERS_PER_DAY' => sprintf($user->lang[$l_users_per_day_s], $users_per_day),
|
||||
'TOPICS_PER_USER' => sprintf($user->lang[$l_topics_per_user_s], $topics_per_user),
|
||||
'POSTS_PER_USER' => sprintf($user->lang[$l_posts_per_user_s], $posts_per_user),
|
||||
'POSTS_PER_TOPIC' => sprintf($user->lang[$l_posts_per_topic_s], $posts_per_topic),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['statistics_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'statistics_block' => 'portal/block/statistics.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('statistics_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
$sql = 'SELECT user_id, username, user_posts, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_posts <> 0
|
||||
ORDER BY user_posts DESC';
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_most_poster']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['username']) )
|
||||
{
|
||||
$template->assign_block_vars('top_poster', array(
|
||||
'S_SEARCH_ACTION'=> append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&sr=posts'),
|
||||
'USERNAME_FULL'=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'POSTER_POSTS' => $row['user_posts'],
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!isset($template->filename['top_posters_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'top_posters_block' => 'portal/block/top_poster.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('top_posters_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,123 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
//
|
||||
// + new posts since last visit & you post number
|
||||
//
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
|
||||
|
||||
if ($auth->acl_get('m_approve'))
|
||||
{
|
||||
$m_approve_fid_ary = array(-1);
|
||||
$m_approve_fid_sql = '';
|
||||
}
|
||||
else if ($auth->acl_getf_global('m_approve'))
|
||||
{
|
||||
$m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary);
|
||||
$m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$m_approve_fid_ary = array();
|
||||
$m_approve_fid_sql = ' AND p.post_approved = 1';
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(distinct t.topic_id) as total
|
||||
FROM ' . TOPICS_TABLE . ' t
|
||||
WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . '
|
||||
AND t.topic_moved_id = 0
|
||||
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
|
||||
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
|
||||
$result = $db->sql_query($sql);
|
||||
$new_posts_count = (int) $db->sql_fetchfield('total');
|
||||
|
||||
// your post number
|
||||
$sql = "SELECT user_posts
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id = " . $user->data['user_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$you_posts_count = (int) $db->sql_fetchfield('user_posts');
|
||||
|
||||
//
|
||||
// - new posts since last visit & you post number
|
||||
//
|
||||
|
||||
|
||||
// Get user...
|
||||
$user_id = $user->data['user_id'];
|
||||
$username = $user->data['username'];
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id");
|
||||
$result = $db->sql_query($sql);
|
||||
$member = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$avatar_img = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
|
||||
$rank_title = $rank_img = '';
|
||||
get_user_rank($member['user_rank'], $member['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
$username = $member['username'];
|
||||
$user_id = (int) $member['user_id'];
|
||||
$colour = $member['user_colour'];
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'L_NEW_POSTS' => $user->lang['SEARCH_NEW'] . ' (' . $new_posts_count . ')',
|
||||
'L_SELF_POSTS' => $user->lang['SEARCH_SELF'] . ' (' . $you_posts_count . ')',
|
||||
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
|
||||
'RANK_TITLE' => $rank_title,
|
||||
'RANK_IMG' => $rank_img,
|
||||
'RANK_IMG_SRC' => $rank_img_src,
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
|
||||
'USERNAME' => get_username_string('username', $user_id, $username, $colour),
|
||||
'USER_COLOR' => get_username_string('colour', $user_id, $username, $colour),
|
||||
'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour),
|
||||
|
||||
'U_NEW_POSTS' => append_sid($phpbb_root_path . 'search.' . $phpEx . '?search_id=newposts'),
|
||||
'U_SELF_POSTS' => append_sid($phpbb_root_path . 'search.' . $phpEx . '?search_id=egosearch'),
|
||||
'U_UM_BOOKMARKS' => ($config['allow_bookmarks']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "i=main&mode=bookmarks") : '',
|
||||
'U_UM_MAIN_SUBSCRIBED' => append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?i=main&mode=subscribed'),
|
||||
));
|
||||
|
||||
if (!isset($template->filename['user_menu_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'user_menu_block' => 'portal/block/user_menu.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('user_menu_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
} else {
|
||||
include($phpbb_root_path . 'portal/block/login_box.'.$phpEx);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !$portal_config['portal_welcome_guest'] || ( $portal_config['portal_welcome_guest'] && (!isset($user->data['is_registered']) || !$user->data['is_registered']) ) )
|
||||
{
|
||||
$allow_bbcode = 1;
|
||||
$allow_urls = 1;
|
||||
$allow_smilies = 1;
|
||||
|
||||
$message_parser = new parse_message($portal_config['portal_welcome_intro']);
|
||||
$message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies);
|
||||
|
||||
$text = $message_parser->message;
|
||||
$bbcode_uid = $message_parser->bbcode_uid;
|
||||
$bbcode_bitfield = $message_parser->bbcode_bitfield;
|
||||
|
||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||
$text = censor_text($text);
|
||||
$bbcode->bbcode_second_pass($text, $bbcode_uid, $bbcode_bitfield);
|
||||
$text = bbcode_nl2br($text);
|
||||
$text = smiley_text($text);
|
||||
|
||||
if (!isset($template->filename['welcome_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'welcome_block' => 'portal/block/welcome.html')
|
||||
);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PORTAL_WELCOME_INTRO' => $text,
|
||||
));
|
||||
|
||||
$block_temp = $template->assign_display('welcome_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
?>
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
if ($config['load_online'] && $config['load_online_time'])
|
||||
{
|
||||
// who is online borrowed from index.php (phpBB-3.0.B3)
|
||||
// if this gets changed (in index.php) and I don't notice it, please tell me)
|
||||
//
|
||||
|
||||
// Grab group details for legend display
|
||||
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
||||
{
|
||||
$sql = 'SELECT group_id, group_name, group_colour, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_legend = 1
|
||||
ORDER BY group_name ASC';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
|
||||
FROM ' . GROUPS_TABLE . ' g
|
||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
|
||||
ON (
|
||||
g.group_id = ug.group_id
|
||||
AND ug.user_id = ' . $user->data['user_id'] . '
|
||||
AND ug.user_pending = 0
|
||||
)
|
||||
WHERE g.group_legend = 1
|
||||
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
|
||||
ORDER BY g.group_name ASC';
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$legend = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
|
||||
|
||||
if ($row['group_name'] == 'BOTS')
|
||||
{
|
||||
$legend .= (($legend != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
//
|
||||
// users online list borrowed from includes/functions.php (phpBB-3.0.B3)
|
||||
// if this gets changed (in functions.php) and I don't notice it, please tell me)
|
||||
//
|
||||
$display_online_list = true;
|
||||
|
||||
// Get users online list ... if required
|
||||
$l_online_users = $online_userlist = $l_online_record = '';
|
||||
|
||||
if ($config['load_online'] && $config['load_online_time'] && $display_online_list)
|
||||
{
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'LEGEND' => $legend,
|
||||
));
|
||||
|
||||
if (!isset($template->filename['whois_online_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'whois_online_block' => 'portal/block/whois_online.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('whois_online_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$words_array = array();
|
||||
|
||||
// Get words and number of those words
|
||||
$sql = 'SELECT l.word_text, COUNT(*) AS word_count
|
||||
FROM ' . SEARCH_WORDLIST_TABLE . ' AS l, ' . SEARCH_WORDMATCH_TABLE . ' AS m
|
||||
WHERE m.word_id = l.word_id
|
||||
GROUP BY m.word_id
|
||||
ORDER BY word_count DESC';
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_wordgraph_max_words']);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$word = strtolower($row['word_text']);
|
||||
$words_array[$word] = $row['word_count'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$minimum = 1000000;
|
||||
$maximum = -1000000;
|
||||
|
||||
foreach ( array_keys($words_array) as $word )
|
||||
{
|
||||
if ( $words_array[$word] > $maximum )
|
||||
{
|
||||
$maximum = $words_array[$word];
|
||||
}
|
||||
|
||||
if ( $words_array[$word] < $minimum )
|
||||
{
|
||||
$minimum = $words_array[$word];
|
||||
}
|
||||
}
|
||||
|
||||
// ratio
|
||||
$ratio = $portal_config['portal_wordgraph_ratio'] / ( $maximum - $minimum +1);
|
||||
|
||||
$words = array_keys($words_array);
|
||||
sort($words);
|
||||
|
||||
foreach ( $words as $word )
|
||||
{
|
||||
$template->assign_block_vars('wordgraph', array(
|
||||
'WORD' => ($portal_config['portal_wordgraph_word_counts']) ? $word . '(' . $words_array[$word] . ')' : $word,
|
||||
'WORD_FONT_SIZE' => (int) ( 9 + ( $words_array[$word] * $ratio ) ),
|
||||
'WORD_SEARCH_URL' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode($word)),
|
||||
));
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_WORDGRAPH' => $user->lang['WORDGRAPH'],
|
||||
));
|
||||
if (!isset($template->filename['wordgraph_block']))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'wordgraph_block' => 'portal/block/wordgraph.html')
|
||||
);
|
||||
}
|
||||
|
||||
$block_temp = $template->assign_display('wordgraph_block');
|
||||
|
||||
$template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -1,630 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
// Get portal config
|
||||
function obtain_portal_config()
|
||||
{
|
||||
global $db, $cache;
|
||||
|
||||
if (($portal_config = $cache->get('portal_config')) !== true)
|
||||
{
|
||||
$portal_config = $cached_portal_config = array();
|
||||
|
||||
$sql = 'SELECT config_name, config_value
|
||||
FROM ' . PORTAL_CONFIG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$cached_portal_config[$row['config_name']] = $row['config_value'];
|
||||
$portal_config[$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$cache->put('portal_config', $cached_portal_config);
|
||||
}
|
||||
|
||||
return $portal_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set config value. Creates missing config entry.
|
||||
*/
|
||||
function set_portal_config($config_name, $config_value)
|
||||
{
|
||||
global $db, $cache, $portal_config;
|
||||
|
||||
$sql = 'UPDATE ' . PORTAL_CONFIG_TABLE . "
|
||||
SET config_value = '" . $db->sql_escape($config_value) . "'
|
||||
WHERE config_name = '" . $db->sql_escape($config_name) . "'";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!$db->sql_affectedrows() && !isset($portal_config[$config_name]))
|
||||
{
|
||||
$sql = 'INSERT INTO ' . PORTAL_CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||
'config_name' => $config_name,
|
||||
'config_value' => $config_value));
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$portal_config[$config_name] = $config_value;
|
||||
}
|
||||
|
||||
//
|
||||
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
|
||||
|
||||
// fetch post for news & announce
|
||||
function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0)
|
||||
{
|
||||
global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config;
|
||||
|
||||
$posts = array();
|
||||
|
||||
$post_time = ($time == 0) ? '' : 'AND t.topic_time > ' . (time() - $time * 86400);
|
||||
|
||||
$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
||||
|
||||
$str_where = '';
|
||||
|
||||
$topic_icons = array(0);
|
||||
|
||||
$have_icons = 0;
|
||||
|
||||
if( $permissions == TRUE )
|
||||
{
|
||||
$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
|
||||
} else {
|
||||
$disallow_access = array();
|
||||
}
|
||||
|
||||
$global_f = 0;
|
||||
|
||||
if( sizeof($forum_from) )
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if( !sizeof($disallow_access) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach( $disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "t.forum_id = $acc_id OR ";
|
||||
if( $type == 'announcements' && $global_f < 1 && $acc_id > 0 )
|
||||
{
|
||||
$global_f = $acc_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $disallow_access as $acc_id )
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "t.forum_id <> $acc_id AND ";
|
||||
}
|
||||
}
|
||||
|
||||
switch( $type )
|
||||
{
|
||||
case "announcements":
|
||||
|
||||
$topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
|
||||
$str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
|
||||
$user_link = 't.topic_poster = u.user_id';
|
||||
$post_link = 't.topic_first_post_id = p.post_id';
|
||||
$topic_order = 't.topic_time DESC';
|
||||
|
||||
break;
|
||||
case "news":
|
||||
|
||||
$topic_type = 't.topic_type = ' . POST_NORMAL;
|
||||
$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
||||
$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
||||
$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
||||
$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
||||
|
||||
|
||||
break;
|
||||
case "news_all":
|
||||
|
||||
$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)) . ')' : '';
|
||||
$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
|
||||
$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
|
||||
$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if( $type == 'announcements' && $global_f < 1 )
|
||||
{
|
||||
$sql = 'SELECT
|
||||
forum_id
|
||||
FROM
|
||||
' . FORUMS_TABLE . '
|
||||
WHERE
|
||||
forum_type = ' . FORUM_POST . '
|
||||
' . str_replace('t.', '', $str_where) . '
|
||||
ORDER BY
|
||||
forum_id';
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
||||
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
if( !sizeof( $row ) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
$global_f = $row['forum_id'];
|
||||
|
||||
}
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 't.forum_id,
|
||||
t.topic_id,
|
||||
t.topic_last_post_id,
|
||||
t.topic_last_post_time,
|
||||
t.topic_time,
|
||||
t.topic_title,
|
||||
t.topic_attachment,
|
||||
t.topic_views,
|
||||
t.poll_title,
|
||||
t.topic_replies,
|
||||
t.topic_replies_real,
|
||||
t.topic_poster,
|
||||
t.topic_type,
|
||||
t.topic_status,
|
||||
t.topic_last_poster_name,
|
||||
t.topic_last_poster_id,
|
||||
t.topic_last_poster_colour,
|
||||
t.icon_id,
|
||||
u.username,
|
||||
u.user_id,
|
||||
u.user_type,
|
||||
u.user_colour,
|
||||
p.post_id,
|
||||
p.poster_id,
|
||||
p.post_time,
|
||||
p.post_text,
|
||||
p.post_attachment,
|
||||
p.post_username,
|
||||
p.enable_smilies,
|
||||
p.enable_bbcode,
|
||||
p.enable_magic_url,
|
||||
p.bbcode_bitfield,
|
||||
p.bbcode_uid,
|
||||
f.forum_name,
|
||||
f.enable_icons',
|
||||
|
||||
'FROM' => array(
|
||||
TOPICS_TABLE => 't',
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(USERS_TABLE => 'u'),
|
||||
'ON' => $user_link,
|
||||
),
|
||||
array(
|
||||
'FROM' => array(FORUMS_TABLE => 'f'),
|
||||
'ON' => 't.forum_id=f.forum_id',
|
||||
),
|
||||
array(
|
||||
'FROM' => array(POSTS_TABLE => 'p'),
|
||||
'ON' => $post_link,
|
||||
),
|
||||
),
|
||||
|
||||
'WHERE' => $topic_type . '
|
||||
' . $post_time . '
|
||||
AND t.topic_status <> ' . ITEM_MOVED . '
|
||||
AND t.topic_approved = 1
|
||||
AND t.topic_moved_id = 0
|
||||
' . $str_where,
|
||||
|
||||
'ORDER_BY' => $topic_order,
|
||||
);
|
||||
|
||||
$sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']);
|
||||
$sql_array['SELECT'] .= ', tp.topic_posted';
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
|
||||
if ($number_of_posts <> 0)
|
||||
{
|
||||
$result = $db->sql_query_limit($sql, $number_of_posts, $start);
|
||||
} else {
|
||||
$result = $db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Instantiate BBCode if need be
|
||||
if ($bbcode_bitfield !== '')
|
||||
{
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
|
||||
$attachments = array();
|
||||
if( $config['allow_attachments'] && $row['post_id'] )
|
||||
{
|
||||
// Pull attachment data
|
||||
$sql2 = 'SELECT *
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE post_msg_id = '. $row['post_id'] .'
|
||||
AND in_message = 0
|
||||
ORDER BY filetime DESC';
|
||||
|
||||
$result2 = $db->sql_query($sql2);
|
||||
|
||||
while ($row2 = $db->sql_fetchrow($result2))
|
||||
{
|
||||
$attachments[] = $row2;
|
||||
}
|
||||
$db->sql_freeresult($result2);
|
||||
}
|
||||
|
||||
$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
|
||||
$len_check = $row['post_text'];
|
||||
$maxlen = $text_length;
|
||||
|
||||
if (($text_length != 0) && (strlen($len_check) > $text_length))
|
||||
{
|
||||
$message = censor_text(get_sub_taged_string(str_replace("\n", '<br/> ', $row['post_text']), $row['bbcode_uid'], $maxlen));
|
||||
$posts[$i]['striped'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = censor_text( str_replace("\n", '<br/> ', $row['post_text']) );
|
||||
}
|
||||
|
||||
// Second parse bbcode here
|
||||
if ($row['bbcode_bitfield'])
|
||||
{
|
||||
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
|
||||
}
|
||||
if (!empty($attachments))
|
||||
{
|
||||
parse_attachments($row['forum_id'], $message, $attachments, $update_count);
|
||||
}
|
||||
$message = smiley_text($message); // Always process smilies after parsing bbcodes
|
||||
|
||||
if( $global_f < 1 )
|
||||
{
|
||||
$global_f = $row['forum_id'];
|
||||
}
|
||||
|
||||
$topic_icons[] = $row['enable_icons'];
|
||||
$have_icons = ( $row['icon_id'] > 0 ) ? 1 : $have_icons;
|
||||
|
||||
$posts[$i] = array_merge($posts[$i], array(
|
||||
'post_text' => ap_validate($message),
|
||||
'topic_id' => $row['topic_id'],
|
||||
'topic_last_post_id' => $row['topic_last_post_id'],
|
||||
'topic_type' => $row['topic_type'],
|
||||
'topic_posted' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
||||
'icon_id' => $row['icon_id'],
|
||||
'topic_status' => $row['topic_status'],
|
||||
'forum_id' => $row['forum_id'],
|
||||
'topic_replies' => $row['topic_replies'],
|
||||
'topic_replies_real' => $row['topic_replies_real'],
|
||||
'topic_time' => $user->format_date($row['post_time']),
|
||||
'topic_last_post_time' => $row['topic_last_post_time'],
|
||||
'topic_title' => $row['topic_title'],
|
||||
'username' => $row['username'],
|
||||
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $row['post_username']),
|
||||
'username_full_last' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour'], $row['topic_last_poster_name']),
|
||||
'user_id' => $row['user_id'],
|
||||
'user_type' => $row['user_type'],
|
||||
'user_colour' => $row['user_colour'],
|
||||
'poll' => ($row['poll_title']) ? true : false,
|
||||
'attachment' => ($row['topic_attachment']) ? true : false,
|
||||
'topic_views' => $row['topic_views'],
|
||||
'forum_name' => $row['forum_name'],
|
||||
'attachments' => (!empty($attachments)) ? $attachments : array(),
|
||||
));
|
||||
$posts['global_id'] = $global_f;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$posts['topic_icons'] = ( (max($topic_icons) > 0 ) && $have_icons ) ? true : false;
|
||||
|
||||
$posts['topic_count'] = $i;
|
||||
|
||||
if( $global_f < 1 )
|
||||
{
|
||||
return array();
|
||||
} else {
|
||||
return $posts;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Censor title, return short title
|
||||
*
|
||||
* @param $title string title to censor
|
||||
* @param $limit int short title character limit
|
||||
*
|
||||
*/
|
||||
function character_limit(&$title, $limit = 0)
|
||||
{
|
||||
$title = censor_text($title);
|
||||
if ($limit > 0)
|
||||
{
|
||||
return (strlen(utf8_decode($title)) > $limit + 3) ? truncate_string($title, $limit) . '...' : $title;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $title;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't let them mess up the complete portal layout in cut messages and do some real AP magic
|
||||
|
||||
function is_valid_bbtag($str, $bbuid) {
|
||||
return (substr($str,0,1) == '[') && (strpos($str, ':'.$bbuid.']') > 0);
|
||||
}
|
||||
|
||||
function get_end_bbtag($tag, $bbuid) {
|
||||
$etag = '';
|
||||
for($i=0;$i<strlen($tag);$i++) {
|
||||
if ($tag[$i] == '[') $etag .= $tag[$i] . '/';
|
||||
else if (($tag[$i] == '=') || ($tag[$i] == ':')) {
|
||||
if ($tag[1] == '*') $etag .= ':m:'.$bbuid.']';
|
||||
else if (strpos($tag, 'list')) $etag .= ':u:'.$bbuid.']';
|
||||
else $etag .= ':'.$bbuid.']';
|
||||
break;
|
||||
} else $etag .= $tag[$i];
|
||||
}
|
||||
|
||||
return $etag;
|
||||
}
|
||||
|
||||
function get_next_word($str) {
|
||||
$ret = '';
|
||||
for($i=0;$i<strlen($str);$i++) {
|
||||
switch ($str[$i]) {
|
||||
case ' ': //$ret .= ' '; break; break;
|
||||
return $ret . ' ';
|
||||
case '\\':
|
||||
if ($str[$i+1] == 'n') return $ret . '\n';
|
||||
case '[': if ($i != 0) return $ret;
|
||||
default: $ret .= $str[$i];
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function get_next_bbhtml_part($str) {
|
||||
$lim = substr($str,0,strpos($str,'>')+1);
|
||||
return substr($str,0,strpos($str, $lim, strlen($lim))+strlen($lim));
|
||||
}
|
||||
|
||||
function get_sub_taged_string($str, $bbuid, $maxlen) {
|
||||
$sl = $str;
|
||||
$ret = '';
|
||||
$ntext = '';
|
||||
$lret = '';
|
||||
$i = 0;
|
||||
$cnt = $maxlen;
|
||||
$last = '';
|
||||
$arr = array();
|
||||
|
||||
while((strlen($ntext) < $cnt) && (strlen($sl) > 0)) {
|
||||
$sr = '';
|
||||
if (substr($sl, 0, 1) == '[') $sr = substr($sl,0,strpos($sl,']')+1);
|
||||
/* GESCHLOSSENE HTML-TAGS BEACHTEN */
|
||||
if (substr($sl, 0, 2) == '<!') {
|
||||
$sr = get_next_bbhtml_part($sl);
|
||||
$ret .= $sr;
|
||||
} else if (substr($sl, 0, 1) == '<') {
|
||||
$sr = substr($sl,0,strpos($sl,'>')+1);
|
||||
$ret .= $sr;
|
||||
} else if (is_valid_bbtag($sr, $bbuid)) {
|
||||
if ($sr[1] == '/') {
|
||||
/* entfernt das endtag aus dem tag array */
|
||||
$tarr = array();
|
||||
$j = 0;
|
||||
foreach ($arr as $elem) {
|
||||
if (strcmp($elem[1],$sr) != 0) $tarr[$j++] = $elem;
|
||||
}
|
||||
$arr = $tarr;
|
||||
} else {
|
||||
$arr[$i][0] = $sr;
|
||||
$arr[$i++][1] = get_end_bbtag($sr, $bbuid);
|
||||
}
|
||||
$ret .= $sr;
|
||||
} else {
|
||||
$sr = get_next_word($sl);
|
||||
$ret .= $sr;
|
||||
$ntext .= $sr;
|
||||
$last = $sr;
|
||||
}
|
||||
$sl = substr($sl, strlen($sr), strlen($sl)-strlen($sr));
|
||||
}
|
||||
|
||||
$ret = trim($ret) . '...';
|
||||
|
||||
$ap = '';
|
||||
foreach ($arr as $elem) {
|
||||
$ap = $elem[1] . $ap;
|
||||
}
|
||||
$ret .= $ap;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function ap_validate($str) {
|
||||
$s = str_replace('<br />', '<br/>', $str);
|
||||
return str_replace('</li><br/>', '</li>', $s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pagination routine, generates archive number sequence
|
||||
*/
|
||||
function generate_portal_pagination($base_url, $num_items, $per_page, $start_item, $type, $add_prevnext_text = false, $tpl_prefix = '')
|
||||
{
|
||||
global $template, $user;
|
||||
|
||||
switch( $type )
|
||||
{
|
||||
case "announcements":
|
||||
$pagination_type = 'ap';
|
||||
$anker = '#a';
|
||||
break;
|
||||
case "news":
|
||||
case "news_all":
|
||||
$pagination_type = 'np';
|
||||
$anker = '#n';
|
||||
break;
|
||||
}
|
||||
|
||||
// Make sure $per_page is a valid value
|
||||
$per_page = ($per_page <= 0) ? 1 : $per_page;
|
||||
|
||||
$seperator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
|
||||
$total_pages = ceil($num_items / $per_page);
|
||||
|
||||
if ($total_pages == 1 || !$num_items)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$on_page = floor($start_item / $per_page) + 1;
|
||||
$url_delim = (strpos($base_url, '?') === false) ? '?' : '&';
|
||||
|
||||
$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . $anker .'">1</a>';
|
||||
|
||||
if ($total_pages > 5)
|
||||
{
|
||||
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
|
||||
$end_cnt = max(min($total_pages, $on_page + 4), 6);
|
||||
|
||||
$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;
|
||||
|
||||
for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
|
||||
{
|
||||
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
|
||||
if ($i < $end_cnt - 1)
|
||||
{
|
||||
$page_string .= $seperator;
|
||||
}
|
||||
}
|
||||
|
||||
$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
|
||||
}
|
||||
else
|
||||
{
|
||||
$page_string .= $seperator;
|
||||
|
||||
for ($i = 2; $i < $total_pages; $i++)
|
||||
{
|
||||
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
|
||||
if ($i < $total_pages)
|
||||
{
|
||||
$page_string .= $seperator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($total_pages - 1) * $per_page) . $anker . '">' . $total_pages . '</a>';
|
||||
|
||||
if ($add_prevnext_text)
|
||||
{
|
||||
if ($on_page != 1)
|
||||
{
|
||||
$page_string = '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($on_page - 2) * $per_page) . $anker . '">' . $user->lang['PREVIOUS'] . '</a> ' . $page_string;
|
||||
}
|
||||
|
||||
if ($on_page != $total_pages)
|
||||
{
|
||||
$page_string .= ' <a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . ($on_page * $per_page) . $anker . '">' . $user->lang['NEXT'] . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$tpl_prefix . 'BASE_URL' => $base_url,
|
||||
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
|
||||
$tpl_prefix . 'PER_PAGE' => $per_page,
|
||||
|
||||
$tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . (($on_page - 2) * $per_page) . $anker,
|
||||
$tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . ($on_page * $per_page) . $anker,
|
||||
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
|
||||
));
|
||||
|
||||
return $page_string;
|
||||
}
|
||||
|
||||
// Mini Cal.
|
||||
class calendar
|
||||
{
|
||||
var $dateYYY; // year in numeric format (YYYY)
|
||||
var $dateMM; // month in numeric format (MM)
|
||||
var $dateDD; // day in numeric format (DD)
|
||||
var $ext_dateMM; // extended month (e.g. February)
|
||||
var $daysMonth; // count of days in month
|
||||
var $stamp; // timestamp
|
||||
var $day; // return array s.a.
|
||||
|
||||
/**
|
||||
* convert date->timestamp
|
||||
**/
|
||||
function makeTimestamp($date)
|
||||
{
|
||||
$this->stamp = strtotime($date);
|
||||
return ($this->stamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* get date listed in array
|
||||
**/
|
||||
function getMonth($callDate)
|
||||
{
|
||||
|
||||
$this->makeTimestamp($callDate);
|
||||
$this->dateYYYY = date("Y", $this->stamp);
|
||||
$this->dateMM = date("n", $this->stamp);
|
||||
$this->ext_dateMM = date("F", $this->stamp);
|
||||
$this->dateDD = date("d", $this->stamp);
|
||||
$this->daysMonth = date("t", $this->stamp);
|
||||
|
||||
for($i=1; $i < $this->daysMonth+1; $i++)
|
||||
{
|
||||
$this->makeTimestamp("$i $this->ext_dateMM $this->dateYYYY");
|
||||
$this->day[] = array(
|
||||
"0" => "$i",
|
||||
"1" => $this->dateMM,
|
||||
"2" => $this->dateYYYY,
|
||||
"3" => (date('w', $this->stamp))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user