Move over to own Repository :)

This commit is contained in:
Kevin
2008-01-26 00:01:09 +00:00
commit 41022d1ddb
149 changed files with 12674 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
<?php
/*
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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(
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_NEWEST_POST'),
'S_DISPLAY_ANNOUNCEMENTS' => true,
));
#if (!isset($HTTP_GET_VARS['article']))
$news = request_var('announcement', -1);
if($news < 0)
{
$fetch_news = phpbb_fetch_posts('', $portal_config['portal_number_of_announcements'], $portal_config['portal_announcements_length'], $portal_config['portal_announcements_day'], 'announcements');
if (count($fetch_news) == 0)
{
$template->assign_block_vars('announcements_row', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news); $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;
$template->assign_block_vars('announcements_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'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&amp;u=' . $fetch_news[$i]['user_id']) : '',
'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'],
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . '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", (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . 't=' . $fetch_news[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;' . (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . 't=' . $fetch_news[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'announcement=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news) - 1) ? true : false,
'S_POLL' => $fetch_news[$i]['poll'],
// 'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'),
'S_UNREAD_INFO' => $unread_topic,
));
}
}
}
else
{
#$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], 0, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
$fetch_news = $fetch_news = phpbb_fetch_posts('', $portal_config['portal_number_of_announcements'], 0, 0, 'announcements');
$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;
$template->assign_block_vars('announcements_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'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'],
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . '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", (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . 't=' . $fetch_news[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;' . (($fetch_news[$i]['forum_id']) ? 'f=' . $fetch_news[$i]['forum_id'] . '&amp;' : '') . 't=' . $fetch_news[$i]['topic_id']),
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
?>

View File

@@ -0,0 +1,54 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
// Just grab all attachment info from database
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
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['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $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']),
));
}
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array(
'S_DISPLAY_ATTACHMENTS' => true,
));
?>

View File

@@ -0,0 +1,52 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
// Generate birthday list if required ... / borrowed from index.php (RC4)
$birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
$sql = 'SELECT user_id, username, user_colour, user_birthday
FROM ' . USERS_TABLE . "
WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$birthday_list .= (($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) . ')';
}
}
$db->sql_freeresult($result);
}
// Assign index specific vars
$template->assign_vars(array(
'BIRTHDAY_LIST' => $birthday_list,
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
)
);
?>

View File

@@ -0,0 +1,76 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
$lang = request_var('lang', '', false, true);
if (file_exists($phpbb_root_path . 'language/' . $lang . "/common.$phpEx"))
{
$this->lang_name = $lang;
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
$this->set_cookie('lang', $lang, $cookie_expire);
unset($cookie_expire);
}
$requested_style = request_var('style', 0, false, true);
if ($requested_style && (!$config['override_user_style'] || $auth->acl_get('a_styles')))
{
$style = $requested_style;
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
$this->set_cookie('style', $style, $cookie_expire);
unset($cookie_expire);
}
$all = false;
$default = '';
$sql_where = (!$all) ? 'WHERE style_active = 1 ' : '';
$sql = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . "
$sql_where
ORDER BY style_name";
$result = $db->sql_query($sql);
$style_options = '';
while ($row = $db->sql_fetchrow($result))
{
$selected = ($row['style_id'] == $default) ? ' selected="selected"' : '';
$style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>';
$template->assign_block_vars('styles', array(
'STYLE_ID' => $row['style_id'],
'STYLE_NAME' => $row['style_name'],
'STYLE_COPY' => $row['style_copyright'],
'U_STYLE' => append_sid("{$phpbb_root_path}portal.$phpEx", 'style=' . $row['style_id']),
));
}
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array(
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_DISPLAY_CHANGE_STYLE' => true,
));
?>

View File

@@ -0,0 +1,44 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_pay_acc'])
{
if ($portal_config['portal_pay_c_block'])
{
$template->assign_vars(array(
'S_DISPLAY_PAY_C' => true,
));
}
if ($portal_config['portal_pay_s_block'])
{
$template->assign_vars(array(
'S_DISPLAY_PAY_S' => true,
));
}
// Assign specific vars
$template->assign_vars(array(
'PAY_ACC' => $portal_config['portal_pay_acc'],
));
}
?>

View File

@@ -0,0 +1,71 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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.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);
// Assign specific vars
$template->assign_vars(array(
'S_DISPLAY_FRIENDS' => $s_display_friends,
'S_ZEBRA_ENABLED' => true,
));
?>

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

View File

@@ -0,0 +1,59 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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']);
while ($row = $db->sql_fetchrow($result))
{
// if ($row['user_lastvisit'] == 0)
if (!$row['user_lastvisit'])
{
$template->assign_vars(array(
'S_DISPLAY_LAST_BOTS' => false,
));
}
else
{
$template->assign_vars(array(
'S_DISPLAY_LAST_BOTS' => true,
));
$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']),
));
}
}
$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']),
'S_LAST_VISITED_BOTS' => ($portal_config['portal_load_last_visited_bots']) ? true : false,
));
?>

View File

@@ -0,0 +1,44 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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' => censor_text($row['username']),
'USERNAME_COLOR'=> ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '',
'U_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'JOINED' => $user->format_date($row['user_regdate'], $format = 'd M'),
));
}
$db->sql_freeresult($result);
$template->assign_vars(array(
'S_DISPLAY_LATEST_MEMBERS' => true,
));
?>

View File

@@ -0,0 +1,174 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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&amp;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);
/*we may delete this?
// Generate online information for user
if ($config['load_onlinetrack'] && sizeof($id_cache))
{
$sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
FROM ' . SESSIONS_TABLE . '
WHERE ' . $db->sql_in_set('session_user_id', $id_cache) . '
GROUP BY session_user_id';
$result = $db->sql_query($sql);
$update_time = $config['load_online_time'] * 60;
while ($row = $db->sql_fetchrow($result))
{
$user_cache[$row['session_user_id']]['online'] = (time() - $update_time < $row['online_time'] && (($row['viewonline'] && $user_cache[$row['session_user_id']]['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
}
$db->sql_freeresult($result);
}
unset($id_cache);
// Assign specific vars
$template->assign_vars(array(
'ONLINE_IMG'=> ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
));
*/
$template->assign_vars(array(
'S_DISPLAY_LEADERS' => true,
));
?>

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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(
'S_DISPLAY_LINK_US' => true,
'LINK_US_TXT' => sprintf($user->lang['LINK_US_TXT'], $config['sitename']),
'U_LINK_US' => '&lt;a&nbsp;href=&quot;' . $u_link . '&quot;&nbsp;' . (($config['site_desc']) ? 'title=&quot;' . $config['site_desc'] . '&quot;' : '' ) . '&gt;' . (($config['sitename']) ? $config['sitename'] : $u_link ) . '&lt;/a&gt;',
));
?>

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_DISPLAY_LINKS' => true,
));
?>

View File

@@ -0,0 +1,32 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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'),
));
?>

View File

@@ -0,0 +1,22 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
//we main delete this aswell? Oo
?>

View File

@@ -0,0 +1,164 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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;
}
define ('IN_MINI_CAL', 1);
include_once($phpbb_root_path . '/portal/includes/mini_cal/mini_cal_config.'.$phpEx);
include_once($phpbb_root_path . '/portal/includes/mini_cal/mini_cal_common.'.$phpEx);
include_once($phpbb_root_path . '/portal/includes/mini_cal/calendarSuite.'.$phpEx);
// get the mode (if any)
$mini_cal_mode = 0;
if( isset($_GET['mode']) || isset($_POST['mode']) )
{
$mini_cal_mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
}
$mini_cal_mode = ($mini_cal_mode == 'personal') ? $mini_cal_mode : 'default';
// get the user (for personal calendar)
if( isset($_GET['u']) || isset($_POST['u']) )
{
$mini_cal_user = ( isset($_POST['u']) ) ? intval($_POST['u']) : intval($_GET['u']);
}
// 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 calendarSuite();
// 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());
$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;
if ( MINI_CAL_CALENDAR_VERSION != 'NONE' )
{
// include the required events calendar support
$mini_cal_inc = 'mini_cal_' . MINI_CAL_CALENDAR_VERSION;
include_once($phpbb_root_path . 'portal/includes/mini_cal/' . $mini_cal_inc . '.' . $phpEx);
// include the required events calendar support
$mini_cal_auth = getMiniCalForumsAuth($user);
$mini_cal_event_days = getMiniCalEventDays($mini_cal_auth['view']);
getMiniCalEvents($mini_cal_auth);
getMiniCalPostForumsList($mini_cal_auth['post']);
}
// output the days for the current month
// if MINI_CAL_DATE_SEARCH = POSTS then hyperlink any days which have already past
// if MINI_CAL_DATE_SEARCH = EVENTS then hyperkink any which have events
$holiday=0;
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][7]))
{
$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 class="' . MINI_CAL_TODAY_CLASS . '" style="font-weight: bold; border-style: outset; border-width: thin; color:' . $portal_config['portal_minicalendar_today_color'] . ';">' . $mini_cal_this_day . '</span>' : $mini_cal_this_day;
if ( (MINI_CAL_CALENDAR_VERSION != 'NONE') && (MINI_CAL_DATE_SEARCH == 'EVENTS') )
{
$mini_cal_day_link = '<a href="' . getMiniCalSearchURL($d_mini_cal_today) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
$mini_cal_day = ( in_array($mini_cal_this_day, $mini_cal_event_days) ) ? $mini_cal_day_link : $mini_cal_day;
}
else
{
$nix_mini_cal_today = gmmktime($config['board_timezone'], 0, 0, $mini_cal_this_month, $mini_cal_this_day, $mini_cal_this_year);
$mini_cal_day_link = '<a href="' . append_sid($phpbb_root_path . "search.$phpEx?search_id=unanswered&amp;st=" . $nix_mini_cal_today) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
$mini_cal_day = ( $mini_cal_today >= $d_mini_cal_today ) ? $mini_cal_day_link : $mini_cal_day;
}
$template->assign_block_vars('mini_cal_row.mini_cal_days', array(
'MINI_CAL_DAY' => $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
$prev_qs = setQueryStringVal('m', $mini_cal_month -1);
$next_qs = setQueryStringVal('m', $mini_cal_month +1);
$down = $mini_cal_month - 1;
$up = $mini_cal_month + 1;
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$down") . '"><img src="' . "{$phpbb_root_path}portal/images/mini_cal_icon_left_arrow.png" . '" title="' . $user->lang['View_previous_month'] . '" height="16" width="16" alt="&lt;&lt;" /></a>';
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$up") . '"><img src="' . "{$phpbb_root_path}portal/images/mini_cal_icon_right_arrow.png" . '" title="' . $user->lang['View_next_month'] . '" height="16" width="16" alt="&gt;&gt;" /></a>';
$template->assign_vars(array(
'S_DISPLAY_MINICAL' => true,
'L_MINI_CAL_MONTH' => $user->lang['mini_cal']['long_month'][$mini_cal->day[0][4]] . " " . $mini_cal->day[0][5],
'L_MINI_CAL_ADD_EVENT' => $user->lang['Mini_Cal_add_event'],
'L_MINI_CAL_CALENDAR' => $user->lang['Mini_Cal_calendar'],
'L_MINI_CAL_EVENTS' => $user->lang['Mini_Cal_events'],
'L_MINI_CAL_NO_EVENTS' => $user->lang['Mini_Cal_no_events'],
'L_MINI_CAL_SUN' => $user->lang['mini_cal']['day'][1],
'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,
));
?>

117
root/portal/block/news.php Normal file
View File

@@ -0,0 +1,117 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
//
// Fetch Posts for news from portal/includes/functions.php
//
$template->assign_vars(array(
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_NEWEST_POST'),
'S_DISPLAY_NEWS' => true,
));
#if (!isset($HTTP_GET_VARS['article']))
$news = request_var('news', -1);
if($news < 0)
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news) == 0)
{
$template->assign_block_vars('news_row', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news); $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;
$template->assign_block_vars('news_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'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&amp;u=' . $fetch_news[$i]['user_id']) : '',
'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'],
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;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'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news) - 1) ? true : false,
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
}
else
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], 0, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
$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;
$template->assign_block_vars('news_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
//'FORUM_NAME' => $fetch_news[$i]['forum_name'],
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'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'],
//'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'],
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;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'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
?>

395
root/portal/block/poll.php Normal file
View File

@@ -0,0 +1,395 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
/**
* @ignore
*/
// Initial var setup
$forum_id = request_var('f', 0);
$topic_id = request_var('t', ((!empty($portal_config['portal_poll_topic_id'])) ? $portal_config['portal_poll_topic_id'] : 0));
$topic_id = preg_replace('/[^0-9]/', '', $topic_id); // just a temporary solution to get rid of sql errors
$post_id = request_var('p', 0);
$voted_id = request_var('vote_id', array('' => 0));
$start = request_var('start', 0);
$view = request_var('view', '');
$sort_days = request_var('st', ((!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0));
$sort_key = request_var('sk', ((!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'));
$sort_dir = request_var('sd', ((!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'));
$update = request_var('update', false);
// Do we have a topic or post id?
if (!$topic_id && !$post_id)
{
// trigger_error('NO_TOPIC');
$portal_config['portal_poll_topic'] = false;
}
// Find topic id if user requested a newer or older topic
if ($view && !$post_id)
{
if (!$forum_id)
{
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $topic_id";
$result = $db->sql_query($sql);
$forum_id = (int) $db->sql_fetchfield('forum_id');
$db->sql_freeresult($result);
if (!$forum_id)
{
trigger_error('NO_TOPIC');
}
}
// Check for global announcement correctness?
if ((!isset($row) || !$row['forum_id']) && !$forum_id)
{
//trigger_error('NO_TOPIC');
$portal_config['portal_poll_topic'] = false;
}
else if (isset($row) && $row['forum_id'])
{
$forum_id = $row['forum_id'];
}
}
// This rather complex gaggle of code handles querying for topics but
// also allows for direct linking to a post (and the calculation of which
// page the post is on and the correct display of viewtopic)
$sql_array = array(
'SELECT' => 't.*, f.*',
'FROM' => array(
FORUMS_TABLE => 'f',
)
);
if ($user->data['is_registered'])
{
$sql_array['SELECT'] .= ', tw.notify_status';
$sql_array['LEFT_JOIN'] = array();
$sql_array['LEFT_JOIN'][] = array(
'FROM' => array(TOPICS_WATCH_TABLE => 'tw'),
'ON' => 'tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id'
);
}
if (!$post_id)
{
$sql_array['WHERE'] = "t.topic_id = $topic_id";
}
else
{
$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
$sql_array['FROM'][POSTS_TABLE] = 'p';
}
$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
$sql_array['WHERE'] .= ')';
$sql_array['FROM'][TOPICS_TABLE] = 't';
// Join to forum table on topic forum_id unless topic forum_id is zero
// whereupon we join on the forum_id passed as a parameter ... this
// is done so navigation, forum name, etc. remain consistent with where
// user clicked to view a global topic
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$topic_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$topic_data)
{
// If post_id was submitted, we try at least to display the topic as a last resort...
if ($post_id && $forum_id && $topic_id)
{
redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id"));
}
//trigger_error('NO_TOPIC');
$portal_config['portal_poll_topic'] = false;
}
$forum_id = (int) $topic_data['forum_id'];
$topic_id = (int) $topic_data['topic_id'];
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
if (!$topic_data['topic_approved'] && !$auth->acl_get('m_approve', $forum_id))
{
//trigger_error('NO_TOPIC');
$portal_config['portal_poll_topic'] = false;
}
// Start auth check
if (!$auth->acl_get('f_read', $forum_id))
{
if ($user->data['user_id'] != ANONYMOUS)
{
//trigger_error('SORRY_AUTH_READ');
$portal_config['portal_poll_topic'] = false;
}
//login_box('', $user->lang['LOGIN_VIEWFORUM']);
$portal_config['portal_poll_topic'] = false;
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($topic_data['forum_password'])
{
login_forum_box($topic_data);
}
// Post ordering options
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
$sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// General Viewtopic URL for return links
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param");
// This is only used for print view so ...
$server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
// Does this topic contain a poll?
if (!empty($topic_data['poll_start']))
{
$sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid
FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p
WHERE o.topic_id = $topic_id
AND p.post_id = {$topic_data['topic_first_post_id']}
AND p.topic_id = o.topic_id
ORDER BY o.poll_option_id";
$result = $db->sql_query($sql);
$poll_info = array();
while ($row = $db->sql_fetchrow($result))
{
$poll_info[] = $row;
}
$db->sql_freeresult($result);
$cur_voted_id = array();
if ($user->data['is_registered'])
{
$sql = 'SELECT poll_option_id
FROM ' . POLL_VOTES_TABLE . '
WHERE topic_id = ' . $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_' . $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) && $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;
$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
if ($update && $s_can_vote)
{
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'])
{
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
meta_refresh(5, $redirect_url);
$message = (!sizeof($voted_id)) ? 'NO_VOTE_OPTION' : 'TOO_MANY_VOTE_OPTIONS';
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<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) $topic_id;
$db->sql_query($sql);
if ($user->data['is_registered'])
{
$sql_ary = array(
'topic_id' => (int) $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) $topic_id;
$db->sql_query($sql);
if ($user->data['is_registered'])
{
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
WHERE topic_id = ' . (int) $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_' . $topic_id, implode(',', $voted_id), time() + 31536000);
}
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET poll_last_vote = ' . time() . "
WHERE topic_id = $topic_id";
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
meta_refresh(5, $redirect_url);
trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
}
$poll_total = 0;
foreach ($poll_info as $poll_option)
{
$poll_total += $poll_option['poll_option_total'];
}
if ($poll_info[0]['bbcode_bitfield'])
{
$poll_bbcode = new bbcode();
}
else
{
$poll_bbcode = false;
}
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
$poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
$poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
}
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
}
$topic_data['poll_title'] = censor_text($topic_data['poll_title']);
$topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
}
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
unset($poll_bbcode);
foreach ($poll_info as $poll_option)
{
$option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
$option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
$template->assign_block_vars('poll_option', array(
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
'POLL_OPTION_RESULT' => $poll_option['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 * 10)),
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false
));
}
$poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
$template->assign_vars(array(
'POLL_QUESTION' => $topic_data['poll_title'],
'TOTAL_VOTES' => $poll_total,
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
'S_HAS_POLL' => true,
'S_CAN_VOTE' => $s_can_vote,
'S_DISPLAY_RESULTS' => $s_display_results,
'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false,
'S_POLL_ACTION' => $viewtopic_url,
'U_VIEW_RESULTS' => $viewtopic_url . '&amp;view=viewpoll'
));
unset($poll_end, $poll_info, $voted_id);
}
$template->assign_vars(array(
'S_DISPLAY_POLL' => true
));
?>

View File

@@ -0,0 +1,63 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
WHERE user_type <> ' . USER_IGNORE . '
AND user_inactive_time = 0
ORDER BY RAND()
LIMIT 0,1';
$result = $db->sql_query($sql);
$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);
$template->assign_vars(array(
'S_DISPLAY_RANDOM_MEMBER' => true,
));
?>

View File

@@ -0,0 +1,158 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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);
}
}
}
//
// 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 . ' )
' . $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'] . '&amp;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'] . '
' . $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'] . '&amp;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 <> ' . FORUM_LINK . '
AND topic_approved = 1
AND topic_type = ' . POST_NORMAL . '
' . $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'] . '&amp;t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
/*//we may also delete this?
//
// Recent active topic
//
$last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : '';
$sql = 'SELECT topic_title, forum_id, topic_id, topic_time, topic_first_poster_name
FROM ' . TOPICS_TABLE . '
WHERE topic_status <> ' . FORUM_LINK . "
$last_post_time_sql
AND topic_moved_id = 0
AND topic_approved = 1
AND topic_type = " . POST_NORMAL . '
' . $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('active_topics', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'DATE' => $user->format_date($row['topic_time']),
'POSTER' => $row['topic_first_poster_name'],
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
*/
$template->assign_vars(array(
'S_DISPLAY_RECENT' => true,
));
?>

View File

@@ -0,0 +1,28 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_DISPLAY_PORTALSEARCH' => true,
'S_SEARCH_ACTION' => "{$phpbb_root_path}search.$phpEx",
));
?>

View File

@@ -0,0 +1,149 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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 'announcmenttotal':
$sql = 'SELECT COUNT(distinct t.topic_id) AS announcment_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 'announcmenttotal':
return $row['announcment_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'];
// no last user color, no more SQL codes ;)
$newest_user = $config['newest_username'];
$newest_uid = $config['newest_user_id'];
$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 = round($total_topics / $board_days, 0);
$posts_per_day = round($total_posts / $board_days, 0);
$users_per_day = round($total_users / $board_days, 0);
$topics_per_user = round($total_topics / $total_users, 0);
$posts_per_user = round($total_posts / $total_users, 0);
$posts_per_topic = round($total_posts / $total_topics, 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(
'S_DISPLAY_ADVANCED_STAT' => true,
'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'], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $newest_uid) . '" style="color: #' . $config['newest_user_colour'] . ';">' . $newest_user . '</a>'),
'S_ANN' => get_db_stat('announcmenttotal'),
'S_SCT' => get_db_stat('stickytotal'),
'S_TOT_ATTACH' => get_db_stat('attachmentstotal'),
// 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),
));
?>

View File

@@ -0,0 +1,48 @@
<?php
/*
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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'] . '&amp;sr=posts'),
'USERNAME' => censor_text($row['username']),
'USERNAME_COLOR'=> ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '',
'U_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'POSTER_POSTS' => $row['user_posts'],
)
);
}
$db->sql_freeresult($result);
$template->assign_vars(array(
'S_DISPLAY_TOP_POSTERS' => true
));
?>

View File

@@ -0,0 +1,86 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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'])
{
// new posts since last visit
$sql = "SELECT COUNT(distinct post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $user->data['session_last_visit'];
$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'] . '&nbsp;(' . $new_posts_count . ')',
'L_SELF_POSTS' => $user->lang['SEARCH_SELF'] . '&nbsp;(' . $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' => append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?i=main&amp;mode=bookmarks'),
'U_UM_MAIN_SUBSCRIBED' => append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?i=main&amp;mode=subscribed'),
'U_PRIVATE_MESSAGES' => append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?i=pm&amp;folder=inbox'),
));
?>

View File

@@ -0,0 +1,251 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
//
// 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
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
AND group_type <> ' . GROUP_HIDDEN . '
ORDER BY 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&amp;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)
{
$userlist_ary = $userlist_visible = array();
$logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0;
$prev_session_ip = $reading_sql = '';
if (!empty($_REQUEST['f']))
{
$f = request_var('f', 0);
// Do not change this (it is defined as _f_={forum_id}x within session.php)
$reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'";
// Specify escape character for MSSQL
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{
$reading_sql .= " ESCAPE '\\'";
}
}
// Get number of online guests
if (!$config['load_online_guests'])
{
if ($db->sql_layer === 'sqlite')
{
$sql = 'SELECT COUNT(session_ip) as num_guests
FROM (
SELECT DISTINCT s.session_ip
FROM ' . SESSIONS_TABLE . ' s
WHERE s.session_user_id = ' . ANONYMOUS . '
AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
$reading_sql .
')';
}
else
{
$sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests
FROM ' . SESSIONS_TABLE . ' s
WHERE s.session_user_id = ' . ANONYMOUS . '
AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
$reading_sql;
}
$result = $db->sql_query($sql);
$guests_online = (int) $db->sql_fetchfield('num_guests');
$db->sql_freeresult($result);
}
$sql = 'SELECT u.username, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_viewonline
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s
WHERE s.session_time >= ' . (time() - (intval($config['load_online_time']) * 60)) .
$reading_sql .
((!$config['load_online_guests']) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . '
AND u.user_id = s.session_user_id
ORDER BY u.username ASC, s.session_ip ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// User is logged in and therefore not a guest
if ($row['user_id'] != ANONYMOUS)
{
// Skip multiple sessions for one user
if ($row['user_id'] != $prev_user_id)
{
if ($row['user_colour'])
{
$user_colour = ' style="color:#' . $row['user_colour'] . '"';
$row['username'] = '<strong>' . $row['username'] . '</strong>';
}
else
{
$user_colour = '';
}
if ($row['user_allow_viewonline'] && $row['session_viewonline'])
{
$user_online_link = $row['username'];
$logged_visible_online++;
}
else
{
$user_online_link = '<em>' . $row['username'] . '</em>';
$logged_hidden_online++;
}
if (($row['user_allow_viewonline'] && $row['session_viewonline']) || $auth->acl_get('u_viewonline'))
{
if ($row['user_type'] <> USER_IGNORE)
{
$user_online_link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']) . '"' . $user_colour . '>' . $user_online_link . '</a>';
}
else
{
$user_online_link = ($user_colour) ? '<span' . $user_colour . '>' . $user_online_link . '</span>' : $user_online_link;
}
$online_userlist .= ($online_userlist) ? ', ' . $user_online_link : $user_online_link;
}
}
$prev_user_id = $row['user_id'];
}
else
{
// Skip multiple sessions for one user
if ($row['session_ip'] != $prev_session_ip)
{
$guests_online++;
}
}
$prev_session_ip = $row['session_ip'];
}
$db->sql_freeresult($result);
if (!$online_userlist)
{
$online_userlist = $user->lang['NO_ONLINE_USERS'];
}
if (empty($_REQUEST['f']))
{
$online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist;
}
else
{
$l_online = ($guests_online == 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS'];
$online_userlist = sprintf($l_online, $online_userlist, $guests_online);
}
$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;
if ($total_online_users > $config['record_online_users'])
{
set_config('record_online_users', $total_online_users, true);
set_config('record_online_date', time(), true);
}
// Build online listing
$vars_online = array(
'ONLINE' => array('total_online_users', 'l_t_user_s'),
'REG' => array('logged_visible_online', 'l_r_user_s'),
'HIDDEN' => array('logged_hidden_online', 'l_h_user_s'),
'GUEST' => array('guests_online', 'l_g_user_s')
);
foreach ($vars_online as $l_prefix => $var_ary)
{
switch (${$var_ary[0]})
{
case 0:
${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL'];
break;
case 1:
${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL'];
break;
default:
${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL'];
break;
}
}
unset($vars_online);
$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
$l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date']));
$l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
$l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
}
else
{
$l_online_time = '';
}
// Assign specific vars
$template->assign_vars(array(
'S_DISPLAY_ONLINE_PORTAL_LIST' => true,
'TOTAL_ONLINE_USERS' => $total_online_users,
'VISIBLE_ONLINE' => $logged_visible_online,
'HIDDEN_ONLINE' => $logged_hidden_online,
'GUEST_ONLINE' => $guests_online,
'RECORD_USERS' => $l_online_record,
'LEGEND'=> $legend,
));
?>

View File

@@ -0,0 +1,76 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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(
'S_DISPLAY_WORDGRAPH' => true,
'L_WORDGRAPH' => $user->lang['WORDGRAPH'],
)
);
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

BIN
root/portal/images/dot.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

BIN
root/portal/images/link.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,489 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
// Get portal config
$sql = 'SELECT *
FROM ' . PORTAL_CONFIG_TABLE;
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$portal_config_name = $row['config_name'];
$portal_config_value = $row['config_value'];
$portal_config[$portal_config_name] = $portal_config_value;
}
//
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
// fetch post for news & announce
function phpbb_fetch_posts($forum_sql, $number_of_posts, $text_length, $time, $type)
{
global $db, $phpbb_root_path, $auth, $bbcode_bitfield, $user, $forum_id;
$from_forum = ($forum_sql) ? 't.forum_id IN (' . $forum_sql . ') AND' : '';
$post_time = ($time == 0) ? '' : 't.topic_last_post_time > ' . (time() - $time * 86400) . ' AND';
if ($type == 'announcements')
{
// only global announcements for announcements block
$topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . ')) AND';
$sql = '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.forum_id,
t.topic_poster,
u.username,
u.user_id,
u.user_type,
u.user_colour,
p.post_id,
p.post_time,
p.post_text,
p.post_attachment,
p.enable_smilies,
p.enable_bbcode,
p.enable_magic_url,
p.bbcode_bitfield,
p.bbcode_uid
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TABLE . ' AS p
WHERE
' . $topic_type . '
' . $from_forum . '
' . $post_time . '
t.topic_poster = u.user_id AND
t.topic_first_post_id = p.post_id AND
t.topic_status <> 2 AND
t.topic_approved = 1
ORDER BY
t.topic_time DESC';
// query the database
if(!($result = $db->sql_query_limit($sql, $number_of_posts)))
{
die('Could not query topic information for board3 Portal announcements section');
}
//
// fetch all postings
//
// 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));
}
$posts = array();
$i = 0;
while ( ($row = $db->sql_fetchrow($result)) && ( ($i < $number_of_posts) || ($number_of_posts == '0') ) )
{
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
if ($row['user_id'] != ANONYMOUS && $row['user_colour'])
{
$row['username'] = '<b style="color:#' . $row['user_colour'] . '">' . $row['username'] . '</b>';
}
$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$len_check = $row['post_text'];
$maxlen = $text_length;
if (($text_length != 0) && (strlen($len_check) > $text_length))
{
$posts[$i]['post_text'] = censor_text(get_sub_taged_string(str_replace("\n", '<br/> ', $row['post_text']), $row['bbcode_uid'], $maxlen));
$posts[$i]['striped'] = true;
} else $posts[$i]['post_text'] = censor_text($row['post_text']);
$posts[$i]['topic_id'] = $row['topic_id'];
$posts[$i]['topic_last_post_id'] = $row['topic_last_post_id'];
$posts[$i]['forum_id'] = $row['forum_id'];
$posts[$i]['topic_replies'] = $row['topic_replies'];
$posts[$i]['topic_time'] = $user->format_date($row['topic_time']);
$posts[$i]['topic_last_post_time'] = $row['topic_last_post_time'];
$posts[$i]['topic_title'] = $row['topic_title'];
$posts[$i]['username'] = $row['username'];
$posts[$i]['user_id'] = $row['user_id'];
$posts[$i]['user_type'] = $row['user_type'];
$posts[$i]['user_user_colour'] = $row['user_colour'];
$posts[$i]['poll'] = ($row['poll_title']) ? true : false;
$posts[$i]['attachment'] = ($row['topic_attachment']) ? true : false;
$posts[$i]['topic_views'] = ($row['topic_views']);
$message = $posts[$i]['post_text'];
$message = str_replace("\n", '<br />', $message);
if ($auth->acl_get('f_html', $forum_id))
{
$message = preg_replace('#<!\-\-(.*?)\-\->#is', '', $message); // Remove Comments from post content
}
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = smiley_text($message); // Always process smilies after parsing bbcodes
$posts[$i]['post_text']= ap_validate($message);
$i++;
}
}
// return the result
return $posts;
}
// news - get last post
else if ($type == 'news_all')
{
// not show global announcements
$topic_type = '( t.topic_type != ' . POST_ANNOUNCE . ' ) AND ( t.topic_type != ' . POST_GLOBAL . ') AND';
}
else
{
// only normal topic
$topic_type = 't.topic_type = ' . POST_NORMAL . ' AND';
}
$sql = '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.forum_id,
t.topic_poster,
u.username,
u.user_id,
u.user_type,
u.user_colour,
p.post_id,
p.post_time,
p.post_text,
p.post_attachment,
p.enable_smilies,
p.enable_bbcode,
p.enable_magic_url,
p.bbcode_bitfield,
p.bbcode_uid
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TABLE . ' AS p
WHERE
' . $topic_type . '
' . $from_forum . '
' . $post_time . '
t.topic_last_poster_id = u.user_id AND
t.topic_last_post_id = p.post_id AND
t.topic_status <> 2 AND
t.topic_approved = 1
ORDER BY
t.topic_last_post_time DESC';
// query the database
if(!($result = $db->sql_query_limit($sql, $number_of_posts)))
{
die('Could not query topic information for board Portal news section');
}
//
// fetch all postings
//
// 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));
}
$posts = array();
$i = 0;
while ( ($row = $db->sql_fetchrow($result)) && ( ($i < $number_of_posts) || ($number_of_posts == '0') ) )
{
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
if ($row['user_id'] != ANONYMOUS && $row['user_colour'])
{
$row['username'] = '<b style="color:#' . $row['user_colour'] . '">' . $row['username'] . '</b>';
}
$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$len_check = $row['post_text'];
$maxlen = $text_length;
if (($text_length != 0) && (strlen($len_check) > $text_length))
{
$posts[$i]['post_text'] = censor_text(get_sub_taged_string(str_replace("\n", '<br/> ', $row['post_text']), $row['bbcode_uid'], $maxlen));
$posts[$i]['striped'] = true;
} else $posts[$i]['post_text'] = censor_text($row['post_text']);
$posts[$i]['topic_id'] = $row['topic_id'];
$posts[$i]['topic_last_post_id'] = $row['topic_last_post_id'];
$posts[$i]['forum_id'] = $row['forum_id'];
$posts[$i]['topic_replies'] = $row['topic_replies'];
$posts[$i]['topic_time'] = $user->format_date($row['topic_last_post_time']);
$posts[$i]['topic_last_post_time'] = $row['topic_last_post_time'];
$posts[$i]['topic_title'] = $row['topic_title'];
$posts[$i]['username'] = $row['username'];
$posts[$i]['user_id'] = $row['user_id'];
$posts[$i]['user_type'] = $row['user_type'];
$posts[$i]['user_user_colour'] = $row['user_colour'];
$posts[$i]['poll'] = ($row['poll_title']) ? true : false;
$posts[$i]['attachment'] = ($row['topic_attachment']) ? true : false;
$posts[$i]['topic_views'] = ($row['topic_views']);
$message = $posts[$i]['post_text'];
$message = str_replace("\n", '<br/> ', $message);
if ($auth->acl_get('f_html', $forum_id))
{
$message = preg_replace('#<!\-\-(.*?)\-\->#is', '', $message); // Remove Comments from post content
}
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = smiley_text($message); // Always process smilies after parsing bbcodes
$posts[$i]['post_text']= ap_validate($message);
$i++;
}
}
// return the result
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;
}
}
/**
* Get user avatar / barroved from RC4
*
* @param string $avatar Users assigned avatar name
* @param int $avatar_type Type of avatar
* @param string $avatar_width Width of users avatar
* @param string $avatar_height Height of users avatar
* @param string $alt Optional language string for alt tag within image, can be a language key or text
*
* @return string Avatar image
*/
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
{
global $user, $portal_config, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type)
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $avatar;
return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}
/**
* Get user rank title and image / barroved from RC4
*
* @param int $user_rank the current stored users rank id
* @param int $user_posts the users number of posts
* @param string &$rank_title the rank title will be stored here after execution
* @param string &$rank_img the rank image as full img tag is stored here after execution
* @param string &$rank_img_src the rank image source is stored here after execution
*
*/
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
{
global $ranks, $config;
if (empty($ranks))
{
global $cache;
$ranks = $cache->obtain_ranks();
}
if (!empty($user_rank))
{
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
}
else
{
if (!empty($ranks['normal']))
{
foreach ($ranks['normal'] as $rank)
{
if ($user_posts >= $rank['rank_min'])
{
$rank_title = $rank['rank_title'];
$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
$rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
break;
}
}
}
}
}
// 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_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, 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 = trim(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);
}
?>

View File

@@ -0,0 +1,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

View File

@@ -0,0 +1,307 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_MINI_CAL'))
{
exit;
}
/**
* Features include: 11 languages, returns all data in one array,
* intelligent linker function
*
* day[] = array(0 => 'dayNumeric', // e.g. 19
* 1 => 'dayName', // e.g. Tue
* 2 => 'dayNameL', // e.g. Tuesday
* 3 => 'monthName', // e.g. March
* 4 => 'monthNumeric' // e.g. 12
* 5 => 'year' // e.g. 2002
* 6 => 'timestamp' // e.g. 1020204000
* 7 => 'dayOfWeek' // 0-6 ! e.g. sunday=0, monday=1...
* 8 => 'dayOfYear' // day of year (001 - 366)
* 9 => 'weekNum' // weeknumber of current year
* 10 => 'link' // link from link function
* 11 => 'mysqlDate' // contains date in mysql-format (YYYY-MM-DD)
*
*
* language options:
* 0 = english (default) 1 = german
* 2 = french 3 = spanish
* 4 = finish 5 = polish
* 6 = portuguese 7 = italian
* 8 = italian 9 = slovak
* 10 = turkish
*
**/
/**
* set language
* @const language
* default 0 / english
**/
define("language", "1");
/**
* set default date format
* @const dateFormat
* default
**/
define("dateFormat" , "0");
class calendarSuite {
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 $ext_dateDD; // extended day (e.g. Mon)
var $daysMonth; // count of days in month
var $nextMonth; // contains next month
var $lastMonth; // contains last month
var $stamp; // timestamp
var $day; // return array s.a.
/**
* Constructor
*
* Sets default values for e.g. language (default=english)
**/
function calendarSuite(){
switch (language) {
case 0:
$this->language = "en_EN";
break;
case 1:
$this->language = "de_DE";
break;
case 2:
$this->language = "fr_FR";
break;
case 3:
$this->language = "es_ES";
break;
case 4:
$this->language = "fi_FI";
break;
case 5:
$this->language = "pl_PL";
break;
case 6:
$this->language = "pt_PT";
break;
case 7:
$this->language = "it_IT";
break;
case 8:
$this->language = "ru_RU";
break;
case 9:
$this->language = "sk_SK";
break;
case 10:
$this->language = "tr_TR";
break;
default:
$this->language = "en_EN";
}
setlocale (LC_TIME, $this->language); // set language
// end of function calendarSuite
}
/**
* determine the next month after current
**/
function nextMonth() {
$this->nextMonth = $this->getMonth("+1 month");
// end of function nextMonth
}
/**
* determine the last month before current
**/
function lastMonth() {
$this->lastMonth = $this->getMonth("-1 month");
// end of function lastMonth
}
/**
* convert date->timestamp
**/
function makeTimestamp($date) {
$this->stamp = strtotime($date);
return ($this->stamp);
// end of function makeTimestamp
}
/**
* 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);
$this->monthStart = date("w", $this->stamp);
for($i=1; $i < $this->daysMonth+1; $i++) {
$this->makeTimestamp("$i $this->ext_dateMM $this->dateYYYY");
$this->day[] = array(
"0" => "$i",
"1" => (strftime('%a', $this->stamp)),
"2" => (strftime('%A', $this->stamp)),
"3" => (strftime("%B", $this->stamp)),
"4" => $this->dateMM,
"5" => $this->dateYYYY,
"6" => $this->stamp,
"7" => (date('w', $this->stamp)),
"8" => (strftime('%j', $this->stamp)),
"9" => (strftime('%U', $this->stamp)),
"10" => $this->dateLinker($this->stamp),
"11" => $this->formatDate($this->stamp, 99)
);
}
// end of function getMonth
}
/**
* get detailed array of day
**/
function getDayDetail($stamp) {
$this->dateYYYY = date("Y", $stamp);
$this->dateMM = date("n", $stamp);
$this->dateDD = date("d", $stamp);
$this->ext_dateMM = date("F", $stamp);
$this->daysMonth = date("t", $stamp);
$this->monthStart = date("w", $stamp);
$this->day = array(
"0" => (date("j",$stamp)),
"1" => (strftime('%a', $stamp)),
"2" => (strftime('%A', $stamp)),
"3" => $this->ext_dateMM,
"4" => $this->dateMM,
"5" => $this->dateYYYY,
"6" => $stamp,
"7" => (date('w', $stamp)),
"8" => strftime('%j', $stamp),
"9" => strftime('%U', $stamp)
);
// end of function getDay
}
/**
* make links for every day
**/
function dateLinker($stamp) {
$link = "?stamp=".$stamp;
return $link;
// end of function dateLinker
}
/**
* format date in different forms
**/
function formatDate($stamp, $option = dateFormat) {
switch ($option) {
case 0:
$this->formatted = date("d n Y", $stamp);
return $this->formatted;
break;
case 1:
$this->formatted = date("d Y M", $stamp);
return $this->formatted;
break;
case 2:
$this->formatted = date("M d Y", $stamp);
return $this->formatted;
break;
case 3:
$this->formatted = date("M Y d", $stamp);
return $this->formatted;
break;
case 4:
$this->formatted = date("Y M d", $stamp);
return $this->formatted;
break;
case 5:
$this->formatted = date("Y d M", $stamp);
return $this->formatted;
break;
case 6:
$this->formatted = date("d M Y", $stamp);
return $this->formatted;
break;
case 99:
$this->formatted = date("Y-m-d", $stamp);
return $this->formatted;
break;
}
// end of function formatDate
}
// end of class
}
?>

View File

@@ -0,0 +1,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

View File

@@ -0,0 +1,142 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_MINI_CAL'))
{
exit;
}
/***************************************************************************
getFormattedDate
version: 1.0.0
parameters: $cal_weekday -
$cal_month -
$cal_monthday -
$cal_year -
$cal_hour -
$cal_min -
$cal_sec -
returns: a date formatted according to the MINI_CAL_DATE_PATTERNS
set in mini_cal_config.php and the Mini_Cal_date_format
set in lang_main_min_cal.php
***************************************************************************/
function getFormattedDate($cal_weekday, $cal_month, $cal_monthday, $cal_year, $cal_hour, $cal_min, $cal_sec, $format)
{
global $lang;
// initialise out date formatting patterns
$cal_date_pattern = unserialize(MINI_CAL_DATE_PATTERNS);
$cal_date_replace = array(
$lang['mini_cal']['day'][$cal_weekday],
$lang['mini_cal']['month'][$cal_month],
$cal_month,
( (strlen($cal_monthday) < 2 ) ? '0' : '' ) . $cal_monthday,
$cal_monthday,
( (strlen($cal_month) < 2 ) ? '0' : '' ) . $cal_month,
substr($cal_year, -2),
$cal_year,
( (strlen($cal_hour) < 2 ) ? '0' : '' ) . $cal_hour,
$cal_hour,
( (strlen($cal_hour) < 2 ) ? '0' : '' ) . ( ( $cal_hour > 12 ) ? $cal_hour-12 : $cal_hour ),
( $cal_hour > 12 ) ? $cal_hour-12 : $cal_hour,
$cal_min,
$cal_sec,
( $cal_hour < 12 ) ? 'AM' : 'PM'
);
return preg_replace($cal_date_pattern, $cal_date_replace, $format);
}
/***************************************************************************
setQueryStringVal
version: 1.0.0
parameters: $var - the variable who's value is to be replaced
$value - the new value for the variable
returns: a modified querystring prefixed with ?
***************************************************************************/
function setQueryStringVal($var, $value)
{
$querystring = $_SERVER["QUERY_STRING"];
if (!stristr($querystring, $var))
{
$querystring .= ($querystring) ? '&' : '';
$querystring .= "$var=$value";
}
else
{
$querystring = ereg_replace("($var=[[:digit:]]{1,3})", "$var=$value", $querystring);
}
return '?' . $querystring;
}
/***************************************************************************
getPostForumsList
version: 1.0.0
parameters: $mini_cal_post_auth - a comma seperated list of forms with post rights
returns: adds a forums select list to the template output
***************************************************************************/
function getPostForumsList($mini_cal_post_auth, $and_post_auth_sql = '')
{
if ($mini_cal_post_auth)
{
global $db, $template, $lang;
// get a list of events forums
$sql = 'SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE f.cat_id = c.cat_id
AND f.forum_id IN (' . $mini_cal_post_auth . ')' .
$and_post_auth_sql;
if( $result = $db->sql_query($sql) )
{
$num_rows = $db->sql_numrows($result);
if ( $num_rows > 0 )
{
$template->assign_block_vars('switch_mini_cal_add_events', array());
$forums_list = '<select style="width: 100%" name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value > -1){ forms[\'mini_cal\'].submit() }">';
$cat_id = 0;
while ($row = $db->sql_fetchrow($result))
{
$forums_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '> - ' . substr($row['forum_name'],0,20) . '</option>';
}
$forums_list .= '</select>';
$template->assign_vars( array(
'S_MINI_CAL_EVENTS_FORUMS_LIST' => $forums_list
)
);
}
$db->sql_freeresult($result);
}
}
}
?>

View File

@@ -0,0 +1,88 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_MINI_CAL'))
{
exit;
}
/***************************************************************************
The following values are configurable to tailor the mini cal to your needs.
***************************************************************************/
// Defines which events calendar you are using, if any
// possible values:
// MYCAL - MyCalendar
// PLUS - MyCalendar+
// TOPIC - Topic Calendar
// SNAIL - Websnail Calendar Pro
// SNAILLITE - Websnail Calendar Lite
// NONE - No Supported Calendar is installed
define('MINI_CAL_CALENDAR_VERSION', 'NONE');
// EVENTS CALENDAR USERS ONLY!
// Limits the number of events shown on the mini cal
define('MINI_CAL_LIMIT', 5);
// EVENTS CALENDAR USERS ONLY!
// Limits the number of days ahead in which time upcoming events will be shown
// set to 0 (zero) for umlimited
define('MINI_CAL_DAYS_AHEAD', 7);
// Defines what type of search happens when a user clicks on a date in the calendar
// possible values:
// POSTS - will return all posts posted on that date
// EVENTS - will return all events happening on that date (ONLY SUITABLE FOR EVENTS CALENDAR USERS).
define('MINI_CAL_DATE_SEARCH', 'POSTS');
// First Day of the Week - 0=Sunday, 1=Monday...6=Saturday
// if you change this remember to change the short day names in lang_main_mini_cal.php
define('MINI_CAL_FDOW', 1);
// Defines the css class to use for mini cal days urls
define('MINI_CAL_DAY_LINK_CLASS', 'gensmall');
// Defines the css class to use for mini cal today date
define('MINI_CAL_TODAY_CLASS', 'gensmall');
// defines the authentication level required to be able to view the upcoming events
// this relates to the permission level assigned to forum
// possible values:
// auth_view, auth_read, auth_post, auth_reply, auth_edit,
// auth_delte, auth_sticky, auth_announce, auth_vote, auth_pollcreate
define('MINI_CAL_EVENT_AUTH_LEVEL', 'auth_view');
/***************************************************************************
You should NOT modify any values below here.
***************************************************************************/
// DO NOT MODIFY THIS!
define('MINI_CAL_DATE_PATTERNS', serialize(array('/%a/', '/%b/', '/%c/', '/%d/', '/%e/', '/%m/', '/%y/', '/%Y/',
'/%H/', '/%k/', '/%h/', '/%l/', '/%i/', '/%s/', '/%p/')));
?>

View File

@@ -0,0 +1,304 @@
<?php
/**
*
* @package - Board3portal
* @version $Id$
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) nickvergessen ( http://mods.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @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_MINI_CAL'))
{
exit;
}
/**
* set_var
*
* Set variable, used by {@link request_var the request_var function}
*
* @access private
*/
/***************************************************************************
getMiniCalForumsAuth
version: 1.0.0
parameters: $userdata - an initialised $userdata array.
returns: a two part array
$mini_cal_auth['view'] - a comma seperated list of forums which the user has VIEW permissions for
$mini_cal_auth['post'] - a comma seperated list of forums which the user has POST permissions for
***************************************************************************/
function getMiniCalForumsAuth($user)
{
global $db, $auth, $user;
// initialise our forums auth list
$mini_cal_auth_ary = array();
$mini_cal_auth_ary = $auth->acl($user->data);
$mini_cal_auth = array();
$mini_cal_auth['view'] = '';
$mini_cal_auth['post'] = '';
while ( list($mini_cal_forum_id, $mini_cal_auth_level) = each($mini_cal_auth_ary) )
{
if ( $mini_cal_auth_level[MINI_CAL_EVENT_AUTH_LEVEL] )
{
$mini_cal_auth['view'] .= ($mini_cal_auth['view'] == '') ? $mini_cal_forum_id : ', ' . $mini_cal_forum_id;
}
if ( ($mini_cal_auth_level['auth_post']) && $mini_cal_auth_level['auth_cal'] )
{
$mini_cal_auth['post'] .= ($mini_cal_auth['post'] == '') ? $mini_cal_forum_id : ', ' . $mini_cal_forum_id;
}
}
return $mini_cal_auth;
}
/***************************************************************************
getMiniCalEventDays
version: 1.0.0
parameters: $auth_view_forums - a comma seperated list of forums which the user has VIEW permissions for
returns: an array containing a list of day containing event the user has permission to view
***************************************************************************/
function getMiniCalEventDays($auth_view_forums)
{
global $db, $mini_cal_this_year, $mini_cal_this_month;
$mini_cal_event_days = array();
if ($auth_view_forums)
{
// start and end date
$start_date = mktime(0,0,0, $mini_cal_this_month, 01, $mini_cal_this_year);
$w_month = $mini_cal_this_month + 1;
$w_year = $mini_cal_this_year;
if ($w_month > 12)
{
$w_month = 01;
$w_year++;
}
$end_date = mktime(0,0,0, $w_month, 01, $w_year);
// we consider the duration
$sql = "SELECT DISTINCT topic_calendar_time, topic_calendar_duration
FROM " . TOPICS_TABLE . "
WHERE forum_id IN ($auth_view_forums)
AND (topic_calendar_time + topic_calendar_duration) >= $start_date
AND topic_calendar_time < $end_date
AND topic_calendar_time IS NOT NULL
AND topic_calendar_time <> 0";
if ( $result = $db->sql_query($sql) )
{
$mini_cal_event_days_ww = array();
while( $row = $db->sql_fetchrow($result) )
{
$start_day = intval(date('d', $row['topic_calendar_time']));
for ($i = 0; ( ($i <= intval($row['topic_calendar_duration'] / 86400)) && ( ($start_day + $i) <= 31) ); $i++)
{
$mini_cal_event_days_ww[ ($start_day + $i) ] = true;
}
}
while (list($mini_cal_event_day, $mini_cal_event_present) = each($mini_cal_event_days_ww) )
{
$mini_cal_event_days[] = $mini_cal_event_day;
}
}
}
return $mini_cal_event_days;
}
/***************************************************************************
getMiniCalEvents
version: 1.0.0
parameters: $mini_cal_auth - a two part array
$mini_cal_auth['view'] - a comma seperated list of forums which the user has VIEW permissions for
$mini_cal_auth['post'] - a comma seperated list of forums which the user has POST permissions for
returns: nothing - it assigns variable to the template
***************************************************************************/
function getMiniCalEvents($mini_cal_auth)
{
global $template, $db, $phpEx, $lang, $mini_cal_today,
$mini_cal_this_month, $mini_cal_this_year, $mini_cal_this_day;
// start and end date
$start_date = mktime(0,0,0, intval(substr($mini_cal_today, 4, 2)), $mini_cal_this_day, $mini_cal_this_year);
$w_month = $mini_cal_this_month;
$days_ahead_sql = '';
if (MINI_CAL_DAYS_AHEAD > 0)
{
$w_year = $mini_cal_this_year;
if ($w_month > 12)
{
$w_month = 01;
$w_year++;
}
$end_date = mktime(0,0,0, $w_month, $mini_cal_this_day + MINI_CAL_DAYS_AHEAD, $w_year);
$days_ahead_sql = " AND topic_calendar_time < $end_date ";
}
// initialise some sql bits
$mini_cal_auth_sql = ($mini_cal_auth['view']) ? ' AND t.forum_id in (' . $mini_cal_auth['view'] . ') ' : '';
// get events
$sql = "SELECT t.topic_id, t.topic_calendar_time, t.topic_title, t.forum_id, t.topic_calendar_duration
FROM " . TOPICS_TABLE . " t
WHERE topic_calendar_time >= $start_date
$days_ahead_sql
AND topic_calendar_time IS NOT NULL
AND topic_calendar_time <> 0
$mini_cal_auth_sql
ORDER BY
t.topic_calendar_time ASC
LIMIT
0," . MINI_CAL_LIMIT;
// did we get a result?
if( $result = $db->sql_query($sql) )
{
$template->assign_block_vars('switch_mini_cal_events', array());
if ( $db->sql_numrows($result) > 0 )
{
// we've got some events
// now let's output our events in the given date format for the current language
while ($row = $db->sql_fetchrow($result))
{
$cal_time = $row['topic_calendar_time'];
$day_span = (date("Ymd", $cal_time) < date("Ymd", $cal_time+$row['topic_calendar_duration']));
$include_time = date("His", $cal_time) > 0;
$cal_date = getFormattedDate(
date('w', $cal_time),
date('n', $cal_time),
date('d', $cal_time),
date('Y', $cal_time),
date('H', $cal_time),
date('i', $cal_time),
date('s', $cal_time),
$lang['Mini_Cal_date_format'].((!$day_span && $include_time)?' '.$lang['Mini_Cal_date_format_Time']:'')
);
if ($day_span || $row['topic_calendar_duration'] > 0)
{
$cal_time = $cal_time + $row['topic_calendar_duration'];
$cal_date .= ' - ' . getFormattedDate(
date('w', $cal_time),
date('n', $cal_time),
date('d', $cal_time),
date('Y', $cal_time),
date('H', $cal_time),
date('i', $cal_time),
date('s', $cal_time),
((!$day_span)?$lang['Mini_Cal_date_format_Time']:$lang['Mini_Cal_date_format'])
);
}
$template->assign_block_vars('mini_cal_events', array(
'MINI_CAL_EVENT_DATE' => $cal_date,
'S_MINI_CAL_EVENT' => $row['topic_title'],
'U_MINI_CAL_EVENT' => append_sid( $phpbb_root_path . "viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $row['topic_id'] )
)
);
}
}
else
{
// no events :(
$template->assign_block_vars('mini_cal_no_events', array());
}
$db->sql_freeresult($result);
}
}
/***************************************************************************
getMiniCalSearchSql
version: 1.0.0
parameters: $search_id - the type of search we're looking for
$search_date - the date passed to the search
returns: an sql string
***************************************************************************/
function getMiniCalSearchSql($search_date)
{
$s_yy = intval(substr($search_date, 0, 4));
$s_mm = intval(substr($search_date, 4, 2));
$s_dd = intval(substr($search_date, 6, 2));
$search_date = mktime(0,0,0, $s_mm, $s_dd, $s_yy);
$nix_tomorrow = mktime (0,0,0, $s_mm, $s_dd + 1, $s_yy);
$sql = "SELECT topic_first_post_id as post_id
FROM " . TOPICS_TABLE . "
WHERE (topic_calendar_time + topic_calendar_duration) >= $search_date AND topic_calendar_time < $nix_tomorrow";
return $sql;
}
/***************************************************************************
getMiniCalSearchURL
version: 1.0.0
parameters: $search_date - the date passed to the search
returns: an url string
***************************************************************************/
function getMiniCalSearchURL($search_date)
{
global $phpEx;
$s_yy = intval(substr($search_date, 0, 4));
$s_mm = intval(substr($search_date, 4, 2));
$s_dd = intval(substr($search_date, 6, 2));
$search_date = mktime(0,0,0, $s_mm, $s_dd, $s_yy);
//$url = append_sid($phpbb_root_path . "search.$phpEx?search_id=mini_cal_events&amp;d=" . $search_date);
$url = append_sid($phpbb_root_path . "calendar_scheduler.$phpEx?d=" . $search_date);
return $url;
}
/***************************************************************************
getMiniCalPostForumsList
version: 1.0.0
parameters: $mini_cal_post_auth - a comma seperated list of forms with post rights
returns: adds a forums select list to the template output
***************************************************************************/
function getMiniCalPostForumsList($mini_cal_post_auth)
{
getPostForumsList($mini_cal_post_auth);
}
$template->assign_vars(array(
'U_MINI_CAL_CALENDAR' => append_sid($phpbb_root_path . 'calendar.' . $phpEx),
'U_MINI_CAL_ADD_EVENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=newtopic&f=' . MINI_CAL_EVENTS_FORUM )
)
);
?>

7
root/portal/index.html Normal file
View File

@@ -0,0 +1,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>