1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-31 22:15:31 +01:00

topic watch/forum/topic read now cause a message to be displayed, changed profile ICQ for subSilver, various other changes

git-svn-id: file:///svn/phpbb/trunk@1093 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-09-26 22:12:38 +00:00
parent 33d7444cc4
commit 53dd64926a
5 changed files with 153 additions and 47 deletions

View File

@ -278,25 +278,16 @@ if($total_categories = $db->sql_numrows($q_categories))
if($forum_rows[$j]['username'] != "" && $forum_rows[$j]['post_time'] > 0)
{
if($forum_rows[$j]['user_id'] == ANONYMOUS && $forum_rows[$j]['post_username'] != '')
{
$last_poster = $forum_rows[$j]['post_username'];
}
else
{
$last_poster = $forum_rows[$j]['username'];
}
$last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]['post_time'], $board_config['board_timezone']);
$last_post = $last_post_time . "<br />" . $lang['by'] . " ";
$last_post .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $forum_rows[$j]['user_id']) . "\">" . $last_poster . "</a>&nbsp;";
$last_post .= ( $forum_rows[$j]['user_id'] == ANONYMOUS ) ? $forum_rows[$j]['username'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $forum_rows[$j]['user_id']) . "\">" . $forum_rows[$j]['username'] . "</a> ";
$last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $forum_rows[$j]['forum_last_post_id']) . "#" . $forum_rows[$j]['forum_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>";
}
else
{
$last_post = $lang['No_Posts'];
$forum_rows[$j]['forum_name'] = $forum_rows[$j]['forum_name'];
}
$mod_count = 0;

View File

@ -162,6 +162,7 @@ $lang['theforums'] = "the forums";
$lang['No_new_posts'] = "No new posts";
$lang['New_posts'] = "New posts";
$lang['New_post'] = "New post";
$lang['No_new_posts_hot'] = "No new posts [ Popular ]";
$lang['New_posts_hot'] = "New posts [ Popular ]";
$lang['Topic_is_locked'] = "Topic is locked";
@ -188,6 +189,8 @@ $lang['No_forums'] = "This board has no forums";
$lang['Private_Messages'] = "Private Messages";
$lang['Who_is_Online'] = "Who is Online";
$lang['Forums_marked_read'] = "All forums have been marked read";
//
// Viewforum
//
@ -203,6 +206,9 @@ $lang['Topic_Sticky'] = "<b>Sticky:</b>";
$lang['Topic_Moved'] = "<b>Moved:</b>";
$lang['Topic_Poll'] = "<b>[ Poll ]</b>";
$lang['View_newest_posts'] = "View posts since your last visit";
$lang['Topics_marked_read'] = "The topics for this forum have now been marked read";
//
// Viewtopic
//
@ -248,7 +254,8 @@ $lang['Split_topic'] = "Split this topic";
$lang['Stop_watching_topic'] = "Stop watching this topic";
$lang['Start_watching_topic'] = "Watch this topic for replies";
$lang['No_longer_watching'] = "You are no longer watching this topic";
$lang['You_are_watching'] = "You are now watching this topic";
//
// Posting/Replying (Not private messaging!)

View File

@ -259,9 +259,22 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if( !empty($profiledata['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $profiledata['user_icq'] . "#pager\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=" . $profiledata['user_icq'] . "&amp;img=5\" border=\"0\" alt=\"\" /></a>";
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $profiledata['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $profiledata['user_icq'] . "&amp;img=5\" border=\"0\" alt=\"\" /></a>";
$icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $profiledata['user_icq'] . "\"><img src=\"" . $images['icon_icq'] . "\" alt=\"" . $lang['ICQ'] . "\" border=\"0\" /></a>";
//
// This cannot stay like this, it needs a 'proper' solution, eg a separate
// template for overlaying the ICQ icon, or we just do away with the icq status
// display (which is after all somewhat a pain in the rear :D
//
if( $theme['template_name'] == "subSilver" )
{
$icq_add_img = '<table width="59" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap" class="icqback"><img src="images/spacer.gif" width="3" height="18" alt = "">' . $icq_status_img . '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="images/spacer.gif" width="35" height="18" border="0" alt="' . $lang['ICQ'] . '" /></a></td></tr></table>';
$icq_status_img = "";
}
else
{
$icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $profiledata['user_icq'] . "\"><img src=\"" . $images['icon_icq'] . "\" alt=\"" . $lang['ICQ'] . "\" border=\"0\" /></a>";
}
}
else
{

View File

@ -65,7 +65,7 @@ init_userprefs($userdata);
//
if(isset($forum_id))
{
$sql = "SELECT forum_name, forum_status, forum_topics, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_pollcreate, auth_vote, prune_enable, prune_next
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
if(!$result = $db->sql_query($sql))
@ -88,8 +88,6 @@ if(!$total_rows = $db->sql_numrows($result))
}
$forum_row = $db->sql_fetchrow($result);
$forum_name = $forum_row['forum_name'];
//
// Start auth check
//
@ -108,6 +106,57 @@ if(!$is_auth['auth_read'] || !$is_auth['auth_view'])
// End of auth check
//
//
// Handle marking posts
//
if( $mark_read == "topics" )
{
$sql = "SELECT t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id
AND p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['session_last_visit'] . "
AND t.topic_moved_id = NULL
LIMIT $start, " . $board_config['topics_per_page'];
if(!$t_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
}
if( $mark_read_rows = $db->sql_numrows($t_result) )
{
$mark_read_list = $db->sql_fetchrowset($t_result);
for($i = 0; $i < $mark_read_rows; $i++ )
{
$topic_id = $mark_read_list[$i]['topic_id'];
$post_time = $mark_read_list[$i]['post_time'];
if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
{
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
else
{
if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
{
setcookie('phpbb2_' . $forum_id . '_' . $topic_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=viewforum.' . $phpEx . '?' . POST_FORUM_URL . '=' . $forum_id . '">')
);
$message = $lang['Topics_marked_read'] . "<br /><br />" . $lang['Click'] . " <a href=\"viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id\">" . $lang['HERE'] . "</a> " . $lang['to_return_forum'];
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
//
// Do the forum Prune
//
@ -330,7 +379,7 @@ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
"FORUM_NAME" => $forum_row['forum_name'],
"MODERATORS" => $forum_moderators,
"IMG_POST" => ($forum_row['forum_status'] == FORUM_LOCKED) ? $images['post_locked'] : $images['post_new'],
@ -472,29 +521,13 @@ if($total_topics)
if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) && $topic_rowset[$i]['post_time'] > $userdata['session_last_visit'] )
{
if($mark_read == "topics")
{
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
$folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
}
else
{
$folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" />";
}
$folder_image = "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" />";
}
else
{
if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
{
if($mark_read == "topics")
{
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
$folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
}
else
{
$folder_image = ($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id] < $topic_rowset[$i]['post_time'] ) ? "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" />" : "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
}
$folder_image = ($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id] < $topic_rowset[$i]['post_time'] ) ? "<img src=\"$folder_new\" alt=\"" . $lang['New_posts'] . "\" />" : "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
}
else
{
@ -508,19 +541,19 @@ if($total_topics)
$topic_poster = $topic_rowset[$i]['username'];
$topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']);
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);
if($topic_rowset[$i]['id2'] == ANONYMOUS && $topic_rowset[$i]['post_username'] != '')
if($topic_rowset[$i]['post_time'] >= $userdata['session_last_visit'])
{
$last_post_user = $topic_rowset[$i]['post_username'];
$newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_posts'] . "\" border=\"0\" /></a> ";
}
else
{
$last_post_user = $topic_rowset[$i]['user2'];
$newest_post_img = "";
}
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);
$last_post = $last_post_time . "<br />" . $lang['by'] . " ";
$last_post .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $last_post_user . "</a>&nbsp;";
$last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $topic_rowset[$i]['user2'] . "</a> ";
$last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $topic_rowset[$i]['topic_last_post_id']) . "#" . $topic_rowset[$i]['topic_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>";
$views = $topic_rowset[$i]['topic_views'];
@ -532,6 +565,7 @@ if($total_topics)
"TOPIC_POSTER" => $topic_poster,
"GOTO_PAGE" => $goto_page,
"REPLIES" => $replies,
"NEWEST_POST_IMG" => $newest_post_img,
"TOPIC_TITLE" => $topic_title,
"TOPIC_TYPE" => $topic_type,
"VIEWS" => $views,

View File

@ -53,7 +53,41 @@ if( !isset($topic_id) && !isset($post_id) )
//
if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if($HTTP_GET_VARS["view"] == "next")
if( $HTTP_GET_VARS["view"] == "newest" )
{
if(isset($HTTP_COOKIE_VARS[$board_config['cookie_name']]))
{
$sessiondata = unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name']]));
$newest_time = $sessiondata['lastvisit'];
$sql = "SELECT post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_time >= $newest_time
ORDER BY post_time ASC
LIMIT 1";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain newer/older topic information", "", __LINE__, __FILE__, $sql);
}
if( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No new posts since your last visit');
}
else
{
$post_id = $row['post_id'];
header("Location: viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
}
}
else
{
header("Location: viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
}
}
else if($HTTP_GET_VARS["view"] == "next")
{
$sql_condition = ">";
$sql_ordering = "ASC";
@ -198,6 +232,13 @@ if($userdata['user_id'] != ANONYMOUS)
message_die(GENERAL_ERROR, "Couldn't delete topic watch information", "", __LINE__, __FILE__, $sql);
}
}
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $topic_id . '&amp;start=' . $start .'">')
);
$message = $lang['No_longer_watching']. "<br /><br />" . $lang['Click'] . " <a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start\">" . $lang['HERE'] . "</a> " . $lang['to_return_topic'];
message_die(GENERAL_MESSAGE, $message);
}
else
{
@ -235,6 +276,13 @@ if($userdata['user_id'] != ANONYMOUS)
message_die(GENERAL_ERROR, "Couldn't insert topic watch information", "", __LINE__, __FILE__, $sql);
}
}
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $topic_id . '&amp;start=' . $start .'">')
);
$message = $lang['You_are_watching']. "<br /><br />" . $lang['Click'] . " <a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start\">" . $lang['HERE'] . "</a> " . $lang['to_return_topic'];
message_die(GENERAL_MESSAGE, $message);
}
else
{
@ -623,6 +671,18 @@ for($i = 0; $i < $total_posts; $i++)
$poster_avatar = "";
}
//
// Define the little post icon
//
if( $postrow[$i]['post_time'] > $userdata['session_last_visit'] )
{
$mini_post_img = '<img src="' . $images['icon_minipost_new'] . '" alt="' . $lang['New_post'] . '" />';
}
else
{
$mini_post_img = '<img src="' . $images['icon_minipost'] . '" alt="' . $lang['Post'] . '" />';
}
//
// Generate ranks
//
@ -676,16 +736,16 @@ for($i = 0; $i < $total_posts; $i++)
if( !empty($postrow[$i]['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $postrow[$i]['user_icq'] . "#pager\"><img src=\"http://wwp.icq.com/scripts/online.dll?icq=" . $postrow[$i]['user_icq'] . "&amp;img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $postrow[$i]['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $postrow[$i]['user_icq'] . "&amp;img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
//
// This cannot stay like this, it needs a 'proper' solution, eg a separate
// template for overlaying the ICQ icon, or we just do away with the icq status
// display (which is after all somewhat a pain in the rear :D
// template for overlaying the ICQ icon, or we just do away with the icq status
// display (which is after all somewhat a pain in the rear :D
//
if( $theme['template_name'] == "subSilver" )
{
$icq_add_img = '<table width="59" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap" class="icqback"><img src="images/spacer.gif" width="3" height="18" alt = "">' . $icq_status_img . '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '"><img src="images/spacer.gif" width="35" height="18" border="0" alt="' . $lang['ICQ'] . '" /></a></td></tr></table>';
$icq_add_img = '<table width="59" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap" class="icqback"><img src="images/spacer.gif" width="3" height="18" alt = "">' . $icq_status_img . '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '"><img src="images/spacer.gif" width="35" height="18" border="0" alt="' . $lang['ICQ'] . '" /></a></td></tr></table>';
$icq_status_img = "";
}
else
@ -818,6 +878,7 @@ for($i = 0; $i < $total_posts; $i++)
$template->assign_block_vars("postrow", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"MINI_POST_IMG" => $mini_post_img,
"POSTER_NAME" => $poster,
"POSTER_RANK" => $poster_rank,
"RANK_IMAGE" => $rank_image,
@ -834,7 +895,7 @@ for($i = 0; $i < $total_posts; $i++)
"EMAIL_IMG" => $email_img,
"WWW_IMG" => $www_img,
"ICQ_STATUS_IMG" => $icq_status_img,
"ICQ_ADD_IMG" => $icq_add_img,
"ICQ_ADD_IMG" => $icq_add_img,
"AIM_IMG" => $aim_img,
"MSN_IMG" => $msn_img,
"YIM_IMG" => $yim_img,