|
From: Doug K. <dou...@us...> - 2001-10-16 01:00:50
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv32362
Modified Files:
config.php viewforum.php viewtopic.php
Log Message:
Just the start to the wonderful world of global announcements. Adds support for them as well as creates a new forum, id -1. Do not delete the forum. I'll write the admin later.
Index: config.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/config.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** config.php 2001/10/14 20:05:48 1.40
--- config.php 2001/10/16 01:00:47 1.41
***************
*** 0 ****
--- 1,19 ----
+ <?php
+
+ //
+ // phpBB 2.x auto-generated config file
+ // Do not change anything in this file!
+ //
+
+ $dbms = "mysql";
+
+ $dbhost = "127.0.0.1";
+ $dbname = "devphpbb2";
+ $dbuser = "dougk";
+ $dbpasswd = "dougk";
+
+ $table_prefix = "phpbb_";
+
+ define('PHPBB_INSTALLED', true);
+
+ ?>
\ No newline at end of file
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -r1.91 -r1.92
*** viewforum.php 2001/10/14 18:22:32 1.91
--- viewforum.php 2001/10/16 01:00:47 1.92
***************
*** 436,447 ****
--- 436,450 ----
{
$topic_type = $lang['Topic_Announcement'] . " ";
+ $is_announcement = TRUE;
}
else if($topic_type == POST_STICKY)
{
$topic_type = $lang['Topic_Sticky'] . " ";
+ $is_announcement = FALSE;
}
else
{
$topic_type = "";
+ $is_announcement = FALSE;
}
***************
*** 450,454 ****
$topic_type .= $lang['Topic_Poll'] . " ";
}
!
$topic_id = $topic_rowset[$i]['topic_id'];
--- 453,457 ----
$topic_type .= $lang['Topic_Poll'] . " ";
}
!
$topic_id = $topic_rowset[$i]['topic_id'];
***************
*** 554,559 ****
}
}
!
! $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
$topic_poster = $topic_rowset[$i]['username'];
--- 557,568 ----
}
}
! if($is_announcement == TRUE)
! {
! $view_topic_url = append_sid("viewtopic.$phpEx?mode=viewannounce&". POST_FORUM_URL . "=" . $forum_id . "&" . POST_TOPIC_URL . "=$topic_id");
! }
! else
! {
! $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! }
$topic_poster = $topic_rowset[$i]['username'];
***************
*** 564,568 ****
$last_post = $last_post_time . "<br />" . $lang['by'] . " ";
$last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . 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'];
--- 573,584 ----
$last_post = $last_post_time . "<br />" . $lang['by'] . " ";
$last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $topic_rowset[$i]['user2'] . "</a> ";
! if($is_announcement == TRUE)
! {
! $last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?mode=viewannounce&" . POST_FORUM_URL . "=" . $forum_id . "&" . 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>";
! }
! else
! {
! $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'];
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.120
retrieving revision 1.121
diff -C2 -r1.120 -r1.121
*** viewtopic.php 2001/10/14 18:22:32 1.120
--- viewtopic.php 2001/10/16 01:00:47 1.121
***************
*** 39,47 ****
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
//
// End initial var setup
//
! if( !isset($topic_id) && !isset($post_id) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
--- 39,52 ----
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
+
+ $mode = (isset($HTTP_GET_VARS['mode'])) ? addslashes($HTTP_GET_VARS['mode']) : "";
+
+ $forum_id = (isset($HTTP_GET_VARS['f'])) ? intval($HTTP_GET_VARS['f']) : "";
+
//
// End initial var setup
//
! if( !isset($topic_id) && !isset($post_id) && ($mode != "viewannounce") )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
***************
*** 131,134 ****
--- 136,140 ----
}
+
//
// This rather complex gaggle of code handles querying for topics but
***************
*** 142,150 ****
$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
! $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
! FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
! WHERE $join_sql
! AND f.forum_id = t.forum_id
! $order_sql";
if(!$result = $db->sql_query($sql))
--- 148,169 ----
$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
! if( $mode=="viewannounce" )
! {
! $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
! FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
! WHERE $join_sql AND
! t.topic_type = " . POST_ANNOUNCE . " AND
! (f.forum_id = " . $forum_id . "
! OR f.forum_id = -1)
! $order_sql";
! }
! else
! {
! $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
! FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
! WHERE $join_sql
! AND f.forum_id = t.forum_id
! $order_sql";
! }
if(!$result = $db->sql_query($sql))
|