diff --git a/root/adm/mods/board3_portal_check_version.php b/root/adm/mods/board3_portal_check_version.php new file mode 100644 index 00000000..a1b4f39d --- /dev/null +++ b/root/adm/mods/board3_portal_check_version.php @@ -0,0 +1,41 @@ + 'Saint_hh', + 'title' => 'Board3 Portal', + 'tag' => 'board3_portal_v2', + 'version' => $portal_config['portal_version'], + 'file' => array('board3.de', 'updatecheck', 'board3_portal.xml'), + ); + } +} + +?> \ No newline at end of file diff --git a/root/adm/style/acp_portal_blocks.html b/root/adm/style/acp_portal_blocks.html new file mode 100644 index 00000000..8b3f7745 --- /dev/null +++ b/root/adm/style/acp_portal_blocks.html @@ -0,0 +1,285 @@ + + + + + + + « {L_BACK} + + + + + + +

{L_ACP_PORTAL_BLOCKS}

+

{L_ACP_PORTAL_BLOCKS_EXPLAIN}

+ +
+ +
+ {L_ACP_PORTAL_BLOCKS} +
+

+ {L_BLOCK_TITLE_EXPLAIN}
+
+
+
+

+ {L_BLOCK_ICON_EXPLAIN}
+
+
+
+
+
+
+
+
+

+ {L_BLOCK_POSITION_EXPLAIN}
+
+
+
+

+ {L_BLOCK_TYPE_EXPLAIN}
+
+
+
+
+ + + +

{L_ACP_PORTAL_BLOCKS}

+

{L_ACP_PORTAL_BLOCKS_EXPLAIN}

+ +
+
+ {L_ACP_PORTAL_BLOCKS} + +

+ +

+ + + + + + + + + + + + + + + + + + + + + + +
{L_BLOCK_ICON}{L_BLOCK_TITLE}{L_BLOCK_TYPE}{L_BLOCK_POSITION}{L_ACTION}
{blocks.BLOCK_TITLE}  -  {blocks.BLOCK_TITLE}{blocks.BLOCK_TYPE}{blocks.BLOCK_POSITION} [ {L_DISABLE} ] + {ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP}  + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN}  + {ICON_EDIT} {ICON_DELETE} +
+ + {S_FORM_TOKEN} +
+
+ + + + \ No newline at end of file diff --git a/root/adm/style/acp_portal_config.html b/root/adm/style/acp_portal_config.html new file mode 100644 index 00000000..8f54e59f --- /dev/null +++ b/root/adm/style/acp_portal_config.html @@ -0,0 +1,75 @@ + + + + +

{L_TITLE}

+ +

{L_TITLE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + + +
+ {L_VERSION_CHECK} +

{mods.UP_TO_DATE}

+
+
+
{mods.CURRENT_VERSION}
+
+
+
+
{mods.LATEST_VERSION}
+
+ +
+
+
{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}
+
+
+
+
{L_RELEASE_ANNOUNCEMENT}
+
+ +
+ + +
+ + + + + + +
+ {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + + + + + {auth_tpl.TPL} + + + +

+   + +

+ {S_FORM_TOKEN} +
+
+ + \ No newline at end of file diff --git a/root/adm/style/acp_portal_links.html b/root/adm/style/acp_portal_links.html new file mode 100644 index 00000000..2affa1bd --- /dev/null +++ b/root/adm/style/acp_portal_links.html @@ -0,0 +1,83 @@ + + + + + + + « {L_BACK} +

{L_ACP_PORTAL_LINKS}

+

{L_ACP_PORTAL_LINKS_EXPLAIN}

+ + + + + +

{L_ACP_PORTAL_LINKS}

+

{L_ACP_PORTAL_LINKS_EXPLAIN}

+ + + + + + diff --git a/root/images/portal/Thumbs.db b/root/images/portal/Thumbs.db new file mode 100644 index 00000000..400f9bd3 Binary files /dev/null and b/root/images/portal/Thumbs.db differ diff --git a/root/images/portal/arrowbullet.gif b/root/images/portal/arrowbullet.gif new file mode 100644 index 00000000..3b754e5e Binary files /dev/null and b/root/images/portal/arrowbullet.gif differ diff --git a/root/images/portal/board3clock.swf b/root/images/portal/board3clock.swf new file mode 100644 index 00000000..d2385a04 Binary files /dev/null and b/root/images/portal/board3clock.swf differ diff --git a/root/images/portal/icon_topic_attach.gif b/root/images/portal/icon_topic_attach.gif new file mode 100644 index 00000000..9a706386 Binary files /dev/null and b/root/images/portal/icon_topic_attach.gif differ diff --git a/root/images/portal/icons/Thumbs.db b/root/images/portal/icons/Thumbs.db new file mode 100644 index 00000000..75336e1a Binary files /dev/null and b/root/images/portal/icons/Thumbs.db differ diff --git a/root/images/portal/icons/index.html b/root/images/portal/icons/index.html new file mode 100644 index 00000000..5832e4a2 --- /dev/null +++ b/root/images/portal/icons/index.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/root/images/portal/icons/portal_attach.png b/root/images/portal/icons/portal_attach.png new file mode 100644 index 00000000..68307ecf Binary files /dev/null and b/root/images/portal/icons/portal_attach.png differ diff --git a/root/images/portal/icons/portal_birthday.png b/root/images/portal/icons/portal_birthday.png new file mode 100644 index 00000000..5c1ca3c0 Binary files /dev/null and b/root/images/portal/icons/portal_birthday.png differ diff --git a/root/images/portal/icons/portal_bots.png b/root/images/portal/icons/portal_bots.png new file mode 100644 index 00000000..604c3d59 Binary files /dev/null and b/root/images/portal/icons/portal_bots.png differ diff --git a/root/images/portal/icons/portal_clock.png b/root/images/portal/icons/portal_clock.png new file mode 100644 index 00000000..7c622a09 Binary files /dev/null and b/root/images/portal/icons/portal_clock.png differ diff --git a/root/images/portal/icons/portal_custom.png b/root/images/portal/icons/portal_custom.png new file mode 100644 index 00000000..f9c503e8 Binary files /dev/null and b/root/images/portal/icons/portal_custom.png differ diff --git a/root/images/portal/icons/portal_donation.png b/root/images/portal/icons/portal_donation.png new file mode 100644 index 00000000..42c52d05 Binary files /dev/null and b/root/images/portal/icons/portal_donation.png differ diff --git a/root/images/portal/icons/portal_friends.png b/root/images/portal/icons/portal_friends.png new file mode 100644 index 00000000..5024275c Binary files /dev/null and b/root/images/portal/icons/portal_friends.png differ diff --git a/root/images/portal/icons/portal_link_us.png b/root/images/portal/icons/portal_link_us.png new file mode 100644 index 00000000..c688d5f6 Binary files /dev/null and b/root/images/portal/icons/portal_link_us.png differ diff --git a/root/images/portal/icons/portal_links.png b/root/images/portal/icons/portal_links.png new file mode 100644 index 00000000..03ef9a57 Binary files /dev/null and b/root/images/portal/icons/portal_links.png differ diff --git a/root/images/portal/icons/portal_login.png b/root/images/portal/icons/portal_login.png new file mode 100644 index 00000000..6b4f311c Binary files /dev/null and b/root/images/portal/icons/portal_login.png differ diff --git a/root/images/portal/icons/portal_members.png b/root/images/portal/icons/portal_members.png new file mode 100644 index 00000000..8e649a80 Binary files /dev/null and b/root/images/portal/icons/portal_members.png differ diff --git a/root/images/portal/icons/portal_menu.png b/root/images/portal/icons/portal_menu.png new file mode 100644 index 00000000..a4da1c15 Binary files /dev/null and b/root/images/portal/icons/portal_menu.png differ diff --git a/root/images/portal/icons/portal_minical.png b/root/images/portal/icons/portal_minical.png new file mode 100644 index 00000000..bd4b4c6c Binary files /dev/null and b/root/images/portal/icons/portal_minical.png differ diff --git a/root/images/portal/icons/portal_random.png b/root/images/portal/icons/portal_random.png new file mode 100644 index 00000000..35beef8a Binary files /dev/null and b/root/images/portal/icons/portal_random.png differ diff --git a/root/images/portal/icons/portal_search.png b/root/images/portal/icons/portal_search.png new file mode 100644 index 00000000..6dd19315 Binary files /dev/null and b/root/images/portal/icons/portal_search.png differ diff --git a/root/images/portal/icons/portal_stats.png b/root/images/portal/icons/portal_stats.png new file mode 100644 index 00000000..82e15c17 Binary files /dev/null and b/root/images/portal/icons/portal_stats.png differ diff --git a/root/images/portal/icons/portal_style.png b/root/images/portal/icons/portal_style.png new file mode 100644 index 00000000..b2731f61 Binary files /dev/null and b/root/images/portal/icons/portal_style.png differ diff --git a/root/images/portal/icons/portal_team.png b/root/images/portal/icons/portal_team.png new file mode 100644 index 00000000..d0e68864 Binary files /dev/null and b/root/images/portal/icons/portal_team.png differ diff --git a/root/images/portal/icons/portal_top_poster.png b/root/images/portal/icons/portal_top_poster.png new file mode 100644 index 00000000..4a52bb1c Binary files /dev/null and b/root/images/portal/icons/portal_top_poster.png differ diff --git a/root/images/portal/icons/portal_user.png b/root/images/portal/icons/portal_user.png new file mode 100644 index 00000000..4aeaa1d3 Binary files /dev/null and b/root/images/portal/icons/portal_user.png differ diff --git a/root/images/portal/index.html b/root/images/portal/index.html new file mode 100644 index 00000000..5832e4a2 --- /dev/null +++ b/root/images/portal/index.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/root/images/portal/mini_cal_icon_left_arrow.png b/root/images/portal/mini_cal_icon_left_arrow.png new file mode 100644 index 00000000..33b7979b Binary files /dev/null and b/root/images/portal/mini_cal_icon_left_arrow.png differ diff --git a/root/images/portal/mini_cal_icon_right_arrow.png b/root/images/portal/mini_cal_icon_right_arrow.png new file mode 100644 index 00000000..7bfc11ad Binary files /dev/null and b/root/images/portal/mini_cal_icon_right_arrow.png differ diff --git a/root/images/portal/paypal.gif b/root/images/portal/paypal.gif new file mode 100644 index 00000000..0044501d Binary files /dev/null and b/root/images/portal/paypal.gif differ diff --git a/root/includes/acp/acp_portal_blocks.php b/root/includes/acp/acp_portal_blocks.php new file mode 100644 index 00000000..9fb8f069 --- /dev/null +++ b/root/includes/acp/acp_portal_blocks.php @@ -0,0 +1,497 @@ +tpl_name = 'acp_portal_blocks'; + $this->page_title = 'ACP_PORTAL_BLOCKS'; + + $form_name = 'acp_portal_blocks'; + add_form_key($form_name); + + switch ($action) + { + case 'save': + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + $block_title = utf8_normalize_nfc(request_var('block_title', '', true)); + $block_birthday = request_var('block_birthday', ''); + $block_online_friends = request_var('block_online_friends', ''); + $block_donation = request_var('block_donation', ''); + $block_latest_members = request_var('block_latest_members', ''); + $block_latest_bots = request_var('block_latest_bots', ''); + $block_type = request_var('block_type', ''); + $block_position = request_var('block_position', 0); + $block_groups = request_var('block_groups', 0); + $block_icon = request_var('block_icon', ''); + $block_text = ($block_type == 'custom') ? utf8_normalize_nfc(request_var('block_text', '', true)) : ''; + + if ($block_icon != '' && !preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#i', $block_icon)) + { + $block_icon = ''; + } + if (!$block_title) + { + trigger_error($user->lang['NO_BLOCK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($block_type == 'custom' && $block_text == '') + { + trigger_error($user->lang['NO_BLOCK_TEXT'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + set_portal_config('portal_birthdays_ahead', $block_birthday); + set_portal_config('portal_max_online_friends', $block_online_friends); + set_portal_config('portal_pay_acc', $block_donation); + set_portal_config('portal_max_last_member', $block_latest_members); + set_portal_config('portal_last_visited_bots_number', $block_latest_bots); + + $sql_ary = array( + 'block_title' => $block_title, + 'block_type' => $block_type, + 'block_position' => $block_position, + 'block_groups' => $block_groups, + 'block_icon' => htmlspecialchars_decode($block_icon), + 'block_text' => ($block_type == 'custom') ? $block_text : '', + 'block_text_uid' => '', + 'block_text_options' => 7, + 'block_text_bitfield' => '', + ); + + $order_ary = array( + 'block_order' => $portal_config['num_blocks'] + 1, + ); + + // Get data for block text if specified + if ($sql_ary['block_text']) + { + generate_text_for_storage($sql_ary['block_text'], $sql_ary['block_text_uid'], $sql_ary['block_text_bitfield'], $sql_ary['block_text_options'], request_var('text_parse_bbcode', false), request_var('text_parse_urls', false), request_var('text_parse_smilies', false)); + } + + if ($block_id) + { + $sql = 'UPDATE ' . PORTAL_BLOCKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE block_id = $block_id"; + $message = $user->lang['BLOCK_UPDATED']; + + add_log('admin', 'LOG_BLOCK_UPDATED', (!empty($user->lang[strtoupper($block_title)])) ? $user->lang[strtoupper($block_title)] : $block_title); + } + else + { + $sql = 'INSERT INTO ' . PORTAL_BLOCKS_TABLE . ' ' . $db->sql_build_array('INSERT', array_merge($sql_ary, $order_ary)); + $message = $user->lang['BLOCK_ADDED']; + + set_portal_config('num_blocks', $portal_config['num_blocks'] + 1, true); + add_log('admin', 'LOG_BLOCK_ADDED', (!empty($user->lang[strtoupper($block_title)])) ? $user->lang[strtoupper($block_title)] : $block_title); + } + $db->sql_query($sql); + + $cache->destroy('_blocks'); + + trigger_error($message . adm_back_link($this->u_action)); + + break; + + case 'delete': + + if (!$block_id) + { + trigger_error($user->lang['MUST_SELECT_BLOCK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $sql = 'SELECT block_title, block_order + FROM ' . PORTAL_BLOCKS_TABLE . " + WHERE block_id = $block_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $row['block_title'] = (string) $row['block_title']; + $row['block_order'] = (int) $row['block_order']; + } + + $sql = 'DELETE FROM ' . PORTAL_BLOCKS_TABLE . " WHERE block_id = $block_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . PORTAL_BLOCKS_TABLE . ' SET block_order = block_order - 1 WHERE block_order > ' . $row['block_order']; + $db->sql_query($sql); + + $cache->destroy('_blocks'); + + set_portal_config('num_blocks', $portal_config['num_blocks'] - 1, true); + add_log('admin', 'LOG_BLOCK_REMOVED', (!empty($user->lang[strtoupper($row['block_title'])])) ? $user->lang[strtoupper($row['block_title'])] : $row['block_title']); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'block_id' => $block_id, + 'action' => 'delete', + ))); + } + + break; + + case 'disable': + + if (!$block_id) + { + trigger_error($user->lang['MUST_SELECT_BLOCK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT block_title + FROM ' . PORTAL_BLOCKS_TABLE . " + WHERE block_id = $block_id"; + $result = $db->sql_query($sql); + $disabled_block = $db->sql_fetchfield('block_title'); + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . PORTAL_BLOCKS_TABLE . " SET block_position = 0 WHERE block_id = $block_id"; + $db->sql_query($sql); + + $cache->destroy('_blocks'); + + add_log('admin', 'LOG_BLOCK_DISABLED', (!empty($user->lang[strtoupper($disabled_block)])) ? $user->lang[strtoupper($disabled_block)] : $disabled_block); + + break; + + case 'move_up': + case 'move_down': + + if (!$block_id) + { + trigger_error($user->lang['MUST_SELECT_BLOCK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Get current order id... + $sql = 'SELECT block_order AS current_order + FROM ' . PORTAL_BLOCKS_TABLE . " + WHERE block_id = $block_id"; + $result = $db->sql_query($sql); + $current_order = (int) $db->sql_fetchfield('current_order'); + $db->sql_freeresult($result); + + if ($current_order == 0 && $action == 'move_up') + { + break; + } + $switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1; + + $sql = 'UPDATE ' . PORTAL_BLOCKS_TABLE . " + SET block_order = $current_order + WHERE block_order = $switch_order_id + AND block_id <> $block_id"; + $db->sql_query($sql); + + if ($db->sql_affectedrows()) + { + $sql = 'UPDATE ' . PORTAL_BLOCKS_TABLE . " + SET block_order = $switch_order_id + WHERE block_order = $current_order + AND block_id = $block_id"; + $db->sql_query($sql); + } + + $cache->destroy('_blocks'); + + break; + + case 'edit': + case 'add': + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + $user->add_lang('posting'); + + // Assigning custom bbcodes + display_custom_bbcodes(); + + $blocks = $existing_icons = array(); + + $sql = 'SELECT * + FROM ' . PORTAL_BLOCKS_TABLE . ' + ORDER BY block_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $existing_icons[] = $row['block_icon']; + + if ($action == 'edit' && $block_id == $row['block_id']) + { + $blocks = $row; + } + } + $db->sql_freeresult($result); + + // Select the block icon + $icon_list = filelist($phpbb_root_path . $portal_icons_path); + $edit_icon = $icon_filename_list = ''; + + foreach ($icon_list as $path => $icon_ary) + { + sort($icon_ary); + + foreach ($icon_ary as $icon) + { + $icon = $path . $icon; + + if (!in_array($icon, $existing_icons) || $action == 'edit') + { + if ($blocks && $icon == $blocks['block_icon']) + { + $selected = ' selected="selected"'; + $edit_icon = $icon; + } + else + { + $selected = ''; + } + + if (strlen($icon) > 255) + { + continue; + } + + $icon_filename_list .= ''; + } + } + } + + $icon_filename_list = '' . $icon_filename_list; + unset($existing_icons, $icon_list); + + $block_groups = ''; + $sql = 'SELECT g.* + FROM ' . GROUPS_TABLE . ' g + ORDER BY g.group_id'; + $result = $db->sql_query($sql); + + $block_groups = ''; + while ($row = $db->sql_fetchrow($result)) + { + $block_groups .= ''; + } + $db->sql_freeresult($result); + + // Select the display position for block + $position_list = array( + 'none' => array($user->lang['BLOCK_POSITION_NONE'], BLOCK_NONE), + 'left' => array($user->lang['BLOCK_POSITION_LEFT'], BLOCK_LEFT), + 'right' => array($user->lang['BLOCK_POSITION_RIGHT'], BLOCK_RIGHT), + 'top' => array($user->lang['BLOCK_POSITION_TOP'], BLOCK_TOP), + 'bottom' => array($user->lang['BLOCK_POSITION_BOTTOM'], BLOCK_BOTTOM), + 'middle_top' => array($user->lang['BLOCK_POSITION_MIDDLE_TOP'], BLOCK_MIDDLE_TOP), + 'middle_bottom' => array($user->lang['BLOCK_POSITION_MIDDLE_BOTTOM'], BLOCK_MIDDLE_BOTTOM), + ); + + $s_position_options = ''; + + foreach ($position_list as $position_var => $position_ary) + { + $selected = (isset($blocks['block_position']) && $position_ary[1] == $blocks['block_position']) ? ' selected="selected"' : ''; + $s_position_options .= ''; + } + + // Select the block type + $type_list = array( + 0 => array($user->lang['BLOCK_CUSTOM'], 'custom'), + 1 => array($user->lang['BLOCK_BIRTHDAY'], 'birthday'), + 2 => array($user->lang['BLOCK_ONLINE'], 'online'), + 3 => array($user->lang['BLOCK_SEARCH'], 'search'), + 4 => array($user->lang['BLOCK_CLOCK'], 'clock'), + 5 => array($user->lang['BLOCK_USER_MENU'], 'user_menu'), + 6 => array($user->lang['BLOCK_CHANGE_STYLE'], 'change_style'), + 7 => array($user->lang['BLOCK_DONATION'], 'donation'), + 8 => array($user->lang['BLOCK_LINKS'], 'links'), + 9 => array($user->lang['BLOCK_LATEST_BOTS'], 'latest_bots'), + 10 => array($user->lang['BLOCK_LATEST_MEMBERS'], 'latest_members'), + 11 => array($user->lang['BLOCK_MINI_CALENDAR'], 'mini_calendar'), + 12 => array($user->lang['BLOCK_ONLINE_FRIENDS'], 'online_friends'), + 13 => array($user->lang['BLOCK_STATISTICS'], 'statistics'), + 14 => array($user->lang['BLOCK_TOP_POSTER'], 'top_poster'), + //15 => array($user->lang['BLOCK_'], ''),// Add your blocks here... + ); + + + + $s_type_options = ''; + + foreach ($type_list as $type_var => $type_ary) + { + $selected = (isset($blocks['block_type']) && $type_ary[1] == $blocks['block_type']) ? ' selected="selected"' : ''; + $s_type_options .= ''; + } + + $block_text_data = array( + 'text' => (isset($blocks['block_text'])) ? $blocks['block_text'] : '', + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + + $block_text_preview = ''; + + if (isset($blocks['block_text'])) + { + if (!isset($blocks['block_text_uid'])) + { + $blocks['block_text_uid'] = ''; + $blocks['block_text_bitfield'] = ''; + $blocks['block_text_options'] = 0; + + generate_text_for_storage($blocks['block_text'], $blocks['block_text_uid'], $blocks['block_text_bitfield'], $blocks['block_text_options'], request_var('text_allow_bbcode', false), request_var('text_allow_urls', false), request_var('text_allow_smilies', false)); + } + $block_text_preview = generate_text_for_display($blocks['block_text'], $blocks['block_text_uid'], $blocks['block_text_bitfield'], $blocks['block_text_options']); + $block_text_data = generate_text_for_edit($blocks['block_text'], $blocks['block_text_uid'], $blocks['block_text_options']); + } + + $template->assign_vars(array( + 'TYPE' => (isset($blocks['block_type'])) ? $blocks['block_type'] : '', + 'ICONS_PATH' => $phpbb_root_path . $portal_icons_path, + + 'BLOCK_TITLE' => (isset($blocks['block_title'])) ? $blocks['block_title'] : '', + 'BLOCK_PAYPAL' => (isset($portal_config['portal_pay_acc'])) ? $portal_config['portal_pay_acc'] : '', + 'BLOCK_BIRTHDAY' => (isset($portal_config['portal_birthdays_ahead'])) ? $portal_config['portal_birthdays_ahead'] : '', + 'BLOCK_LATEST_MEMBERS' => (isset($portal_config['portal_max_last_member'])) ? $portal_config['portal_max_last_member'] : '', + 'BLOCK_ONLINE_FRIENDS' => (isset($portal_config['portal_max_online_friends'])) ? $portal_config['portal_max_online_friends'] : '', + 'BLOCK_LATEST_BOTS' => (isset($portal_config['portal_last_visited_bots_number'])) ? $portal_config['portal_last_visited_bots_number'] : '', + 'BLOCK_GROUPS' => (isset($blocks['block_groups'])) ? $blocks['block_groups'] : 0, + 'BLOCK_POSITION' => (isset($blocks['block_position'])) ? $blocks['block_position'] : 0, + 'BLOCK_ICON' => ($edit_icon) ? $phpbb_root_path . $portal_icons_path . '/' . $edit_icon : $phpbb_admin_path . 'images/spacer.gif', + 'BLOCK_TEXT' => $block_text_data['text'], + 'BLOCK_TEXT_PREVIEW' => $block_text_preview, + + 'U_BACK' => $this->u_action, + 'U_ACTION' => $this->u_action . '&id=' . $block_id, + + 'S_EDIT' => true, + 'S_ICON_FILENAME_LIST' => $icon_filename_list, + 'S_POSITION_OPTIONS' => $s_position_options, + 'S_BLOCK_GROUPS' => $block_groups, + 'S_TYPE_OPTIONS' => $s_type_options, + 'S_SELECT_BLOCK' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'custom') ? true : false, + 'S_SELECT_BIRTHDAY' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'birthday') ? true : false, + 'S_SELECT_ONLINE_FRIENDS' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'online_friends') ? true : false, + 'S_SELECT_PAYPAL' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'donation') ? true : false, + 'S_SELECT_LATEST_MEMBERS' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'latest_members') ? true : false, + 'S_SELECT_LATEST_BOTS' => (!isset($blocks['block_type']) || $blocks['block_type'] != 'latest_bots') ? true : false, + 'S_TEXT_BBCODE_CHECKED' => ($block_text_data['allow_bbcode']) ? true : false, + 'S_TEXT_SMILIES_CHECKED' => ($block_text_data['allow_smilies']) ? true : false, + 'S_TEXT_URLS_CHECKED' => ($block_text_data['allow_urls']) ? true : false, + )); + + return; + + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + )); + + $sql = 'SELECT * + FROM ' . PORTAL_BLOCKS_TABLE . ' + ORDER BY block_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + switch ($row['block_position']) + { + case BLOCK_LEFT: + $position = $user->lang['BLOCK_POSITION_LEFT']; + break; + + case BLOCK_RIGHT: + $position = $user->lang['BLOCK_POSITION_RIGHT']; + break; + + case BLOCK_TOP: + $position = $user->lang['BLOCK_POSITION_TOP']; + break; + + case BLOCK_BOTTOM: + $position = $user->lang['BLOCK_POSITION_BOTTOM']; + break; + + case BLOCK_MIDDLE_TOP: + $position = $user->lang['BLOCK_POSITION_MIDDLE_TOP']; + break; + + case BLOCK_MIDDLE_BOTTOM: + $position = $user->lang['BLOCK_POSITION_MIDDLE_BOTTOM']; + break; + + case BLOCK_NONE: + default: + $position = $user->lang['BLOCK_POSITION_NONE']; + break; + } + + $template->assign_block_vars('blocks', array( + 'BLOCK_TITLE' => (!empty($user->lang[strtoupper($row['block_title'])])) ? $user->lang[strtoupper($row['block_title'])] : $row['block_title'], + 'BLOCK_POSITION' => $position, + //'BLOCK_GROUP' => $groups, + 'BLOCK_TYPE' => $user->lang['BLOCK_' . strtoupper($row['block_type'])], + 'BLOCK_ICON' => $phpbb_root_path . $portal_icons_path . '/' . $row['block_icon'], + + 'U_DISABLE' => $this->u_action . '&action=disable&id=' . $row['block_id'], + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['block_id'], + 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['block_id'], + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row['block_id'], + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['block_id'], + + 'S_BLOCK_ICON' => ($row['block_icon']) ? true : false, + 'S_BLOCK_DISABLED' => ($row['block_position'] == BLOCK_NONE) ? true : false, + )); + } + $db->sql_freeresult($result); + } +} + +?> \ No newline at end of file diff --git a/root/includes/acp/acp_portal_config.php b/root/includes/acp/acp_portal_config.php new file mode 100644 index 00000000..f10dcd52 --- /dev/null +++ b/root/includes/acp/acp_portal_config.php @@ -0,0 +1,170 @@ +add_lang('mods/portal'); + $submit = (isset($_POST['submit'])) ? true : false; + + $form_key = 'acp_time'; + add_form_key($form_key); + + /** + * Validation types are: + * string, int, bool, + * script_path (absolute path in url - beginning with / and no trailing slash), + * rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) + */ + switch ($mode) + { + case 'config': + $display_vars = array( + 'title' => 'ACP_PORTAL_GENERAL_TITLE', + 'vars' => array( + 'legend1' => 'ACP_PORTAL_GENERAL_INFO', + 'portal_enable' => array('lang' => 'PORTAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'portal_left_column_width' => array('lang' => 'PORTAL_LEFT_COLUMN_WIDTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'portal_right_column_width' => array('lang' => 'PORTAL_RIGHT_COLUMN_WIDTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + ) + ); + break; + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + $this->new_config = $config; + $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config; + $error = array(); + + // We validate the complete config if whished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + if ($submit && !check_form_key($form_key)) + { + $error[] = $user->lang['FORM_INVALID']; + } + + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } + + // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... + foreach ($display_vars['vars'] as $config_name => $null) + { + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + { + continue; + } + + $this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; + + if ($submit) + { + set_portal_config($config_name, $config_value); + } + } + + if ($submit) + { + $cache->destroy('sql', PORTAL_CONFIG_TABLE); + add_log('admin', 'LOG_PORTAL_CONFIG', $user->lang['ACP_PORTAL_' . strtoupper($mode) . '_INFO']); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + + $this->tpl_name = 'acp_portal_config'; + $this->page_title = $display_vars['title']; + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$display_vars['title']], + 'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'], + + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => implode('
', $error), + + 'U_ACTION' => $this->u_action) + ); + + // Output relevant page + foreach ($display_vars['vars'] as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars) + ); + + continue; + } + $this->new_config[$config_key] = $portal_config[$config_key]; + $type = explode(':', $vars['type']); + + $l_explain = ''; + if ($vars['explain']) + { + $l_explain = (isset($user->lang[$vars['lang'] . '_EXP'])) ? $user->lang[$vars['lang'] . '_EXP'] : ''; + } + + $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); + + if (empty($content)) + { + continue; + } + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], + 'S_EXPLAIN' => $vars['explain'], + 'TITLE_EXPLAIN' => $l_explain, + 'CONTENT' => $content, + )); + + unset($display_vars['vars'][$config_key]); + } + } +} +?> \ No newline at end of file diff --git a/root/includes/acp/acp_portal_links.php b/root/includes/acp/acp_portal_links.php new file mode 100644 index 00000000..219c9a43 --- /dev/null +++ b/root/includes/acp/acp_portal_links.php @@ -0,0 +1,257 @@ +add_lang('mods/portal'); + $portal_root_path = PORTAL_ROOT_PATH; + $portal_icons_path = PORTAL_ICONS_PATH; + include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx); + $portal_config = obtain_portal_config(); + + // Set up general vars + $action = request_var('action', ''); + $action = (isset($_POST['add'])) ? 'add' : $action; + $action = (isset($_POST['save'])) ? 'save' : $action; + $link_id = request_var('id', 0); + + $this->tpl_name = 'acp_portal_links'; + $this->page_title = 'ACP_PORTAL_LINKS'; + + $form_name = 'acp_portal_links'; + add_form_key($form_name); + + switch ($action) + { + case 'save': + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + $link_title = utf8_normalize_nfc(request_var('link_title', '', true)); + $link_is_cat = request_var('link_is_cat', 0); + $link_url = ($link_is_cat) ? '' : request_var('link_url', ''); + + if (!$link_title) + { + trigger_error($user->lang['NO_LINK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$link_is_cat && !$link_url) + { + trigger_error($user->lang['NO_LINK_URL'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql_ary = array( + 'link_title' => $link_title, + 'link_is_cat' => $link_is_cat, + 'link_url' => htmlspecialchars_decode($link_url), + ); + + $order_ary = array( + 'link_order' => $portal_config['num_links'] + 1, + ); + + if ($link_id) + { + $sql = 'UPDATE ' . PORTAL_LINKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE link_id = $link_id"; + $message = $user->lang['LINK_UPDATED']; + + add_log('admin', 'LOG_PORTAL_LINK_UPDATED', $link_title); + } + else + { + $sql = 'INSERT INTO ' . PORTAL_LINKS_TABLE . ' ' . $db->sql_build_array('INSERT', array_merge($sql_ary, $order_ary)); + $message = $user->lang['LINK_ADDED']; + + set_portal_config('num_links', $portal_config['num_links'] + 1, true); + add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title); + } + $db->sql_query($sql); + + $cache->destroy('_links'); + + trigger_error($message . adm_back_link($this->u_action)); + + break; + + case 'delete': + + if (!$link_id) + { + trigger_error($user->lang['MUST_SELECT_LINK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $sql = 'SELECT link_title, link_order + FROM ' . PORTAL_LINKS_TABLE . " + WHERE link_id = $link_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $row['link_title'] = (string) $row['link_title']; + $row['link_order'] = (int) $row['link_order']; + } + + $sql = 'DELETE FROM ' . PORTAL_LINKS_TABLE . " WHERE link_id = $link_id"; + $db->sql_query($sql); + + // Reset link order... + $sql = 'UPDATE ' . PORTAL_LINKS_TABLE . ' SET link_order = link_order - 1 WHERE link_order > ' . $row['link_order']; + $db->sql_query($sql); + + $cache->destroy('_links'); + + set_portal_config('num_links', $portal_config['num_links'] - 1, true); + add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $row['link_title']); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'link_id' => $link_id, + 'action' => 'delete', + ))); + } + + break; + + case 'move_up': + case 'move_down': + + if (!$link_id) + { + trigger_error($user->lang['MUST_SELECT_LINK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Get current order id... + $sql = 'SELECT link_order AS current_order + FROM ' . PORTAL_LINKS_TABLE . " + WHERE link_id = $link_id"; + $result = $db->sql_query($sql); + $current_order = (int) $db->sql_fetchfield('current_order'); + $db->sql_freeresult($result); + + if ($current_order == 0 && $action == 'move_up') + { + break; + } + + // on move_down, switch position with next order_id... + // on move_up, switch position with previous order_id... + $switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1; + + // Update order values + $sql = 'UPDATE ' . PORTAL_LINKS_TABLE . " + SET link_order = $current_order + WHERE link_order = $switch_order_id + AND link_id <> $link_id"; + $db->sql_query($sql); + + // Only update the other entry too if the previous entry got updated + if ($db->sql_affectedrows()) + { + $sql = 'UPDATE ' . PORTAL_LINKS_TABLE . " + SET link_order = $switch_order_id + WHERE link_order = $current_order + AND link_id = $link_id"; + $db->sql_query($sql); + } + + break; + + case 'edit': + case 'add': + + $links = array(); + + $sql = 'SELECT * + FROM ' . PORTAL_LINKS_TABLE . ' + ORDER BY link_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($action == 'edit' && $link_id == $row['link_id']) + { + $links = $row; + } + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'LINK_TITLE' => (isset($links['link_title'])) ? $links['link_title'] : '', + 'LINK_URL' => (isset($links['link_url']) && !$links['link_is_cat']) ? $links['link_url'] : '', + + 'U_BACK' => $this->u_action, + 'U_ACTION' => $this->u_action . '&id=' . $link_id, + + 'S_EDIT' => true, + 'S_LINK_IS_CAT' => (!isset($links['link_is_cat']) || $links['link_is_cat']) ? true : false, + )); + + return; + + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + )); + + $sql = 'SELECT * + FROM ' . PORTAL_LINKS_TABLE . ' + ORDER BY link_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('links', array( + 'LINK_TITLE' => $row['link_title'], + 'LINK_URL' => $row['link_url'], + + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['link_id'], + 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['link_id'], + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row['link_id'], + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['link_id'], + + 'S_LINK_IS_CAT' => ($row['link_is_cat']) ? true : false, + )); + } + $db->sql_freeresult($result); + } +} + +?> \ No newline at end of file diff --git a/root/includes/acp/info/acp_portal_blocks.php b/root/includes/acp/info/acp_portal_blocks.php new file mode 100644 index 00000000..f10d3d07 --- /dev/null +++ b/root/includes/acp/info/acp_portal_blocks.php @@ -0,0 +1,42 @@ + 'acp_portal_blocks', + 'title' => 'ACP_PORTAL_BLOCKS', + 'version' => '2.0.0', + 'modes' => array( + 'blocks' => array('title' => 'ACP_PORTAL_MANAGE_BLOCKS', 'auth' => 'acl_a_portal', 'cat' => array('ACP_PORTAL')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?> \ No newline at end of file diff --git a/root/includes/acp/info/acp_portal_config.php b/root/includes/acp/info/acp_portal_config.php new file mode 100644 index 00000000..a7c7c7b0 --- /dev/null +++ b/root/includes/acp/info/acp_portal_config.php @@ -0,0 +1,42 @@ + 'acp_portal_config', + 'title' => 'ACP_PORTAL_INFO', + 'version' => '2.0.0', + 'modes' => array( + 'config' => array('title' => 'ACP_PORTAL_GENERAL_INFO', 'auth' => 'acl_a_portal', 'cat' => array('ACP_PORTAL')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?> \ No newline at end of file diff --git a/root/includes/acp/info/acp_portal_links.php b/root/includes/acp/info/acp_portal_links.php new file mode 100644 index 00000000..e0285141 --- /dev/null +++ b/root/includes/acp/info/acp_portal_links.php @@ -0,0 +1,42 @@ + 'acp_portal_links', + 'title' => 'ACP_PORTAL_LINKS', + 'version' => '2.0.0', + 'modes' => array( + 'links' => array('title' => 'ACP_PORTAL_MANAGE_LINKS', 'auth' => 'acl_a_portal', 'cat' => array('ACP_PORTAL')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?> \ No newline at end of file diff --git a/root/language/de/mods/info_acp_portal.php b/root/language/de/mods/info_acp_portal.php new file mode 100644 index 00000000..b6346840 --- /dev/null +++ b/root/language/de/mods/info_acp_portal.php @@ -0,0 +1,165 @@ + 'Block-Verwaltung', + 'ACP_PORTAL_BLOCKS_EXPLAIN' => 'Du kannst hier Blöcke anlegen, bearbeiten und löschen.', + 'ADD_BLOCK' => 'Neuer Block hinzufügen', + 'ACP_PORTAL_MANAGE_BLOCKS' => 'Blöcke verwalten', + + // general + 'ACP_PORTAL' => 'Portal', + 'ACP_PORTAL_GENERAL_INFO' => 'Allgemeine Einstellungen', + 'ACP_PORTAL_GENERAL_TITLE' => 'Portal Administration', + 'ACP_PORTAL_GENERAL_TITLE_EXPLAIN' => 'Hier kannst du allgemeine Einstellungen vornehmen.', + + 'BLOCK_ADDED' => 'The block was successfully added.', + 'BLOCK_FILENAME' => 'Block template file', + 'BLOCK_FILENAME_EXPLAIN' => 'Use this to define a tempalte file used for the block. The path is relative to the root phpBB directory.', + 'BLOCK_ICON' => 'Block icon', + 'BLOCK_ICON_EXPLAIN' => 'Use this to define a small icon associated with the block. The path is relative to the root phpBB directory.', + 'BLOCK_POSITION' => 'Display position', + 'BLOCK_POSITION_EXPLAIN' => 'Select the display position on index page.', + 'BLOCK_POSITION_BOTTOM' => 'Bottom', + 'BLOCK_POSITION_LEFT' => 'Left', + 'BLOCK_POSITION_MIDDLE_BOTTOM' => 'Middle - Bottom', + 'BLOCK_POSITION_MIDDLE_TOP' => 'Middle - Top', + 'BLOCK_POSITION_NONE' => 'Not display', + 'BLOCK_POSITION_RIGHT' => 'Right', + 'BLOCK_POSITION_TOP' => 'Top', + 'BLOCK_REMOVED' => 'The block was successfully deleted.', + 'BLOCK_TEXT' => 'Text', + 'BLOCK_TEXT_EXPLAIN' => 'Enter here the content of the block text.', + 'BLOCK_TITLE' => 'Block title', + 'BLOCK_TITLE_EXPLAIN' => 'Enter the displayed block title. Use language constant if name is served from language file: language/en/mods/portal.php', + 'BLOCK_TYPE' => 'Block type', + 'BLOCK_TYPE_EXPLAIN' => 'Select the block type.', + 'BLOCK_UPDATED' => 'The block was successfully updated.', + + 'MUST_SELECT_BLOCK' => 'You must select a block.', + + 'NO_BLOCK_HTML' => 'You have created block with template file but haven’t selected a template file for this block.', + 'NO_BLOCK_TEXT' => 'You have created custom text block but haven’t entered the content for this block.', + 'NO_BLOCK_TITLE' => 'You haven’t specified a title for the block.', + + 'SELECT_BLOCK_FILE' => 'Select a template file…', + 'SELECT_BLOCK_ICON' => 'Select an icon…', + 'SELECT_BLOCK_CLOCK' => 'Select an clock…', + 'SELECT_BLOCK_POSITION' => 'Select a position…', + 'SELECT_BLOCK_TYPE' => 'Select a type…', + + // Manage links + 'ACP_EXPRESS_LINKS_EXPLAIN' => 'Using this form you can add, edit, view and delete navigation links on the index page. You can also create special navigation links as categories which aren’t clickable links.', + 'ADD_LINK' => 'Add new navigation link', + 'ACP_PORTAL_MANAGE_LINKS' => 'Links verwalten', + + 'LINK_ADDED' => 'The navigation link was successfully added.', + 'LINK_CAT' => 'Navigation link category', + 'LINK_ICON' => 'Link icon', + 'LINK_ICON_EXPLAIN' => 'Use this to define a small icon associated with the navigation link. The path is relative to the root phpBB directory.', + 'LINK_IS_CAT' => 'Set as special link category', + 'LINK_REMOVED' => 'The navigation link was successfully deleted.', + 'LINK_TITLE' => 'Link title', + 'LINK_UPDATED' => 'The navigation link was successfully updated.', + 'LINK_URL' => 'Link URL', + + 'MUST_SELECT_LINK' => 'You must select a link.', + + 'NO_LINK_TITLE' => 'You haven’t specified a title for the navigation link.', + 'NO_LINK_URL' => 'You have created clickable navigation link but haven’t entered the URL for this navigation link.', + + 'SELECT_LINK_ICON' => 'Select an icon…', + + // paypal + 'PORTAL_PAY_ACC' => 'Paypal Account', + 'PORTAL_PAY_ACC_EXPLAIN' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com', +)); + +// BLOCK TITLES +// Set additional block titles here... +// +// Example: +// 'BLOCK_TOP_POSTERS' => 'Top posters', /* Main block title */ +// 'BLOCK_TOP_POSTERS_SUB' => 'Posted', /* Legend, block sub-title */ +// +$lang = array_merge($lang, array( + 'BLOCK_BIRTHDAY' => 'Geburtstage', + 'BLOCK_EXPRESS_LINKS' => 'Navigation', + 'BLOCK_SEARCH' => 'Suche', + 'BLOCK_CLOCK' => 'Uhr', + 'BLOCK_USER_MENU' => 'Benutzer-Menü', + 'BLOCK_MAIN_MENU' => '', + 'BLOCK_CHANGE_STYLE' => 'Mein Board-Style', + 'BLOCK_ONLINE' => 'Wer ist Online?', + 'BLOCK_DONATION' => 'Paypal-Spenden', + 'BLOCK_LINKS' => 'Links', + 'BLOCK_LATEST_BOTS' => 'Bots', + 'BLOCK_LATEST_MEMBERS' => 'Neueste Mitglieder', + 'BLOCK_MINI_CALENDAR' => 'Kalender', + 'BLOCK_ONLINE_FRIENDS' => 'Freunde', + 'BLOCK_STATISTICS' => 'Statistik', + 'BLOCK_TOP_POSTER' => 'Top Poster', + 'BLOCK_CUSTOM' => 'Custom', + 'BLOCK_BOTS' => 'Letzten Bots', +)); + +// CUSTOM PAGE TITLES +// Set custom page titles here... +// +// Example: +// 'PAGE_ABOUT' => 'About us', /* Main page title */ +// 'PAGE_ABOUT_EXPLAIN' => 'Contact information here.', /* Explanation, page sub-title */ +// +$lang = array_merge($lang, array( +)); + +/** +* A copy of Handyman` s MOD version check, to view it on the gallery overview +*/ +$lang = array_merge($lang, array( + 'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung', + 'CURRENT_VERSION' => 'Derzeitige Version', + 'DOWNLOAD_LATEST' => 'Neueste Version herunterladen', + 'LATEST_VERSION' => 'Neueste Version', + 'NO_INFO' => 'Der Server konnte nicht erreicht werden', + 'NOT_UP_TO_DATE' => '%s ist nicht aktuell', + 'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema', + 'UP_TO_DATE' => '%s ist aktuell', + 'VERSION_CHECK' => 'MOD Version Check', +)); + +?> \ No newline at end of file diff --git a/root/language/de/mods/portal.php b/root/language/de/mods/portal.php new file mode 100644 index 00000000..a2725498 --- /dev/null +++ b/root/language/de/mods/portal.php @@ -0,0 +1,185 @@ + 'In den nächsten %s Tagen', + 'NO_BIRTHDAYS_AHEAD' => 'In diesem Zeitraum hat kein Mitglied Geburtstag', +)); + +// Common +$lang = array_merge($lang, array( + 'POSTERS' => 'Posters', + + 'SEARCH_A9' => 'A9.com', + 'SEARCH_ACRONYM_FINDER' => 'AcronymFinder', + 'SEARCH_ALEXA' => 'Alexa', + 'SEARCH_ALTA_VISTA' => 'AltaVista', + 'SEARCH_AMAZON' => 'Amazon', + 'SEARCH_AOL' => 'AOL', + 'SEARCH_ASK' => 'Ask.com', + 'SEARCH_BAAMBOO' => 'BaamBoo', + 'SEARCH_BIT_TORRENT' => 'BitTorrent', + 'SEARCH_CREATIVE_COMMONS' => 'Crative Commons', + 'SEARCH_EBAY' => 'Ebay', + 'SEARCH_GOOGLE' => 'Google', + 'SEARCH_LIVE' => 'Windows Live', + 'SEARCH_LYCOS' => 'Lycos', + 'SEARCH_MININOVA' => 'Mininova', + 'SEARCH_REFERENCE' => 'Reference.com', + 'SEARCH_SOURCE_FORGE' => 'SourceForge', + 'SEARCH_TORRENT_PORTAL' => 'TorrentPortal', + 'SEARCH_TORRENT_SPY' => 'TorrentSpy', + 'SEARCH_TORRENTZ' => 'TorrentZ', + 'SEARCH_VDICT' => 'VDict', + 'SEARCH_WIKI_PEDIA' => 'WikiPedia', + 'SEARCH_YAHOO' => 'Yahoo! Search', + + 'WELCOME_YOU' => 'Welcome you', + + // paypal + 'PORTAL_PAY_ACC' => 'Paypal Account', + 'PORTAL_PAY_ACC_EXPLAIN' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com', + +// User menu + 'UM_LOG_ME_IN' => 'Mich bei jedem Besuch automatisch anmelden', + 'UM_HIDE_ME' => 'Meinen Online-Status während dieser Sitzung verbergen', + 'UM_MAIN_SUBSCRIBED' => 'Benachrichtigungen verwalten', + 'UM_BOOKMARKS' => 'Lesezeichen verwalten', + 'M_MENU' => 'Menü', + 'M_ACP' => 'Administrations-Bereich', + + // search + 'GO' => 'Los', + 'SEARCH_BOARD' => 'Foren', + 'SEARCH_SERVICE' => 'Suchmaschinen', + 'SEARCH_LOOKUP' => 'Lookup', + 'SEARCH_TORRENT' => 'Torrent', + 'SEARCH_ADV' => 'erweiterte Suche', + +// Styles + 'STYLE_CHOOSE' => '', + +// Friends + 'FRIENDS_OFFLINE' => 'Offline', + 'FRIENDS_ONLINE' => 'Online', + 'NO_FRIENDS' => 'Derzeit sind keine Freunde definiert', + 'NO_FRIENDS_OFFLINE' => 'Keine Freunde offline', + 'NO_FRIENDS_ONLINE' => 'Keine Freunde online', + +// Statistics + 'ST_TOP' => 'Insgesamt', + 'ST_TOP_ANNS' => 'Bekanntmachungen insgesamt:', + 'ST_TOP_STICKYS' => 'Wichtig insgesamt:', + 'ST_TOT_ATTACH' => 'Dateianhänge insgesamt:', + + 'TOPICS_PER_DAY_OTHER' => 'Themen pro Tag: %d', + 'TOPICS_PER_DAY_ZERO' => 'Themen pro Tag: 0', + 'POSTS_PER_DAY_OTHER' => 'Beiträge pro Tag: %d', + 'POSTS_PER_DAY_ZERO' => 'Beiträge pro Tag: 0', + 'USERS_PER_DAY_OTHER' => 'Benutzer pro Tag: %d', + 'USERS_PER_DAY_ZERO' => 'Benutzer pro Tag: 0', + 'TOPICS_PER_USER_OTHER' => 'Themen pro Benutzer: %d', + 'TOPICS_PER_USER_ZERO' => 'Themen pro Benutzer: 0', + 'POSTS_PER_USER_OTHER' => 'Beiträge pro Benutzer: %d', + 'POSTS_PER_USER_ZERO' => 'Beiträge pro Benutzer: 0', + 'POSTS_PER_TOPIC_OTHER' => 'Beiträge pro Thema: %d', + 'POSTS_PER_TOPIC_ZERO' => 'Beiträge pro Thema: 0', + + +// PayPal + 'DONATION' => 'PayPal-Spenden', + 'DONATION_TEXT' => 'ist eine Webseite ohne jedes Gewinninteresse. Jeder der dieses Projekt unterstützen möchte, kann dies mit einer kleinen PayPal-Spende tun, damit die Rechnungen für den Server, die Domain, etc. bezahlt werden können.', + 'PAY_MSG' => 'Betrag bitte mit Punkt statt Komma trennen, z.B. 3.50', + 'PAY_ITEM' => 'Freiwillige Foren-Spende', + + 'AUD' => 'Australische Dollar (AUD)', + 'CAD' => 'Kanadische Dollar (CAD)', + 'CZK' => 'Tschechische Kronen (CZK)', + 'DKK' => 'Dänische Kronen (DKK)', + 'HKD' => 'Hongkong-Dollar (HKD)', + 'HUF' => 'Ungarische Forint (HUF)', + 'NZD' => 'Neuseeland-Dollar (NZD)', + 'NOK' => 'Norwegische Kronen (NOK)', + 'PLN' => 'Polnische Zloty (PLN)', + 'GBP' => 'Britische Pfund (GBP)', + 'SGD' => 'Singapur-Dollar (SGD)', + 'SEK' => 'Schwedische Kronen (SEK)', + 'CHF' => 'Schweizer Franken (CHF)', + 'JPY' => 'Japanische Yen (JPY)', + 'USD' => 'US-Dollar (USD)', + 'EUR' => 'Euro (EUR)', + 'MXN' => 'Mexikanische Pesos (MXN)', + 'ILS' => 'Neue Israelische Schekel (ILS)', +)); + +// BLOCK TITLES +// Set additional block titles here... +// +// Example: +// 'BLOCK_TOP_POSTERS' => 'Top posters', /* Main block title */ +// 'BLOCK_TOP_POSTERS_SUB' => 'Posted', /* Legend, block sub-title */ +// +$lang = array_merge($lang, array( + 'BLOCK_BIRTHDAY' => 'Geburtstage', + 'BLOCK_EXPRESS_LINKS' => 'Navigation', + 'BLOCK_SEARCH' => 'Suche', + 'BLOCK_CLOCK' => 'Uhr', + 'BLOCK_USER_MENU' => 'Benutzer-Menü', + 'BLOCK_CHANGE_STYLE' => 'Mein Board-Style', + 'BLOCK_ONLINE' => 'Wer ist Online?', + 'BLOCK_DONATION' => 'Paypal-Spenden', + 'BLOCK_LINKS' => 'Links', + 'BLOCK_LATEST_BOTS' => 'Bots', + 'BLOCK_LATEST_MEMBERS' => 'Neueste Mitglieder', + 'BLOCK_MINI_CALENDAR' => 'Kalender', + 'BLOCK_ONLINE_FRIENDS' => 'Freunde', + 'BLOCK_STATISTICS' => 'Statistik', + 'BLOCK_TOP_POSTER' => 'Top Poster', + 'BLOCK_CUSTOM' => 'Custom', + 'BLOCK_BOTS' => 'Letzten Bots-Besuche', +)); + +// CUSTOM PAGE TITLES +// Set custom page titles here... +// +// Example: +// 'PAGE_ABOUT' => 'About us', /* Main page title */ +// 'PAGE_ABOUT_EXPLAIN' => 'Contact information here.', /* Explanation, page sub-title */ +// +$lang = array_merge($lang, array( +)); + +?> \ No newline at end of file diff --git a/root/language/en/mods/info_acp_portal.php b/root/language/en/mods/info_acp_portal.php new file mode 100644 index 00000000..b6346840 --- /dev/null +++ b/root/language/en/mods/info_acp_portal.php @@ -0,0 +1,165 @@ + 'Block-Verwaltung', + 'ACP_PORTAL_BLOCKS_EXPLAIN' => 'Du kannst hier Blöcke anlegen, bearbeiten und löschen.', + 'ADD_BLOCK' => 'Neuer Block hinzufügen', + 'ACP_PORTAL_MANAGE_BLOCKS' => 'Blöcke verwalten', + + // general + 'ACP_PORTAL' => 'Portal', + 'ACP_PORTAL_GENERAL_INFO' => 'Allgemeine Einstellungen', + 'ACP_PORTAL_GENERAL_TITLE' => 'Portal Administration', + 'ACP_PORTAL_GENERAL_TITLE_EXPLAIN' => 'Hier kannst du allgemeine Einstellungen vornehmen.', + + 'BLOCK_ADDED' => 'The block was successfully added.', + 'BLOCK_FILENAME' => 'Block template file', + 'BLOCK_FILENAME_EXPLAIN' => 'Use this to define a tempalte file used for the block. The path is relative to the root phpBB directory.', + 'BLOCK_ICON' => 'Block icon', + 'BLOCK_ICON_EXPLAIN' => 'Use this to define a small icon associated with the block. The path is relative to the root phpBB directory.', + 'BLOCK_POSITION' => 'Display position', + 'BLOCK_POSITION_EXPLAIN' => 'Select the display position on index page.', + 'BLOCK_POSITION_BOTTOM' => 'Bottom', + 'BLOCK_POSITION_LEFT' => 'Left', + 'BLOCK_POSITION_MIDDLE_BOTTOM' => 'Middle - Bottom', + 'BLOCK_POSITION_MIDDLE_TOP' => 'Middle - Top', + 'BLOCK_POSITION_NONE' => 'Not display', + 'BLOCK_POSITION_RIGHT' => 'Right', + 'BLOCK_POSITION_TOP' => 'Top', + 'BLOCK_REMOVED' => 'The block was successfully deleted.', + 'BLOCK_TEXT' => 'Text', + 'BLOCK_TEXT_EXPLAIN' => 'Enter here the content of the block text.', + 'BLOCK_TITLE' => 'Block title', + 'BLOCK_TITLE_EXPLAIN' => 'Enter the displayed block title. Use language constant if name is served from language file: language/en/mods/portal.php', + 'BLOCK_TYPE' => 'Block type', + 'BLOCK_TYPE_EXPLAIN' => 'Select the block type.', + 'BLOCK_UPDATED' => 'The block was successfully updated.', + + 'MUST_SELECT_BLOCK' => 'You must select a block.', + + 'NO_BLOCK_HTML' => 'You have created block with template file but haven’t selected a template file for this block.', + 'NO_BLOCK_TEXT' => 'You have created custom text block but haven’t entered the content for this block.', + 'NO_BLOCK_TITLE' => 'You haven’t specified a title for the block.', + + 'SELECT_BLOCK_FILE' => 'Select a template file…', + 'SELECT_BLOCK_ICON' => 'Select an icon…', + 'SELECT_BLOCK_CLOCK' => 'Select an clock…', + 'SELECT_BLOCK_POSITION' => 'Select a position…', + 'SELECT_BLOCK_TYPE' => 'Select a type…', + + // Manage links + 'ACP_EXPRESS_LINKS_EXPLAIN' => 'Using this form you can add, edit, view and delete navigation links on the index page. You can also create special navigation links as categories which aren’t clickable links.', + 'ADD_LINK' => 'Add new navigation link', + 'ACP_PORTAL_MANAGE_LINKS' => 'Links verwalten', + + 'LINK_ADDED' => 'The navigation link was successfully added.', + 'LINK_CAT' => 'Navigation link category', + 'LINK_ICON' => 'Link icon', + 'LINK_ICON_EXPLAIN' => 'Use this to define a small icon associated with the navigation link. The path is relative to the root phpBB directory.', + 'LINK_IS_CAT' => 'Set as special link category', + 'LINK_REMOVED' => 'The navigation link was successfully deleted.', + 'LINK_TITLE' => 'Link title', + 'LINK_UPDATED' => 'The navigation link was successfully updated.', + 'LINK_URL' => 'Link URL', + + 'MUST_SELECT_LINK' => 'You must select a link.', + + 'NO_LINK_TITLE' => 'You haven’t specified a title for the navigation link.', + 'NO_LINK_URL' => 'You have created clickable navigation link but haven’t entered the URL for this navigation link.', + + 'SELECT_LINK_ICON' => 'Select an icon…', + + // paypal + 'PORTAL_PAY_ACC' => 'Paypal Account', + 'PORTAL_PAY_ACC_EXPLAIN' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com', +)); + +// BLOCK TITLES +// Set additional block titles here... +// +// Example: +// 'BLOCK_TOP_POSTERS' => 'Top posters', /* Main block title */ +// 'BLOCK_TOP_POSTERS_SUB' => 'Posted', /* Legend, block sub-title */ +// +$lang = array_merge($lang, array( + 'BLOCK_BIRTHDAY' => 'Geburtstage', + 'BLOCK_EXPRESS_LINKS' => 'Navigation', + 'BLOCK_SEARCH' => 'Suche', + 'BLOCK_CLOCK' => 'Uhr', + 'BLOCK_USER_MENU' => 'Benutzer-Menü', + 'BLOCK_MAIN_MENU' => '', + 'BLOCK_CHANGE_STYLE' => 'Mein Board-Style', + 'BLOCK_ONLINE' => 'Wer ist Online?', + 'BLOCK_DONATION' => 'Paypal-Spenden', + 'BLOCK_LINKS' => 'Links', + 'BLOCK_LATEST_BOTS' => 'Bots', + 'BLOCK_LATEST_MEMBERS' => 'Neueste Mitglieder', + 'BLOCK_MINI_CALENDAR' => 'Kalender', + 'BLOCK_ONLINE_FRIENDS' => 'Freunde', + 'BLOCK_STATISTICS' => 'Statistik', + 'BLOCK_TOP_POSTER' => 'Top Poster', + 'BLOCK_CUSTOM' => 'Custom', + 'BLOCK_BOTS' => 'Letzten Bots', +)); + +// CUSTOM PAGE TITLES +// Set custom page titles here... +// +// Example: +// 'PAGE_ABOUT' => 'About us', /* Main page title */ +// 'PAGE_ABOUT_EXPLAIN' => 'Contact information here.', /* Explanation, page sub-title */ +// +$lang = array_merge($lang, array( +)); + +/** +* A copy of Handyman` s MOD version check, to view it on the gallery overview +*/ +$lang = array_merge($lang, array( + 'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung', + 'CURRENT_VERSION' => 'Derzeitige Version', + 'DOWNLOAD_LATEST' => 'Neueste Version herunterladen', + 'LATEST_VERSION' => 'Neueste Version', + 'NO_INFO' => 'Der Server konnte nicht erreicht werden', + 'NOT_UP_TO_DATE' => '%s ist nicht aktuell', + 'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema', + 'UP_TO_DATE' => '%s ist aktuell', + 'VERSION_CHECK' => 'MOD Version Check', +)); + +?> \ No newline at end of file diff --git a/root/language/en/mods/portal.php b/root/language/en/mods/portal.php new file mode 100644 index 00000000..a2725498 --- /dev/null +++ b/root/language/en/mods/portal.php @@ -0,0 +1,185 @@ + 'In den nächsten %s Tagen', + 'NO_BIRTHDAYS_AHEAD' => 'In diesem Zeitraum hat kein Mitglied Geburtstag', +)); + +// Common +$lang = array_merge($lang, array( + 'POSTERS' => 'Posters', + + 'SEARCH_A9' => 'A9.com', + 'SEARCH_ACRONYM_FINDER' => 'AcronymFinder', + 'SEARCH_ALEXA' => 'Alexa', + 'SEARCH_ALTA_VISTA' => 'AltaVista', + 'SEARCH_AMAZON' => 'Amazon', + 'SEARCH_AOL' => 'AOL', + 'SEARCH_ASK' => 'Ask.com', + 'SEARCH_BAAMBOO' => 'BaamBoo', + 'SEARCH_BIT_TORRENT' => 'BitTorrent', + 'SEARCH_CREATIVE_COMMONS' => 'Crative Commons', + 'SEARCH_EBAY' => 'Ebay', + 'SEARCH_GOOGLE' => 'Google', + 'SEARCH_LIVE' => 'Windows Live', + 'SEARCH_LYCOS' => 'Lycos', + 'SEARCH_MININOVA' => 'Mininova', + 'SEARCH_REFERENCE' => 'Reference.com', + 'SEARCH_SOURCE_FORGE' => 'SourceForge', + 'SEARCH_TORRENT_PORTAL' => 'TorrentPortal', + 'SEARCH_TORRENT_SPY' => 'TorrentSpy', + 'SEARCH_TORRENTZ' => 'TorrentZ', + 'SEARCH_VDICT' => 'VDict', + 'SEARCH_WIKI_PEDIA' => 'WikiPedia', + 'SEARCH_YAHOO' => 'Yahoo! Search', + + 'WELCOME_YOU' => 'Welcome you', + + // paypal + 'PORTAL_PAY_ACC' => 'Paypal Account', + 'PORTAL_PAY_ACC_EXPLAIN' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com', + +// User menu + 'UM_LOG_ME_IN' => 'Mich bei jedem Besuch automatisch anmelden', + 'UM_HIDE_ME' => 'Meinen Online-Status während dieser Sitzung verbergen', + 'UM_MAIN_SUBSCRIBED' => 'Benachrichtigungen verwalten', + 'UM_BOOKMARKS' => 'Lesezeichen verwalten', + 'M_MENU' => 'Menü', + 'M_ACP' => 'Administrations-Bereich', + + // search + 'GO' => 'Los', + 'SEARCH_BOARD' => 'Foren', + 'SEARCH_SERVICE' => 'Suchmaschinen', + 'SEARCH_LOOKUP' => 'Lookup', + 'SEARCH_TORRENT' => 'Torrent', + 'SEARCH_ADV' => 'erweiterte Suche', + +// Styles + 'STYLE_CHOOSE' => '', + +// Friends + 'FRIENDS_OFFLINE' => 'Offline', + 'FRIENDS_ONLINE' => 'Online', + 'NO_FRIENDS' => 'Derzeit sind keine Freunde definiert', + 'NO_FRIENDS_OFFLINE' => 'Keine Freunde offline', + 'NO_FRIENDS_ONLINE' => 'Keine Freunde online', + +// Statistics + 'ST_TOP' => 'Insgesamt', + 'ST_TOP_ANNS' => 'Bekanntmachungen insgesamt:', + 'ST_TOP_STICKYS' => 'Wichtig insgesamt:', + 'ST_TOT_ATTACH' => 'Dateianhänge insgesamt:', + + 'TOPICS_PER_DAY_OTHER' => 'Themen pro Tag: %d', + 'TOPICS_PER_DAY_ZERO' => 'Themen pro Tag: 0', + 'POSTS_PER_DAY_OTHER' => 'Beiträge pro Tag: %d', + 'POSTS_PER_DAY_ZERO' => 'Beiträge pro Tag: 0', + 'USERS_PER_DAY_OTHER' => 'Benutzer pro Tag: %d', + 'USERS_PER_DAY_ZERO' => 'Benutzer pro Tag: 0', + 'TOPICS_PER_USER_OTHER' => 'Themen pro Benutzer: %d', + 'TOPICS_PER_USER_ZERO' => 'Themen pro Benutzer: 0', + 'POSTS_PER_USER_OTHER' => 'Beiträge pro Benutzer: %d', + 'POSTS_PER_USER_ZERO' => 'Beiträge pro Benutzer: 0', + 'POSTS_PER_TOPIC_OTHER' => 'Beiträge pro Thema: %d', + 'POSTS_PER_TOPIC_ZERO' => 'Beiträge pro Thema: 0', + + +// PayPal + 'DONATION' => 'PayPal-Spenden', + 'DONATION_TEXT' => 'ist eine Webseite ohne jedes Gewinninteresse. Jeder der dieses Projekt unterstützen möchte, kann dies mit einer kleinen PayPal-Spende tun, damit die Rechnungen für den Server, die Domain, etc. bezahlt werden können.', + 'PAY_MSG' => 'Betrag bitte mit Punkt statt Komma trennen, z.B. 3.50', + 'PAY_ITEM' => 'Freiwillige Foren-Spende', + + 'AUD' => 'Australische Dollar (AUD)', + 'CAD' => 'Kanadische Dollar (CAD)', + 'CZK' => 'Tschechische Kronen (CZK)', + 'DKK' => 'Dänische Kronen (DKK)', + 'HKD' => 'Hongkong-Dollar (HKD)', + 'HUF' => 'Ungarische Forint (HUF)', + 'NZD' => 'Neuseeland-Dollar (NZD)', + 'NOK' => 'Norwegische Kronen (NOK)', + 'PLN' => 'Polnische Zloty (PLN)', + 'GBP' => 'Britische Pfund (GBP)', + 'SGD' => 'Singapur-Dollar (SGD)', + 'SEK' => 'Schwedische Kronen (SEK)', + 'CHF' => 'Schweizer Franken (CHF)', + 'JPY' => 'Japanische Yen (JPY)', + 'USD' => 'US-Dollar (USD)', + 'EUR' => 'Euro (EUR)', + 'MXN' => 'Mexikanische Pesos (MXN)', + 'ILS' => 'Neue Israelische Schekel (ILS)', +)); + +// BLOCK TITLES +// Set additional block titles here... +// +// Example: +// 'BLOCK_TOP_POSTERS' => 'Top posters', /* Main block title */ +// 'BLOCK_TOP_POSTERS_SUB' => 'Posted', /* Legend, block sub-title */ +// +$lang = array_merge($lang, array( + 'BLOCK_BIRTHDAY' => 'Geburtstage', + 'BLOCK_EXPRESS_LINKS' => 'Navigation', + 'BLOCK_SEARCH' => 'Suche', + 'BLOCK_CLOCK' => 'Uhr', + 'BLOCK_USER_MENU' => 'Benutzer-Menü', + 'BLOCK_CHANGE_STYLE' => 'Mein Board-Style', + 'BLOCK_ONLINE' => 'Wer ist Online?', + 'BLOCK_DONATION' => 'Paypal-Spenden', + 'BLOCK_LINKS' => 'Links', + 'BLOCK_LATEST_BOTS' => 'Bots', + 'BLOCK_LATEST_MEMBERS' => 'Neueste Mitglieder', + 'BLOCK_MINI_CALENDAR' => 'Kalender', + 'BLOCK_ONLINE_FRIENDS' => 'Freunde', + 'BLOCK_STATISTICS' => 'Statistik', + 'BLOCK_TOP_POSTER' => 'Top Poster', + 'BLOCK_CUSTOM' => 'Custom', + 'BLOCK_BOTS' => 'Letzten Bots-Besuche', +)); + +// CUSTOM PAGE TITLES +// Set custom page titles here... +// +// Example: +// 'PAGE_ABOUT' => 'About us', /* Main page title */ +// 'PAGE_ABOUT_EXPLAIN' => 'Contact information here.', /* Explanation, page sub-title */ +// +$lang = array_merge($lang, array( +)); + +?> \ No newline at end of file diff --git a/root/portal.php b/root/portal.php new file mode 100644 index 00000000..8e82a100 --- /dev/null +++ b/root/portal.php @@ -0,0 +1,214 @@ +session_begin(); +$auth->acl($user->data); +$user->setup('mods/portal'); + +$portal_root_path = PORTAL_ROOT_PATH; +$portal_icons_path = PORTAL_ICONS_PATH; +if (!function_exists('group_memberships')) +{ + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); +} +if (!function_exists('obtain_portal_config')) +{ + include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx); +} +$portal_config = obtain_portal_config(); + + +if (!$portal_config['portal_enable']) +{ + redirect($phpbb_root_path . 'index.' . $phpEx); +} + +if (file_exists($phpbb_root_path . 'install/index.' . $phpEx) && ($user->data['user_type'] == USER_FOUNDER)) +{ + $template->assign_var('S_DISPLAY_GENERAL', true); +} + +// Grab blocks +if ($portal_config['num_blocks'] > 0) +{ + $blocks = $cache->obtain_blocks(); + + if (sizeof($blocks)) + { + foreach ($blocks as $id => $data) + { + $group_id = $data['group']; + $user_id = $user->data['user_id']; + $is_in_group = ($data['group'] <> 0) ? group_memberships($group_id, $user_id , true) : true; + + /*if ($data['title'] == 'BLOCK_ANNOUNCEMENTS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/announcements.' . $phpEx); + } + if ($data['title'] == 'BLOCK_ATTACHMENTS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/attachments.' . $phpEx); + }*/ + if ($data['title'] == 'BLOCK_BIRTHDAY' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/birthday_list.' . $phpEx); + } + /*if ($data['title'] == 'BLOCK_CHANGE_STYLE' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/change_style.' . $phpEx); + }*/ + if ($data['title'] == 'BLOCK_DONATE' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/donate.' . $phpEx); + } + if ($data['title'] == 'BLOCK_ONLINE_FRIENDS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/friends.' . $phpEx); + } + if ($data['title'] == 'BLOCK_LATEST_MEMBERS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/latest_members.' . $phpEx); + } + if ($data['title'] == 'BLOCK_BOTS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/latest_bots.' . $phpEx); + } + /*if ($data['title'] == 'BLOCK_LEADERS' && $data['position'] > 0 && $is_in_group) + { + if ($portal_config['portal_leaders_ext']) + { + include($phpbb_root_path . 'portal/block/leaders_ext.'.$phpEx); + } + else + { + include($phpbb_root_path . 'portal/block/leaders.'.$phpEx); + } + } + if ($data['title'] == 'BLOCK_LINK_US' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/link_us.' . $phpEx); + } + if ($data['title'] == 'BLOCK_MINI_CAL' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/mini_cal.' . $phpEx); + } + if ($data['title'] == 'BLOCK_POLL' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/poll.' . $phpEx); + } + if ($data['title'] == 'BLOCK_RANDOM_MEMBER' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/random_member.' . $phpEx); + } + if ($data['title'] == 'BLOCK_RECENT' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/recent.' . $phpEx); + }*/ + if ($data['title'] == 'BLOCK_STATISTICS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/statistics.' . $phpEx); + } + if ($data['title'] == 'BLOCK_TOP_POSTERS' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/top_posters.' . $phpEx); + } + if ($data['title'] == 'BLOCK_USER_MENU' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/user_menu.' . $phpEx); + } + /*if ($data['title'] == 'BLOCK_WORDGRAPH' && $data['position'] > 0 && $is_in_group) + { + include($phpbb_root_path . $portal_root_path . 'block/wordgraph.' . $phpEx); + }*/ + + $template->assign_block_vars('blocks', array( + 'TYPE' => $data['type'], + 'ICON' => $phpbb_root_path . $portal_icons_path .'/' . $data['icon'], + 'TITLE' => (!empty($user->lang[strtoupper($data['title'])])) ? $user->lang[strtoupper($data['title'])] : $data['title'], + 'TEXT' => ($data['type'] == 'custom') ? generate_text_for_display($data['text'], $data['text_uid'], $data['text_bitfield'], $data['text_options']) : '', + + 'S_GROUP' => ($is_in_group) ? true : false, + 'S_ICON' => ($data['icon']) ? true : false, + 'S_BLOCK_LEFT' => ($data['position'] == BLOCK_LEFT) ? true : false, + 'S_BLOCK_RIGHT' => ($data['position'] == BLOCK_RIGHT) ? true : false, + 'S_BLOCK_TOP' => ($data['position'] == BLOCK_TOP) ? true : false, + 'S_BLOCK_BOTTOM' => ($data['position'] == BLOCK_BOTTOM) ? true : false, + 'S_BLOCK_MIDDLE_TOP' => ($data['position'] == BLOCK_MIDDLE_TOP) ? true : false, + 'S_BLOCK_MIDDLE_BOTTOM' => ($data['position'] == BLOCK_MIDDLE_BOTTOM) ? true : false, + )); + } + } +} + +$sql = 'SELECT block_position + FROM ' . PORTAL_BLOCKS_TABLE; +$result = $db->sql_query($sql); +$db->sql_freeresult($result); + +// Grab navigation links +//if ($portal_config['num_links'] > 0) +//{ +/* $links = $cache->obtain_links(); + + if (sizeof($links)) + { + foreach ($links as $id => $data) + { + $template->assign_block_vars('links', array( + 'TITLE' => $data['title'], + 'URL' => $data['url'], + + 'S_IS_CAT' => $data['is_cat'], + )); + } + } +//} +*/ +// Assign specific vars +$template->assign_vars(array( + 'WELCOME_USERNAME' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), + + 'U_M_BBCODE' => append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode'), + 'U_M_TERMS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), + 'U_M_PRV' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), + + 'PAY_ACC' => $portal_config['portal_pay_acc'], + + 'S_SMALL_BLOCK' => ($row['block_position'] == BLOCK_LEFT || $row['block_position'] == BLOCK_RIGHT) ? true : false, + 'S_PORTAL_LEFT_COLUMN' => $portal_config['portal_left_column_width'], + 'S_PORTAL_RIGHT_COLUMN' => $portal_config['portal_right_column_width'], +)); + +// Output page +page_header($user->lang['INDEX']); + +$template->set_filenames(array( + 'body' => 'portal/portal_body.html') +); + +make_jumpbox(append_sid("{$phpbb_root_path}viewforum . $phpEx")); + +page_footer(); + +?> \ No newline at end of file diff --git a/root/portal/block/birthday_list.php b/root/portal/block/birthday_list.php new file mode 100644 index 00000000..9681e431 --- /dev/null +++ b/root/portal/block/birthday_list.php @@ -0,0 +1,86 @@ +timezone + $user->dst - date('Z')); + $cache_days = $portal_config['portal_birthdays_ahead']; + $sql_days = ''; + while ($cache_days > 0) + { + $day = getdate(time() + 86400 * $cache_days + $user->timezone + $user->dst - date('Z')); + $sql_days .= " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $day['mday'], $day['mon'])) . "%'"; + $cache_days--; + } + + switch ($db->sql_layer) + { + case 'mssql': + case 'mssql_odbc': + $order_by = 'u.user_birthday ASC'; + break; + + default: + $order_by = 'SUBSTRING(u.user_birthday FROM 4 FOR 2) ASC, SUBSTRING(u.user_birthday FROM 1 FOR 2) ASC, u.username_clean ASC'; + break; + } + $now = getdate(time() + $user->timezone + $user->dst - date('Z')); + $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid) + WHERE (b.ban_id IS NULL + OR b.ban_exclude = 1) + AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' {$sql_days}) + AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY ' . $order_by; + $result = $db->sql_query($sql); + $today = sprintf('%2d-%2d-', $now['mday'], $now['mon']); + + while ($row = $db->sql_fetchrow($result)) + { + if (substr($row['user_birthday'], 0, 6) == $today) + { + $birthday_list .= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); + if ($age = (int) substr($row['user_birthday'], -4)) + { + $birthday_list .= ' (' . ($now['year'] - $age) . ')'; + } + $birthday_list .= '

'; + } + else + { + $birthday_ahead_list .= '' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ''; + if ($age = (int) substr($row['user_birthday'], -4)) + { + $birthday_ahead_list .= ' (' . ($now['year'] - $age) . ')'; + } + $birthday_ahead_list .= '

'; + } + } + $db->sql_freeresult($result); +} + +// Assign index specific vars +$template->assign_vars(array( + 'BIRTHDAY_LIST' => $birthday_list, + 'BIRTHDAYS_AHEAD_LIST' => ($portal_config['portal_birthdays_ahead']) ? $birthday_ahead_list : '', + 'L_BIRTHDAYS_AHEAD' => sprintf($user->lang['BIRTHDAYS_AHEAD'], $portal_config['portal_birthdays_ahead']), + 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, +)); + +?> \ No newline at end of file diff --git a/root/portal/block/donate.php b/root/portal/block/donate.php new file mode 100644 index 00000000..ed42fdbb --- /dev/null +++ b/root/portal/block/donate.php @@ -0,0 +1,33 @@ +assign_var('S_DISPLAY_PAY_C', true); + } + + if ($portal_config['portal_pay_s_block']) + { + $template->assign_var('S_DISPLAY_PAY_S', true); + } + + // Assign specific vars + $template->assign_var('PAY_ACC', $portal_config['portal_pay_acc']); +} + +?> \ No newline at end of file diff --git a/root/portal/block/friends.php b/root/portal/block/friends.php new file mode 100644 index 00000000..5792c8c7 --- /dev/null +++ b/root/portal/block/friends.php @@ -0,0 +1,66 @@ +sql_build_query('SELECT_DISTINCT', array( + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', + 'FROM' => array( + USERS_TABLE => 'u', + ZEBRA_TABLE => 'z' + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(SESSIONS_TABLE => 's'), + 'ON' => 's.session_user_id = z.zebra_id' + ) + ), + + 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' + AND z.friend = 1 + AND u.user_id = z.zebra_id', + 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline, u.user_colour', + 'ORDER_BY' => 'u.username_clean ASC', +)); + +$result = $db->sql_query_limit($sql, $portal_config['portal_max_online_friends']); + +while ($row = $db->sql_fetchrow($result)) +{ + $which = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_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, +)); + +?> \ No newline at end of file diff --git a/root/portal/block/index.html b/root/portal/block/index.html new file mode 100644 index 00000000..5832e4a2 --- /dev/null +++ b/root/portal/block/index.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/root/portal/block/latest_bots.php b/root/portal/block/latest_bots.php new file mode 100644 index 00000000..b6211233 --- /dev/null +++ b/root/portal/block/latest_bots.php @@ -0,0 +1,55 @@ +sql_query_limit($sql, $portal_config['portal_last_visited_bots_number']); +$first = true; +while ($row = $db->sql_fetchrow($result)) +{ + if (!$row['user_lastvisit'] && $first == TRUE) + { + $template->assign_vars(array( + 'S_DISPLAY_LAST_BOTS' => false, + )); + } + else + { + $template->assign_var('S_DISPLAY_LAST_BOTS', true); + + if( $row['user_lastvisit'] > 0 ) + { + $template->assign_block_vars('last_visited_bots', array( + 'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']), + 'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']), + )); + } + } + $first = false; +} +$db->sql_freeresult($result); + +// Assign specific vars +$template->assign_vars(array( + 'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $portal_config['portal_last_visited_bots_number']), + 'S_LAST_VISITED_BOTS' => ($portal_config['portal_load_last_visited_bots']) ? true : false, +)); + +?> \ No newline at end of file diff --git a/root/portal/block/latest_members.php b/root/portal/block/latest_members.php new file mode 100644 index 00000000..60a9b460 --- /dev/null +++ b/root/portal/block/latest_members.php @@ -0,0 +1,35 @@ + ' . USER_IGNORE . ' + AND user_inactive_time = 0 + ORDER BY user_regdate DESC'; +$result = $db->sql_query_limit($sql, $portal_config['portal_max_last_member']); + +while( ($row = $db->sql_fetchrow($result)) && ($row['username']) ) +{ + $template->assign_block_vars('latest_members', array( + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'JOINED' => $user->format_date($row['user_regdate'], $format = 'd M'), + )); +} +$db->sql_freeresult($result); + +$template->assign_var('S_DISPLAY_LATEST_MEMBERS', true); + +?> \ No newline at end of file diff --git a/root/portal/block/statistics.php b/root/portal/block/statistics.php new file mode 100644 index 00000000..ecd44f4c --- /dev/null +++ b/root/portal/block/statistics.php @@ -0,0 +1,140 @@ +sql_query($sql)) ) + { + return false; + } + + $row = $db->sql_fetchrow($result); + + switch ( $mode ) + { + case 'announcementtotal': + return $row['announcement_total']; + break; + case 'stickytotal': + return $row['sticky_total']; + break; + case 'attachmentstotal': + return $row['attachments_total']; + break; + } + return false; +} + +// Set some stats, get posts count from forums data if we... hum... retrieve all forums data +$total_posts = $config['num_posts']; +$total_topics = $config['num_topics']; +$total_users = $config['num_users']; + +$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER'; +$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER'; +$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER'; + +// avarage stat +$board_days = ( time() - $config['board_startdate'] ) / 86400; + +$topics_per_day = ($total_topics) ? round($total_topics / $board_days, 0) : 0; +$posts_per_day = ($total_posts) ? round($total_posts / $board_days, 0) : 0; +$users_per_day = round($total_users / $board_days, 0); +$topics_per_user = ($total_topics) ? round($total_topics / $total_users, 0) : 0; +$posts_per_user = ($total_posts) ? round($total_posts / $total_users, 0) : 0; +$posts_per_topic = ($total_topics) ? round($total_posts / $total_topics, 0) : 0; + +if ($topics_per_day > $total_topics) +{ + $topics_per_day = $total_topics; +} + +if ($posts_per_day > $total_posts) +{ + $posts_per_day = $total_posts; +} + +if ($users_per_day > $total_users) +{ + $users_per_day = $total_users; +} + +if ($topics_per_user > $total_topics) +{ + $topics_per_user = $total_topics; +} + +if ($posts_per_user > $total_posts) +{ + $posts_per_user = $total_posts; +} + +if ($posts_per_topic > $total_posts) +{ + $posts_per_topic = $total_posts; +} + +$l_topics_per_day_s = ($total_topics == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER'; +$l_posts_per_day_s = ($total_posts == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER'; +$l_users_per_day_s = ($total_users == 0) ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER'; +$l_topics_per_user_s = ($total_topics == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER'; +$l_posts_per_user_s = ($total_posts == 0) ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER'; +$l_posts_per_topic_s = ($total_posts == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER'; + +// Assign specific vars +$template->assign_vars(array( + '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'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), + 'S_ANN' => get_db_stat('announcementtotal'), + 'S_SCT' => get_db_stat('stickytotal'), + 'S_TOT_ATTACH' => ($config['allow_attachments']) ? get_db_stat('attachmentstotal') : 0, + + // avarage stat + 'TOPICS_PER_DAY' => sprintf($user->lang[$l_topics_per_day_s], $topics_per_day), + 'POSTS_PER_DAY' => sprintf($user->lang[$l_posts_per_day_s], $posts_per_day), + 'USERS_PER_DAY' => sprintf($user->lang[$l_users_per_day_s], $users_per_day), + 'TOPICS_PER_USER' => sprintf($user->lang[$l_topics_per_user_s], $topics_per_user), + 'POSTS_PER_USER' => sprintf($user->lang[$l_posts_per_user_s], $posts_per_user), + 'POSTS_PER_TOPIC' => sprintf($user->lang[$l_posts_per_topic_s], $posts_per_topic), +)); + +?> \ No newline at end of file diff --git a/root/portal/block/top_posters.php b/root/portal/block/top_posters.php new file mode 100644 index 00000000..95b81eb4 --- /dev/null +++ b/root/portal/block/top_posters.php @@ -0,0 +1,39 @@ + ' . USER_IGNORE . ' + AND user_posts <> 0 + ORDER BY user_posts DESC'; +$result = $db->sql_query_limit($sql, $portal_config['portal_max_most_poster']); + +while( ($row = $db->sql_fetchrow($result)) && ($row['username']) ) +{ + $template->assign_block_vars('top_poster', array( + 'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&sr=posts'), + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'POSTER_POSTS' => $row['user_posts'], + ) + ); +} +$db->sql_freeresult($result); + +$template->assign_var('S_DISPLAY_TOP_POSTERS', true); + +?> \ No newline at end of file diff --git a/root/portal/block/user_menu.php b/root/portal/block/user_menu.php new file mode 100644 index 00000000..ed469653 --- /dev/null +++ b/root/portal/block/user_menu.php @@ -0,0 +1,100 @@ +data['is_registered']) +{ + $ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true)))); + + if ($auth->acl_get('m_approve')) + { + $m_approve_fid_ary = array(-1); + $m_approve_fid_sql = ''; + } + else if ($auth->acl_getf_global('m_approve')) + { + $m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary); + $m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')'; + } + else + { + $m_approve_fid_ary = array(); + $m_approve_fid_sql = ' AND p.post_approved = 1'; + } + + $sql = 'SELECT COUNT(distinct t.topic_id) as total + FROM ' . TOPICS_TABLE . ' t + WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . ' + AND t.topic_moved_id = 0 + ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . ' + ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : ''); + $result = $db->sql_query($sql); + $new_posts_count = (int) $db->sql_fetchfield('total'); + + // your post number + $sql = "SELECT user_posts + FROM " . USERS_TABLE . " + WHERE user_id = " . $user->data['user_id']; + $result = $db->sql_query($sql); + $you_posts_count = (int) $db->sql_fetchfield('user_posts'); +} +// +// - new posts since last visit & you post number +// + + +// Get user... +$user_id = $user->data['user_id']; +$username = $user->data['username']; + +$sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id"); +$result = $db->sql_query($sql); +$member = $db->sql_fetchrow($result); +$db->sql_freeresult($result); +$avatar_img = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']); +$rank_title = $rank_img = ''; +get_user_rank($member['user_rank'], $member['user_posts'], $rank_title, $rank_img, $rank_img_src); +$username = $member['username']; +$user_id = (int) $member['user_id']; +$colour = $member['user_colour']; + +// Assign specific vars +$template->assign_vars(array( + 'L_NEW_POSTS' => $user->lang['SEARCH_NEW'] . ' (' . $new_posts_count . ')', + 'L_SELF_POSTS' => $user->lang['SEARCH_SELF'] . ' (' . $you_posts_count . ')', + + 'AVATAR_IMG' => $avatar_img, + 'RANK_TITLE' => $rank_title, + 'RANK_IMG' => $rank_img, + 'RANK_IMG_SRC' => $rank_img_src, + + 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour), + 'USERNAME' => get_username_string('username', $user_id, $username, $colour), + 'USER_COLOR' => get_username_string('colour', $user_id, $username, $colour), + 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour), + + 'U_NEW_POSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'), + 'U_SELF_POSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'), + 'U_UM_BOOKMARKS' => ($config['allow_bookmarks']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks') : '', + 'U_UM_MAIN_SUBSCRIBED' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=subscribed'), + 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '', +)); + +?> \ No newline at end of file diff --git a/root/portal/includes/functions.php b/root/portal/includes/functions.php new file mode 100644 index 00000000..ca769baa --- /dev/null +++ b/root/portal/includes/functions.php @@ -0,0 +1,650 @@ +get('portal_config')) !== true) + { + $portal_config = $cached_portal_config = array(); + + $sql = 'SELECT config_name, config_value + FROM ' . PORTAL_CONFIG_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $cached_portal_config[$row['config_name']] = $row['config_value']; + $portal_config[$row['config_name']] = $row['config_value']; + } + $db->sql_freeresult($result); + + $cache->put('portal_config', $cached_portal_config); + } + + return $portal_config; +} + +/** +* Set config value. Creates missing config entry. +*/ +function set_portal_config($config_name, $config_value) +{ + global $db, $cache, $portal_config; + + $sql = 'UPDATE ' . PORTAL_CONFIG_TABLE . " + SET config_value = '" . $db->sql_escape($config_value) . "' + WHERE config_name = '" . $db->sql_escape($config_name) . "'"; + $db->sql_query($sql); + + if (!$db->sql_affectedrows() && !isset($portal_config[$config_name])) + { + $sql = 'INSERT INTO ' . PORTAL_CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'config_name' => $config_name, + 'config_value' => $config_value)); + $db->sql_query($sql); + } + + $portal_config[$config_name] = $config_value; +} + +// fetch post for news & announce +function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0) +{ + global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config; + + $posts = array(); + $post_time = ($time == 0) ? '' : 'AND t.topic_time > ' . (time() - $time * 86400); + $forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array()); + $str_where = ''; + $topic_icons = array(0); + $have_icons = 0; + + if( $permissions == TRUE ) + { + $disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true))); + } + else + { + $disallow_access = array(); + } + + $global_f = 0; + + if( sizeof($forum_from) ) + { + $disallow_access = array_diff($forum_from, $disallow_access); + if( !sizeof($disallow_access) ) + { + return array(); + } + + foreach( $disallow_access as $acc_id) + { + $acc_id = (int) $acc_id; + $str_where .= "t.forum_id = $acc_id OR "; + if( $type == 'announcements' && $global_f < 1 && $acc_id > 0 ) + { + $global_f = $acc_id; + } + } + } + else + { + foreach( $disallow_access as $acc_id ) + { + $acc_id = (int) $acc_id; + $str_where .= "t.forum_id <> $acc_id AND "; + } + } + + switch( $type ) + { + case "announcements": + $topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))'; + $str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : ''; + $user_link = 't.topic_poster = u.user_id'; + $post_link = 't.topic_first_post_id = p.post_id'; + $topic_order = 't.topic_time DESC'; + break; + case "news": + $topic_type = 't.topic_type = ' . POST_NORMAL; + $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : ''; + $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ; + $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ; + $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ; + break; + case "news_all": + $topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')'; + $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : ''; + $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ; + $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ; + $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ; + break; + } + + if( $type == 'announcements' && $global_f < 1 ) + { + $sql = 'SELECT + forum_id + FROM + ' . FORUMS_TABLE . ' + WHERE + forum_type = ' . FORUM_POST . ' + ' . str_replace('t.', '', $str_where) . ' + ORDER BY + forum_id'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + + if( !sizeof( $row ) ) + { + return array(); + } + $global_f = $row['forum_id']; + } + + $sql_array = array( + 'SELECT' => 't.forum_id, + t.topic_id, + t.topic_last_post_id, + t.topic_last_post_time, + t.topic_time, + t.topic_title, + t.topic_attachment, + t.topic_views, + t.poll_title, + t.topic_replies, + t.topic_replies_real, + t.topic_poster, + t.topic_type, + t.topic_status, + t.topic_last_poster_name, + t.topic_last_poster_id, + t.topic_last_poster_colour, + t.icon_id, + u.username, + u.user_id, + u.user_type, + u.user_colour, + p.post_id, + p.poster_id, + p.post_time, + p.post_text, + p.post_attachment, + p.post_username, + p.enable_smilies, + p.enable_bbcode, + p.enable_magic_url, + p.bbcode_bitfield, + p.bbcode_uid, + f.forum_name, + f.enable_icons', + 'FROM' => array( + TOPICS_TABLE => 't', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => $user_link, + ), + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 't.forum_id=f.forum_id', + ), + array( + 'FROM' => array(POSTS_TABLE => 'p'), + 'ON' => $post_link, + ), + ), + 'WHERE' => $topic_type . ' + ' . $post_time . ' + AND t.topic_status <> ' . ITEM_MOVED . ' + AND t.topic_approved = 1 + AND t.topic_moved_id = 0 + ' . $str_where, + 'ORDER_BY' => $topic_order, + ); + + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', tp.topic_posted'; + $sql = $db->sql_build_query('SELECT', $sql_array); + + if ($number_of_posts <> 0) + { + $result = $db->sql_query_limit($sql, $number_of_posts, $start); + } + else + { + $result = $db->sql_query($sql); + } + + // Instantiate BBCode if need be + if ($bbcode_bitfield !== '') + { + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + $i = 0; + + while ( $row = $db->sql_fetchrow($result) ) + { + $attachments = array(); + if( $config['allow_attachments'] && $row['post_id'] ) + { + // Pull attachment data + $sql2 = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = '. $row['post_id'] .' + AND in_message = 0 + ORDER BY filetime DESC'; + $result2 = $db->sql_query($sql2); + + while ($row2 = $db->sql_fetchrow($result2)) + { + $attachments[] = $row2; + } + $db->sql_freeresult($result2); + } + + $posts[$i]['bbcode_uid'] = $row['bbcode_uid']; + $len_check = $row['post_text']; + $maxlen = $text_length; + + if (($text_length != 0) && (strlen($len_check) > $text_length)) + { + $message = censor_text(get_sub_taged_string(str_replace("\n", '
', $row['post_text']), $row['bbcode_uid'], $maxlen)); + $posts[$i]['striped'] = true; + } + else + { + $message = censor_text( str_replace("\n", '
', $row['post_text']) ); + } + + // Second parse bbcode here + if ($row['bbcode_bitfield']) + { + $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); + } + if (!empty($attachments)) + { + parse_attachments($row['forum_id'], $message, $attachments, $update_count); + } + $message = smiley_text($message); // Always process smilies after parsing bbcodes + + if( $global_f < 1 ) + { + $global_f = $row['forum_id']; + } + + $topic_icons[] = $row['enable_icons']; + $have_icons = ( $row['icon_id'] > 0 ) ? 1 : $have_icons; + + $posts[$i] = array_merge($posts[$i], array( + 'post_text' => ap_validate($message), + 'topic_id' => $row['topic_id'], + 'topic_last_post_id' => $row['topic_last_post_id'], + 'topic_type' => $row['topic_type'], + 'topic_posted' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false, + 'icon_id' => $row['icon_id'], + 'topic_status' => $row['topic_status'], + 'forum_id' => $row['forum_id'], + 'topic_replies' => $row['topic_replies'], + 'topic_replies_real' => $row['topic_replies_real'], + 'topic_time' => $user->format_date($row['post_time']), + 'topic_last_post_time' => $row['topic_last_post_time'], + 'topic_title' => $row['topic_title'], + 'username' => $row['username'], + 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'username_full_last' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour'], $row['topic_last_poster_name']), + 'user_id' => $row['user_id'], + 'user_type' => $row['user_type'], + 'user_colour' => $row['user_colour'], + 'poll' => ($row['poll_title']) ? true : false, + 'attachment' => ($row['topic_attachment']) ? true : false, + 'topic_views' => $row['topic_views'], + 'forum_name' => $row['forum_name'], + 'attachments' => (!empty($attachments)) ? $attachments : array(), + )); + $posts['global_id'] = $global_f; + $i++; + } + + $posts['topic_icons'] = ( (max($topic_icons) > 0 ) && $have_icons ) ? true : false; + $posts['topic_count'] = $i; + + if( $global_f < 1 ) + { + return array(); + } + else + { + return $posts; + } +} + +/** +* Censor title, return short title +* +* @param $title string title to censor +* @param $limit int short title character limit +* +*/ +function character_limit(&$title, $limit = 0) +{ + $title = censor_text($title); + if ($limit > 0) + { + return (strlen(utf8_decode($title)) > $limit + 3) ? truncate_string($title, $limit) . '...' : $title; + } + else + { + return $title; + } +} + +// Don't let them mess up the complete portal layout in cut messages and do some real AP magic +function is_valid_bbtag($str, $bbuid) +{ + return (substr($str,0,1) == '[') && (strpos($str, ':'.$bbuid.']') > 0); +} + +function get_end_bbtag($tag, $bbuid) +{ + $etag = ''; + for($i=0;$i')+1); + return substr($str,0,strpos($str, $lim, strlen($lim))+strlen($lim)); +} + +function get_sub_taged_string($str, $bbuid, $maxlen) +{ + $sl = $str; + $ret = ''; + $ntext = ''; + $lret = ''; + $i = 0; + $cnt = $maxlen; + $last = ''; + $arr = array(); + + while((strlen($ntext) < $cnt) && (strlen($sl) > 0)) + { + $sr = ''; + if (substr($sl, 0, 1) == '[') $sr = substr($sl,0,strpos($sl,']')+1); + /* GESCHLOSSENE HTML-TAGS BEACHTEN */ + if (substr($sl, 0, 2) == '')+1); + $ret .= $sr; + } + else if (is_valid_bbtag($sr, $bbuid)) + { + if ($sr[1] == '/') + { + /* entfernt das endtag aus dem tag array */ + $tarr = array(); + $j = 0; + foreach ($arr as $elem) + { + if (strcmp($elem[1],$sr) != 0) $tarr[$j++] = $elem; + } + $arr = $tarr; + } + else + { + $arr[$i][0] = $sr; + $arr[$i++][1] = get_end_bbtag($sr, $bbuid); + } + $ret .= $sr; + } + else + { + $sr = get_next_word($sl); + $ret .= $sr; + $ntext .= $sr; + $last = $sr; + } + $sl = substr($sl, strlen($sr), strlen($sl)-strlen($sr)); + } + + $ret = trim($ret) . '...'; + $ap = ''; + + foreach ($arr as $elem) + { + $ap = $elem[1] . $ap; + } + $ret .= $ap; + + return $ret; +} + +function ap_validate($str) +{ + $s = str_replace('
', '
', $str); + return str_replace('
', '', $s); +} + +/** +* Pagination routine, generates archive number sequence +*/ +function generate_portal_pagination($base_url, $num_items, $per_page, $start_item, $type, $add_prevnext_text = false, $tpl_prefix = '') +{ + global $template, $user; + + switch( $type ) + { + case "announcements": + $pagination_type = 'ap'; + $anker = '#a'; + break; + case "news": + case "news_all": + $pagination_type = 'np'; + $anker = '#n'; + break; + } + + // Make sure $per_page is a valid value + $per_page = ($per_page <= 0) ? 1 : $per_page; + + $seperator = '' . $user->lang['COMMA_SEPARATOR'] . ''; + $total_pages = ceil($num_items / $per_page); + + if ($total_pages == 1 || !$num_items) + { + return false; + } + + $on_page = floor($start_item / $per_page) + 1; + $url_delim = (strpos($base_url, '?') === false) ? '?' : '&'; + + $page_string = ($on_page == 1) ? '1' : '1'; + + if ($total_pages > 5) + { + $start_cnt = min(max(1, $on_page - 4), $total_pages - 5); + $end_cnt = max(min($total_pages, $on_page + 4), 6); + + $page_string .= ($start_cnt > 1) ? ' ... ' : $seperator; + + for ($i = $start_cnt + 1; $i < $end_cnt; $i++) + { + $page_string .= ($i == $on_page) ? '' . $i . '' : '' . $i . ''; + if ($i < $end_cnt - 1) + { + $page_string .= $seperator; + } + } + $page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator; + } + else + { + $page_string .= $seperator; + + for ($i = 2; $i < $total_pages; $i++) + { + $page_string .= ($i == $on_page) ? '' . $i . '' : '' . $i . ''; + if ($i < $total_pages) + { + $page_string .= $seperator; + } + } + } + $page_string .= ($on_page == $total_pages) ? '' . $total_pages . '' : '' . $total_pages . ''; + + if ($add_prevnext_text) + { + if ($on_page != 1) + { + $page_string = '' . $user->lang['PREVIOUS'] . '  ' . $page_string; + } + + if ($on_page != $total_pages) + { + $page_string .= '  ' . $user->lang['NEXT'] . ''; + } + } + + $template->assign_vars(array( + $tpl_prefix . 'BASE_URL' => $base_url, + 'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url), + $tpl_prefix . 'PER_PAGE' => $per_page, + + $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . (($on_page - 2) * $per_page) . $anker, + $tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . ($on_page * $per_page) . $anker, + $tpl_prefix . 'TOTAL_PAGES' => $total_pages, + )); + + return $page_string; +} + +/** +* Format user date for the Birthday block +* Note: this function is used as we already added timezones, etc +* +* borrowed from Upcoming Birthday Mod +* @author: lefty +* changed to work outside session.php by B3P +* @function: format_dateucb +*/ + +function format_birthday($date, $format = false) +{ + global $user; + $time->time_now = time(); + $lang_dates = $user->lang['datetime']; + $format = (!$format) ? $time->date_format : $format; + + // Short representation of month in format + if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) + { + $lang_dates['May'] = $lang_dates['May_short']; + } + unset($lang_dates['May_short']); + + return strtr(@date(str_replace('|', '', $format), $date), $lang_dates); +} + +// Mini Cal. +class calendar +{ + var $dateYYY; // year in numeric format (YYYY) + var $dateMM; // month in numeric format (MM) + var $dateDD; // day in numeric format (DD) + var $ext_dateMM; // extended month (e.g. February) + var $daysMonth; // count of days in month + var $stamp; // timestamp + var $day; // return array s.a. + + /** + * convert date->timestamp + **/ + function makeTimestamp($date) + { + $this->stamp = strtotime($date); + return ($this->stamp); + } + + /** + * get date listed in array + **/ + function getMonth($callDate) + { + + $this->makeTimestamp($callDate); + $this->dateYYYY = date("Y", $this->stamp); + $this->dateMM = date("n", $this->stamp); + $this->ext_dateMM = date("F", $this->stamp); + $this->dateDD = date("d", $this->stamp); + $this->daysMonth = date("t", $this->stamp); + + for($i=1; $i < $this->daysMonth+1; $i++) + { + $this->makeTimestamp("$i $this->ext_dateMM $this->dateYYYY"); + $this->day[] = array( + "0" => "$i", + "1" => $this->dateMM, + "2" => $this->dateYYYY, + "3" => (date('w', $this->stamp)) + ); + } + } +} + +?> \ No newline at end of file diff --git a/root/portal/includes/functions_version_check.php b/root/portal/includes/functions_version_check.php new file mode 100644 index 00000000..dd695735 --- /dev/null +++ b/root/portal/includes/functions_version_check.php @@ -0,0 +1,191 @@ +lang['NO_INFO']; + $data = array( + 'title' => $var['title'], + 'description' => $user->lang['NO_INFO'], + 'download' => $user->lang['NO_INFO'], + 'announcement' => $user->lang['NO_INFO'], + ); + } + $file = get_remote_file($var['file'][0], '/' . $var['file'][1], $var['file'][2], $errstr, $errno); + + if ($file) + { + if (version_compare(PHP_VERSION, '5.0.0', '<')) + { + $row = array(); + $data_array = mvc_setup_array($file); + + $row = $data_array['mods'][$var['tag']]; + $mod_version = $row['mod_version']; + $mod_version = $mod_version['major'] . '.' . $mod_version['minor'] . '.' . $mod_version['revision'] . $mod_version['release']; + + $data = array( + 'title' => $row['title'], + 'description' => $row['description'], + 'download' => $row['download'], + 'announcement' => $row['announcement'], + ); + } + else + { + // let's not stop the page from loading if a mod author messed up their mod check file + // also take care of one of the easiest ways to mess up an xml file: "&" + $mod = @simplexml_load_string(str_replace('&', '&', $file)); + if (isset($mod->$var['tag'])) + { + $row = $mod->$var['tag']; + $mod_version = $row->mod_version->major . '.' . $row->mod_version->minor . '.' . $row->mod_version->revision . $row->mod_version->release; + + $data = array( + 'title' => $row->title, + 'description' => $row->description, + 'download' => $row->download, + 'announcement' => $row->announcement, + ); + } + } + } + + // remove spaces from the version in the mod file stored locally + $version = str_replace(' ', '', $var['version']); + if ($return_version) + { + return $version; + } + + $version_compare = (version_compare($version, $mod_version, '<')) ? false : true; + + $template->assign_block_vars('mods', array( + 'ANNOUNCEMENT' => $data['announcement'], + 'AUTHOR' => $var['author'], + 'CURRENT_VERSION' => $version, + 'DESCRIPTION' => $data['description'], + 'DOWNLOAD' => $data['download'], + 'LATEST_VERSION' => $mod_version, + 'TITLE' => $data['title'], + + 'UP_TO_DATE' => sprintf((!$version_compare) ? $user->lang['NOT_UP_TO_DATE'] : $user->lang['UP_TO_DATE'], $data['title']), + + 'S_UP_TO_DATE' => $version_compare, + + 'U_AUTHOR' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $var['author'], + )); +} + +/** +* this is for php4 only +* kind of a dirty hack, but since I get the say on how the xml is done, I can have 4 levels max +*/ +function mvc_setup_array($xml) +{ + // Fire up the built-in XML parser + $values = $index = array(); + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + + // this takes care of one possible xml error + $xml = str_replace('&', '&', $xml); + + // Set tag names and values + xml_parse_into_struct($parser, $xml, $values, $index); + + // Close down XML parser + xml_parser_free($parser); + + $ary = array(); + + foreach ($values as $value) + { + switch (trim($value['level'])) + { + case 1: + if ($value['type'] == 'open') + { + $one = $value['tag']; + } + else if ($value['type'] == 'complete') + { + $ary[$value['tag']] = $value['value']; + } + break; + + case 2: + if ($value['type'] == 'open') + { + $two = $value['tag']; + } + else if ($value['type'] == 'complete') + { + $ary[$one][$value['tag']] = $value['value']; + } + break; + + case 3: + if ($value['type'] == 'open') + { + $three = $value['tag']; + } + else if ($value['type'] == 'complete') + { + $ary[$one][$two][$value['tag']] = $value['value']; + } + break; + + case 4: + if ($value['type'] == 'complete') + { + $ary[$one][$two][$three][$value['tag']] = isset($value['value']) ? $value['value'] : ''; + } + break; + } + } + return $ary; +} + +?> \ No newline at end of file diff --git a/root/portal/includes/index.html b/root/portal/includes/index.html new file mode 100644 index 00000000..dc8f7f41 --- /dev/null +++ b/root/portal/includes/index.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/root/portal/index.html b/root/portal/index.html new file mode 100644 index 00000000..dc8f7f41 --- /dev/null +++ b/root/portal/index.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/_block_config.html b/root/styles/prosilver/template/portal/_block_config.html new file mode 100644 index 00000000..d759f234 --- /dev/null +++ b/root/styles/prosilver/template/portal/_block_config.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/birthday.html b/root/styles/prosilver/template/portal/block/birthday.html new file mode 100644 index 00000000..74770e21 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/birthday.html @@ -0,0 +1,12 @@ + + + {L_CONGRATULATIONS}:
{BIRTHDAY_LIST}
+ + {L_NO_BIRTHDAYS} + +

{L_BIRTHDAYS_AHEAD}

+ + {BIRTHDAYS_AHEAD_LIST} + + {L_NO_BIRTHDAYS_AHEAD} + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/change_style.html b/root/styles/prosilver/template/portal/block/change_style.html new file mode 100644 index 00000000..757dc88b --- /dev/null +++ b/root/styles/prosilver/template/portal/block/change_style.html @@ -0,0 +1,7 @@ + +{$LR_BLOCK_H_L} {L_BOARD_STYLE}{$LR_BLOCK_H_R} + +
+{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/clock.html b/root/styles/prosilver/template/portal/block/clock.html new file mode 100644 index 00000000..862e7f75 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/clock.html @@ -0,0 +1,8 @@ + +
+
+ + + + +
\ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/donation.html b/root/styles/prosilver/template/portal/block/donation.html new file mode 100644 index 00000000..5120168b --- /dev/null +++ b/root/styles/prosilver/template/portal/block/donation.html @@ -0,0 +1,39 @@ + +{SITENAME} {L_DONATION_TEXT} +
+
+
+
+ + + + + + + + + + +
+
+
+{L_PAY_MSG} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/general_block.html b/root/styles/prosilver/template/portal/block/general_block.html new file mode 100644 index 00000000..cbcabcad --- /dev/null +++ b/root/styles/prosilver/template/portal/block/general_block.html @@ -0,0 +1,12 @@ + +{$C_BLOCK_H_L}
{L_PORTAL_INSTALL}{L_INFORMATION}
{$C_BLOCK_H_R} + +{$C_BLOCK_F_L}{$C_BLOCK_F_R} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/index.html b/root/styles/prosilver/template/portal/block/index.html new file mode 100644 index 00000000..c3c1935f --- /dev/null +++ b/root/styles/prosilver/template/portal/block/index.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/jumpbox.html b/root/styles/prosilver/template/portal/block/jumpbox.html new file mode 100644 index 00000000..480e30f8 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/jumpbox.html @@ -0,0 +1,21 @@ + + +
+ + +
+ +
+ + + + +
+ +
+ \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/latest_bots.html b/root/styles/prosilver/template/portal/block/latest_bots.html new file mode 100644 index 00000000..edb1a5c5 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/latest_bots.html @@ -0,0 +1,5 @@ + + + {last_visited_bots.BOT_NAME}
{last_visited_bots.LAST_VISIT_DATE} +
+ diff --git a/root/styles/prosilver/template/portal/block/latest_members.html b/root/styles/prosilver/template/portal/block/latest_members.html new file mode 100644 index 00000000..af3ce11f --- /dev/null +++ b/root/styles/prosilver/template/portal/block/latest_members.html @@ -0,0 +1,7 @@ + +{L_USERNAME} +{L_JOINED}
+ + {latest_members.USERNAME_FULL} + {latest_members.JOINED}
+ \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/links.html b/root/styles/prosilver/template/portal/block/links.html new file mode 100644 index 00000000..4e75bfa6 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/links.html @@ -0,0 +1,14 @@ + +{$LR_BLOCK_H_L} {L_LINKS}{$LR_BLOCK_H_R} +
+ +
+{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} diff --git a/root/styles/prosilver/template/portal/block/mini_calendar.html b/root/styles/prosilver/template/portal/block/mini_calendar.html new file mode 100644 index 00000000..e92b3102 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/mini_calendar.html @@ -0,0 +1,31 @@ + +{$LR_BLOCK_H_L} {L_MINI_CALENDAR}{$LR_BLOCK_H_R} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{U_PREV_MONTH}{L_MINI_CAL_MONTH}{U_NEXT_MONTH}
{L_MINI_CAL_SUN}{L_MINI_CAL_MON}{L_MINI_CAL_TUE}{L_MINI_CAL_WED}{L_MINI_CAL_THU}{L_MINI_CAL_FRI}{L_MINI_CAL_SAT}{L_MINI_CAL_SUN}
{mini_cal_row.mini_cal_days.MINI_CAL_DAY}
+{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/online.html b/root/styles/prosilver/template/portal/block/online.html new file mode 100644 index 00000000..3f4e1f02 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/online.html @@ -0,0 +1,3 @@ + +{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})
{RECORD_USERS}

{LOGGED_IN_USER_LIST} +
{L_LEGEND}: {LEGEND} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/online_friends.html b/root/styles/prosilver/template/portal/block/online_friends.html new file mode 100644 index 00000000..46fa0352 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/online_friends.html @@ -0,0 +1,15 @@ + +{L_FRIENDS_ONLINE}
+ + {friends_online.USERNAME_FULL}
+ + {L_NO_FRIENDS_ONLINE} +
+ +
+{L_FRIENDS_OFFLINE}
+ + {friends_offline.USERNAME_FULL}
+ + {L_NO_FRIENDS_OFFLINE} + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/random_member.html b/root/styles/prosilver/template/portal/block/random_member.html new file mode 100644 index 00000000..5a39a07f --- /dev/null +++ b/root/styles/prosilver/template/portal/block/random_member.html @@ -0,0 +1,20 @@ + + +
{random_member.USERNAME_FULL}
+ {random_member.AVATAR_IMG}
+ {random_member.RANK_TITLE}
+ {random_member.RANK_IMG}
+
+
+ {L_RND_JOIN}:{random_member.JOINED}
+ {L_RND_POSTS}:{random_member.USER_POSTS}
+ + {L_RND_OCC}:   {random_member.USER_OCC}
+ + + {L_RND_FROM}:   {random_member.USER_FROM}
+ + + {L_RND_WWW}
+ + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/search.html b/root/styles/prosilver/template/portal/block/search.html new file mode 100644 index 00000000..ebbba4a7 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/search.html @@ -0,0 +1,74 @@ + + +
+

+ +

+

+ + + + +

+
+

{L_SH_ADV}

diff --git a/root/styles/prosilver/template/portal/block/statistics.html b/root/styles/prosilver/template/portal/block/statistics.html new file mode 100644 index 00000000..0cde5a92 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/statistics.html @@ -0,0 +1,19 @@ + +{L_ST_TOP}
+{TOTAL_POSTS}
+{TOTAL_TOPICS}
+{L_ST_TOP_ANNS} {S_ANN}
+{L_ST_TOP_STICKYS} {S_SCT}
+{L_ST_TOT_ATTACH} {S_TOT_ATTACH}
+ +
+{TOPICS_PER_DAY}
+{POSTS_PER_DAY}
+{USERS_PER_DAY}
+{TOPICS_PER_USER}
+{POSTS_PER_USER}
+{POSTS_PER_TOPIC}
+
+ +{TOTAL_USERS}
+{NEWEST_USER} \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/top_poster.html b/root/styles/prosilver/template/portal/block/top_poster.html new file mode 100644 index 00000000..6103d841 --- /dev/null +++ b/root/styles/prosilver/template/portal/block/top_poster.html @@ -0,0 +1,11 @@ + + +{$LR_BLOCK_H_L} {L_TOP_POSTER}{$LR_BLOCK_H_R} + {L_USERNAME} + {L_POSTS}
+ + {top_poster.USERNAME_FULL} + {top_poster.POSTER_POSTS}
+ +{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/user_menu.html b/root/styles/prosilver/template/portal/block/user_menu.html new file mode 100644 index 00000000..422819fd --- /dev/null +++ b/root/styles/prosilver/template/portal/block/user_menu.html @@ -0,0 +1,36 @@ + +
+ {USERNAME}
+ + {AVATAR_IMG} + + + +
{RANK_TITLE} +
{RANK_IMG} +
+
+ \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_bottom.html b/root/styles/prosilver/template/portal/blocks_bottom.html new file mode 100644 index 00000000..e33ceb11 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_bottom.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_left.html b/root/styles/prosilver/template/portal/blocks_left.html new file mode 100644 index 00000000..d4a55012 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_left.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_middle_bottom.html b/root/styles/prosilver/template/portal/blocks_middle_bottom.html new file mode 100644 index 00000000..c33e5933 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_middle_bottom.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_middle_top.html b/root/styles/prosilver/template/portal/blocks_middle_top.html new file mode 100644 index 00000000..a6629919 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_middle_top.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_right.html b/root/styles/prosilver/template/portal/blocks_right.html new file mode 100644 index 00000000..7a4aa2c9 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_right.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/blocks_top.html b/root/styles/prosilver/template/portal/blocks_top.html new file mode 100644 index 00000000..ec132c03 --- /dev/null +++ b/root/styles/prosilver/template/portal/blocks_top.html @@ -0,0 +1,24 @@ + + + {$LR_BLOCK_H_L}
style="background: url('{blocks.ICON}') no-repeat; padding-left: 20px; white-space: nowrap;">{blocks.TITLE}
{$LR_BLOCK_H_R} + + {blocks.TEXT} + + + + + + + + + + + + + + + + + {$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/index.html b/root/styles/prosilver/template/portal/index.html new file mode 100644 index 00000000..c3c1935f --- /dev/null +++ b/root/styles/prosilver/template/portal/index.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/portal_body.html b/root/styles/prosilver/template/portal/portal_body.html new file mode 100644 index 00000000..aacc1095 --- /dev/null +++ b/root/styles/prosilver/template/portal/portal_body.html @@ -0,0 +1,48 @@ + + + + + + +
+
+ {L_INFORMATION}: {PORTAL_VERSION_CHECK} +
+
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + +
+
+ +
+ + + + + \ No newline at end of file diff --git a/root/styles/prosilver/theme/portal.css b/root/styles/prosilver/theme/portal.css new file mode 100644 index 00000000..d6c59910 --- /dev/null +++ b/root/styles/prosilver/theme/portal.css @@ -0,0 +1,52 @@ +/* inner corners */ + +span.portal-corners-top-inner { + margin: 0 -5px; +} + +span.portal-corners-bottom-inner { + margin: 0 -5px; + clear: both; +} + +span.portal-corners-top-inner, span.portal-corners-bottom-inner{ + font-size: 1px; + line-height: 1px; + display: block; + height: 5px; + background-repeat: no-repeat; +} + +/* main menu, user menu and the links */ + +.portal-navigation{ +width: auto; +} + +.portal-navigation ul{ +list-style-type: none; +margin: 0; +padding: 0; +margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/ +} + +.portal-navigation ul li{ +padding-bottom: 2px; /*bottom spacing between menu items*/ +} + +.portal-navigation ul li a{ +background-image: url("{T_THEME_PATH}/images/portal/arrowbullet.gif"); +background-repeat: no-repeat; +background-position: center left; /*custom bullet list image*/ +display: block; +padding: 2px 0; +padding-left: 19px; /*link text is indented 19px*/ +font-weight: bold; +font-size: 90%; +} + +.portal-navigation div.menutitle{ +padding: 1px 0; +font: bold 90% 'Trebuchet MS', 'Lucida Grande', Arial, sans-serif; +font-size: 12px; +} \ No newline at end of file