|
From: <dac...@us...> - 2007-09-16 21:15:18
|
Revision: 63
http://thevr.svn.sourceforge.net/thevr/?rev=63&view=rev
Author: dachebodt
Date: 2007-09-16 14:15:22 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Re-adding forums and search mod
Added Paths:
-----------
mods/cms/trunk/modules/forums1/
mods/cms/trunk/modules/forums1/blocks/
mods/cms/trunk/modules/forums1/blocks/cms_polls.php
mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php
mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php
mods/cms/trunk/modules/forums1/cms_forums.php
mods/cms/trunk/modules/forums1/grp_forums.php
mods/cms/trunk/modules/forums1/info/
mods/cms/trunk/modules/forums1/info/cms_forums.php
mods/cms/trunk/modules/forums1/info/forums_info.php
mods/cms/trunk/modules/forums1/info/grp_forums.php
mods/cms/trunk/modules/forums1/language/
mods/cms/trunk/modules/forums1/language/en/
mods/cms/trunk/modules/forums1/language/en/admin.php
mods/cms/trunk/modules/forums1/language/en/common.php
mods/cms/trunk/modules/forums1/template/
mods/cms/trunk/modules/forums1/template/blank.html
mods/cms/trunk/modules/forums1/template/block_polls.html
mods/cms/trunk/modules/forums1/template/block_recent_topics.html
mods/cms/trunk/modules/forums1/template/block_wordgraph.html
mods/cms/trunk/modules/search1/
mods/cms/trunk/modules/search1/blocks/
mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php
mods/cms/trunk/modules/search1/cms_search.php
mods/cms/trunk/modules/search1/info/
mods/cms/trunk/modules/search1/info/cms_search.php
mods/cms/trunk/modules/search1/info/search_info.php
mods/cms/trunk/modules/search1/language/
mods/cms/trunk/modules/search1/language/en/
mods/cms/trunk/modules/search1/language/en/admin.php
mods/cms/trunk/modules/search1/language/en/common.php
mods/cms/trunk/modules/search1/template/
mods/cms/trunk/modules/search1/template/block_wordgraph.html
Added: mods/cms/trunk/modules/forums1/blocks/cms_polls.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/cms_polls.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/cms_polls.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,273 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: cms_polls.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Polls
+* @package phpBB3
+*/
+
+function polls_block($data)
+{
+ global $db, $phpbb_root_path, $phpEx, $mtemplate;
+ global $cache, $user, $auth, $config, $user_cache;
+
+ include_once($phpbb_root_path . 'modules/forums/functions_display.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+
+ $user->add_lang('viewtopic');
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sort_order = ($data['config']['poll_display_order']) ? 't.poll_start DESC' : 'RAND()';
+
+ $sql = 'SELECT t.topic_id, t.forum_id, t.topic_first_post_id, t.poll_vote_change, t.poll_length, t.poll_start, t.topic_status, f.forum_status, t.poll_max_options, t.poll_title
+ FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
+ WHERE t.poll_start > 0
+ AND f.forum_id = t.forum_id
+ AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . "
+ ORDER BY $sort_order LIMIT 1";
+ $result = $db->sql_query($sql);
+ $topic_data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $topic_id = $topic_data['topic_id'];
+ $forum_id = $topic_data['forum_id'];
+
+ // Does this topic contain a poll?
+ if ($forum_id && $topic_id)
+ {
+ $sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid
+ FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p
+ WHERE o.topic_id = $topic_id
+ AND p.post_id = {$topic_data['topic_first_post_id']}
+ AND p.topic_id = o.topic_id
+ ORDER BY o.poll_option_id";
+ $result = $db->sql_query($sql);
+
+ $poll_info = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $poll_info[] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ $cur_voted_id = array();
+ if ($user->data['is_registered'])
+ {
+ $sql = 'SELECT poll_option_id
+ FROM ' . POLL_VOTES_TABLE . '
+ WHERE topic_id = ' . $topic_id . '
+ AND vote_user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $cur_voted_id[] = $row['poll_option_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+ else
+ {
+ // Cookie based guest tracking ... I don't like this but hum ho
+ // it's oft requested. This relies on "nice" users who don't feel
+ // the need to delete cookies to mess with results.
+ if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
+ {
+ $cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
+ $cur_voted_id = array_map('intval', $cur_voted_id);
+ }
+ }
+
+ $s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
+ ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) &&
+ (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
+ $topic_data['topic_status'] != ITEM_LOCKED &&
+ $topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
+ $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
+
+ if ($update && $s_can_vote)
+ {
+ if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'])
+ {
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
+
+ meta_refresh(5, $redirect_url);
+
+ $message = (!sizeof($voted_id)) ? 'NO_VOTE_OPTION' : 'TOO_MANY_VOTE_OPTIONS';
+ $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+ trigger_error($message);
+ }
+
+ foreach ($voted_id as $option)
+ {
+ if (in_array($option, $cur_voted_id))
+ {
+ continue;
+ }
+
+ $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
+ SET poll_option_total = poll_option_total + 1
+ WHERE poll_option_id = ' . (int) $option . '
+ AND topic_id = ' . (int) $topic_id;
+ $db->sql_query($sql);
+
+ if ($user->data['is_registered'])
+ {
+ $sql_ary = array(
+ 'topic_id' => (int) $topic_id,
+ 'poll_option_id' => (int) $option,
+ 'vote_user_id' => (int) $user->data['user_id'],
+ 'vote_user_ip' => (string) $user->ip,
+ );
+
+ $sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+ }
+ }
+
+ foreach ($cur_voted_id as $option)
+ {
+ if (!in_array($option, $voted_id))
+ {
+ $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
+ SET poll_option_total = poll_option_total - 1
+ WHERE poll_option_id = ' . (int) $option . '
+ AND topic_id = ' . (int) $topic_id;
+ $db->sql_query($sql);
+
+ if ($user->data['is_registered'])
+ {
+ $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
+ WHERE topic_id = ' . (int) $topic_id . '
+ AND poll_option_id = ' . (int) $option . '
+ AND vote_user_id = ' . (int) $user->data['user_id'];
+ $db->sql_query($sql);
+ }
+ }
+ }
+
+ if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot'])
+ {
+ $user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
+ }
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET poll_last_vote = ' . time() . "
+ WHERE topic_id = $topic_id";
+ //, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
+ $db->sql_query($sql);
+
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
+
+ meta_refresh(5, $redirect_url);
+ trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
+ }
+
+ $poll_total = 0;
+ foreach ($poll_info as $poll_option)
+ {
+ $poll_total += $poll_option['poll_option_total'];
+ }
+
+ if ($poll_info[0]['bbcode_bitfield'])
+ {
+ $poll_bbcode = new bbcode();
+ }
+ else
+ {
+ $poll_bbcode = false;
+ }
+
+ for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
+ {
+ $poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
+ $poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
+
+ if ($poll_bbcode !== false)
+ {
+ $poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
+ }
+
+ $poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
+ }
+
+ $topic_data['poll_title'] = censor_text($topic_data['poll_title']);
+ $topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
+
+ if ($poll_bbcode !== false)
+ {
+ $poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
+ }
+ $topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
+
+ unset($poll_bbcode);
+
+ foreach ($poll_info as $poll_option)
+ {
+ $option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
+ $option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
+
+ $mtemplate->assign_block_vars('poll_option', array(
+ 'POLL_OPTION_ID' => $poll_option['poll_option_id'],
+ 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
+ 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
+ 'POLL_OPTION_PERCENT' => $option_pct_txt,
+ 'POLL_OPTION_PCT' => round($option_pct * 100),
+ 'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 10)),
+ 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
+ );
+ }
+
+ $poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
+
+ $mtemplate->assign_vars(array(
+ 'POLL_QUESTION' => $topic_data['poll_title'],
+ 'TOTAL_VOTES' => $poll_total,
+ 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
+ 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
+
+ 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
+ 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
+
+ 'S_HAS_POLL' => true,
+ 'S_CAN_VOTE' => $s_can_vote,
+ 'S_DISPLAY_RESULTS' => $s_display_results,
+ 'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false,
+ 'S_POLL_ACTION' => $viewtopic_url,
+
+ 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll')
+ );
+
+ unset($poll_end, $poll_info, $voted_id);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_polls.html')
+ );
+
+ $block['TITLE'] = $user->lang['POLLS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+ }
+}
+
+function polls_block_config()
+{
+ $block_config = array(
+ array('field' => 'poll_display_order', 'label' => 'ORDER_BY', 'type' => 'radio', 'value' => '0', 'options' => array(array('field' => '', 'value' => '1', 'label' => 'POST_TIME'), array('field' => '', 'value' => '0', 'label' => 'RANDOM'))),
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: cms_recent_topics.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Recent Topic Block
+* @package phpBB3
+*/
+
+function recent_topics_block($data)
+{
+ global $auth, $db, $bconfig, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sql_where = ' AND ' . $db->sql_in_set('forum_id', $forum_ary);
+ if ($bconfig['exclude_forums'])
+ {
+ $exclude_forums = explode(',', $bconfig['exclude_forums']);
+ $sql_where .= ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, true);
+ }
+
+ $sql = 'SELECT topic_title, forum_id, topic_id
+ FROM ' . TOPICS_TABLE . "
+ WHERE topic_status <> 2
+ AND topic_approved = 1
+ AND topic_title <> ''
+ AND topic_type = 0 " . $sql_where . '
+ ORDER BY topic_time DESC';
+ $result = $db->sql_query_limit($sql, $bconfig['max_topics']);
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $title = censor_text($row['topic_title']);
+ $mtemplate->assign_block_vars('recent_topics', array(
+ 'TITLE' => truncate_string($title, $bconfig['recent_title_limit']),
+ 'FULL_TITLE' => $title,
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_recent_topics.html')
+ );
+
+ $block['TITLE'] = $user->lang['RECENT_TOPICS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function recent_topics_block_config()
+{
+ $block_config = array(
+ array('field' => 'max_topics', 'label' => 'MAX_TOPICS', 'type' => 'text', 'value' => '5'),
+ array('field' => 'recent_title_limit', 'label' => 'RECENT_TITLE_LIMIT', 'type' => 'text', 'value' => '25'),
+ array('field' => 'exclude_forums', 'label' => 'EXCLUDE_FORUMS', 'type' => 'text', 'value' => '')
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: grp_recent_topics.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Recent Topic Block
+* @package phpBB3
+*/
+
+function recent_topics_block($data)
+{
+ global $auth, $db, $bconfig, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sql_where = ' AND ' . $db->sql_in_set('forum_id', $forum_ary);
+ if ($bconfig['exclude_forums'])
+ {
+ $exclude_forums = explode(',', $bconfig['exclude_forums']);
+ $sql_where .= ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, true);
+ }
+
+ $sql = 'SELECT topic_title, forum_id, topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_status <> 2
+ AND topic_approved = 1
+ AND topic_type = 0 ' . $sql_where . '
+ ORDER BY topic_time DESC';
+ $result = $db->sql_query_limit($sql, $bconfig['max_topics']);
+
+ while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
+ {
+ $mtemplate->assign_block_vars('recent_topics', array(
+ 'TITLE' => character_limit($row['topic_title'], $bconfig['recent_title_limit']),
+ 'FULL_TITLE' => censor_text($row['topic_title']),
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=forums&disp=topic&f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
+ )
+ );
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_recent_topics.html')
+ );
+
+ $block['TITLE'] = $user->lang['RECENT_TOPICS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function character_limit($data, $lim)
+{
+ return $data;
+}
+
+function recent_topics_block_config()
+{
+ $block_config = array(
+ array('field' => 'max_topics', 'label' => 'MAX_TOPICS', 'type' => 'text', 'value' => '5'),
+ array('field' => 'recent_title_limit', 'label' => 'RECENT_TITLE_LIMIT', 'type' => 'text', 'value' => '25'),
+ array('field' => 'exclude_forums', 'label' => 'EXCLUDE_FORUMS', 'type' => 'text', 'value' => '')
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/cms_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/cms_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/cms_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_forums
+* @package cms
+*/
+class cms_forums
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
+ $s_hidden_fields = '';
+
+ $mode = request_var('mode', '');
+ $action = request_var('action', false);
+ $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
+
+ display_forums('', $config['load_moderators']);
+
+ $template->assign_vars(array(
+ 'S_NO_CONTAINER' => true,
+ 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
+ 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
+ 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
+ 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
+ ));
+
+ $template->set_filenames(array(
+ 'body' => 'forumlist_body.html')
+ );
+
+ $u_other = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=$mode");
+ $u_forum = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=forum");
+
+ $template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($mode)), 'change');
+ $template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
+
+ $this->page_title = $user->lang['FORUMS'];
+ $module_block['TITLE'] = '';
+ $module_block['CONTENT'] = $template->assign_display('body');
+
+ $template->assign_block_vars('module', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/grp_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/grp_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/grp_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: gui_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* grp_forums
+* @package grp
+*/
+class grp_forums
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+
+ $s_hidden_fields = '';
+
+ $disp = request_var('disp', '');
+ $action = request_var('action', false);
+ $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
+
+ switch($disp)
+ {
+ case 'posting':
+
+ include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/posting.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/functions_posting.' . $phpEx);
+
+ display_posting();
+ $tpl_name = 'posting_body';
+
+ break;
+
+ case 'topic':
+
+ include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/viewtopic.' . $phpEx);
+
+ display_topic();
+ $tpl_name = 'viewtopic_body';
+
+ break;
+
+ default:
+
+ include($phpbb_root_path . 'modules/forums/viewforum.' . $phpEx);
+
+ $forum_id = 3; // $user->data['group_data']['forum_id'];
+ if($forum_id)
+ {
+ $url = "{$phpbb_root_path}memberlist.$phpEx?mode=group&g=14";
+ display_viewforums($forum_id, $url);
+ }
+
+ $template->set_filenames(array(
+ 'body' => 'viewforum_body.html')
+ );
+ $tpl_name = 'viewforum_body';
+
+ break;
+ }
+
+ $template->assign_vars(array('S_CMS_ENABLED' => true));
+
+ $template->set_filenames(array(
+ 'content' => $tpl_name . '.html')
+ );
+
+ $this->page_title = 'FORUMS';
+ $this->tpl_name = 'blank';
+
+ $module_block['TITLE'] = '';
+ $module_block['CONTENT'] = $template->assign_display('content');
+
+ $template->assign_block_vars('blockrow_c', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/cms_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/cms_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/cms_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_forums.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class cms_forums_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'cms_forums',
+ 'title' => 'CMS_COMMUNITY',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'forum' => array('title' => 'FORUMS', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'viewforum' => array('title' => 'VIEWFORUM', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'viewtopic' => array('title' => 'VIEWTOPIC', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'posting' => array('title' => 'POSTING', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ global $db;
+
+ $mods_ary = array('viewforum', 'viewtopic', 'posting');
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_display = 0
+ WHERE ' . $db->sql_in_set('module_mode', $mods_ary);
+ $db->sql_query($sql);
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/forums_info.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/forums_info.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/forums_info.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* @package ucp
+* @version $Id: ucp_attachments.php,v 1.3 2006/10/06 18:43:54 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+$module_info = array(
+ 'mod_name' => 'forums',
+ 'mod_disp_name' => 'Forums',
+ 'mod_short_desc' => 'Community forum',
+ 'mod_long_desc' => 'phpbb core forum',
+ 'mod_image' => '',
+ 'mod_author' => 'mod',
+ 'mod_contact' => 'www.phpbb.com',
+ 'mod_url' => 'www.phpbb.com',
+ 'mod_vers' => '1.00',
+ 'mod_compat' => 'rc4',
+ 'mod_type' => 'mod',
+ 'mod_demo_url' => '',
+ 'mod_dependents' => ''
+);
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/grp_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/grp_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/grp_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package grp
+* @version $Id: grp_forums.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class grp_forums_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'grp_forums',
+ 'title' => 'GRP_MODS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'forum' => array('title' => 'FORUMS', 'auth' => '', 'cat' => array('GRP_MODS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/language/en/admin.php
===================================================================
--- mods/cms/trunk/modules/forums1/language/en/admin.php (rev 0)
+++ mods/cms/trunk/modules/forums1/language/en/admin.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* blocks [English]
+*
+* @package language
+* @version $Id: style_generator.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'MAX_TOPICS' => 'Maximum number of topics',
+ 'RECENT_TITLE_LIMIT' => 'Maximum # of words for topic title',
+ 'EXCLUDE_FORUMS' => 'Exclude forums',
+ 'RANDOM' => 'Random',
+ 'ORDER_BY' => 'Order by',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/forums1/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/forums1/language/en/common.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package language
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CMS_COMMUNITY' => 'Community',
+ 'FORUMS_SEARCH' => 'Forums Search',
+ 'RECENT_TOPICS' => 'Recent Topics',
+ 'POLLS' => 'Polls',
+ 'FORUMS_ONLINE' => 'Board index',
+ 'SEARCH_FORUMS_ONLINE' => 'Searching forums',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/template/blank.html
===================================================================
Added: mods/cms/trunk/modules/forums1/template/block_polls.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_polls.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_polls.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,42 @@
+<form method="post" action="{S_POLL_ACTION}">
+<b>{POLL_QUESTION}</b><br />
+<!-- BEGIN poll_option -->
+ <!-- IF S_CAN_VOTE -->
+ <!-- IF S_IS_MULTI_CHOICE -->
+ <input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF -->/>
+ <!-- ELSE -->
+ <input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- IF S_CAN_VOTE -->
+ <label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label>
+ <!-- ELSE -->
+ {poll_option.POLL_OPTION_CAPTION}
+ <!-- ENDIF --><br />
+ <!-- IF S_DISPLAY_RESULTS --><dd class="resultbar"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT};">{poll_option.POLL_OPTION_RESULT}</div></dd>
+ <dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
+<!-- END poll_option -->
+ <p>{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE -->{L_MAX_VOTES}<!-- ENDIF --></p>
+
+ <!-- IF S_DISPLAY_RESULTS -->
+ <dl>
+ <dt> </dt>
+ <dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}</dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <!-- IF S_CAN_VOTE -->
+ <dl style="border-top: none;">
+ <dt> </dt>
+ <dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <!-- IF not S_DISPLAY_RESULTS -->
+ <dl style="border-top: none;">
+ <dt> </dt>
+ <dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
+ </dl>
+ <!-- ENDIF -->
+{S_HIDDEN_FIELDS}
+</form>
Added: mods/cms/trunk/modules/forums1/template/block_recent_topics.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_recent_topics.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_recent_topics.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,3 @@
+<!-- BEGIN recent_topics -->
+ <a href="{recent_topics.U_VIEW_TOPIC}" title="{recent_topics.FULL_TITLE}">{recent_topics.TITLE}</a><br />
+<!-- END recent_topics -->
Added: mods/cms/trunk/modules/forums1/template/block_wordgraph.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_wordgraph.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_wordgraph.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,3 @@
+<!-- BEGIN wordgraph -->
+ <a href="{wordgraph.WORD_URL}" style="font-size: {wordgraph.WORD_SIZE}px;">{wordgraph.WORD}</a>
+<!-- END wordgraph -->
Added: mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php
===================================================================
--- mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php (rev 0)
+++ mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,118 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: cms_wordgraph.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Word Graph Block
+* Based on nedka's Wordgraph Mod, contact: http://www.wonasti.com, ad...@wo...
+* @package phpBB3
+*/
+
+function wordgraph_block($data)
+{
+ global $auth, $db, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+ $topic_id = request_var('t', '');
+
+ // Get words and number of those words
+ if($topic_id)
+ {
+ $sql = 'SELECT l.word_text, COUNT(*) AS word_count
+ FROM ' . SEARCH_WORDLIST_TABLE . ' l, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . POSTS_TABLE . " p
+ WHERE m.word_id = l.word_id
+ AND m.post_id = p.post_id
+ AND p.topic_id = $topic_id
+ GROUP BY m.word_id
+ ORDER BY word_count DESC";
+ }
+ else
+ {
+ $sql = 'SELECT l.word_text, COUNT(*) AS word_count
+ FROM ' . SEARCH_WORDLIST_TABLE . ' l, ' . SEARCH_WORDMATCH_TABLE . " m
+ WHERE m.word_id = l.word_id
+ GROUP BY m.word_id
+ ORDER BY word_count DESC";
+ }
+ $result = $db->sql_query_limit($sql, $bconfig['wordgraph_word_number']);
+
+ $words_array = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $word = strtolower($row['word_text']);
+ $words_array[$word] = $row['word_count'];
+ }
+ $db->sql_freeresult($result);
+
+ // Get max value and min value of word count, use it to create word size
+ static $words_max, $words_min;
+ foreach (array_keys($words_array) as $word)
+ {
+ if ($words_array[$word] > $words_max)
+ {
+ $words_max = $words_array[$word];
+ }
+
+ if ($words_array[$word] < $words_min)
+ {
+ $words_min = $words_array[$word];
+ }
+ }
+
+ // Sort words in result
+ $words = array_keys($words_array);
+ sort($words);
+
+ foreach ($words as $word)
+ {
+ // Calculate word size and limit its size
+ $word_size = (int) $words_array[$word] * ($words_max - $words_min) / 2;
+
+ if ($word_size > $bconfig['wordgraph_max_size'])
+ {
+ $word_size = $bconfig['wordgraph_max_size'];
+ }
+
+ if ($word_size < $bconfig['wordgraph_min_size'])
+ {
+ $word_size = $bconfig['wordgraph_min_size'];
+ }
+
+ $mtemplate->assign_block_vars('wordgraph', array(
+ 'WORD' => ($bconfig['wordgraph_word_count']) ? $word . '(' . $words_array[$word] . ')' : $word,
+ 'WORD_SIZE' => $word_size,
+ 'WORD_URL' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=forums&mode=forum&disp=search&keywords=' . urlencode($word)),
+ ));
+ }
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_wordgraph.html')
+ );
+
+ $block['TITLE'] = $user->lang['WORDGRAPH'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function wordgraph_block_config()
+{
+ global $user;
+
+ return array(
+ array('field' => 'wordgraph_word_count', 'label' => 'ALLOW_WORD_COUNT', 'validate' => 'bool', 'explain' => true, 'type' => 'radio', 'value' => '1', 'options' => array(array('field' => '', 'value' => '1', 'label' => 'YES'), array('field' => '', 'value' => '0', 'label' => 'NO'))),
+ array('field' => 'wordgraph_word_number', 'label' => 'WORD_NUMBER', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '100', 'append' => ' ' . $user->lang['WORDS']),
+ array('field' => 'wordgraph_max_size', 'label' => 'WORD_MAX_SIZE', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '36', 'append' => ' ' . $user->lang['PIXEL']),
+ array('field' => 'wordgraph_min_size', 'label' => 'WORD_MIN_SIZE', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '9', 'append' => ' ' . $user->lang['PIXEL']),
+ );
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/search1/cms_search.php
===================================================================
--- mods/cms/trunk/modules/search1/cms_search.php (rev 0)
+++ mods/cms/trunk/modules/search1/cms_search.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,1113 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_search.php,v 1.210 2007/08/23 13:41:32 naderman Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_search
+* @package search
+*/
+class cms_search
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $_SID, $cache, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
+ $user->add_lang('search');
+
+ // Define initial vars
+ $search_id = request_var('search_id', '');
+ $start = max(request_var('start', 0), 0);
+ $post_id = request_var('p', 0);
+ $topic_id = request_var('t', 0);
+ $view = request_var('view', '');
+
+ $submit = request_var('submit', false);
+ $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $add_keywords = utf8_normalize_nfc(request_var('add_keywords', '', true));
+ $author = request_var('author', '', true);
+ $author_id = request_var('author_id', 0);
+ $show_results = ($topic_id) ? 'posts' : request_var('sr', 'posts');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ $search_terms = request_var('terms', 'all');
+ $search_fields = request_var('sf', 'all');
+ $search_child = request_var('sc', true);
+
+ $sort_days = request_var('st', 0);
+ $sort_key = request_var('sk', 't');
+ $sort_dir = request_var('sd', 'd');
+
+ $return_chars = request_var('ch', ($topic_id) ? -1 : 300);
+ $search_forum = request_var('fid', array(0));
+
+ // Is user able to search? Has search been disabled?
+ if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH');
+ }
+
+ // Check search load limit
+ if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load'])))
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_TIME');
+ }
+
+ // Check flood limit ... if applicable
+ $interval = ($user->data['user_id'] == ANONYMOUS) ? $config['search_anonymous_interval'] : $config['search_interval'];
+ if ($interval && !$auth->acl_get('u_ignoreflood'))
+ {
+ if ($user->data['user_last_search'] > time() - $interval)
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_TIME');
+ }
+ }
+
+ // Define some vars
+ $limit_days = array(0 => $user->lang['ALL_RESULTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['SORT_AUTHOR'], 't' => $user->lang['SORT_TIME'], 'f' => $user->lang['SORT_FORUM'], 'i' => $user->lang['SORT_TOPIC_TITLE'], 's' => $user->lang['SORT_POST_SUBJECT']);
+
+ $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+
+ if ($keywords || $author || $author_id || $search_id || $submit)
+ {
+ // clear arrays
+ $id_ary = array();
+
+ // egosearch is an author search
+ if ($search_id == 'egosearch')
+ {
+ $author_id = $user->data['user_id'];
+
+ if ($user->data['user_id'] == ANONYMOUS)
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
+ }
+ }
+
+ // If we are looking for authors get their ids
+ $author_id_ary = array();
+ if ($author_id)
+ {
+ $author_id_ary[] = $author_id;
+ }
+ else if ($author)
+ {
+ if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
+ {
+ trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
+ }
+
+ $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE $sql_where
+ AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ $result = $db->sql_query_limit($sql, 100);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $author_id_ary[] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!sizeof($author_id_ary))
+ {
+ trigger_error('NO_SEARCH_RESULTS');
+ }
+ }
+
+ // if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
+ // so we can keep the old keywords in their old mode, but add the new ones as required words
+ if ($add_keywords)
+ {
+ if ($search_terms == 'all')
+ {
+ $keywords .= ' ' . $add_keywords;
+ }
+ else
+ {
+ $search_terms = 'all';
+ $keywords = implode(' |', explode(' ', preg_replace('#\s+#u', ' ', $keywords))) . ' ' .$add_keywords;
+ }
+ }
+
+ // Which forums should not be searched? Author searches are also carried out in unindexed forums
+ if (empty($keywords) && sizeof($author_id_ary))
+ {
+ $ex_fid_ary = array_keys($auth->acl_getf('!f_read', true));
+ }
+ else
+ {
+ $ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
+ }
+
+ $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
+
+ $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
+ FROM ' . FORUMS_TABLE . ' f
+ LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
+ AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
+ $not_in_fid
+ ORDER BY f.left_id";
+ $result = $db->sql_query($sql);
+
+ $right_id = 0;
+ $reset_search_forum = true;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
+ {
+ $ex_fid_ary[] = (int) $row['forum_id'];
+ continue;
+ }
+
+ if (sizeof($search_forum))
+ {
+ if ($search_child)
+ {
+ if (in_array($row['forum_id'], $search_forum) && $row['right_id'] > $right_id)
+ {
+ $right_id = (int) $row['right_id'];
+ }
+ else if ($row['right_id'] < $right_id)
+ {
+ continue;
+ }
+ }
+
+ if (!in_array($row['forum_id'], $search_forum))
+ {
+ $ex_fid_ary[] = (int) $row['forum_id'];
+ $reset_search_forum = false;
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ // find out in which forums the user is allowed to view approved posts
+ 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';
+ }
+
+ if ($reset_search_forum)
+ {
+ $search_forum = array();
+ }
+
+ // Select which method we'll use to obtain the post_id or topic_id information
+ $search_type = basename($config['search_type']);
+
+ if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ {
+ trigger_error('NO_SUCH_SEARCH_MODULE');
+ }
+
+ require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+
+ // We do some additional checks in the module to ensure it can actually be utilised
+ $error = false;
+ $search = new $search_type($error);
+
+ if ($error)
+ {
+ trigger_error($error);
+ }
+
+ // let the search module split up the keywords
+ if ($keywords)
+ {
+ $correct_query = $search->split_keywords($keywords, $search_terms);
+ if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
+ {
+ $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
+ trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
+ }
+ }
+
+ if (!$keywords && sizeof($author_id_ary))
+ {
+ // if it is an author search we want to show topics by default
+ $show_results = ($topic_id) ? 'posts' : request_var('sr', ($search_id == 'egosearch') ? 'topics' : 'posts');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ }
+
+ // define some variables needed for retrieving post_id/topic_id information
+ $sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'));
+
+ // pre-made searches
+ $sql = $field = $l_search_title = '';
+ if ($search_id)
+ {
+ switch ($search_id)
+ {
+ // Oh holy Bob, bring us some activity...
+ case 'active_topics':
+ $l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS'];
+ $show_results = 'topics';
+ $sort_key = 't';
+ $sort_dir = 'd';
+ $sort_days = request_var('st', 7);
+ $sort_by_sql['t'] = 't.topic_last_post_time';
+
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+ $s_sort_key = $s_sort_dir = '';
+
+ $last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : '';
+
+ $sql = 'SELECT t.topic_last_post_time, t.topic_id
+ FROM ' . TOPICS_TABLE . " t
+ WHERE t.topic_moved_id = 0
+ $last_post_time_sql
+ " . 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) : '') . '
+ ORDER BY t.topic_last_post_time DESC';
+ $field = 'topic_id';
+ break;
+
+ case 'unanswered':
+ $l_search_title = $user->lang['SEARCH_UNANSWERED'];
+ $show_results = request_var('sr', 'topics');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
+ $sort_by_sql['s'] = ($show_results == 'posts') ? 'p.post_subject' : 't.topic_title';
+ $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+ $sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : '';
+ $sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort;
+
+ if ($sort_days)
+ {
+ $last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600));
+ }
+ else
+ {
+ $last_post_time = '';
+ }
+
+
+ if ($sort_key == 'a')
+ {
+ $sort_join = USERS_TABLE . ' u, ';
+ $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort;
+ }
+ if ($show_results == 'posts')
+ {
+ $sql = "SELECT p.post_id
+ FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ WHERE t.topic_replies = 0
+ AND p.topic_id = t.topic_id
+ $last_post_time
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id
+ FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ WHERE t.topic_replies = 0
+ AND t.topic_moved_id = 0
+ AND p.topic_id = t.topic_id
+ $last_post_time
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'topic_id';
+ }
+ break;
+
+ case 'newposts':
+ $l_search_title = $user->lang['SEARCH_NEW'];
+ // force sorting
+ $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
+ $sort_key = 't';
+ $sort_dir = 'd';
+ $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
+ $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+ $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
+
+ if ($show_results == 'posts')
+ {
+ $sql = 'SELECT p.post_id
+ FROM ' . POSTS_TABLE . ' p
+ WHERE p.post_time > ' . $user->data['user_lastvisit'] . "
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = 'SELECT t.topic_id
+ 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) : '') . "
+ $sql_sort";
+ $field = 'topic_id';
+ }
+ break;
+
+ case 'egosearch':
+ $l_search_title = $user->lang['SEARCH_SELF'];
+ break;
+ }
+ }
+
+ // show_results should not change after this
+ $per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page'];
+ $total_match_count = 0;
+
+ if ($search_id)
+ {
+ if ($sql)
+ {
+ // only return up to 1000 ids (the last one will be removed later)
+ $result = $db->sql_query_limit($sql, 1001 - $start, $start);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $db->sql_freeresult($result);
+
+ $total_match_count = sizeof($id_ary) + $start;
+ $id_ary = array_slice($id_ary, 0, $per_page);
+ }
+ else
+ {
+ $search_id = '';
+ }
+ }
+
+ // make sure that some arrays are always in the same order
+ sort($ex_fid_ary);
+ sort($m_approve_fid_ary);
+ sort($author_id_ary);
+
+ if (!empty($search->search_query))
+ {
+ $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+ }
+ else if (sizeof($author_id_ary))
+ {
+ $firstpost_only = ($search_fields === 'firstpost') ? true : false;
+ $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+ }
+
+ // For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
+ if (!sizeof($id_ary) && !$search_id)
+ {
+ trigger_error('NO_SEARCH_RESULTS');
+ }
+
+ $sql_where = '';
+
+ if (sizeof($id_ary))
+ {
+ $sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary);
+ $sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . ' OR f.forum_id IS NULL)' : '';
+ $sql_where .= ($show_results == 'posts') ? $m_approve_fid_sql : str_replace(array('p.post_approved', 'p.forum_id'), array('t.topic_approved', 't.forum_id'), $m_approve_fid_sql);
+ }
+
+ if ($show_results == 'posts')
+ {
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ }
+ else
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
+
+ // Grab icons
+ $icons = $cache->obtain_icons();
+
+ // Output header
+ if ($search_id && ($total_match_count > 1000))
+ {
+ // limit the number to 1000 for pre-made searches
+ $total_match_count--;
+ $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count);
+ }
+ else
+ {
+ $l_search_matches = ($total_match_count == 1) ? sprintf($user->lang['FOUND_SEARCH_MATCH'], $total_match_count) : sprintf($user->lang['FOUND_SEARCH_MATCHES'], $total_match_count);
+ }
+
+ // define some vars for urls
+ $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords))));
+ $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
+ $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : '';
+ $u_search_forum = implode('&fid%5B%5D=', $search_forum);
+
+ $u_search = append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&' . $u_sort_param . $u_show_results);
+ $u_search .= ($search_id) ? '&search_id=' . $search_id : '';
+ $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
+ $u_search .= ($topic_id) ? '&t=' . $topic_id : '';
+ $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : '';
+ $u_search .= ($author_id) ? '&author_id=' . $author_id : '';
+ $u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : '';
+ $u_search .= (!$search_child) ? '&sc=0' : '';
+ $u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : '';
+ $u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';
+
+ $template->assign_vars(array(
+ 'SEARCH_TITLE' => $l_search_title,
+ 'SEARCH_MATCHES' => $l_search_matches,
+ 'SEARCH_WORDS' => $search->search_query,
+ 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
+ 'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
+ 'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
+ 'TOTAL_MATCHES' => $total_match_count,
+ 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
+
+ 'S_SELECT_SORT_DIR' => $s_sort_dir,
+ 'S_SELECT_SORT_KEY' => $s_sort_key,
+ 'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_SEARCH_ACTION' => $u_search,
+ 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
+
+ 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
+ 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
+ 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
+ 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+
+ 'U_SEARCH_WORDS' => $u_search,
+ ));
+
+ if ($sql_where)
+ {
+ if ($show_results == 'posts')
+ {
+ // @todo Joining this query to the one below?
+ $sql = 'SELECT zebra_id, friend, foe
+ FROM ' . ZEBRA_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ $zebra = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $zebra[($row['friend']) ? 'friend' : 'foe'][] = $row['zebra_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour
+ FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id)
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id)
+ LEFT JOIN ' . USERS_TABLE . " u ON (p.poster_id = u.user_id)
+ WHERE $sql_where";
+ }
+ else
+ {
+ $sql_from = TOPICS_TABLE . ' t
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = t.forum_id)
+ ' . (($sort_key == 'a') ? ' LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = t.topic_poster) ' : '');
+ $sql_select = 't.*, f.forum_id, f.forum_name';
+
+ if ($user->data['is_registered'])
+ {
+ if ($config['load_db_track'])
+ {
+ $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.user_id = ' . $user->data['user_id'] . '
+ AND t.topic_id = tp.topic_id)';
+ $sql_select .= ', tp.topic_posted';
+ }
+
+ if ($config['load_db_lastread'])
+ {
+ $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.user_id = ' . $user->data['user_id'] . '
+ AND t.topic_id = tt.topic_id)
+ LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
+ AND ft.forum_id = f.forum_id)';
+ $sql_select .= ', tt.mark_time, ft.mark_time as f_mark_time';
+ }
+ }
+
+ if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
+ {
+ $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
+ }
+
+ $sql = "SELECT $sql_select
+ FROM $sql_from
+ WHERE $sql_where";
+ }
+ $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+ $result = $db->sql_query($sql);
+ $result_topic_id = 0;
+
+ $rowset = array();
+
+ if ($show_results == 'topics')
+ {
+ $forums = $rowset = $shadow_topic_list = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['topic_status'] == ITEM_MOVED)
+ {
+ $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
+ }
+
+ $rowset[$row['topic_id']] = $row;
+
+ if (!isset($forums[$row['forum_id']]) && $user->data['is_registered'] && $config['load_db_lastread'])
+ {
+ $forums[$row['forum_id']]['mark_time'] = $row['f_mark_time'];
+ }
+ $forums[$row['forum_id']]['topic_list'][] = $row['topic_id'];
+ $forums[$row['forum_id']]['rowset'][$row['topic_id']] = &$rowset[$row['topic_id']];
+ }
+ $db->sql_freeresult($result);
+
+ // If we have some shadow topics, update the rowset to reflect their topic information
+ if (sizeof($shadow_topic_list))
+ {
+ $sql = 'SELECT *
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $orig_topic_id = $shadow_topic_list[$row['topic_id']];
+
+ // We want to retain some values
+ $row = array_merge($row, array(
+ 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
+ 'topic_status' => $rowset[$orig_topic_id]['topic_status'],
+ 'forum_name' => $rowset[$orig_topic_id]['forum_name'])
+ );
+
+ $rowset[$orig_topic_id] = $row;
+ }
+ $db->sql_freeresult($result);
+ }
+ unset($shadow_topic_list);
+
+ foreach ($forums as $forum_id => $forum)
+ {
+ if ($user->data['is_registered'] && $config['load_db_lastread'])
+ {
+ $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
+
+ if (!$user->data['is_registered'])
+ {
+ $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
+ }
+ }
+ }
+ unset($forum...
[truncated message content] |