|
From: Paul S. O. <ps...@us...> - 2001-12-14 02:39:47
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv11288
Modified Files:
viewtopic.php viewforum.php index.php search.php
Log Message:
Remove guest user topic tracking via cookies, update viewtopic to re-fix highlighting of search terms, add lang capability to images, various other issues, removed remote avatar size reduction
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -r1.149 -r1.150
*** viewtopic.php 2001/12/14 02:15:32 1.149
--- viewtopic.php 2001/12/14 02:39:44 1.150
***************
*** 389,393 ****
// Go ahead and pull all data for this topic
//
! $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
--- 389,393 ----
// Go ahead and pull all data for this topic
//
! $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
***************
*** 741,762 ****
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
! $poster_posts = ($postrow[$i]['user_id'] != ANONYMOUS) ? $lang['Posts'] . ": " . $postrow[$i]['user_posts'] : "";
! $poster_from = ($postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS) ? $lang['Location'] . ": " . $postrow[$i]['user_from'] : "";
! $poster_joined = ($postrow[$i]['user_id'] != ANONYMOUS) ? $lang['Joined'] . ": " . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : "";
! if( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS )
{
switch( $postrow[$i]['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
! $poster_avatar = ( $board_config['avatar_upload_db'] ) ? "<img src=\"avatar.$phpEx?p=" . $postrow[$i]['post_id'] . "\" alt=\"\" />" : "<img src=\"" . $board_config['avatar_path'] . "/" . $postrow[$i]['user_avatar'] . "\" alt=\"\" border=\"\" />";
break;
case USER_AVATAR_REMOTE:
! $poster_avatar = "<img src=\"" . $postrow[$i]['user_avatar'] . "\" width=\"".$board_config['avatar_max_width']."\" height=\"".$board_config['avatar_max_height']."\" alt=\"\" border=\"\" />";
break;
case USER_AVATAR_GALLERY:
! $poster_avatar = "<img src=\"" . $board_config['avatar_gallery_path'] . "/" . $postrow[$i]['user_avatar'] . "\" alt=\"\" border=\"\" />";
break;
}
--- 741,762 ----
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
! $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ": " . $postrow[$i]['user_posts'] : "";
! $poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ": " . $postrow[$i]['user_from'] : "";
! $poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ": " . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : "";
! if( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
{
switch( $postrow[$i]['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
! $poster_avatar = ( $board_config['avatar_upload_db'] ) ? "<img src=\"avatar.$phpEx?p=" . $postrow[$i]['post_id'] . "\" alt=\"\" />" : "<img src=\"" . $board_config['avatar_path'] . "/" . $postrow[$i]['user_avatar'] . "\" alt=\"\" border=\"0\" />";
break;
case USER_AVATAR_REMOTE:
! $poster_avatar = "<img src=\"" . $postrow[$i]['user_avatar'] . "\" alt=\"\" border=\"0\" />";
break;
case USER_AVATAR_GALLERY:
! $poster_avatar = "<img src=\"" . $board_config['avatar_gallery_path'] . "/" . $postrow[$i]['user_avatar'] . "\" alt=\"\" border=\"0\" />";
break;
}
***************
*** 940,951 ****
//
- // Highlight active words (primarily for search)
- //
- if( $highlight_active )
- {
- $message = preg_replace($highlight_match, $highlight_replace, $message);
- }
-
- //
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
--- 940,943 ----
***************
*** 989,993 ****
$message = make_clickable($message);
!
//
// Replace naughty words
--- 981,993 ----
$message = make_clickable($message);
!
! //
! // Highlight active words (primarily for search)
! //
! if( $highlight_active )
! {
! $message = preg_replace($highlight_match, $highlight_replace, $message);
! }
!
//
// Replace naughty words
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -r1.109 -r1.110
*** viewforum.php 2001/12/14 02:19:57 1.109
--- viewforum.php 2001/12/14 02:39:44 1.110
***************
*** 113,138 ****
if( $mark_read == "topics" )
{
! $sql = "SELECT MAX(post_time) AS last_post
! FROM " . POSTS_TABLE . "
! WHERE forum_id = $forum_id";
! if( !$result = $db->sql_query($sql) )
{
! message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql);
! }
!
! if( $db->sql_numrows($result) )
! {
! $row = $db->sql_fetchrow($result);
! if( $row['last_post'] > $userdata['session_last_visit'] )
{
! setcookie($board_config['cookie_name'] . "_f_$forum_id", time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
! // session_send_cookie("_f_$forum_id", time(), 0);
}
- }
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
! );
$message = $lang['Topics_marked_read'] . "<br /><br />" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a> ");
--- 113,140 ----
if( $mark_read == "topics" )
{
! if( $userdata['session_logged_in'] )
{
! $sql = "SELECT MAX(post_time) AS last_post
! FROM " . POSTS_TABLE . "
! WHERE forum_id = $forum_id";
! if( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql);
! }
! if( $db->sql_numrows($result) )
{
! $row = $db->sql_fetchrow($result);
!
! if( $row['last_post'] > $userdata['user_lastvisit'] )
! {
! setcookie($board_config['cookie_name'] . "_f_$forum_id", time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
! }
}
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
! );
! }
$message = $lang['Topics_marked_read'] . "<br /><br />" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a> ");
***************
*** 359,362 ****
--- 361,375 ----
"IMG_POST" => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],
+ "FOLDER_IMG" => $images['folder'],
+ "FOLDER_NEW_IMG" => $images['folder_new'],
+ "FOLDER_HOT_IMG" => $images['folder_hot'],
+ "FOLDER_HOT_NEW_IMG" => $images['folder_hot_new'],
+ "FOLDER_LOCKED_IMG" => $images['folder_locked'],
+ "FOLDER_LOCKED_NEW_IMG" => $images['folder_locked_new'],
+ "FOLDER_STICKY_IMG" => $images['folder_sticky'],
+ "FOLDER_STICKY_NEW_IMG" => $images['folder_sticky_new'],
+ "FOLDER_ANNOUNCE_IMG" => $images['folder_announce'],
+ "FOLDER_ANNOUNCE_NEW_IMG" => $images['folder_announce_new'],
+
"L_MARK_TOPICS_READ" => $lang['Mark_all_topics'],
"L_POST_NEW_TOPIC" => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],
***************
*** 500,535 ****
}
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"]) ||
! isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) ||
! isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
{
! $unread_topics = true;
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"]) )
! {
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"] > $topic_rowset[$i]['post_time'] )
{
! $unread_topics = false;
}
- }
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) )
! {
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"] > $topic_rowset[$i]['post_time'] )
{
! $unread_topics = false;
}
- }
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
! {
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"] > $topic_rowset[$i]['post_time'] )
{
! $unread_topics = false;
}
! }
! if( $unread_topics )
{
$folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" title=\"" . $lang['New_posts'] . "\" />";
--- 513,565 ----
}
! if( $userdata['session_logged_in'] )
{
+ if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"]) ||
+ isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) ||
+ isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
+ {
! $unread_topics = true;
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"]) )
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$topic_id"] > $topic_rowset[$i]['post_time'] )
! {
! $unread_topics = false;
! }
}
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) )
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"] > $topic_rowset[$i]['post_time'] )
! {
! $unread_topics = false;
! }
}
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"] > $topic_rowset[$i]['post_time'] )
! {
! $unread_topics = false;
! }
}
!
! if( $unread_topics )
! {
! $folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" title=\"" . $lang['New_posts'] . "\" />";
!
! $newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_post'] . "\" title=\"" . $lang['View_newest_post'] . "\" border=\"0\" /></a> ";
! }
! else
! {
! $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
!
! $folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" title=\"$folder_alt\" border=\"0\" />";
! $newest_post_img = "";
! }
! }
! else if( $topic_rowset[$i]['post_time'] > $userdata['session_last_visit'] )
{
$folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" title=\"" . $lang['New_posts'] . "\" />";
***************
*** 537,556 ****
$newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_post'] . "\" title=\"" . $lang['View_newest_post'] . "\" border=\"0\" /></a> ";
}
! else
{
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
-
$folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" title=\"$folder_alt\" border=\"0\" />";
$newest_post_img = "";
}
-
}
! else if( $topic_rowset[$i]['post_time'] > $userdata['session_last_visit'] )
! {
! $folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" title=\"" . $lang['New_posts'] . "\" />";
!
! $newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_post'] . "\" title=\"" . $lang['View_newest_post'] . "\" border=\"0\" /></a> ";
! }
! else
{
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
--- 567,578 ----
$newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_post'] . "\" title=\"" . $lang['View_newest_post'] . "\" border=\"0\" /></a> ";
}
! else
{
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
$folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" title=\"$folder_alt\" border=\"0\" />";
$newest_post_img = "";
}
}
! else
{
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
***************
*** 644,646 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
--- 666,668 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
\ No newline at end of file
Index: index.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/index.php,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -r1.81 -r1.82
*** index.php 2001/12/10 01:19:12 1.81
--- index.php 2001/12/14 02:39:44 1.82
***************
*** 34,37 ****
--- 34,43 ----
//
+ while( list($key, $value) = @each($images) )
+ {
+
+
+ }
+
$viewcat = (!empty($HTTP_GET_VARS['viewcat'])) ? $HTTP_GET_VARS['viewcat'] : -1;
***************
*** 50,70 ****
if( $mark_read == "forums" )
{
! $sql = "SELECT MAX(post_time) AS last_post
! FROM " . POSTS_TABLE;
! if(!$result = $db->sql_query($sql))
{
! message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql);
! }
! if( $forum_count = $db->sql_numrows($result) )
! {
! $mark_read_list = $db->sql_fetchrow($result);
! $last_post_time = $mark_read_list['last_post'];
! if( $last_post_time > $userdata['session_last_visit'] )
! {
! setcookie($board_config['cookie_name'] . "_f_all", time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
! // session_send_cookie("_f_all", time(), 0);
}
}
--- 56,78 ----
if( $mark_read == "forums" )
{
! if( $userdata['session_logged_in'] )
{
! $sql = "SELECT MAX(post_time) AS last_post
! FROM " . POSTS_TABLE;
! if(!$result = $db->sql_query($sql))
! {
! message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql);
! }
! if( $forum_count = $db->sql_numrows($result) )
! {
! $mark_read_list = $db->sql_fetchrow($result);
! $last_post_time = $mark_read_list['last_post'];
! if( $last_post_time > $userdata['user_lastvisit'] )
! {
! setcookie($board_config['cookie_name'] . "_f_all", time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
! }
}
}
***************
*** 172,189 ****
$forum_rows = $db->sql_fetchrowset($q_forums);
! $sql = "SELECT f.forum_id, t.topic_id, p.post_time
! FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
! WHERE t.forum_id = f.forum_id
! AND p.post_id = t.topic_last_post_id
! AND p.post_time > " . $userdata['session_last_visit'] . "
! AND t.topic_moved_id IS NULL";
! if(!$new_topic_ids = $db->sql_query($sql))
{
! message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql);
! }
! while( $topic_data = $db->sql_fetchrow($new_topic_ids) )
! {
! $new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
--- 180,200 ----
$forum_rows = $db->sql_fetchrowset($q_forums);
! if( $userdata['session_logged_in'] )
{
! $sql = "SELECT f.forum_id, t.topic_id, p.post_time
! FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
! WHERE t.forum_id = f.forum_id
! AND p.post_id = t.topic_last_post_id
! AND p.post_time > " . $userdata['session_last_visit'] . "
! AND t.topic_moved_id IS NULL";
! if(!$new_topic_ids = $db->sql_query($sql))
! {
! message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql);
! }
! while( $topic_data = $db->sql_fetchrow($new_topic_ids) )
! {
! $new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
! }
}
***************
*** 237,240 ****
--- 248,255 ----
"NEWEST_USER" => sprintf($lang['Newest_user'], "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . "\">", $newest_user, "</a>"),
+ "FORUM_IMG" => $images['forum'],
+ "FORUM_NEW_IMG" => $images['forum_new'],
+ "FORUM_LOCKED_IMG" => $images['forum_locked'],
+
"L_FORUM_LOCKED" => $lang['Forum_is_locked'],
"L_MARK_FORUMS_READ" => $lang['Mark_all_forums'],
***************
*** 277,320 ****
{
$unread_topics = false;
! if( count($new_topic_data[$forum_id]) )
{
! $forum_last_post_time = 0;
!
! while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
{
! if( !isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$check_topic_id"]) )
! {
! // echo "NOT SET :: $forum_id :: $check_topic_id <BR>\n";
! $unread_topics = true;
! $forum_last_post_time = max($check_post_time, $forum_last_post_time);
! }
! else
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$check_topic_id"] < $check_post_time )
{
- // echo "SET :: $forum_id :: $check_topic_id <BR>\n";
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
}
}
- }
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) )
! {
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"] > $forum_last_post_time )
{
! $unread_topics = false;
}
- }
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
! {
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"] > $forum_last_post_time )
{
! $unread_topics = false;
}
- }
}
--- 292,336 ----
{
$unread_topics = false;
! if( $userdata['session_logged_in'] )
{
! if( count($new_topic_data[$forum_id]) )
{
! $forum_last_post_time = 0;
! while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
{
! if( !isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$check_topic_id"]) )
{
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
+
}
+ else
+ {
+ if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t_$check_topic_id"] < $check_post_time )
+ {
+ $unread_topics = true;
+ $forum_last_post_time = max($check_post_time, $forum_last_post_time);
+ }
+ }
}
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"]) )
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_$forum_id"] > $forum_last_post_time )
! {
! $unread_topics = false;
! }
}
! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"]) )
{
! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f_all"] > $forum_last_post_time )
! {
! $unread_topics = false;
! }
}
+ }
}
***************
*** 325,329 ****
$topics = $forum_rows[$j]['forum_topics'];
! if($forum_rows[$j]['username'] != "" && $forum_rows[$j]['post_time'] > 0)
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]['post_time'], $board_config['board_timezone']);
--- 341,345 ----
$topics = $forum_rows[$j]['forum_topics'];
! if( $forum_rows[$j]['username'] != "" && $forum_rows[$j]['post_time'] > 0 )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]['post_time'], $board_config['board_timezone']);
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/search.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** search.php 2001/12/11 09:13:03 1.44
--- search.php 2001/12/14 02:39:44 1.45
***************
*** 266,273 ****
if( $search_id == "newposts" )
{
! $sql = "SELECT post_id
! FROM " . POSTS_TABLE . "
! WHERE post_time >= " . $userdata['session_last_visit'] . "
! ORDER BY post_time DESC";
}
else if( $search_id == "egosearch" )
--- 266,280 ----
if( $search_id == "newposts" )
{
! if( $userdata['session_logged_in'] )
! {
! $sql = "SELECT post_id
! FROM " . POSTS_TABLE . "
! WHERE post_time >= " . $userdata['user_lastvisit'] . "
! ORDER BY post_time DESC";
! }
! else
! {
! message_die(GENERAL_MESSAGE, $lang['No_search_match']);
! }
}
else if( $search_id == "egosearch" )
***************
*** 556,560 ****
// Define common SQL
//
! $sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.post_subject, p.post_id, p.post_time, p.post_username, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ;
$sql_from = ( $show_results == "posts") ? FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt" : FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2";
--- 563,567 ----
// Define common SQL
//
! $sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.bbcode_uid, pt.post_subject, p.post_id, p.post_time, p.post_username, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ;
$sql_from = ( $show_results == "posts") ? FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt" : FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2";
***************
*** 883,887 ****
if( $showresults == "posts" )
{
! if($return_chars != 0 )
{
$bbcode_uid = $searchset[$i]['bbcode_uid'];
--- 890,894 ----
if( $showresults == "posts" )
{
! if( $return_chars )
{
$bbcode_uid = $searchset[$i]['bbcode_uid'];
***************
*** 910,920 ****
$user_sig_bbcode_uid = $searchset[$i]['user_sig_bbcode_uid'];
-
-
- if( count($search_string) )
- {
- $message = preg_replace($search_string, $replace_string, $message);
- }
-
if( !$board_config['allow_html'] )
{
--- 917,920 ----
***************
*** 946,949 ****
--- 946,955 ----
$message = make_clickable($message);
+
+ if( count($search_string) )
+ {
+ $message = preg_replace($search_string, $replace_string, $message);
+ }
+
}
|