You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(171) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Josh G. <os...@us...> - 2005-01-28 01:29:46
|
Update of /cvsroot/nanuke/nanuke0.x In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19991 Removed Files: phpbb-patches-2004-12-12-08.07.txt phpbb-patches-2004-12-15-12.31.txt phpbb-patches-2004-12-18-0.42.txt phpbb-patches-2004-12-19-09.59.txt phpbb-patches-2004-12-21-18.06.txt phpbb-patches-2004-12-31-19.24.txt phpbb-patches-2005-1-02-19.52.txt Log Message: - Uploading/.updating phpBB patches --- phpbb-patches-2004-12-15-12.31.txt DELETED --- --- phpbb-patches-2005-1-02-19.52.txt DELETED --- --- phpbb-patches-2004-12-18-0.42.txt DELETED --- --- phpbb-patches-2004-12-31-19.24.txt DELETED --- --- phpbb-patches-2004-12-21-18.06.txt DELETED --- --- phpbb-patches-2004-12-12-08.07.txt DELETED --- --- phpbb-patches-2004-12-19-09.59.txt DELETED --- |
|
From: Josh G. <os...@us...> - 2005-01-28 01:29:45
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19991/modules/forum/styles/subSilver/template Modified Files: viewforum_topicrow_loop.html viewtopic_body.html Log Message: - Uploading/.updating phpBB patches Index: viewforum_topicrow_loop.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template/viewforum_topicrow_loop.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** viewforum_topicrow_loop.html 3 Jan 2005 21:40:45 -0000 1.3 --- viewforum_topicrow_loop.html 28 Jan 2005 01:18:36 -0000 1.4 *************** *** 33,37 **** <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> ! <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> <!-- ENDIF --> <p class="topictitle"> --- 33,37 ---- <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> ! <a href="{topicrow.U_MCP_REPORT}"><img src="{T_THEME_PATH}/images/btn_report.gif" alt="{L_REPORT_POST}" title="{L_REPORT_POST}" /></a> <!-- ENDIF --> <p class="topictitle"> Index: viewtopic_body.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template/viewtopic_body.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** viewtopic_body.html 23 Dec 2004 03:09:24 -0000 1.1 --- viewtopic_body.html 28 Jan 2005 01:18:36 -0000 1.2 *************** *** 131,136 **** <td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td> <!-- ELSE --> ! <td align="center" valign="middle"><a name="{postrow.U_POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td> ! <td width="100%" height="25"><table width="100%" cellspacing="0"> <tr> <td class="gensmall"> --- 131,136 ---- <td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td> <!-- ELSE --> ! <td width="10%" align="center" valign="middle"><a name="{postrow.U_POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td> ! <td width="90%" height="25"><table width="100%" cellspacing="0"> <tr> <td class="gensmall"> |
Update of /cvsroot/nanuke/nanuke0.x In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20488 Added Files: phpbb-patches-2004-12-12-08.07.txt phpbb-patches-2004-12-15-12.31.txt phpbb-patches-2004-12-18-0.42.txt phpbb-patches-2004-12-19-09.59.txt phpbb-patches-2004-12-21-18.06.txt phpbb-patches-2004-12-31-19.24.txt phpbb-patches-2005-01-04-03.57.txt phpbb-patches-2005-1-02-19.52.txt phpbb-patches-2005-1-04-22.35.txt phpbb-patches-2005-1-05.txt phpbb-patches-2005-1-13.txt phpbb-patches-2005-1-15.txt Log Message: - Uploading/.updating phpBB patches --- NEW FILE: phpbb-patches-2004-12-18-0.42.txt --- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612 Modified Files: viewtopic.php Log Message: fix highlight issue in 2.1 Index: viewtopic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -r1.354 -r1.355 *** viewtopic.php 14 Nov 2004 17:12:07 -0000 1.354 --- viewtopic.php 18 Dec 2004 16:42:21 -0000 1.355 *************** *** 35,39 **** $update = request_var("update", false); ! $hilit_words = urldecode(request_var("hilit", "")); // Do we have a topic or post id? --- 35,39 ---- $update = request_var("update", false); ! $hilit_words = request_var("hilit", ""); // Do we have a topic or post id? *************** *** 336,344 **** if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote($word, "#")); } } ! $highlight = htmlspecialchars(urlencode($hilit_words)); } --- 336,344 ---- if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote(urlencode($word), "#")); } } ! $highlight = urlencode($hilit_words); } --- NEW FILE: phpbb-patches-2005-1-05.txt --- Update of /cvsroot/phpbb/phpBB2/install/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15793/install/schemas Modified Files: mysql_schema.sql Log Message: - small change in text size. ;) Index: mysql_schema.sql =================================================================== RCS file: /cvsroot/phpbb/phpBB2/install/schemas/mysql_schema.sql,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -r1.149 -r1.150 *** mysql_schema.sql 29 Oct 2004 10:45:51 -0000 1.149 --- mysql_schema.sql 5 Jan 2005 18:18:58 -0000 1.150 *************** *** 124,128 **** var_name varchar(255) DEFAULT "" NOT NULL, var_expires int(10) UNSIGNED DEFAULT "0" NOT NULL, ! var_data text NOT NULL, PRIMARY KEY (var_name) ); --- 124,128 ---- var_name varchar(255) DEFAULT "" NOT NULL, var_expires int(10) UNSIGNED DEFAULT "0" NOT NULL, ! var_data mediumtext NOT NULL, PRIMARY KEY (var_name) ); *************** *** 160,164 **** save_time int(11) UNSIGNED DEFAULT "0" NOT NULL, draft_subject varchar(60), ! draft_message text DEFAULT "" NOT NULL, PRIMARY KEY (draft_id), KEY save_time (save_time) --- 160,164 ---- save_time int(11) UNSIGNED DEFAULT "0" NOT NULL, draft_subject varchar(60), ! draft_message mediumtext DEFAULT "" NOT NULL, PRIMARY KEY (draft_id), KEY save_time (save_time) *************** *** 384,388 **** post_username varchar(30), post_subject varchar(60), ! post_text text, post_checksum varchar(32) NOT NULL, post_encoding varchar(11) DEFAULT "iso-8859-15" NOT NULL, --- 384,388 ---- post_username varchar(30), post_subject varchar(60), ! post_text mediumtext, post_checksum varchar(32) NOT NULL, post_encoding varchar(11) DEFAULT "iso-8859-15" NOT NULL, *************** *** 419,423 **** enable_sig tinyint(1) DEFAULT "1" NOT NULL, message_subject varchar(60), ! message_text text, message_edit_reason varchar(100), message_edit_user mediumint(8) UNSIGNED DEFAULT "0" NOT NULL, --- 419,423 ---- enable_sig tinyint(1) DEFAULT "1" NOT NULL, message_subject varchar(60), ! message_text mediumtext, message_edit_reason varchar(100), message_edit_user mediumint(8) UNSIGNED DEFAULT "0" NOT NULL, *************** *** 668,672 **** template_included text NOT NULL, template_mtime int(11) DEFAULT "0" NOT NULL, ! template_data text, KEY (template_id), KEY (template_filename) --- 668,672 ---- template_included text NOT NULL, template_mtime int(11) DEFAULT "0" NOT NULL, ! template_data mediumtext, KEY (template_id), KEY (template_filename) *************** *** 681,685 **** theme_storedb tinyint(1) DEFAULT "0" NOT NULL, theme_mtime int(11) DEFAULT "0" NOT NULL, ! theme_data text DEFAULT "" NOT NULL, PRIMARY KEY (theme_id), UNIQUE theme_name (theme_name) --- 681,685 ---- theme_storedb tinyint(1) DEFAULT "0" NOT NULL, theme_mtime int(11) DEFAULT "0" NOT NULL, ! theme_data mediumtext DEFAULT "" NOT NULL, PRIMARY KEY (theme_id), UNIQUE theme_name (theme_name) Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11246/includes Modified Files: functions_privmsgs.php Log Message: - merged getting of unread pm count function to get_folder function - made folder usable within the template (especially custom folder) Index: functions_privmsgs.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_privmsgs.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** functions_privmsgs.php 12 Dec 2004 14:07:01 -0000 1.9 --- functions_privmsgs.php 6 Jan 2005 23:03:07 -0000 1.10 *************** *** 101,134 **** ); - // Get number of unread messages from all folder - function get_unread_pm($user_id) - { - global $db; - - $unread_pm = array(); - - $sql = "SELECT folder_id, SUM(unread) as sum_unread - FROM " . PRIVMSGS_TO_TABLE . " - WHERE user_id = $user_id - AND folder_id <> " . PRIVMSGS_OUTBOX . " - GROUP BY folder_id"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if ($row["sum_unread"]) - { - $unread_pm[$row["folder_id"]] = $row["sum_unread"]; - } - } - $db->sql_freeresult($result); - - return $unread_pm; - } - // Get all folder ! function get_folder($user_id, &$folder) { ! global $db, $user; if (!is_array($folder)) --- 101,108 ---- ); // Get all folder ! function get_folder($user_id, &$folder, $folder_id = false, $mode = "") { ! global $db, $user, $template; if (!is_array($folder)) *************** *** 137,141 **** } ! $sql = "SELECT folder_id, COUNT(msg_id) as num_messages FROM " . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id --- 111,121 ---- } ! if ($mode == "unread") ! { ! $folder["unread"] = array("folder_name" => $user->lang["UNREAD_MESSAGES"]); ! } ! ! // Get folder informations ! $sql = "SELECT folder_id, COUNT(msg_id) as num_messages, SUM(unread) as num_unread FROM " . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id *************** *** 144,161 **** $result = $db->sql_query($sql); ! $num_messages = array(); while ($row = $db->sql_fetchrow($result)) { $num_messages[(int) $row["folder_id"]] = $row["num_messages"]; } $db->sql_freeresult($result); ! if (!isset($num_messages[PRIVMSGS_OUTBOX])) { ! $num_messages[PRIVMSGS_OUTBOX] = 0; } ! $folder[PRIVMSGS_INBOX] = array("folder_name" => $user->lang["PM_INBOX"], "num_messages" => (int) $num_messages[PRIVMSGS_INBOX]); $sql = "SELECT folder_id, folder_name, pm_count FROM " . PRIVMSGS_FOLDER_TABLE . " --- 124,155 ---- $result = $db->sql_query($sql); ! $num_messages = $num_unread = array(); while ($row = $db->sql_fetchrow($result)) { $num_messages[(int) $row["folder_id"]] = $row["num_messages"]; + $num_unread[(int) $row["folder_id"]] = $row["num_unread"]; } $db->sql_freeresult($result); ! // Make sure the default boxes are defined ! foreach (array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX) as $default_folder) { ! if (!isset($num_messages[$default_folder])) ! { ! $num_messages[$default_folder] = 0; ! } ! ! if (!isset($num_unread[$default_folder])) ! { ! $num_unread[$default_folder] = 0; ! } } ! // Adjust unread status for outbox ! $num_unread[PRIVMSGS_OUTBOX] = $num_messages[PRIVMSGS_OUTBOX]; ! ! $folder[PRIVMSGS_INBOX] = array("folder_name" => $user->lang["PM_INBOX"], "num_messages" => $num_messages[PRIVMSGS_INBOX], "unread_messages" => $num_unread[PRIVMSGS_INBOX]); + // Custom Folder $sql = "SELECT folder_id, folder_name, pm_count FROM " . PRIVMSGS_FOLDER_TABLE . " *************** *** 165,174 **** while ($row = $db->sql_fetchrow($result)) { ! $folder[$row["folder_id"]] = array("folder_name" => $row["folder_name"], "num_messages" => $row["pm_count"]); } $db->sql_freeresult($result); ! $folder[PRIVMSGS_OUTBOX] = array("folder_name" => $user->lang["PM_OUTBOX"], "num_messages" => (int) $num_messages[PRIVMSGS_OUTBOX]); ! $folder[PRIVMSGS_SENTBOX] = array("folder_name" => $user->lang["PM_SENTBOX"], "num_messages" => (int) $num_messages[PRIVMSGS_SENTBOX]); return; --- 159,183 ---- while ($row = $db->sql_fetchrow($result)) { ! $folder[$row["folder_id"]] = array("folder_name" => $row["folder_name"], "num_messages" => $row["pm_count"], "unread_messages" => ((isset($num_unread[$row["folder_id"]])) ? $num_unread[$row["folder_id"]] : 0)); } $db->sql_freeresult($result); ! $folder[PRIVMSGS_OUTBOX] = array("folder_name" => $user->lang["PM_OUTBOX"], "num_messages" => $num_messages[PRIVMSGS_OUTBOX], "unread_messages" => $num_unread[PRIVMSGS_OUTBOX]); ! $folder[PRIVMSGS_SENTBOX] = array("folder_name" => $user->lang["PM_SENTBOX"], "num_messages" => $num_messages[PRIVMSGS_SENTBOX], "unread_messages" => $num_unread[PRIVMSGS_SENTBOX]); ! ! // Define Folder Array for template designers (and for making custom folders usable by the template too) ! foreach ($folder as $f_id => $folder_ary) ! { ! $template->assign_block_vars("folder", array( ! "FOLDER_ID" => $f_id, ! "FOLDER_NAME" => $folder_ary["folder_name"], ! "NUM_MESSAGES" => $folder_ary["num_messages"], ! "UNREAD_MESSAGES" => $folder_ary["unread_messages"], ! ! "S_CUR_FOLDER" => ($f_id == $folder_id) ? true : false, ! "S_UNREAD_MESSAGES" => ($folder_ary["unread_messages"]) ? true : false, ! "S_CUSTOM_FOLDER" => ($f_id > 0) ? true : false) ! ); ! } return; --- NEW FILE: phpbb-patches-2004-12-31-19.24.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes Modified Files: functions.php functions_display.php message_parser.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.301 retrieving revision 1.302 diff -C2 -r1.301 -r1.302 *** functions.php 22 Dec 2004 02:06:42 -0000 1.301 --- functions.php 31 Dec 2004 13:58:37 -0000 1.302 *************** *** 1390,1394 **** { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "mysql.php") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; --- 1390,1394 ---- { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; *************** *** 1534,1538 **** AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql, false); while ($row = $db->sql_fetchrow($result)) --- 1534,1538 ---- AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) *************** *** 1580,1583 **** --- 1580,1584 ---- $prev_session_ip = $row["session_ip"]; } + $db->sql_freeresult($result); if (!$online_userlist) Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** functions_display.php 19 Dec 2004 17:59:13 -0000 1.62 --- functions_display.php 31 Dec 2004 13:58:40 -0000 1.63 *************** *** 163,167 **** } } ! $db->sql_freeresult(); // Handle marking posts --- 163,167 ---- } } ! $db->sql_freeresult($result); // Handle marking posts Index: message_parser.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/message_parser.php,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -r1.83 -r1.84 *** message_parser.php 19 Dec 2004 17:59:13 -0000 1.83 --- message_parser.php 31 Dec 2004 13:58:41 -0000 1.84 *************** *** 235,238 **** --- 235,241 ---- } + // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results + $code = strtr($code, array_flip(get_html_translation_table(HTML_ENTITIES))); + ob_start(); highlight_string($code); Update of /cvsroot/phpbb/phpBB2/includes/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes/db Modified Files: mysql.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: mysql.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/db/mysql.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** mysql.php 30 May 2004 19:24:50 -0000 1.21 --- mysql.php 31 Dec 2004 13:58:36 -0000 1.22 *************** *** 58,64 **** } ! if (count($this->open_queries)) { ! foreach ($this->open_queries as $query_id) { @mysql_free_result($query_id); --- 58,64 ---- } ! if (sizeof($this->open_queries)) { ! foreach ($this->open_queries as $i_query_id => $query_id) { @mysql_free_result($query_id); *************** *** 112,117 **** global $cache; ! // DEBUG ! $this->sql_report("start", $query); $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; --- 112,120 ---- global $cache; ! // EXPLAIN only in extra debug mode ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("start", $query); ! } $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; *************** *** 126,145 **** } ! // DEBUG ! $this->sql_report("stop", $query); if ($cache_ttl && method_exists($cache, "sql_save")) { $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result happened within sql_save() } ! elseif (preg_match("/^SELECT/", $query)) { ! $this->open_queries[] = $this->query_result; } } ! else { - // DEBUG $this->sql_report("fromcache", $query); } --- 129,150 ---- } ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("stop", $query); ! } if ($cache_ttl && method_exists($cache, "sql_save")) { + $this->open_queries[(int) $this->query_result] = $this->query_result; $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result called within sql_save() } ! else if (strpos($query, "SELECT") !== false && $this->query_result) { ! $this->open_queries[(int) $this->query_result] = $this->query_result; } } ! else if (defined("DEBUG_EXTRA")) { $this->sql_report("fromcache", $query); } *************** *** 259,263 **** } ! if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); --- 264,270 ---- } ! // This method is called too often... do not waste memory by calling/checking unneeded things ! // if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) ! if (isset($cache->sql_rowset[$query_id])) { return $cache->sql_fetchrow($query_id); *************** *** 346,360 **** } ! if ($query_id) { ! // If it is not found within the open queries, we try to free a cached result. ;) ! if (!(array_search($query_id, $this->open_queries) > 0)) ! { ! return false; ! } ! unset($this->open_queries[array_search($query_id, $this->open_queries)]); } ! return ($query_id) ? @mysql_free_result($query_id) : false; } --- 353,363 ---- } ! if (isset($this->open_queries[(int) $query_id])) { ! unset($this->open_queries[(int) $query_id]); ! return @mysql_free_result($query_id); } ! return false; } *************** *** 368,373 **** if (!$this->return_on_error) { ! $this_page = (!empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((!empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : $_ENV["QUERY_STRING"]); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; --- 371,376 ---- if (!$this->return_on_error) { ! $this_page = (isset($_SERVER["PHP_SELF"]) && !empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((isset($_SERVER["QUERY_STRING"]) && !empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : (isset($_ENV["QUERY_STRING"]) ? $_ENV["QUERY_STRING"] : "")); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; *************** *** 389,393 **** } - // DEBUG function sql_report($mode, $query = "") { --- 392,395 ---- --- NEW FILE: phpbb-patches-2004-12-12-08.07.txt --- -------------------------------------------------------- part 1 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313 Modified Files: common.php download.php posting.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: common.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/common.php,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -r1.163 -r1.164 *** common.php 30 Nov 2004 11:05:23 -0000 1.163 --- common.php 12 Dec 2004 14:06:56 -0000 1.164 *************** *** 295,301 **** } - // Adjust storage path"s - $config["upload_dir"] = ($config["upload_dir"]{0} == "/" || ($config["upload_dir"]{0} != "/" && $config["upload_dir"]{1} == ":")) ? $config["upload_dir"] : $phpbb_root_path . $config["upload_dir"]; - // Handle email/cron queue. if (time() - $config["queue_interval"] >= $config["last_queue_run"] && !defined("IN_ADMIN")) --- 295,298 ---- Index: download.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/download.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** download.php 17 Sep 2004 09:11:31 -0000 1.23 --- download.php 12 Dec 2004 14:07:00 -0000 1.24 *************** *** 37,41 **** } ! $sql = "SELECT * FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; --- 37,41 ---- } ! $sql = "SELECT attach_id, in_message, post_msg_id, extension FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; *************** *** 101,104 **** --- 101,118 ---- $download_mode = (int) $extensions[$attachment["extension"]]["download_mode"]; + // Fetching filename here to prevent sniffing of filename + $sql = "SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype + FROM " . ATTACHMENTS_TABLE . " + WHERE attach_id = $download_id"; + $result = $db->sql_query_limit($sql, 1); + + if (!($attachment = $db->sql_fetchrow($result))) + { + trigger_error("ERROR_NO_ATTACHMENT"); + } + $db->sql_freeresult($result); + + $attachment["physical_filename"] = basename($attachment["physical_filename"]); + if ($thumbnail) { *************** *** 117,126 **** if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($config["upload_dir"] . "/" . $attachment["physical_filename"]); } else --- 131,140 ---- if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($phpbb_root_path . $config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($phpbb_root_path . $config["upload_dir"] . "/" . $attachment["physical_filename"]); } else *************** *** 137,143 **** function send_file_to_browser($attachment, $upload_dir, $category) { ! global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config; ! $filename = $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) --- 151,157 ---- function send_file_to_browser($attachment, $upload_dir, $category) { ! global $user, $db, $config, $phpbb_root_path; ! $filename = $phpbb_root_path . $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) *************** *** 148,152 **** // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ((!empty($HTTP_SERVER_VARS["HTTP_USER_AGENT"])) ? $HTTP_SERVER_VARS["HTTP_USER_AGENT"] : ""); if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) --- 162,166 ---- // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ""; if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) *************** *** 193,198 **** } // Now the tricky part... let"s dance - // TODO: needs a little bit more testing... seems to break on some configurations (incomplete files) header("Pragma: public"); // header("Content-Transfer-Encoding: none"); --- 207,216 ---- } + if ($config["gzip_compress"]) + { + @ob_end_clean(); + } + // Now the tricky part... let"s dance header("Pragma: public"); // header("Content-Transfer-Encoding: none"); Index: posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/posting.php,v retrieving revision 1.347 retrieving revision 1.348 diff -C2 -r1.347 -r1.348 *** posting.php 30 Oct 2004 17:04:44 -0000 1.347 --- posting.php 12 Dec 2004 14:07:00 -0000 1.348 *************** *** 911,915 **** $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id); foreach ($unset_attachments as $index) --- 911,915 ---- $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id, true); foreach ($unset_attachments as $index) *************** *** 1668,1673 **** "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => $attach_row["physical_filename"], ! "real_filename" => $attach_row["real_filename"], "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], --- 1668,1673 ---- "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => basename($attach_row["physical_filename"]), ! "real_filename" => basename($attach_row["real_filename"]), "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], -------------------------------------------------------- part 2 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes/mcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes/mcp Modified Files: mcp_main.php mcp_topic.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: mcp_main.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_main.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** mcp_main.php 6 Nov 2004 14:20:27 -0000 1.10 --- mcp_main.php 12 Dec 2004 14:07:02 -0000 1.11 *************** *** 870,875 **** "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) $attach_row["physical_filename"], ! "real_filename" => (string) $attach_row["real_filename"], "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], --- 870,875 ---- "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) basename($attach_row["physical_filename"]), ! "real_filename" => (string) basename($attach_row["real_filename"]), "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], Index: mcp_topic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_topic.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mcp_topic.php 19 Jul 2004 20:13:16 -0000 1.4 --- mcp_topic.php 12 Dec 2004 14:07:02 -0000 1.5 *************** *** 359,362 **** --- 359,368 ---- move_posts($post_id_list, $to_topic_id); + // Change topic title of first post + $sql = "UPDATE " . POSTS_TABLE . " + SET post_subject = "" . $db->sql_escape($subject) . "" + WHERE post_id = {$post_id_list[0]}"; + $db->sql_query($sql); + $success_msg = "TOPIC_SPLIT_SUCCESS"; -------------------------------------------------------- part 3 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes Modified Files: functions_admin.php functions_display.php functions_posting.php functions_privmsgs.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** functions_admin.php 10 Nov 2004 14:15:16 -0000 1.88 --- functions_admin.php 12 Dec 2004 14:07:01 -0000 1.89 *************** *** 678,682 **** global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $config["upload_dir"] . "/thumb_" . $filename : $config["upload_dir"] . "/" . $filename; $deleted = @unlink($filename); --- 678,682 ---- global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($filename) : $phpbb_root_path . $config["upload_dir"] . "/" . basename($filename); $deleted = @unlink($filename); *************** *** 685,698 **** $filesys = str_replace("/","\\", $filename); $deleted = @system("del $filesys"); - - if (file_exists($filename)) - { - $filename = realpath($filename); - @chmod($filename, 0777); - if (!($deleted = @unlink($filename))) - { - $deleted = @system("del $filename"); - } - } } --- 685,688 ---- Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** functions_display.php 13 Oct 2004 19:30:01 -0000 1.60 --- functions_display.php 12 Dec 2004 14:07:01 -0000 1.61 *************** *** 536,541 **** // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $config["upload_dir"] . "/" . $attachment["physical_filename"]; ! $thumbnail_filename = $config["upload_dir"] . "/thumb_" . $attachment["physical_filename"]; $upload_image = ""; --- 536,541 ---- // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $phpbb_root_path . $config["upload_dir"] . "/" . basename($attachment["physical_filename"]); ! $thumbnail_filename = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($attachment["physical_filename"]); $upload_image = ""; *************** *** 555,559 **** $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = $attachment["real_filename"]; $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); --- 555,559 ---- $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = basename($attachment["real_filename"]); $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); Index: functions_posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_posting.php,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -r1.127 -r1.128 *** functions_posting.php 6 Nov 2004 14:20:26 -0000 1.127 --- functions_posting.php 12 Dec 2004 14:07:01 -0000 1.128 *************** *** 134,138 **** function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db; $filedata = array(); --- 134,138 ---- function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db, $phpbb_root_path; $filedata = array(); *************** *** 145,149 **** } ! $r_file = $filename; $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; --- 145,149 ---- } ! $r_file = trim(basename($filename)); $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; *************** *** 187,190 **** --- 187,229 ---- } + $filedata["thumbnail"] = 0; + + // Prepare Values + $filedata["filetime"] = time(); + $filedata["filename"] = stripslashes($r_file); + + $filedata["destination_filename"] = strtolower($filedata["filename"]); + $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; + + $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); + + // Do we have to create a thumbnail? + if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) + { + $filedata["thumbnail"] = 1; + } + + // Descide the Upload method + $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; + $upload_mode = ($local) ? "local" : $upload_mode; + + // Ok, upload the File + $result = move_uploaded_attachment($upload_mode, $file, $filedata); + + if ($result) + { + $filedata["error"][] = $result; + $filedata["post_attach"] = false; + + return $filedata; + } + + $file = (!$local) ? $phpbb_root_path . $config["upload_dir"] . "/" . $filedata["destination_filename"] : $local_storage; + + if (!$filedata["filesize"]) + { + $filedata["filesize"] = @filesize($file); + } + // Check Image Size, if it is an image if (!$auth->acl_gets("m_", "a_") && $cat_id == ATTACHMENT_CATEGORY_IMAGE) *************** *** 198,201 **** --- 237,244 ---- $filedata["error"][] = sprintf($user->lang["ERROR_IMAGESIZE"], $config["img_max_width"], $config["img_max_height"]); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 212,215 **** --- 255,262 ---- $filedata["error"][] = sprintf($user->lang["ATTACHMENT_TOO_BIG"], $allowed_filesize, $size_lang); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 222,225 **** --- 269,276 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 227,231 **** // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) --- 278,282 ---- // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($phpbb_root_path . $config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) *************** *** 233,273 **** $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; - return $filedata; - } - } - - $filedata["thumbnail"] = 0; - - // Prepare Values - $filedata["filetime"] = time(); - $filedata["filename"] = stripslashes($r_file); ! $filedata["destination_filename"] = strtolower($filedata["filename"]); ! $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; ! ! $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); ! // Do we have to create a thumbnail ? ! if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) ! { ! $filedata["thumbnail"] = 1; } - // Descide the Upload method - $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; - $upload_mode = ($local) ? "local" : $upload_mode; - - // Ok, upload the File - $result = move_uploaded_attachment($upload_mode, $file, $filedata); - - if ($result) - { - $filedata["error"][] = $result; - $filedata["post_attach"] = false; - } return $filedata; } ! // Move/Upload File - could be used for Avatars too ? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { --- 284,299 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; ! phpbb_unlink($filedata["destination_filename"]); ! phpbb_unlink($filedata["destination_filename"], "thumbnail"); ! return $filedata; ! } } return $filedata; } ! // Move/Upload File - could be used for Avatars too? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { *************** *** 280,310 **** { case "copy": ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; --- 306,336 ---- { case "copy": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; *************** *** 313,318 **** if ($filedata["thumbnail"]) { ! $source = $config["upload_dir"] . "/" . $destination_filename; ! $destination = $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) --- 339,344 ---- if ($filedata["thumbnail"]) { ! $source = $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename; ! $destination = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) *************** *** 648,652 **** { $hidden = ""; ! $attach_row["real_filename"] = stripslashes($attach_row["real_filename"]); foreach ($attach_row as $key => $value) --- 674,678 ---- { $hidden = ""; ! $attach_row["real_filename"] = stripslashes(basename($attach_row["real_filename"])); foreach ($attach_row as $key => $value) *************** *** 655,663 **** } ! $download_link = (!$attach_row["attach_id"]) ? $config["upload_dir"] . "/" . $attach_row["physical_filename"] : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => $attach_row["real_filename"], ! "ATTACH_FILENAME" => $attach_row["physical_filename"], "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["attach_id"], --- 681,689 ---- } ! $download_link = (!$attach_row["attach_id"]) ? $phpbb_root_path . $config["upload_dir"] . "/" . basename($attach_row["physical_filename"]) : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => basename($attach_row["real_filename"]), ! "ATTACH_FILENAME" => basename($attach_row["physical_filename"]), "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["at -------------------------------------------------------- part 4 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/adm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/adm Modified Files: admin_attachments.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: admin_attachments.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/adm/admin_attachments.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** admin_attachments.php 25 Nov 2004 21:52:47 -0000 1.32 --- admin_attachments.php 12 Dec 2004 14:06:55 -0000 1.33 *************** *** 362,366 **** if ($submit && $mode == "orphan") { ! $delete_files = array_keys(request_var("delete", "")); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); --- 362,366 ---- if ($submit && $mode == "orphan") { ! $delete_files = (isset($_REQUEST["delete"])) ? array_keys(request_var("delete", "")) : array(); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); *************** *** 368,373 **** foreach ($delete_files as $delete) { ! phpbb_unlink($config["upload_dir"] . "/" . $delete); ! phpbb_unlink($config["upload_dir"] . "/thumb_" . $delete); } --- 368,373 ---- foreach ($delete_files as $delete) { ! phpbb_unlink($delete); ! phpbb_unlink($delete, "thumbnail"); } *************** *** 1187,1194 **** $attach_filelist = array(); ! $dir = @opendir($config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($config["upload_dir"] . "/" . $file) && filesize($config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; --- 1187,1194 ---- $attach_filelist = array(); ! $dir = @opendir($phpbb_root_path . $config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($phpbb_root_path . $config["upload_dir"] . "/" . $file) && filesize($phpbb_root_path . $config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; *************** *** 1242,1251 **** { $row_class = (++$i % 2 == 0) ? "row2" : "row1"; ! $filesize = @filesize($config["upload_dir"] . "/" . $file); $size_lang = ($filesize >= 1048576) ? $user->lang["MB"] : ( ($filesize >= 1024) ? $user->lang["KB"] : $user->lang["BYTES"] ); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ?> <tr> ! <td class="<?php echo $row_class; ?>"><a href="<?php echo $config["upload_dir"] . "/" . $file; ?>" class="gen" target="file"><?php echo $file; ?></a></td> <td class="<?php echo $row_class; ?>"><?php echo $filesize . " " . $size_lang; ?></td> <td class="<?php echo $row_class; ?>"><b class="gen">ID: </b><input type="text" name="post_id[<?php echo $file; ?>]" class="post" size="7" maxlength="10" value="<?php echo (!empty($post_ids[$file])) ? $post_ids[$file] : ""; ?>" /></td> --- 1242,1251 ---- { $row_class = (++$i % 2 == 0) ? "row2" : "row1"; ! $filesize = @filesize($phpbb_root_path . $config["upload_dir"] . "/" . $file); $size_lang = ($filesize >= 1048576) ? $user->lang["MB"] : ( ($filesize >= 1024) ? $user->lang["KB"] : $user->lang["BYTES"] ); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ?> <tr> ! <td class="<?php echo $row_class; ?>"><a href="<?php echo $phpbb_root_path . $config["upload_dir"] . "/" . $file; ?>" class="gen" target="file"><?php echo $file; ?></a></td> <td class="<?php echo $row_class; ?>"><?php echo $filesize . " " . $size_lang; ?></td> <td class="<?php echo $row_class; ?>"><b class="gen">ID: </b><input type="text" name="post_id[<?php echo $file; ?>]" class="post" size="7" maxlength="10" value="<?php echo (!empty($post_ids[$file])) ? $post_ids[$file] : ""; ?>" /></td> *************** *** 1401,1412 **** function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) { ! global $message_parser, $db, $user; $message_parser->attachment_data = array(); $message_parser->filename_data["filecomment"] = ""; ! $message_parser->filename_data["filename"] = $upload_dir . "/" . $filename; ! $filedata = upload_attachment($forum_id, $filename, true, $upload_dir . "/" . $filename); if ($filedata["post_attach"] && !sizeof($filedata["error"])) --- 1401,1412 ---- function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) { ! global $message_parser, $db, $user, $phpbb_root_path; $message_parser->attachment_data = array(); $message_parser->filename_data["filecomment"] = ""; ! $message_parser->filename_data["filename"] = $phpbb_root_path . $upload_dir . "/" . basename($filename); ! $filedata = upload_attachment($forum_id, $filename, true, $phpbb_root_path . $upload_dir . "/" . basename($filename)); if ($filedata["post_attach"] && !sizeof($filedata["error"])) *************** *** 1492,1524 **** global $user, $phpbb_root_path; - // Adjust the Upload Directory. Relative or absolute, this is the question here. - $real_upload_dir = $upload_dir; - $upload_dir = ($upload_dir{0} == "/" || ($upload_dir{0} != "/" && $upload_dir{1} == ":")) ? $upload_dir : $phpbb_root_path . $upload_dir; - // Does the target directory exist, is it a directory and writeable. if ($create_directory) { ! if (!file_exists($upload_dir)) { ! @mkdir($upload_dir, 0777); ! @chmod($upload_dir, 0777); } } ! if (!file_exists($upload_dir)) { ! $error[] = sprintf($user->lang["NO_UPLOAD_DIR"], $real_upload_dir); return; } ! if (!is_dir($upload_dir)) { ! $error[] = sprintf($user->lang["UPLOAD_NOT_DIR"], $real_upload_dir); return; } ! if (!is_writable($upload_dir)) { ! $error[] = sprintf($user->lang["NO_WRITE_UPLOAD"], $real_upload_dir); return; } --- 1492,1520 ---- global $user, $phpbb_root_path; // Does the target directory exist, is it a directory and writeable. if ($create_directory) { ! if (!file_exists($phpbb_root_path . $upload_dir)) { ! @mkdir($phpbb_root_path . $upload_dir, 0777); ! @chmod($phpbb_root_path . $upload_dir, 0777); } } ! if (!file_exists($phpbb_root_path . $upload_dir)) { ! $error[] = sprintf($user->lang["NO_UPLOAD_DIR"], $upload_dir); return; } ! if (!is_dir($phpbb_root_path . $upload_dir)) { ! $error[] = sprintf($user->lang["UPLOAD_NOT_DIR"], $upload_dir); return; } ! if (!is_writable($phpbb_root_path . $upload_dir)) { ! $error[] = sprintf($user->lang["NO_WRITE_UPLOAD"], $upload_dir); return; } --- NEW FILE: phpbb-patches-2004-12-19-09.59.txt --- Update of /cvsroot/phpbb/phpBB2/includes/acm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12148/includes/acm Modified Files: acm_file.php Log Message: - some fixes/changes Index: acm_file.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/acm/acm_file.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** acm_file.php 26 May 2004 18:55:26 -0000 1.15 --- acm_file.php 19 Dec 2004 17:59:13 -0000 1.16 *************** *** 14,18 **** class acm { ! var $vars = ""; var $var_expires = array(); var $is_modified = FALSE; --- 14,18 ---- class acm { ! var $vars = array(); var $var_expires = array(); var $is_modified = FALSE; *************** *** 91,95 **** if (file_exists($this->cache_dir . "data_global." . $phpEx)) { ! if (!is_array($this->vars)) { $this->load(); --- 91,95 ---- if (file_exists($this->cache_dir . "data_global." . $phpEx)) { ! if (!sizeof($this->vars)) { $this->load(); *************** *** 191,195 **** else { ! if (!is_array($this->vars)) { $this->load(); --- 191,195 ---- else { ! if (!sizeof($this->vars)) { $this->load(); Update of /cvsroot/phpbb/phpBB2/adm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12148/adm Modified Files: admin_viewlogs.php Log Message: - some fixes/changes Index: admin_viewlogs.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/adm/admin_viewlogs.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** admin_viewlogs.php 6 Nov 2004 14:11:47 -0000 1.13 --- admin_viewlogs.php 19 Dec 2004 17:59:12 -0000 1.14 *************** *** 148,154 **** view_log($mode, $log_data, $log_count, $config["topics_per_page"], $start, $forum_id, 0, 0, $sql_where, $sql_sort); if ($log_count) { ! for($i = 0; $i < sizeof($log_data); $i++) { $row_class = ($row_class == "row1") ? "row2" : "row1"; --- 148,156 ---- view_log($mode, $log_data, $log_count, $config["topics_per_page"], $start, $forum_id, 0, 0, $sql_where, $sql_sort); + $row_class = ""; + if ($log_count) { ! for ($i = 0; $i < sizeof($log_data); $i++) { $row_class = ($row_class == "row1") ? "row2" : "row1"; *************** *** 166,170 **** foreach (array("viewtopic", "viewlogs", "viewforum") as $check) { ! if ($log_data[$i][$check]) { $data[] = "<a href="" . $log_data[$i][$check] . "">" . $user->lang["LOGVIEW_" . strtoupper($check)] . "</a>"; --- 168,172 ---- foreach (array("viewtopic", "viewlogs", "viewforum") as $check) { ! if (isset($log_data[$i][$check]) && $log_data[$i][$check]) { $data[] = "<a href="" . $log_data[$i][$check] . "">" . $user->lang["LOGVIEW_" . strtoupper($check)] . "</a>"; Update of /cvsroot/phpbb/phpBB2/includes/ucp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12148/includes/ucp Modified Files: ucp_pm_viewmessage.php Log Message: - some fixes/changes Index: ucp_pm_viewmessage.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/ucp/ucp_pm_viewmessage.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ucp_pm_viewmessage.php 8 Oct 2004 11:13:00 -0000 1.7 --- ucp_pm_viewmessage.php 19 Dec 2004 17:59:14 -0000 1.8 *************** *** 16,20 **** global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db; ! $user->add_lang("viewtopic"); $msg_id = (int) $msg_id; --- 16,20 ---- global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db; ! $user->add_lang(array("viewtopic", "memberlist")); $msg_id = (int) $msg_id; *************** *** 413,416 **** --- 413,418 ---- } + $user_row["rank_title"] = $user_row["rank_image"] = ""; + if (!empty($user_row["user_rank"])) { Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12148/includes Modified Files: bbcode.php functions_display.php message_parser.php template.php Log Message: - some fixes/changes Index: bbcode.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/bbcode.php,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -r1.81 -r1.82 *** bbcode.php 14 Nov 2004 17:12:06 -0000 1.81 --- bbcode.php 19 Dec 2004 17:59:13 -0000 1.82 *************** *** 46,49 **** --- 46,50 ---- { $this->bbcode_bitfield = $bbcode_bitfield; + // Init those added with a new bbcode_bitfield (already stored codes will not get parsed again) $this->bbcode_cache_init(); *************** *** 113,117 **** if ($this->bbcode_bitfield & $user->theme["primary"]["bbcode_bitfield"]) { ! $style = (file_exists($phpbb_root_path . "styles/templates/" . $user->theme["primary"]["template_path"] . "/bbcode.html")) ? "primary" : "secondary"; } } --- 114,118 ---- if ($this->bbcode_bitfield & $user->theme["primary"]["bbcode_bitfield"]) { ! $style = (file_exists($phpbb_root_path . "styles/" . $user->theme["primary"]["template_path"] . "/template/bbcode.html")) ? "primary" : "secondary"; } } Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** functions_display.php 12 Dec 2004 14:07:01 -0000 1.61 --- functions_display.php 19 Dec 2004 17:59:13 -0000 1.62 *************** *** 501,509 **** // Generate Template ! // TODO: secondary template ! $template_filename = $phpbb_root_path . "styles/" . $user->theme["primary"]["template_path"] . "/template/attachment.html"; if (!($fp = @fopen($template_filename, "rb"))) { ! trigger_error("Could not load attachment template"); } $attachment_template = fread($fp, filesize($template_filename)); --- 501,515 ---- // Generate Template ! $style = "primary"; ! ! if (!empty($user->theme["secondary"])) ! { ! $style = (file_exists($phpbb_root_path . "styles/" . $user->theme["primary"]["template_path"] . "/template/attachment.html")) ? "primary" : "secondary"; ! } ! ! $template_filename = $phpbb_root_path . "styles/" . $user->theme[$style]["template_path"] . "/template/attachment.html"; if (!($fp = @fopen($template_filename, "rb"))) { ! trigger_error("Could not load template file "" . $template_filename . """); } $attachment_template = fread($fp, filesize($template_filename)); Index: message_parser.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/message_parser.php,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -r1.82 -r1.83 *** message_parser.php 14 Nov 2004 17:12:06 -0000 1.82 --- message_parser.php 19 Dec 2004 17:59:13 -0000 1.83 *************** *** 12,22 **** // ------------------------------------------------------------- - /* - TODO list for M-3: - - add other languages to syntax highlighter - - better (and unified, wrt other pages such as registration) validation for urls, emails, etc... - - need size limit checks on img/flash tags ... probably warrants some discussion - */ - if (!defined("IN_PHPBB")) { --- 12,15 ---- *************** *** 719,722 **** --- 712,716 ---- { $this->warn_msg[] = sprintf($user->lang["TOO_MANY_URLS"], $config["max_" . $mode . "_urls"]); + return $this->warn_msg; } *************** *** 730,734 **** $this->message_status = "parsed"; return; - //return implode("<br />", $this->warn_msg); } --- 724,727 ---- Index: template.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/template.php,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** template.php 30 Oct 2004 17:11:58 -0000 1.65 --- template.php 19 Dec 2004 17:59:13 -0000 1.66 *************** *** 158,162 **** } ! if (!file_exists($this->files[$handle])) { $this->tpl = "secondary"; --- 158,162 ---- } ! if (!file_exists($this->files[$handle]) && !empty($user->theme["secondary"])) { $this->tpl = "secondary"; Update of /cvsroot/phpbb/phpBB2/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12148/styles/subSilver/template Modified Files: ucp_pm_viewmessage.html Log Message: - some fixes/changes Index: ucp_pm_viewmessage.html =================================================================== RCS file: /cvsroot/phpbb/phpBB2/styles/subSilver/template/ucp_pm_viewmessage.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ucp_pm_viewmessage.html 5 Sep 2004 15:45:50 -0000 1.2 --- ucp_pm_viewmessage.html 19 Dec 2004 17:59:15 -0000 1.3 *************** *** 53,102 **** <tr> - <th width="150" nowrap="nowrap">{L_AUTHOR}</th> <th nowrap="nowrap">{L_MESSAGE}</th> </tr> <tr> ! <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> <tr class="row1"> - <td valign="top"> - - <div align="center"> - - <b class="postauthor">{AUTHOR_NAME}</b><br /><br /> - - <table cellspacing="4" align="center"> - <!-- IF ONLINE_IMG --> - <tr> - <td>{ONLINE_IMG}</td> - </tr> - <!-- ENDIF --> - <!-- IF AUTHOR_RANK --> - <tr> - <td class="postdetails">{AUTHOR_RANK}</td> - </tr> - <!-- ENDIF --> - <!-- IF RANK_IMAGE --> - <tr> - <td>{RANK_IMAGE}</td> - </tr> - <!-- ENDIF --> - <!-- IF AUTHOR_AVATAR --> - <tr> - <td>{AUTHOR_AVATAR}</td> - </tr> - <!-- ENDIF --> - </table> - - <span class="postdetails"> - <!-- IF AUTHOR_POSTS --><br /><b>{L_JOINED}:</b> {AUTHOR_JOINED}<!-- ENDIF --> - <!-- IF AUTHOR_POSTS --><br /><b>{L_POSTS}:</b> {AUTHOR_POSTS}<!-- ENDIF --> - <!-- IF AUTHOR_FROM --><br /><b>{L_LOCATION}:</b> {AUTHOR_FROM}<!-- ENDIF --> - </span> - - </div> - </td> <td valign="top"><table width="100%" cellspacing="5"> <tr> --- 53,64 ---- <tr> <th nowrap="nowrap">{L_MESSAGE}</th> </tr> <tr> ! <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> <tr class="row1"> <td valign="top"><table width="100%" cellspacing="5"> ... [truncated message content] |
|
From: Josh G. <os...@us...> - 2005-01-03 21:41:26
|
Update of /cvsroot/nanuke/nanuke0.x/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/docs Modified Files: todo Log Message: - More minor forum module stuff - Viewtopic print view - Report post Index: todo =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/docs/todo,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** todo 23 Dec 2004 05:37:05 -0000 1.16 --- todo 3 Jan 2005 21:40:44 -0000 1.17 *************** *** 11,19 **** reports, searching, etc. - * Fix login and logout not redirecting correctly * Fix "find member" popup (compose privmsg) * Fix hard-coded language strings in UCP->PM->viewmessage (move privmsg to folder text) - * Do something about sql_explain for DB classes that don't have it available... I smell - a standard and extending classes * Something needs to be done about catching errors that may occur with modules, components, blocks, etc. Just make errors more friendly so they're easier to fix. --- 11,16 ---- |
|
From: Josh G. <os...@us...> - 2005-01-03 21:41:26
|
Update of /cvsroot/nanuke/nanuke0.x/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/includes Modified Files: functions_messenger.php modules.php Log Message: - More minor forum module stuff - Viewtopic print view - Report post Index: functions_messenger.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/functions_messenger.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_messenger.php 22 Dec 2004 05:14:56 -0000 1.2 --- functions_messenger.php 3 Jan 2005 21:40:44 -0000 1.3 *************** *** 1,5 **** <?php /** ! * Messenging class for phpBB. Unmodified from phpBB version. * * @script: NA-Nuke --- 1,5 ---- <?php /** ! * Messenging class from phpBB. * * @script: NA-Nuke *************** *** 33,37 **** $this->use_queue = $use_queue; ! $this->subject = ''; } --- 33,37 ---- $this->use_queue = $use_queue; ! $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = $this->encoding = ''; } *************** *** 297,303 **** $headers .= "X-Priority: {$this->mail_priority}\n"; $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n"; ! $headers .= "X-Mailer: PhpBB\n"; ! $headers .= "X-MimeOLE: phpBB\n"; ! $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n"; $headers .= ($this->extra_headers != '') ? $this->extra_headers : ''; --- 297,303 ---- $headers .= "X-Priority: {$this->mail_priority}\n"; $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n"; ! $headers .= "X-Mailer: NA-Nuke\n"; ! $headers .= "X-MimeOLE: NA-Nuke\n"; ! $headers .= "X-phpBB-Origin: nanuke://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n"; $headers .= ($this->extra_headers != '') ? $this->extra_headers : ''; Index: modules.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/modules.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** modules.php 23 Dec 2004 03:09:22 -0000 1.12 --- modules.php 3 Jan 2005 21:40:44 -0000 1.13 *************** *** 30,34 **** function load_module ($module_name, $search_for_synonyms = true) { ! global $user, $nanuke_root_path, $phpEx, $db; if (isset($this->loaded_modules[$module_name])) --- 30,34 ---- function load_module ($module_name, $search_for_synonyms = true) { ! global $user, $nanuke_root_path, $phpEx, $db, $config; if (isset($this->loaded_modules[$module_name])) *************** *** 37,40 **** --- 37,54 ---- } + // Get cache limit for queries... + // Todo: The "reload_module_data" setting should be set in the module ACP + // when permissions for a module are changed... it should also search for + // all of the module's synonyms and add them accordingly + $cache_limit = 1000000000; + if ($config['reload_module_data'] && strstr('|'.$module_name.'|', $config['reload_module_data'])) + { + $config['reload_module_data'] = str_replace('|'.$module_name.'|', '', $config['reload_module_data']); + $cache_limit = 0; + $db->sql_query('UPDATE ' . CONFIG_TABLE . ' + SET config_value = "' . $db->sql_escape($config['reload_module_data']) . '" + WHERE config_name = "reload_module_data"'); + } + // Try to get DB record $sql = 'SELECT * *************** *** 43,47 **** // If this query is a success, we have a valid module name already ! $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); --- 57,61 ---- // If this query is a success, we have a valid module name already ! $result = $db->sql_query($sql, $cache_limit); $row = $db->sql_fetchrow($result); *************** *** 55,80 **** m.module_id = s.real_id'; ! $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); - - if (!$row) - { - // No synonym, the module name is completely invalid - $row = false; - } } ! // Free result to save memory $db->sql_freeresult($result); // Make sure this is a valid module - TODO: check for admins ! if ($row) { $this->loaded_module_data[$module_name] = &$row; } else { trigger_error(sprintf($user->lang['CANNOT_VIEW_MODULE'], $module_name)); ! } ! // Module is valid, include the module class file ! require($nanuke_root_path . "modules/" . $row['module_name'] . "/module.$phpEx"); eval('$this->loaded_modules[$module_name] = new Module_' . $row['module_name'] . '();'); $this->loaded_modules[$module_name]->module_name = $module_name; --- 69,91 ---- m.module_id = s.real_id'; ! $result = $db->sql_query($sql, $cache_limit); $row = $db->sql_fetchrow($result); } ! // Free result to save memory $db->sql_freeresult($result); // Make sure this is a valid module - TODO: check for admins ! if ($row && !empty($row['module_enabled'])) { $this->loaded_module_data[$module_name] = &$row; } else { trigger_error(sprintf($user->lang['CANNOT_VIEW_MODULE'], $module_name)); ! } ! // Module SHOULD be valid, include the module class file ! if (!@include($nanuke_root_path . "modules/" . $row['module_name'] . "/module.$phpEx")) ! { ! trigger_error(sprintf($user->lang['CANNOT_VIEW_MODULE'], $module_name)); ! } eval('$this->loaded_modules[$module_name] = new Module_' . $row['module_name'] . '();'); $this->loaded_modules[$module_name]->module_name = $module_name; *************** *** 91,148 **** /** - * Check if the module/component name is a synonym for another - * module/component. - * - * @access private - * @param int $synonym_type The type of synonym - NAN_SYNONYM_MODULE or NAN_SYNONYM_COMPONENT - * @param string $mcb_name The current name of the module/component - * @return string Returns the new module/component name, or the same one passed - * if no synonyms are found - */ - function get_synonym ($synonym_type, $mcb_name) - { - global $db; - - $sql = ""; - $field = ""; - switch ($synonym_type) - { - case NAN_SYNONYM_MODULE: - $sql = 'SELECT * - FROM ' . NAN_SYNONYM_TABLE . ' s, ' . NAN_MODULES_TABLE . ' m - WHERE s.synonym_name = "' . $db->sql_escape($mcb_name) . '" - AND s.real_id = m.module_id'; - $field = 'module_name'; - break; - case NAN_SYNONYM_COMPONENT: - $sql = 'SELECT * - FROM ' . NAN_SYNONYM_TABLE . ' s, ' . NAN_COMPONENTS_TABLE . ' c - WHERE s.synonym_name = "' . $db->sql_escape($mcb_name) . '" - AND s.real_id = c.component_id'; - $field = 'component_name'; - break; - // case NAN_SYNONYM_BLOCK: - // break; - } - - if (!$sql || !$field) - { - return $mcb_name; - } - - $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) - { - if (isset($row[$field])) - { - return $row[$field]; - } - } - - return $mcb_name; - } // end function get_synonym - - - /** * Add a block "attached" to the visible component * Needs to be moved to Modules class... --- 102,105 ---- |
|
From: Josh G. <os...@us...> - 2005-01-03 21:41:04
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/modules/forum/styles/subSilver/template Modified Files: viewforum_topicrow_loop.html Added Files: report_body.html viewtopic_print.html Log Message: - More minor forum module stuff - Viewtopic print view - Report post --- NEW FILE: viewtopic_print.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html dir="{S_CONTENT_DIRECTION}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>{SITENAME} :: {PAGE_TITLE}</title> <style type="text/css"> <!-- body { font-family: Verdana,serif; font-size: 10pt; } td { font-family: Verdana,serif; font-size: 10pt; line-height: 150%; } .code, .quote { font-size: smaller; border: black solid 1px; } .forum { font-family: Arial,Helvetica,sans-serif; font-weight: bold; font-size: 18pt; } .topic { font-family: Arial,Helvetica,sans-serif; font-size: 14pt; font-weight: bold; } .gensmall { font-size: 8pt; } hr { color: #888888; height: 3px; border-style: solid; } hr.sep { color: #AAAAAA; height: 1px; border-style: dashed; } --> </style> </head> <body> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{U_FORUM}</a></span></td> </tr> <tr> <td colspan="2"><br /></td> </tr> <tr> <td><span class="Topic">{TOPIC_TITLE}</span><br /><span class="gensmall">{U_TOPIC}</a></span></td> <td align="right" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td> </tr> </table> <!-- BEGIN postrow --> <hr width="85%" /> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td width="10%" nowrap="nowrap">{L_AUTHOR}: </td> <td><b>{postrow.POSTER_NAME}</b> [ {postrow.POST_DATE} ]</td> </tr> <tr> <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}: </td> <td><b>{postrow.POST_SUBJECT}</b></td> </tr> <tr> <td colspan="2"><hr class="sep" />{postrow.MESSAGE}</td> </tr> </table> <!-- END postrow --> <hr width="85%" /> <!-- We request you retain the full copyright notice below including the link to www.phpbb.com. This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB {PHPBB_VERSION}" line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> <td><span class="gensmall">{PAGE_NUMBER}</span></td> <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> </tr> <tr> <td colspan="2" align="center"><span class="gensmall">Powered by NA-Nuke {NANUKE_VERSION} © 2004 JPortal <br />http://www.jportalhome.com/</span></td> </tr> </table> </body> </html> --- NEW FILE: report_body.html --- <!-- INCLUDE overall_header.html --> <!-- $Id: report_body.html,v 1.1 2005/01/03 21:40:45 osjp Exp $ --> <form method="post" action="{S_REPORT_ACTION}" name="report"> <table class="tablebg" width="100%" cellspacing="1"> <tr> <th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th> </tr> <tr> <td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td> </tr> <tr> <td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td> <td class="row2" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></td> </tr> <!-- IF S_CAN_NOTIFY --> <tr> <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}:</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td> <td class="row2"><span class="gen"><input type="radio" name="notify" value="1" <!-- IF S_NOTIFY -->checked="checked" <!-- ENDIF -->/>{L_YES} <input type="radio" name="notify" value="0" <!-- IF not S_NOTIFY -->checked="checked" <!-- ENDIF -->/>{L_NO}</span></td> </tr> <!-- ENDIF --> <tr> <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> <td class="row2"><textarea class="post" style="width:500px" name="report_text" rows="25" cols="40" class="post">{REPORT_TEXT}</textarea></td> </tr> <tr> <td class="cat" colspan="2" align="center"><input type="submit" name="submit" class="btnmain" value="{L_SUBMIT}" /> <input type="submit" name="cancel" class="btnlite" value="{L_CANCEL}"></td> </tr> </table> </form> <br clear="all" /> <!-- INCLUDE navbar.html --> <div style="float: right;"><!-- INCLUDE jumpbox.html --></div> <!-- INCLUDE overall_footer.html --> Index: viewforum_topicrow_loop.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template/viewforum_topicrow_loop.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** viewforum_topicrow_loop.html 24 Dec 2004 04:52:45 -0000 1.2 --- viewforum_topicrow_loop.html 3 Jan 2005 21:40:45 -0000 1.3 *************** *** 17,22 **** <!-- ELSEIF topicrow.TOPIC_STATUS == 'folder_posted' --> <img src="{T_THEME_PATH}/images/folder_posted.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> <!-- ELSE --> ! {topicrow.TOPIC_STATUS} <!-- ENDIF --> </td> --- 17,26 ---- <!-- ELSEIF topicrow.TOPIC_STATUS == 'folder_posted' --> <img src="{T_THEME_PATH}/images/folder_posted.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> + <!-- ELSEIF topicrow.TOPIC_STATUS == 'folder_announce' --> + <img src="{T_THEME_PATH}/images/folder_announce.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> + <!-- ELSEIF topicrow.TOPIC_STATUS == 'folder_announce_posted' --> + <img src="{T_THEME_PATH}/images/folder_announce_posted.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> <!-- ELSE --> ! -- {topicrow.TOPIC_STATUS} -- <!-- ENDIF --> </td> |
|
From: Josh G. <os...@us...> - 2005-01-03 21:41:01
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/modules/forum Modified Files: module.php posting.php viewtopic.php Added Files: report.php Log Message: - More minor forum module stuff - Viewtopic print view - Report post Index: module.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/module.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** module.php 24 Dec 2004 04:52:44 -0000 1.6 --- module.php 3 Jan 2005 21:40:45 -0000 1.7 *************** *** 121,124 **** --- 121,128 ---- require($nanuke_root_path . 'modules/forum/posting.'.$phpEx); break; + // Report + case 'report': + require($nanuke_root_path . 'modules/forum/report.'.$phpEx); + break; } } *************** *** 148,152 **** // array of components ! 'components' => array('index', 'viewforum', 'viewtopic', 'posting'), // array of blocks --- 152,156 ---- // array of components ! 'components' => array('index', 'viewforum', 'viewtopic', 'posting', 'report'), // array of blocks Index: posting.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/posting.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** posting.php 24 Dec 2004 04:52:44 -0000 1.3 --- posting.php 3 Jan 2005 21:40:45 -0000 1.4 *************** *** 643,647 **** if ($last_post_time) { ! if ($last_post_time && ($current_time - $last_post_time) < intval($config['flood_interval'])) { $error[] = $user->lang['FLOOD_ERROR']; --- 643,647 ---- if ($last_post_time) { ! if (($current_time - $last_post_time) > 0 && ($current_time - $last_post_time) < intval($config['flood_interval'])) { $error[] = $user->lang['FLOOD_ERROR']; *************** *** 1129,1135 **** 'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $user->data['user_id'] != ANONYMOUS), 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $user->data['user_id'] != ANONYMOUS && $drafts), - 'S_FORM_ENCTYPE' => $form_enctype, - 'S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); --- 1129,1133 ---- *************** *** 1144,1148 **** 'S_POLL_DELETE' => ($mode == 'edit' && $poll_options && ((!$poll_last_vote && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), ! 'L_POLL_OPTIONS_EXPLAIN'=> sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']), 'VOTE_CHANGE_CHECKED' => (isset($poll_vote_change) && $poll_vote_change) ? ' checked="checked"' : '', --- 1142,1146 ---- 'S_POLL_DELETE' => ($mode == 'edit' && $poll_options && ((!$poll_last_vote && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), ! 'L_POLL_OPTIONS_EXPLAIN'=> sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['module_forum_max_poll_options']), 'VOTE_CHANGE_CHECKED' => (isset($poll_vote_change) && $poll_vote_change) ? ' checked="checked"' : '', *************** *** 1161,1168 **** } ! // Set "before and after blocks" HTML $template->assign_vars(array( ! 'S_BEFORE_BLOCKS_HTML' => '<form action="'.$s_action.'" method="post" name="post"'.$form_enctype.'>', ! 'S_AFTER_BLOCKS_HTML' => '</form>' )); --- 1159,1166 ---- } ! // $template->assign_vars(array( ! 'S_POST_FORM_ACTION' => $s_action, ! 'S_POST_FORM_ENCTYPE' => $form_enctype )); --- NEW FILE: report.php --- <?php /** * Report script for NA-Nuke forum module, ported from sections of phpBB's report.php. * * @script: NA-Nuke * @module: forum * @version: $Id: report.php,v 1.1 2005/01/03 21:40:45 osjp Exp $ * @website: www.jportalhome.com * @email: jo...@jp... * @copyright: (C) 2004 JPortal * @begin: Mon Jan 03 2005 * @license: Free, Open Source (GPL) */ // Make sure we are not being called directly if (!defined('IN_NANUKE')) { die('Hacking attempt'); } require($nanuke_root_path . 'modules/forum/includes/functions_display.' . $phpEx); // Include language file for MCP actions $user->add_lang('mcp', false, false, 'modules/forum/language'); $id = request_var('p', 0); $report_post = (request_var('p', 0)) ? true : false; $reason_id = request_var('reason_id', 0); $user_notify = (!empty($_REQUEST['notify']) && $user->data['user_id'] != ANONYMOUS) ? true : false; $report_text = request_var('report_text', ''); if (!$id) { trigger_error('INVALID_MODE'); } $redirect_url = "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewtopic&p=$id#$id"; // Has the report been cancelled? if (isset($_POST['cancel'])) { redirect($redirect_url); } // Grab all relevant data $sql = 'SELECT f.*, t.*, p.* FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE p.post_id = $id AND p.topic_id = t.topic_id AND p.forum_id = f.forum_id"; $result = $db->sql_query($sql); if (!($report_data = $db->sql_fetchrow($result))) { $message = $user->lang['POST_NOT_EXIST']; trigger_error($message); } $forum_id = $report_data['forum_id']; $topic_id = $report_data['topic_id']; $post_id = $report_data['post_id']; // Check required permissions $acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT'); foreach ($acl_check_ary as $acl => $error) { if (!$auth->acl_get($acl, $forum_id)) { trigger_error($error); } } unset($acl_check_ary); // Check if the post has already been reported by this user $sql = 'SELECT * FROM ' . REPORTS_TABLE . ' WHERE post_id = ' . $post_id . ' AND nan_module = "forum" AND user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { if ($user->data['user_id'] != ANONYMOUS) { // A report exists, extract $row if we're going to display the form if ($reason_id) { $report_id = (int) $row['report_id']; } else { // Overwrite set variables extract($row); } } else { trigger_error($user->lang['ALREADY_REPORTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>')); } } else { $report_id = 0; } // Has the report been confirmed? if (isset($_POST['submit']) && $reason_id) { $sql = 'SELECT reason_name FROM ' . REASONS_TABLE . " WHERE reason_id = $reason_id"; $result = $db->sql_query($sql); if (!($row = $db->sql_fetchrow($result)) || (!$report_text && $row['reason_name'] == 'other')) { trigger_error('EMPTY_REPORT'); } $db->sql_freeresult($result); $reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']] : $row['reason_name']; $sql_ary = array( 'reason_id' => (int) $reason_id, 'post_id' => $id, 'user_id' => (int) $user->data['user_id'], 'user_notify' => (int) $user_notify, 'report_time' => (int) time(), 'report_text' => (string) $report_text ); if ($report_id) { $sql = 'UPDATE ' . REPORTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE report_id = ' . $report_id; $db->sql_query($sql); } else { $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); $report_id = $db->sql_nextid(); } if (!$report_data['post_reported']) { $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_reported = 1 WHERE post_id = ' . $id; $db->sql_query($sql); } if (!$report_data['topic_reported']) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_reported = 1 WHERE topic_id = ' . $report_data['topic_id']; $db->sql_query($sql); } // Send Notifications // PM: Reported Post is put into all admin's boxes (not notifying about 'this' PM) // All persons get notified about a new report, if notified by PM, send out email notifications too // Send notifications to moderators $acl_list = ($report_post) ? $auth->acl_get_list(false, array('m_', 'a_'), array(0, $report_data['forum_id'])) : $auth->acl_get_list(false, 'a_', 0); $notify_user = ($report_post) ? $acl_list[$report_data['forum_id']]['m_'] : array(); $notify_user = array_unique(array_merge($notify_user, $acl_list[0]['a_'])); unset($acl_list); // How to notify them? $sql = 'SELECT user_id, username, user_options, user_lang, user_email, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' WHERE user_id IN (' . implode(', ', $notify_user) . ')'; $result = $db->sql_query($sql); $notify_user = array(); while ($row = $db->sql_fetchrow($result)) { $notify_user[$row['user_id']] = array( 'name' => $row['username'], 'email' => $row['user_email'], 'jabber'=> $row['user_jabber'], 'lang' => $row['user_lang'], 'notify_type' => $row['user_notify_type'], 'pm' => $user->optionget('report_pm_notify', $row['user_options']) ); } $db->sql_freeresult($result); $report_data = array( 'id' => $id, 'report_id' => $report_id, 'reporter' => $user->data['username'], 'reason' => $reason_desc, 'text' => $report_text, 'subject' => $report_data['post_subject'], 'view_post' => "index.$phpEx?mod=forum&com=viewtopic&f={$report_data['forum_id']}&t={$report_data['topic_id']}&p=$id&e=$id" ); report_notification($notify_user, $report_data); meta_refresh(3, $redirect_url); $message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } // Generate the form $sql = 'SELECT * FROM ' . REASONS_TABLE . ' ORDER BY reason_priority ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $row['reason_name'] = strtoupper($row['reason_name']); $reason_title = (!empty($user->lang['report_reasons']['TITLE'][$row['reason_name']])) ? $user->lang['report_reasons']['TITLE'][$row['reason_name']] : ucwords(str_replace('_', ' ', $row['reason_name'])); $reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']] : $row['reason_desc']; $template->assign_block_vars('reason', array( 'ID' => $row['reason_id'], 'NAME' => htmlspecialchars($reason_title), 'DESCRIPTION' => htmlspecialchars($reason_desc), 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false) ); } $u_report = "p=$id"; $template->assign_vars(array( 'REPORT_TEXT' => $report_text, 'S_REPORT_ACTION' => "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=report&$u_report&report_id=$report_id", 'S_NOTIFY' => (!empty($user_notify)) ? true : false, 'S_CAN_NOTIFY' => ($user->data['user_id'] == ANONYMOUS) ? false : true, 'S_REPORT_POST' => $report_post) ); // Generate navlinks generate_forum_nav($report_data, false); $template->assign_block_vars('navlinks', array( 'NAVNAME' => $user->lang['REPORT_POST'], 'S_CURRENT_PAGE' => true )); // Start output of page $page_title = $user->lang['REPORT_POST']; page_header($page_title); $template->set_filenames(array( 'body' => 'report_body.html') ); page_footer(); function report_notification($notify_user, $report_data) { global $config, $nanuke_root_path, $phpEx; include_once($nanuke_root_path . 'includes/functions_messenger.' . $phpEx); include_once($nanuke_root_path . 'modules/ucp/includes/functions_privmsgs.' . $phpEx); $messenger = new messenger(); $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); $email_template = 'new_report_post'; $view_report_url = "index.$phpEx&mod=forum&com=mcp?i=queue&r=" . $report_data['report_id']; foreach ($notify_user as $user_id => $notify_row) { // Send notification by email if (!$notify_row['pm']) { print_r($notify_user); $messenger->to($notify_row['email'], $notify_row['name']); $messenger->im($notify_row['jabber'], $notify_row['name']); $messenger->replyto($config['board_email']); $messenger->template($email_template, $notify_row['lang']); $messenger->assign_vars(array( 'EMAIL_SIG' => $email_sig, 'SITENAME' => $config['sitename'], 'USERNAME' => $notify_row['name'], 'SUBJECT' => $report_data['subject'], 'REPORTER' => $report_data['reporter'], 'REPORT_REASON' => $report_data['reason'], 'REPORT_TEXT' => $report_data['text'], 'U_VIEW_REPORT' => generate_board_url() . '/' . $view_report_url, 'U_VIEW_POST' => generate_board_url() . '/' . $report_data['view_post']) ); $messenger->send($notify_row['notify_type']); $messenger->reset(); if ($messenger->queue) { $messenger->queue->save(); } } else { // Use messenger for getting the correct message, we use the email template $messenger->template($email_template, $notify_row['lang']); $messenger->assign_vars(array( 'EMAIL_SIG' => $email_sig, 'SITENAME' => $config['sitename'], 'USERNAME' => $notify_row['name'], 'SUBJECT' => $report_data['subject'], 'REPORTER' => $report_data['reporter'], 'REPORT_REASON' => $report_data['reason'], 'REPORT_TEXT' => $report_data['text'], 'U_VIEW_REPORT' => generate_board_url() . '/' . $view_report_url) ); // break the sending process... $messenger->send(false, true); $messenger->reset(); // do not put in reporters outbox submit_pm('post', $report_data['subject'], '', array(), array(), array( 'address_list' => array('u' => array($user_id => 'to')), 'icon_id' => 0, 'enable_bbcode' => 0, 'enable_html' => 0, 'enable_smilies' => 0, 'enable_magic_url' => 1, 'enable_sig' => 0, 'message_md5' => md5($messenger->msg), 'bbcode_bitfield' => 0, 'bbcode_uid' => 0, 'attachment_data' => array(), 'filename_data' => array(), 'message' => $messenger->msg ), true, false); } } unset($messenger); } ?> Index: viewtopic.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/viewtopic.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** viewtopic.php 24 Dec 2004 04:52:44 -0000 1.3 --- viewtopic.php 3 Jan 2005 21:40:45 -0000 1.4 *************** *** 192,195 **** --- 192,199 ---- } + // NA-Nuke hack: sometimes the "bookmarked" var is not present in the $topic_data + // array (extracted below), but it is still requested in this page, causing PHP notices. Prevent this. + $topic_data['bookmarked'] = (isset($topic_data['bookmarked']) ? $topic_data['bookmarked'] : false); + // Extract the data extract($topic_data); *************** *** 498,502 **** 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f=$forum_id", ! 'U_TOPIC' => "{$server_path}index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, 'U_VIEW_UNREAD_POST' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&view=unread#unread", --- 502,506 ---- 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f=$forum_id", ! 'U_TOPIC' => "{$server_path}index.$phpEx?mod=forum&com=viewtopic&f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, 'U_VIEW_UNREAD_POST' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&view=unread#unread", *************** *** 1276,1280 **** 'U_JABBER' => $user_cache[$poster_id]['jabber'], ! 'U_REPORT' => "report.$phpEx$SID&p=" . $row['post_id'], 'U_MCP_REPORT' => ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'] : '', --- 1280,1284 ---- 'U_JABBER' => $user_cache[$poster_id]['jabber'], ! 'U_REPORT' => "index.$phpEx$SID&mod=forum&com=report&p=" . $row['post_id'], 'U_MCP_REPORT' => ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'] : '', |
|
From: Josh G. <os...@us...> - 2005-01-03 21:40:58
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/language/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/modules/forum/language/en Added Files: mcp.php Log Message: - More minor forum module stuff - Viewtopic print view - Report post --- NEW FILE: mcp.php --- <?php // ------------------------------------------------------------- // // $Id: mcp.php,v 1.1 2005/01/03 21:40:46 osjp Exp $ // // FILENAME : mcp.php [ English ] // STARTED : Sat Dec 16, 2000 // COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ // LICENCE : GPL vs2.0 [ see /docs/COPYING ] // // ------------------------------------------------------------- // 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( 'ACTION' => 'Action', 'ADD_FEEDBACK' => 'Add feedback', 'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text, HTML, BBCode, etc. are not permitted.', 'ALL_ENTRIES' => 'All entries', 'ALREADY_REPORTED' => 'This post has already been reported', 'APPROVE' => 'Approve', 'APPROVE_POST' => 'Approve Post', 'APPROVE_POST_CONFIRM' => 'Are you sure you want to approve this post?', 'APPROVE_POSTS' => 'Approve Posts', 'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?', 'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it\'s already in', 'CAN_LEAVE_BLANK' => 'This can be left blank.', 'CHANGE_POSTER' => 'Change poster', 'DELETE_POSTS' => 'Delete posts', 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?', 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this post?', 'DELETE_TOPICS' => 'Delete selected topics', 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?', 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', 'DISAPPROVE' => 'Disapprove', 'DISPLAY_LOG' => 'Display entries from previous', 'DISPLAY_OPTIONS' => 'Display options', 'EMPTY_REPORT' => 'You must enter a description when selecting this reason', 'EMPTY_TOPICS_REMOVED_WARNING' => 'Please note that one or several topics have been removed from the database because they were or become empty', 'FEEDBACK' => 'Feedback', 'FORK' => 'Fork', 'FORK_TOPIC' => 'Fork Topic', 'FORK_TOPIC_CONFIRM' => 'Are you sure you want to copy this topic?', 'FORK_TOPICS' => 'Fork selected topics', 'FORK_TOPICS_CONFIRM' => 'Are you sure you want to copy the selected topics?', 'FORUM_DESC' => 'Description', 'FORUM_NAME' => 'Forum Name', 'FORUM_NOT_EXIST' => 'The forum you selected does not exist', 'FORUM_NOT_POSTABLE' => 'The forum you selected cannot be posted to', 'FORUM_STATUS' => 'Forum Status', 'FORUM_STYLE' => 'Forum Style', 'IP_INFO' => 'IP Information', 'LATEST_LOGS' => 'Latest 5 logged actions', 'LATEST_REPORTED' => 'Latest 5 reports', 'LATEST_UNAPPROVED' => 'Latest 5 posts awaiting for approval', 'LEAVE_SHADOW' => 'Leave shadow topic in place', 'LOCK' => 'Lock', 'LOCK_POST_POST' => 'Lock Post', 'LOCK_POST_POST_CONFIRM'=> 'Are you sure you want to prevent editing this post?', 'LOCK_POST_POSTS' => 'Lock selected posts', 'LOCK_POST_POSTS_CONFIRM'=> 'Are you sure you want to prevent editing the selected posts?', 'LOCK_TOPIC_CONFIRM' => 'Are you sure you want to lock this topic?', 'LOCK_TOPICS' => 'Lock selected topics', 'LOCK_TOPICS_CONFIRM' => 'Are you sure you want to lock all selected topics?', 'LOGS_CURRENT_TOPIC' => 'Currently viewing logs of:', 'LOG_APPROVE_TOPIC' => '<b>Approved topic</b><br />» %s', 'LOG_FORK' => '<b>Copied topic</b><br />» from %s', 'LOG_LOCK' => '<b>Locked topic</b><br />» %s', 'LOG_LOCK_POST' => '<b>Locked post</b><br />» %s', 'LOG_MERGE' => '<b>Merged posts</b> into topic<br />»%s', 'LOG_MOVE' => '<b>Moved topic</b><br />» from %s', 'LOG_TOPIC_DELETED' => '<b>Deleted topic</b><br />» %s', 'LOG_TOPIC_RESYNC' => '<b>Resynchronised topic counters</b><br />» %s', 'LOG_TOPIC_TYPE_CHANGED'=> '<b>Changed topic type</b><br />» %s', 'LOG_UNLOCK' => '<b>Unlocked topic</b><br />» %s', 'LOG_UNLOCK_POST' => '<b>Unlocked post</b><br />» %s', 'LOG_UNRATE' => '<b>Unrated post</b><br />» %s', 'LOGVIEW_VIEWTOPIC' => 'View Topic', 'LOGVIEW_VIEWLOGS' => 'View Topic Log', 'LOGVIEW_VIEWFORUM' => 'View Forum', 'LOOKUP_ALL' => 'Look up all IP', 'LOOKUP_IP' => 'Look up IP', 'MCP_ADD' => 'Add a warning', 'MCP_MAIN' => 'Main', 'MCP_MAIN_FORUM_VIEW' => 'View Forum', 'MCP_MAIN_FRONT' => 'Front Page', 'MCP_MAIN_POST_DETAILS' => 'Post Details', 'MCP_MAIN_TOPIC_VIEW' => 'View Topic', 'MCP_MAKE_ANNOUNCEMENT' => 'Make Announcement', 'MCP_MAKE_ANNOUNCEMENT_CONFIRM' => 'Are you sure you want to change this topic to an announcement?', 'MCP_MAKE_ANNOUNCEMENTS' => 'Make Announcements', 'MCP_MAKE_ANNOUNCEMENTS_CONFIRM'=> 'Are you sure you want to change the selected topics to announcements?', 'MCP_MAKE_GLOBAL' => 'Make Global Announcement', 'MCP_MAKE_GLOBAL_CONFIRM' => 'Are you sure you want to change this topic to an global announcement?', 'MCP_MAKE_GLOBALS' => 'Make Global Announcements', 'MCP_MAKE_GLOBALS_CONFIRM' => 'Are you sure you want to change the selected topics to global announcements?', 'MCP_MAKE_STICKY' => 'Make Sticky', 'MCP_MAKE_STICKY_CONFIRM' => 'Are you sure you want to stick this topic?', 'MCP_MAKE_STICKIES' => 'Make Stickies', 'MCP_MAKE_STICKIES_CONFIRM' => 'Are you sure you want to stick the selected topics?', 'MCP_MAKE_NORMAL' => 'Make Standard Topic', 'MCP_MAKE_NORMAL_CONFIRM' => 'Are you sure you want to revert this topic?', 'MCP_MAKE_NORMALS' => 'Make Standard Topics', 'MCP_MAKE_NORMALS_CONFIRM' => 'Are you sure you want to revert the selected topics?', 'MCP_QUEUE' => 'Moderation Queue', 'MCP_QUEUE_REPORTS' => 'Reports', 'MCP_QUEUE_UNAPPROVED_POSTS' => 'Posts awaiting for approval', 'MCP_QUEUE_UNAPPROVED_TOPICS' => 'Topics awaiting for approval', 'MCP_VIEW_ALL' => 'View all (%s)', 'MCP_VIEW_LOGS' => 'View logs', 'MCP_VIEW_RECENT' => 'View recent (%s)', 'MCP_VIEW_USER' => 'View warnings for a specific user', 'MCP_WARNINGS' => 'Warnings', 'MERGE_POSTS' => 'Merge posts', 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?', 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.<br />Please enter the destination topic id or click on the "Select" button to search for one', 'MERGE_TOPIC_ID' => 'Destination topic id', 'MESSAGE_REPORTED_SUCCESS' => 'This message has been successfully reported', 'MOD_OPTIONS' => 'Moderator Options', 'MORE_INFO' => 'Further information', 'MOVE_TOPIC_CONFIRM' => 'Are you sure you want to move the topic into a new forum?', 'MOVE_TOPICS' => 'Move selected topics', 'MOVE_TOPICS_CONFIRM' => 'Are you sure you want to move the selected topics into a new forum?', 'NOTIFY_POSTER_APPROVAL'=> 'Notify poster about approval?', 'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?', 'NOT_MODERATOR' => 'You are not a moderator of this forum', 'NO_DESTINATION_FORUM' => 'Please select a forum for destination', 'NO_ENTRIES' => 'No log entries for this period', 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts', 'NO_MATCHES_FOUND' => 'No matches found', 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', 'OTHER_IPS' => 'Other IP addresses this user has posted from', 'OTHER_USERS' => 'Users posting from this IP', 'POSTER' => 'Poster', 'POSTS_APPROVED_SUCCESS'=> 'The selected posts have been approved', 'POSTS_DELETED_SUCCESS' => 'The selected posts have been successfully removed from the database', 'POSTS_LOCKED_SUCCESS' => 'The selected posts have been locked successfully', 'POSTS_MERGED_SUCCESS' => 'The selected posts have been merged', 'POSTS_UNLOCKED_SUCCESS'=> 'The selected posts have been unlocked successfully', 'POSTS_PER_PAGE' => 'Posts per page', 'POSTS_PER_PAGE_EXPLAIN'=> '(Set to 0 to view all posts)', 'POST_APPROVED_SUCCESS' => 'The selected post has been approved', 'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database', 'POST_DETAILS' => 'Post details', 'POST_LOCKED_SUCCESS' => 'Post locked successsfully', 'POST_NOT_EXIST' => 'The post you requested does not exist', 'POST_REPORTED_SUCCESS' => 'This post has been successfully reported', 'POST_UNLOCKED_SUCCESS' => 'Post unlocked successsfully', 'POST_UNRATED_SUCCESS' => 'Post unrated successfully', 'READ_USERNOTES' => 'User notes', 'READ_WARNINGS' => 'User warnings', 'REPORTER' => 'Reporter', 'REPORT_TIME' => 'Report time', 'REPORTS_TOTAL' => 'In total there are <b>%d</b> reports to review', 'REPORTS_ZERO_TOTAL' => 'There are no reports to review', 'REPORT_MESSAGE' => 'Report this message', 'REPORT_MESSAGE_EXPLAIN'=> 'Use this form to report the selected message to the board administrators. Reporting should generally be used only if the message breaks forum rules.', 'REPORT_NOTIFY' => 'Notify me', 'REPORT_NOTIFY_EXPLAIN' => 'Informs you when your report is dealt with', 'REPORT_POST' => 'Report this post', 'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.', 'REPORT_TOTAL' => 'In total there is <b>1</b> report to review', 'RESYNC' => 'Resync', 'RETURN_MESSAGE' => 'Click %sHere%s to return to the message', 'RETURN_NEW_FORUM' => 'Click %sHere%s to return to the new forum', 'RETURN_NEW_TOPIC' => 'Click %sHere%s to return to the new topic', 'SELECT_ACTION' => 'Select desired action', 'SELECT_TOPIC' => 'Select topic', 'SORT_ACTION' => 'Log action', 'SORT_DATE' => 'Date', 'SORT_IP' => 'IP address', 'SPLIT_AFTER' => 'Split from selected post', 'SPLIT_FORUM' => 'Forum for new topic', 'SPLIT_POSTS' => 'Split selected posts', 'SPLIT_SUBJECT' => 'New topic title', 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', 'SPLIT_TOPIC_ALL_CONFIRM' => 'Are you sure you want to split this topic?', 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', 'SPLIT_TOPIC_BEYOND_CONFIRM' => 'Are you sure you want to split this topic at the selected post?', 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', 'THIS_POST_IP' => 'IP for this post', 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved', 'TOPICS_DELETED_SUCCESS'=> 'The selected topics have been successfully removed from the database', 'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully', 'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked', 'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully', 'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised', 'TOPICS_UNLOCKED_SUCCESS' => 'The selected topics have been unlocked', 'TOPIC_APPROVED_SUCCESS'=> 'The selected topic has been approved', 'TOPIC_DELETED_SUCCESS' => 'The selected topic has been successfully removed from the database', 'TOPIC_FORKED_SUCCESS' => 'The selected topic has been copied successfully', 'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked', 'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully', 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist', 'TOPIC_REPORTED' => 'This topic has been reported', 'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised', 'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully', 'TOPIC_TIME' => 'Topic time', 'TOPIC_TYPE_CHANGED' => 'Topic type changed successfully.', 'TOPIC_UNLOCKED_SUCCESS'=> 'The selected topic has been unlocked', 'UNAPPROVED_POSTS_TOTAL'=> 'In total there are <b>%d</b> posts waiting for approval', 'UNAPPROVED_POSTS_ZERO_TOTAL' => 'There are no posts waiting for approval', 'UNAPPROVED_POST_TOTAL' => 'In total there is <b>1</b> post waiting for approval', 'UNLOCK' => 'Unlock', 'UNLOCK_POST' => 'Unlock Post', 'UNLOCK_POST_EXPLAIN' => 'Allow editing', 'UNLOCK_POST_POST' => 'Unlock Post', 'UNLOCK_POST_POST_CONFIRM'=> 'Are you sure you want to allow editing this post?', 'UNLOCK_POST_POSTS' => 'Unlock selected posts', 'UNLOCK_POST_POSTS_CONFIRM'=> 'Are you sure you want to allow editing the selected posts?', 'UNLOCK_TOPIC' => 'Unlock Topic', 'UNLOCK_TOPIC_CONFIRM' => 'Are you sure you want to unlock this topic?', 'UNLOCK_TOPICS' => 'Unlock selected topics', 'UNLOCK_TOPICS_CONFIRM' => 'Are you sure you want to unlock all selected topics?', 'UNRATE_POST' => 'Unrate post', 'UNRATE_POST_EXPLAIN' => 'Reset post rating', 'USER_CANNOT_POST' => 'You cannot post in this forum', 'USER_CANNOT_REPORT' => 'You cannot report posts in this forum', 'USER_FEEDBACK_ADDED' => 'User feedback added successfully', 'VIEW_DETAILS' => 'View Details', 'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s', 'report_reasons' => array( 'TITLE' => array( 'WAREZ' => 'Warez', 'SPAM' => 'Spam', 'OFF_TOPIC' => 'Off-topic', 'OTHER' => 'Other' ), 'DESCRIPTION' => array( 'WAREZ' => 'The post contains links to illegal or pirated software', 'SPAM' => 'The reported post has the only purpose to advertise for a website or another product', 'OFF_TOPIC' => 'The reported post is off topic', 'OTHER' => 'The reported post does not fit into any other category, please use the description field' ) ) ); ?> |
|
From: Josh G. <os...@us...> - 2005-01-03 21:40:56
|
Update of /cvsroot/nanuke/nanuke0.x In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689 Added Files: phpbb-patches-2004-12-12-08.07.txt phpbb-patches-2004-12-15-12.31.txt phpbb-patches-2004-12-18-0.42.txt phpbb-patches-2004-12-19-09.59.txt phpbb-patches-2004-12-21-18.06.txt phpbb-patches-2004-12-31-19.24.txt phpbb-patches-2005-1-02-19.52.txt Log Message: - More minor forum module stuff - Viewtopic print view - Report post --- NEW FILE: phpbb-patches-2004-12-15-12.31.txt --- -------------------------------------------------------- part 1 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes/mcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/includes/mcp Modified Files: mcp_front.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: mcp_front.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_front.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mcp_front.php 19 Jul 2004 20:13:16 -0000 1.3 --- mcp_front.php 15 Dec 2004 18:30:50 -0000 1.4 *************** *** 27,30 **** --- 27,33 ---- $forum_list = get_forum_list("m_approve"); $post_list = array(); + $forum_names = array(); + + $forum_id = request_var("f", 0); $template->assign_var("S_SHOW_UNAPPROVED", (!empty($forum_list)) ? true : false); *************** *** 41,44 **** --- 44,58 ---- if ($total) { + $sql = "SELECT forum_id, forum_name + FROM " . FORUMS_TABLE . " + WHERE forum_id IN (" . implode(", ", $forum_list) . ")"; + $result = $db->sql_query_limit($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row["forum_id"]] = $row["forum_name"]; + } + $db->sql_freeresult($result); + $sql = "SELECT post_id FROM " . POSTS_TABLE . " *************** *** 52,60 **** } ! $sql = "SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, f.forum_id, f.forum_name ! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u WHERE p.post_id IN (" . implode(", ", $post_list) . ") AND t.topic_id = p.topic_id - AND f.forum_id = p.forum_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC"; --- 66,73 ---- } ! $sql = "SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id ! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u WHERE p.post_id IN (" . implode(", ", $post_list) . ") AND t.topic_id = p.topic_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC"; *************** *** 68,75 **** "U_MCP_TOPIC" => $url . "&t=" . $row["topic_id"] . "&mode=topic_view", "U_FORUM" => ($row["forum_id"]) ? "viewforum." . $phpEx . $SID . "&f=" . $row["forum_id"] : "", ! "U_TOPIC" => "viewtopic." . $phpEx . $SID . "&f=" . $row["forum_id"] . "&t=" . $row["topic_id"], "U_AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? "" : "memberlist." . $phpEx . $SID . "&mode=viewprofile&u=" . $row["poster_id"], ! "FORUM_NAME" => ($row["forum_id"]) ? $row["forum_name"] : $user->lang["POST_GLOBAL"], "TOPIC_TITLE" => $row["topic_title"], "AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? (($row["post_username"]) ? $row["post_username"] : $user->lang["GUEST"]) : $row["username"], --- 81,88 ---- "U_MCP_TOPIC" => $url . "&t=" . $row["topic_id"] . "&mode=topic_view", "U_FORUM" => ($row["forum_id"]) ? "viewforum." . $phpEx . $SID . "&f=" . $row["forum_id"] : "", ! "U_TOPIC" => $nanuke_root_path . "viewtopic." . $phpEx . $SID . "&f=" . (($row["forum_id"]) ? $row["forum_id"] : $forum_id) . "&t=" . $row["topic_id"], "U_AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? "" : "memberlist." . $phpEx . $SID . "&mode=viewprofile&u=" . $row["poster_id"], ! "FORUM_NAME" => ($row["forum_id"]) ? $forum_names[$row["forum_id"]] : $user->lang["GLOBAL_ANNOUNCEMENT"], "TOPIC_TITLE" => $row["topic_title"], "AUTHOR" => ($row["poster_id"] == ANONYMOUS) ? (($row["post_username"]) ? $row["post_username"] : $user->lang["GUEST"]) : $row["username"], -------------------------------------------------------- part 2 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/includes Modified Files: functions_admin.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -r1.89 -r1.90 *** functions_admin.php 12 Dec 2004 14:07:01 -0000 1.89 --- functions_admin.php 15 Dec 2004 18:30:48 -0000 1.90 *************** *** 320,324 **** } ! if (!count($where_ids)) { return array("topics" => 0, "posts" => 0); --- 320,324 ---- } ! if (!sizeof($where_ids)) { return array("topics" => 0, "posts" => 0); *************** *** 404,408 **** } ! if (!count($post_ids)) { return false; --- 404,408 ---- } ! if (!sizeof($post_ids)) { return false; *************** *** 658,662 **** } ! if (count($topic_ids)) { $sql = "DELETE FROM " . TOPICS_TABLE . " --- 658,662 ---- } ! if (sizeof($topic_ids)) { $sql = "DELETE FROM " . TOPICS_TABLE . " *************** *** 723,763 **** if (!$where_type) { ! // Sync all topics/forums. ! if($mode == "topic") ! { ! //This can bomb out on a large forum so we"re going to split this up. ! $batch_size = 500; ! ! //TODO: Fit this into the layout. ! print "Syncing topics, going to do this in batches (batch size = $batch_size):<br />"; ! $sql = "SELECT ! MIN(topic_id) AS topic_min, ! MAX(topic_id) AS topic_max ! FROM " . TOPICS_TABLE; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $topic_min = $row["topic_min"]; ! $topic_max = $row["topic_max"]; ! ! // Run the batches ! $batch_start = $topic_min; ! while($batch_start <= $topic_max) ! { ! if (defined("DEBUG_EXTRA")) ! { ! print "Syncing topic_id $batch_start to ". ($batch_start+$batch_size) . ". "; ! print ceil(memory_get_usage()/1024) . " KB<br />\n"; ! flush(); ! } ! sync("topic", "range", "topic_id BETWEEN $batch_start AND " . ($batch_start+$batch_size-1)); ! ! $batch_start += $batch_size; ! } ! } ! else ! { ! $where_sql = ""; ! $where_sql_and = "WHERE"; ! } } elseif ($where_type == "range") --- 723,728 ---- if (!$where_type) { ! $where_sql = ""; ! $where_sql_and = "WHERE"; } elseif ($where_type == "range") *************** *** 775,779 **** } // Limit the topics/forums we are syncing, use specific topic/forum IDs. ! // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; $where_sql_and = $where_sql . "\n\tAND"; --- 740,744 ---- } // Limit the topics/forums we are syncing, use specific topic/forum IDs. ! // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; $where_sql_and = $where_sql . "\n\tAND"; *************** *** 786,789 **** --- 751,755 ---- return; } + // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = "WHERE " . $mode{0} . ".$where_type IN (" . implode(", ", $where_ids) . ")"; *************** *** 853,857 **** $db->sql_freeresult(); ! if (!count($topic_ids)) { return; --- 819,823 ---- $db->sql_freeresult(); ! if (!sizeof($topic_ids)) { return; *************** *** 907,911 **** } ! if (count($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " --- 873,877 ---- } ! if (sizeof($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " *************** *** 945,949 **** } ! if (count($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 911,915 ---- } ! if (sizeof($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 997,1001 **** } ! if (count($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " --- 963,967 ---- } ! if (sizeof($post_ids)) { $sql = "UPDATE " . POSTS_TABLE . " *************** *** 1035,1039 **** } ! if (count($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1001,1005 ---- } ! if (sizeof($topic_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1107,1111 **** // 4: Retrieve last_post infos ! if (count($post_ids)) { $sql = "SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username --- 1073,1077 ---- // 4: Retrieve last_post infos ! if (sizeof($post_ids)) { $sql = "SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username *************** *** 1165,1169 **** } ! if (count($sql)) { $sql = "UPDATE " . FORUMS_TABLE . " --- 1131,1135 ---- } ! if (sizeof($sql)) { $sql = "UPDATE " . FORUMS_TABLE . " *************** *** 1204,1212 **** // Use "t" as table alias because of the $where_sql clause ! // NOTE: "t.post_approved" in the GROUP BY is causing a major slowdown. $sql = "SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM " . POSTS_TABLE . " t $where_sql ! GROUP BY t.topic_id, t.post_approved"; $result = $db->sql_query($sql); --- 1170,1178 ---- // Use "t" as table alias because of the $where_sql clause ! // NOTE: "t.post_approved" in the GROUP BY is causing a major slowdown. $sql = "SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM " . POSTS_TABLE . " t $where_sql ! GROUP BY t.topic_id"; //, t.post_approved"; $result = $db->sql_query($sql); *************** *** 1251,1260 **** // Now we delete empty topics and orphan posts ! if (count($delete_posts)) { delete_posts("topic_id", array_keys($delete_posts), FALSE); unset($delete_posts); } ! if (!count($topic_data)) { // If we get there, topic ids were invalid or topics did not contain any posts --- 1217,1227 ---- // Now we delete empty topics and orphan posts ! if (sizeof($delete_posts)) { delete_posts("topic_id", array_keys($delete_posts), FALSE); unset($delete_posts); } ! ! if (!sizeof($topic_data)) { // If we get there, topic ids were invalid or topics did not contain any posts *************** *** 1262,1266 **** return; } ! if (count($delete_topics)) { $delete_topic_ids = array(); --- 1229,1233 ---- return; } ! if (sizeof($delete_topics)) { $delete_topic_ids = array(); *************** *** 1306,1310 **** // approved becomes unapproved, and vice-versa ! if (count($approved_unapproved_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1273,1277 ---- // approved becomes unapproved, and vice-versa ! if (sizeof($approved_unapproved_ids)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1365,1369 **** } ! if (count($sql)) { $sql = "UPDATE " . TOPICS_TABLE . " --- 1332,1336 ---- } ! if (sizeof($sql)) { $sql = "UPDATE " . TOPICS_TABLE . " *************** *** 1378,1382 **** // if some topics have been resync"ed then resync parent forums ! if ($resync_parents && count($resync_forums)) { sync("forum", "forum_id", $resync_forums, TRUE); --- 1345,1349 ---- // if some topics have been resync"ed then resync parent forums ! if ($resync_parents && sizeof($resync_forums)) { sync("forum", "forum_id", $resync_forums, TRUE); *************** *** 1485,1489 **** // try to keep mem. use down ! $linecount = count($lines); $in_comment = false; --- 1452,1456 ---- // try to keep mem. use down ! $linecount = sizeof($lines); $in_comment = false; *************** *** 1531,1535 **** // this is faster than calling count($oktens) every time thru the loop. ! $token_count = count($tokens); for ($i = 0; $i < $token_count; $i++) { --- 1498,1502 ---- // this is faster than calling count($oktens) every time thru the loop. ! $token_count = sizeof($tokens); for ($i = 0; $i < $token_count; $i++) { *************** *** 1838,1842 **** $db->sql_freeresult($result); ! if (count($topic_id_list)) { $topic_id_list = array_unique($topic_id_list); --- 1805,1809 ---- $db->sql_freeresult($result); ! if (sizeof($topic_id_list)) { $topic_id_list = array_unique($topic_id_list); *************** *** 1853,1857 **** if ($auth->acl_get("f_read", $row["forum_id"])) { ! // DEBUG!! $config["default_forum_id"] = 2; $is_auth[$row["topic_id"]] = ($row["forum_id"]) ? $row["forum_id"] : $config["default_forum_id"]; --- 1820,1824 ---- if ($auth->acl_get("f_read", $row["forum_id"])) { ! // DEBUG!! - global topic $config["default_forum_id"] = 2; $is_auth[$row["topic_id"]] = ($row["forum_id"]) ? $row["forum_id"] : $config["default_forum_id"]; *************** *** 1871,1876 **** } ! $sql = "SELECT COUNT(*) AS total_entries ! FROM " . LOG_TABLE . " l WHERE l.log_type = $log_type AND l.log_time >= $limit_days --- 1838,1843 ---- } ! $sql = "SELECT COUNT(l.log_id) AS total_entries ! FROM " . LOG_TABLE . " l WHERE l.log_type = $log_type AND l.log_time >= $limit_days -------------------------------------------------------- part 3 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/language/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/language/en Modified Files: mcp.php Log Message: - removed custom code. ;) - fixed display of global, unapproved topics in mcp front (still a lot of bugs regarding global announcements) Index: mcp.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/language/en/mcp.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** mcp.php 4 Sep 2004 19:32:23 -0000 1.11 --- mcp.php 15 Dec 2004 18:30:50 -0000 1.12 *************** *** 70,73 **** --- 70,75 ---- "FORUM_STYLE" => "Forum Style", + "GLOBAL_ANNOUNCEMENT" => "Global Announcement", + "IP_INFO" => "IP Information", --- NEW FILE: phpbb-patches-2005-1-02-19.52.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5560/includes Modified Files: functions.php session.php Log Message: ...see if i am able to break the cookie tracking system this time. :D - made some session code updates - added new acl function (might be helpful later) Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.302 retrieving revision 1.303 diff -C2 -r1.302 -r1.303 *** functions.php 31 Dec 2004 13:58:37 -0000 1.302 --- functions.php 2 Jan 2005 19:06:44 -0000 1.303 *************** [...1054 lines suppressed...] *** 366,370 **** # -- username: Admin password: admin (change this or remove it ON #ce everything is working!) ! INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 3, 7, "Admin", 0, "21232f297a57a5a743894a0e4a801fc3", "admin@yo...", "en", 1, 1, "AA0000"); # -- bots --- 366,370 ---- # -- username: Admin password: admin (change this or remove it ON #ce everything is working!) ! INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts) VALUES (2, 3, 7, "Admin", 0, "21232f297a57a5a743894a0e4a801fc3", "admin@yo...", "en", 1, 1, "AA0000", 1); # -- bots --- NEW FILE: phpbb-patches-2004-12-18-0.42.txt --- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612 Modified Files: viewtopic.php Log Message: fix highlight issue in 2.1 Index: viewtopic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -r1.354 -r1.355 *** viewtopic.php 14 Nov 2004 17:12:07 -0000 1.354 --- viewtopic.php 18 Dec 2004 16:42:21 -0000 1.355 *************** *** 35,39 **** $update = request_var("update", false); ! $hilit_words = urldecode(request_var("hilit", "")); // Do we have a topic or post id? --- 35,39 ---- $update = request_var("update", false); ! $hilit_words = request_var("hilit", ""); // Do we have a topic or post id? *************** *** 336,344 **** if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote($word, "#")); } } ! $highlight = htmlspecialchars(urlencode($hilit_words)); } --- 336,344 ---- if (trim($word)) { ! $highlight_match .= (($highlight_match != "") ? "|" : "") . str_replace("\*", "\w*?", preg_quote(urlencode($word), "#")); } } ! $highlight = urlencode($hilit_words); } --- NEW FILE: phpbb-patches-2004-12-31-19.24.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes Modified Files: functions.php functions_display.php message_parser.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.301 retrieving revision 1.302 diff -C2 -r1.301 -r1.302 *** functions.php 22 Dec 2004 02:06:42 -0000 1.301 --- functions.php 31 Dec 2004 13:58:37 -0000 1.302 *************** *** 1390,1394 **** { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "mysql.php") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; --- 1390,1394 ---- { // Remove me ! if (!strstr($errfile, "/cache/") && !strstr($errfile, "template.php")) { echo "<b>PHP Notice</b>: in file <b>$errfile</b> on line <b>$errline</b>: <b>$msg_text</b><br>"; *************** *** 1534,1538 **** AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql, false); while ($row = $db->sql_fetchrow($result)) --- 1534,1538 ---- AND u.user_id = s.session_user_id ORDER BY u.username ASC, s.session_ip ASC"; ! $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) *************** *** 1580,1583 **** --- 1580,1584 ---- $prev_session_ip = $row["session_ip"]; } + $db->sql_freeresult($result); if (!$online_userlist) Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** functions_display.php 19 Dec 2004 17:59:13 -0000 1.62 --- functions_display.php 31 Dec 2004 13:58:40 -0000 1.63 *************** *** 163,167 **** } } ! $db->sql_freeresult(); // Handle marking posts --- 163,167 ---- } } ! $db->sql_freeresult($result); // Handle marking posts Index: message_parser.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/message_parser.php,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -r1.83 -r1.84 *** message_parser.php 19 Dec 2004 17:59:13 -0000 1.83 --- message_parser.php 31 Dec 2004 13:58:41 -0000 1.84 *************** *** 235,238 **** --- 235,241 ---- } + // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results + $code = strtr($code, array_flip(get_html_translation_table(HTML_ENTITIES))); + ob_start(); highlight_string($code); Update of /cvsroot/phpbb/phpBB2/includes/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/includes/db Modified Files: mysql.php Log Message: - fixed [code=php] - optimized db/mysql.php a little bit Index: mysql.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/db/mysql.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** mysql.php 30 May 2004 19:24:50 -0000 1.21 --- mysql.php 31 Dec 2004 13:58:36 -0000 1.22 *************** *** 58,64 **** } ! if (count($this->open_queries)) { ! foreach ($this->open_queries as $query_id) { @mysql_free_result($query_id); --- 58,64 ---- } ! if (sizeof($this->open_queries)) { ! foreach ($this->open_queries as $i_query_id => $query_id) { @mysql_free_result($query_id); *************** *** 112,117 **** global $cache; ! // DEBUG ! $this->sql_report("start", $query); $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; --- 112,120 ---- global $cache; ! // EXPLAIN only in extra debug mode ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("start", $query); ! } $this->query_result = ($cache_ttl && method_exists($cache, "sql_load")) ? $cache->sql_load($query) : false; *************** *** 126,145 **** } ! // DEBUG ! $this->sql_report("stop", $query); if ($cache_ttl && method_exists($cache, "sql_save")) { $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result happened within sql_save() } ! elseif (preg_match("/^SELECT/", $query)) { ! $this->open_queries[] = $this->query_result; } } ! else { - // DEBUG $this->sql_report("fromcache", $query); } --- 129,150 ---- } ! if (defined("DEBUG_EXTRA")) ! { ! $this->sql_report("stop", $query); ! } if ($cache_ttl && method_exists($cache, "sql_save")) { + $this->open_queries[(int) $this->query_result] = $this->query_result; $cache->sql_save($query, $this->query_result, $cache_ttl); ! // mysql_free_result called within sql_save() } ! else if (strpos($query, "SELECT") !== false && $this->query_result) { ! $this->open_queries[(int) $this->query_result] = $this->query_result; } } ! else if (defined("DEBUG_EXTRA")) { $this->sql_report("fromcache", $query); } *************** *** 259,263 **** } ! if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); --- 264,270 ---- } ! // This method is called too often... do not waste memory by calling/checking unneeded things ! // if (method_exists($cache, "sql_fetchrow") && $cache->sql_exists($query_id)) ! if (isset($cache->sql_rowset[$query_id])) { return $cache->sql_fetchrow($query_id); *************** *** 346,360 **** } ! if ($query_id) { ! // If it is not found within the open queries, we try to free a cached result. ;) ! if (!(array_search($query_id, $this->open_queries) > 0)) ! { ! return false; ! } ! unset($this->open_queries[array_search($query_id, $this->open_queries)]); } ! return ($query_id) ? @mysql_free_result($query_id) : false; } --- 353,363 ---- } ! if (isset($this->open_queries[(int) $query_id])) { ! unset($this->open_queries[(int) $query_id]); ! return @mysql_free_result($query_id); } ! return false; } *************** *** 368,373 **** if (!$this->return_on_error) { ! $this_page = (!empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((!empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : $_ENV["QUERY_STRING"]); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; --- 371,376 ---- if (!$this->return_on_error) { ! $this_page = (isset($_SERVER["PHP_SELF"]) && !empty($_SERVER["PHP_SELF"])) ? $_SERVER["PHP_SELF"] : $_ENV["PHP_SELF"]; ! $this_page .= "&" . ((isset($_SERVER["QUERY_STRING"]) && !empty($_SERVER["QUERY_STRING"])) ? $_SERVER["QUERY_STRING"] : (isset($_ENV["QUERY_STRING"]) ? $_ENV["QUERY_STRING"] : "")); $message = "<u>SQL ERROR</u> [ " . SQL_LAYER . " ]<br /><br />" . @mysql_error() . "<br /><br /><u>CALLING PAGE</u><br /><br />" . htmlspecialchars($this_page) . (($sql != "") ? "<br /><br /><u>SQL</u><br /><br />" . $sql : "") . "<br />"; *************** *** 389,393 **** } - // DEBUG function sql_report($mode, $query = "") { --- 392,395 ---- --- NEW FILE: phpbb-patches-2004-12-21-18.06.txt --- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19627/includes Modified Files: Tag: phpBB-2_0_0 page_tail.php Log Message: Remove version information from display Index: page_tail.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/Attic/page_tail.php,v retrieving revision 1.27.2.2 retrieving revision 1.27.2.3 diff -C2 -r1.27.2.2 -r1.27.2.3 *** page_tail.php 26 Nov 2002 11:42:12 -0000 1.27.2.2 --- page_tail.php 22 Dec 2004 02:04:00 -0000 1.27.2.3 *************** *** 36,41 **** $template->assign_vars(array( ! "PHPBB_VERSION" => "2" . $board_config["version"], ! "TRANSLATION_INFO" => ( isset($lang["TRANSLATION_INFO"]) ) ? $lang["TRANSLATION_INFO"] : "", "ADMIN_LINK" => $admin_link) ); --- 36,40 ---- $template->assign_vars(array( ! "TRANSLATION_INFO" => ( isset($lang["TRANSLATION_INFO"]) ) ? $lang["TRANSLATION_INFO"] : "", "ADMIN_LINK" => $admin_link) ); Update of /cvsroot/phpbb/phpBB2/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19799/templates/subSilver Modified Files: Tag: phpBB-2_0_0 overall_footer.tpl Log Message: Remove version information from display Index: overall_footer.tpl =================================================================== RCS file: /cvsroot/phpbb/phpBB2/templates/subSilver/Attic/overall_footer.tpl,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -r1.4.2.1 -r1.4.2.2 *** overall_footer.tpl 22 Apr 2002 17:11:37 -0000 1.4.2.1 --- overall_footer.tpl 22 Dec 2004 02:05:06 -0000 1.4.2.2 *************** *** 5,15 **** This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB 2.0. If you cannot (for good ! reason) retain the full copyright we request you at least leave in place the ! Powered by phpBB {PHPBB_VERSION} line, with phpBB linked to http://www.phpbb.com. If you refuse ! to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> ! Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} © 2001, 2002 phpBB Group<br />{TRANSLATION_INFO}</span></div> </td> </tr> --- 5,15 ---- This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB 2.0. If you cannot (for good ! reason) retain the full copyright we request you at least leave in place the ! Powered by phpBB line, with phpBB linked to http://www.phpbb.com. If you refuse ! to include even this then support on our forums may be affected. The phpBB Group : 2002 // --> ! Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> © 2001, 2004 phpBB Group<br />{TRANSLATION_INFO}</span></div> </td> </tr> Update of /cvsroot/phpbb/phpBB2/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20042/styles/subSilver/template Modified Files: overall_footer.html Log Message: Remove version information from display Index: overall_footer.html =================================================================== RCS file: /cvsroot/phpbb/phpBB2/styles/subSilver/template/overall_footer.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** overall_footer.html 6 Jan 2004 15:36:16 -0000 1.4 --- overall_footer.html 22 Dec 2004 02:06:30 -0000 1.5 *************** *** 7,11 **** but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line, with ! "phpBB" linked to http://www.phpbb.com. If you refuse to include even this then support on our forums may be affected. --- 7,11 ---- but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line, with ! "phpBB" linked to http://www.phpbb.com. If you refuse to include even this then support on our forums may be affected. *************** *** 17,21 **** <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> ! <span class="copyright">Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> {PHPBB_VERSION} © 2002, 2003 phpBB Group<br />{TRANSLATION_INFO}<!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> </div> --- 17,21 ---- <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> ! <span class="copyright">Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> © 2002, 2005 phpBB Group<br />{TRANSLATION_INFO}<!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> </div> Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20102/includes Modified Files: functions.php Log Message: Remove version information from display Index: functions.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v retrieving revision 1.300 retrieving revision 1.301 diff -C2 -r1.300 -r1.301 *** functions.php 6 Nov 2004 14:20:26 -0000 1.300 --- functions.php 22 Dec 2004 02:06:42 -0000 1.301 *************** *** 337,341 **** $result = $db->sql_query($sql); ! $right = $cat_right = $padding = 0; $padding_store = array("0" => 0); $display_jumpbox = false; --- 337,341 ---- $result = $db->sql_query($sql); ! $right = $padding = 0; $padding_store = array("0" => 0); $display_jumpbox = false; *************** *** 389,397 **** $right = $row["right_id"]; - if ($row["right_id"] - $row["left_id"] > 1) - { - $cat_right = max($cat_right, $row["right_id"]); - } - $template->assign_block_vars("jumpbox_forums", array( "FORUM_ID" => $row["forum_id"], --- 389,392 ---- *************** *** 1710,1714 **** "L_ONLINE_EXPLAIN" => $l_online_time, ! "U_PRIVATEMSGS" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=" . (($user->data["user_new_privmsg"] || $l_privmsgs_text_unread) ? "unread" : "view_messages"), "U_RETURN_INBOX" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", "U_POPUP_PM" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", --- 1705,1709 ---- "L_ONLINE_EXPLAIN" => $l_online_time, ! "U_PRIVATEMSGS" => "{$phpbb_root_path}ucp.$phpEx$SID&i=" . (($user->data["user_new_privmsg"] || $l_privmsgs_text_unread) ? "unread" : "view_messages"), "U_RETURN_INBOX" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", "U_POPUP_PM" => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", *************** *** 1798,1802 **** $template->assign_vars(array( - "PHPBB_VERSION" => $config["version"], "DEBUG_OUTPUT" => (defined("DEBUG")) ? $debug_output : "", --- 1793,1796 ---- --- NEW FILE: phpbb-patches-2004-12-12-08.07.txt --- -------------------------------------------------------- part 1 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313 Modified Files: common.php download.php posting.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: common.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/common.php,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -r1.163 -r1.164 *** common.php 30 Nov 2004 11:05:23 -0000 1.163 --- common.php 12 Dec 2004 14:06:56 -0000 1.164 *************** *** 295,301 **** } - // Adjust storage path"s - $config["upload_dir"] = ($config["upload_dir"]{0} == "/" || ($config["upload_dir"]{0} != "/" && $config["upload_dir"]{1} == ":")) ? $config["upload_dir"] : $phpbb_root_path . $config["upload_dir"]; - // Handle email/cron queue. if (time() - $config["queue_interval"] >= $config["last_queue_run"] && !defined("IN_ADMIN")) --- 295,298 ---- Index: download.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/download.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** download.php 17 Sep 2004 09:11:31 -0000 1.23 --- download.php 12 Dec 2004 14:07:00 -0000 1.24 *************** *** 37,41 **** } ! $sql = "SELECT * FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; --- 37,41 ---- } ! $sql = "SELECT attach_id, in_message, post_msg_id, extension FROM " . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; *************** *** 101,104 **** --- 101,118 ---- $download_mode = (int) $extensions[$attachment["extension"]]["download_mode"]; + // Fetching filename here to prevent sniffing of filename + $sql = "SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype + FROM " . ATTACHMENTS_TABLE . " + WHERE attach_id = $download_id"; + $result = $db->sql_query_limit($sql, 1); + + if (!($attachment = $db->sql_fetchrow($result))) + { + trigger_error("ERROR_NO_ATTACHMENT"); + } + $db->sql_freeresult($result); + + $attachment["physical_filename"] = basename($attachment["physical_filename"]); + if ($thumbnail) { *************** *** 117,126 **** if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($config["upload_dir"] . "/" . $attachment["physical_filename"]); } else --- 131,140 ---- if ($download_mode == PHYSICAL_LINK) { ! if (!@is_dir($phpbb_root_path . $config["upload_dir"])) { trigger_error($user->lang["PHYSICAL_DOWNLOAD_NOT_POSSIBLE"]); } ! redirect($phpbb_root_path . $config["upload_dir"] . "/" . $attachment["physical_filename"]); } else *************** *** 137,143 **** function send_file_to_browser($attachment, $upload_dir, $category) { ! global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config; ! $filename = $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) --- 151,157 ---- function send_file_to_browser($attachment, $upload_dir, $category) { ! global $user, $db, $config, $phpbb_root_path; ! $filename = $phpbb_root_path . $upload_dir . "/" . $attachment["physical_filename"]; if (!@file_exists($filename)) *************** *** 148,152 **** // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ((!empty($HTTP_SERVER_VARS["HTTP_USER_AGENT"])) ? $HTTP_SERVER_VARS["HTTP_USER_AGENT"] : ""); if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) --- 162,166 ---- // Determine the Browser the User is using, because of some nasty incompatibilities. // borrowed from phpMyAdmin. :) ! $user_agent = (!empty($_SERVER["HTTP_USER_AGENT"])) ? $_SERVER["HTTP_USER_AGENT"] : ""; if (ereg("Opera(/| )([0-9].[0-9]{1,2})", $user_agent, $log_version)) *************** *** 193,198 **** } // Now the tricky part... let"s dance - // TODO: needs a little bit more testing... seems to break on some configurations (incomplete files) header("Pragma: public"); // header("Content-Transfer-Encoding: none"); --- 207,216 ---- } + if ($config["gzip_compress"]) + { + @ob_end_clean(); + } + // Now the tricky part... let"s dance header("Pragma: public"); // header("Content-Transfer-Encoding: none"); Index: posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/posting.php,v retrieving revision 1.347 retrieving revision 1.348 diff -C2 -r1.347 -r1.348 *** posting.php 30 Oct 2004 17:04:44 -0000 1.347 --- posting.php 12 Dec 2004 14:07:00 -0000 1.348 *************** *** 911,915 **** $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id); foreach ($unset_attachments as $index) --- 911,915 ---- $attachment_data = $message_parser->attachment_data; ! $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id, true); foreach ($unset_attachments as $index) *************** *** 1668,1673 **** "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => $attach_row["physical_filename"], ! "real_filename" => $attach_row["real_filename"], "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], --- 1668,1673 ---- "in_message" => 0, "poster_id" => $poster_id, ! "physical_filename" => basename($attach_row["physical_filename"]), ! "real_filename" => basename($attach_row["real_filename"]), "comment" => $attach_row["comment"], "extension" => $attach_row["extension"], -------------------------------------------------------- part 2 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes/mcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes/mcp Modified Files: mcp_main.php mcp_topic.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: mcp_main.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_main.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** mcp_main.php 6 Nov 2004 14:20:27 -0000 1.10 --- mcp_main.php 12 Dec 2004 14:07:02 -0000 1.11 *************** *** 870,875 **** "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) $attach_row["physical_filename"], ! "real_filename" => (string) $attach_row["real_filename"], "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], --- 870,875 ---- "in_message" => 0, "poster_id" => (int) $attach_row["poster_id"], ! "physical_filename" => (string) basename($attach_row["physical_filename"]), ! "real_filename" => (string) basename($attach_row["real_filename"]), "download_count" => (int) $attach_row["download_count"], "comment" => (string) $attach_row["comment"], Index: mcp_topic.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/mcp/mcp_topic.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mcp_topic.php 19 Jul 2004 20:13:16 -0000 1.4 --- mcp_topic.php 12 Dec 2004 14:07:02 -0000 1.5 *************** *** 359,362 **** --- 359,368 ---- move_posts($post_id_list, $to_topic_id); + // Change topic title of first post + $sql = "UPDATE " . POSTS_TABLE . " + SET post_subject = "" . $db->sql_escape($subject) . "" + WHERE post_id = {$post_id_list[0]}"; + $db->sql_query($sql); + $success_msg = "TOPIC_SPLIT_SUCCESS"; -------------------------------------------------------- part 3 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/includes Modified Files: functions_admin.php functions_display.php functions_posting.php functions_privmsgs.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: functions_admin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** functions_admin.php 10 Nov 2004 14:15:16 -0000 1.88 --- functions_admin.php 12 Dec 2004 14:07:01 -0000 1.89 *************** *** 678,682 **** global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $config["upload_dir"] . "/thumb_" . $filename : $config["upload_dir"] . "/" . $filename; $deleted = @unlink($filename); --- 678,682 ---- global $config, $user, $phpbb_root_path; ! $filename = ($mode == "thumbnail") ? $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($filename) : $phpbb_root_path . $config["upload_dir"] . "/" . basename($filename); $deleted = @unlink($filename); *************** *** 685,698 **** $filesys = str_replace("/","\\", $filename); $deleted = @system("del $filesys"); - - if (file_exists($filename)) - { - $filename = realpath($filename); - @chmod($filename, 0777); - if (!($deleted = @unlink($filename))) - { - $deleted = @system("del $filename"); - } - } } --- 685,688 ---- Index: functions_display.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_display.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** functions_display.php 13 Oct 2004 19:30:01 -0000 1.60 --- functions_display.php 12 Dec 2004 14:07:01 -0000 1.61 *************** *** 536,541 **** // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $config["upload_dir"] . "/" . $attachment["physical_filename"]; ! $thumbnail_filename = $config["upload_dir"] . "/thumb_" . $attachment["physical_filename"]; $upload_image = ""; --- 536,541 ---- // Some basics... $attachment["extension"] = strtolower(trim($attachment["extension"])); ! $filename = $phpbb_root_path . $config["upload_dir"] . "/" . basename($attachment["physical_filename"]); ! $thumbnail_filename = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . basename($attachment["physical_filename"]); $upload_image = ""; *************** *** 555,559 **** $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = $attachment["real_filename"]; $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); --- 555,559 ---- $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ! $display_name = basename($attachment["real_filename"]); $comment = str_replace("\n", "<br />", censor_text($attachment["comment"])); Index: functions_posting.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/includes/functions_posting.php,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -r1.127 -r1.128 *** functions_posting.php 6 Nov 2004 14:20:26 -0000 1.127 --- functions_posting.php 12 Dec 2004 14:07:01 -0000 1.128 *************** *** 134,138 **** function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db; $filedata = array(); --- 134,138 ---- function upload_attachment($forum_id, $filename, $local = false, $local_storage = "", $is_message = false) { ! global $auth, $user, $config, $db, $phpbb_root_path; $filedata = array(); *************** *** 145,149 **** } ! $r_file = $filename; $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; --- 145,149 ---- } ! $r_file = trim(basename($filename)); $file = (!$local) ? $_FILES["fileupload"]["tmp_name"] : $local_storage; $filedata["mimetype"] = (!$local) ? $_FILES["fileupload"]["type"] : "application/octet-stream"; *************** *** 187,190 **** --- 187,229 ---- } + $filedata["thumbnail"] = 0; + + // Prepare Values + $filedata["filetime"] = time(); + $filedata["filename"] = stripslashes($r_file); + + $filedata["destination_filename"] = strtolower($filedata["filename"]); + $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; + + $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); + + // Do we have to create a thumbnail? + if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) + { + $filedata["thumbnail"] = 1; + } + + // Descide the Upload method + $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; + $upload_mode = ($local) ? "local" : $upload_mode; + + // Ok, upload the File + $result = move_uploaded_attachment($upload_mode, $file, $filedata); + + if ($result) + { + $filedata["error"][] = $result; + $filedata["post_attach"] = false; + + return $filedata; + } + + $file = (!$local) ? $phpbb_root_path . $config["upload_dir"] . "/" . $filedata["destination_filename"] : $local_storage; + + if (!$filedata["filesize"]) + { + $filedata["filesize"] = @filesize($file); + } + // Check Image Size, if it is an image if (!$auth->acl_gets("m_", "a_") && $cat_id == ATTACHMENT_CATEGORY_IMAGE) *************** *** 198,201 **** --- 237,244 ---- $filedata["error"][] = sprintf($user->lang["ERROR_IMAGESIZE"], $config["img_max_width"], $config["img_max_height"]); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 212,215 **** --- 255,262 ---- $filedata["error"][] = sprintf($user->lang["ATTACHMENT_TOO_BIG"], $allowed_filesize, $size_lang); $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 222,225 **** --- 269,276 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; + + phpbb_unlink($filedata["destination_filename"]); + phpbb_unlink($filedata["destination_filename"], "thumbnail"); + return $filedata; } *************** *** 227,231 **** // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) --- 278,282 ---- // TODO - Check Free Disk Space - need testing under windows ! if ($free_space = disk_free_space($phpbb_root_path . $config["upload_dir"])) { if ($free_space <= $filedata["filesize"]) *************** *** 233,273 **** $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; - return $filedata; - } - } - - $filedata["thumbnail"] = 0; - - // Prepare Values - $filedata["filetime"] = time(); - $filedata["filename"] = stripslashes($r_file); ! $filedata["destination_filename"] = strtolower($filedata["filename"]); ! $filedata["destination_filename"] = $user->data["user_id"] . "_" . $filedata["filetime"] . "." . $filedata["extension"]; ! ! $filedata["filename"] = str_replace(""", "\"", $filedata["filename"]); ! // Do we have to create a thumbnail ? ! if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config["img_create_thumbnail"]) ! { ! $filedata["thumbnail"] = 1; } - // Descide the Upload method - $upload_mode = (@ini_get("open_basedir") || @ini_get("safe_mode")) ? "move" : "copy"; - $upload_mode = ($local) ? "local" : $upload_mode; - - // Ok, upload the File - $result = move_uploaded_attachment($upload_mode, $file, $filedata); - - if ($result) - { - $filedata["error"][] = $result; - $filedata["post_attach"] = false; - } return $filedata; } ! // Move/Upload File - could be used for Avatars too ? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { --- 284,299 ---- $filedata["error"][] = $user->lang["ATTACH_QUOTA_REACHED"]; $filedata["post_attach"] = false; ! phpbb_unlink($filedata["destination_filename"]); ! phpbb_unlink($filedata["destination_filename"], "thumbnail"); ! return $filedata; ! } } return $filedata; } ! // Move/Upload File - could be used for Avatars too? function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { *************** *** 280,310 **** { case "copy": ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if ( !@move_uploaded_file($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! if ( !@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename) ) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; --- 306,336 ---- { case "copy": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "move": ! if (!@move_uploaded_file($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); break; case "local": ! if (!@copy($source_filename, $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename)) { ! return sprintf($user->lang["GENERAL_UPLOAD_ERROR"], $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename); } ! @chmod($phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename, 0666); @unlink($source_filename); break; *************** *** 313,318 **** if ($filedata["thumbnail"]) { ! $source = $config["upload_dir"] . "/" . $destination_filename; ! $destination = $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) --- 339,344 ---- if ($filedata["thumbnail"]) { ! $source = $phpbb_root_path . $config["upload_dir"] . "/" . $destination_filename; ! $destination = $phpbb_root_path . $config["upload_dir"] . "/thumb_" . $destination_filename; if (!create_thumbnail($source, $destination, $filedata["mimetype"])) *************** *** 648,652 **** { $hidden = ""; ! $attach_row["real_filename"] = stripslashes($attach_row["real_filename"]); foreach ($attach_row as $key => $value) --- 674,678 ---- { $hidden = ""; ! $attach_row["real_filename"] = stripslashes(basename($attach_row["real_filename"])); foreach ($attach_row as $key => $value) *************** *** 655,663 **** } ! $download_link = (!$attach_row["attach_id"]) ? $config["upload_dir"] . "/" . $attach_row["physical_filename"] : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => $attach_row["real_filename"], ! "ATTACH_FILENAME" => $attach_row["physical_filename"], "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["attach_id"], --- 681,689 ---- } ! $download_link = (!$attach_row["attach_id"]) ? $phpbb_root_path . $config["upload_dir"] . "/" . basename($attach_row["physical_filename"]) : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row["attach_id"]); $template->assign_block_vars("attach_row", array( ! "FILENAME" => basename($attach_row["real_filename"]), ! "ATTACH_FILENAME" => basename($attach_row["physical_filename"]), "FILE_COMMENT" => $attach_row["comment"], "ATTACH_ID" => $attach_row["at -------------------------------------------------------- part 4 -------------------------------------------------------- Update of /cvsroot/phpbb/phpBB2/adm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18313/adm Modified Files: admin_attachments.php Log Message: - fix attachment mod errors - make upload path consistent with all other 2.2 path settings - fix "post title wrong after split" bug Index: admin_attachments.php =================================================================== RCS file: /cvsroot/phpbb/phpBB2/adm/admin_attachments.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** admin_attachments.php 25 Nov 2004 21:52:47 -0000 1.32 --- admin_attachments.php 12 Dec 2004 14:06:55 -0000 1.33 *************** *** 362,366 **** if ($submit && $mode == "orphan") { ! $delete_files = array_keys(request_var("delete", "")); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); --- 362,366 ---- if ($submit && $mode == "orphan") { ! $delete_files = (isset($_REQUEST["delete"])) ? array_keys(request_var("delete", "")) : array(); $add_files = (isset($_REQUEST["add"])) ? array_keys(request_var("add", "")) : array(); $post_ids = request_var("post_id", 0); *************** *** 368,373 **** foreach ($delete_files as $delete) { ! phpbb_unlink($config["upload_dir"] . "/" . $delete); ! phpbb_unlink($config["upload_dir"] . "/thumb_" . $delete); } --- 368,373 ---- foreach ($delete_files as $delete) { ! phpbb_unlink($delete); ! phpbb_unlink($delete, "thumbnail"); } *************** *** 1187,1194 **** $attach_filelist = array(); ! $dir = @opendir($config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($config["upload_dir"] . "/" . $file) && filesize($config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; --- 1187,1194 ---- $attach_filelist = array(); ! $dir = @opendir($phpbb_root_path . $config["upload_dir"]); while ($file = @readdir($dir)) { ! if (is_file($phpbb_root_path . $config["upload_dir"] . "/" . $file) && filesize($phpbb_root_path . $config["upload_dir"] . "/" . $file) && $file{0} != "." && $file != "index.htm" && !preg_match("#^thumb\_#", $file)) { $attach_filelist[$file] = $file; *************** *** 1242,1251 **** { $row_class = (++$i % 2 == 0) ? "row2" : "row1"; ! $filesize = @filesize($config["upload_dir"] . "/" . $file); $size_lang = ($filesize >= 1048576) ? $user->lang["MB"] : ( ($filesize >= 1024) ? $user->lang["KB"] : $user->lang["BYTES"] ); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ?> <tr> ! <td class="<?php echo $row_class; ?>"><a href="<?php echo $config["upload_dir"] . "/" . $file; ?>" class="gen" target="file"><?php echo $fil... [truncated message content] |
|
From: Josh G. <os...@us...> - 2005-01-03 21:40:56
|
Update of /cvsroot/nanuke/nanuke0.x/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/install Modified Files: install.php Log Message: - More minor forum module stuff - Viewtopic print view - Report post Index: install.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/install/install.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** install.php 22 Dec 2004 05:14:58 -0000 1.15 --- install.php 3 Jan 2005 21:40:45 -0000 1.16 *************** *** 1552,1556 **** array('field' => 'reason_id', 'type' => 'smallint(6)', 'unsigned' => true, 'null' => false), array('field' => 'post_id', 'type' => 'mediumint(8)', 'unsigned' => true, 'null' => false), - array('field' => 'msg_id', 'type' => 'mediumint(8)', 'unsigned' => true, 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'unsigned' => true, 'null' => false), array('field' => 'user_notify', 'type' => 'tinyint(1)', 'unsigned' => true, 'null' => false), --- 1552,1555 ---- *************** *** 1833,1836 **** --- 1832,1836 ---- "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('pm_edit_time', '0')", "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('allow_mass_pm', '1')", + "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('reload_module_data', '')", "INSERT INTO " . $table_prefix . "config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1)", "INSERT INTO " . $table_prefix . "config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1)", |
|
From: Josh G. <os...@us...> - 2005-01-03 21:40:56
|
Update of /cvsroot/nanuke/nanuke0.x/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689/styles/subSilver/template Modified Files: posting_body.html Log Message: - More minor forum module stuff - Viewtopic print view - Report post Index: posting_body.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/styles/subSilver/template/posting_body.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** posting_body.html 23 Dec 2004 05:37:06 -0000 1.5 --- posting_body.html 3 Jan 2005 21:40:46 -0000 1.6 *************** *** 420,423 **** --- 420,424 ---- <!-- INCLUDE ucp_footer.html --> <!-- ELSE --> + <br clear="all" /> <!-- INCLUDE navbar.html --> |
|
From: Josh G. <os...@us...> - 2004-12-24 04:53:07
|
Update of /cvsroot/nanuke/nanuke0.x/modules/ucp/includes/ucp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/ucp/includes/ucp Modified Files: ucp_attachments.php Log Message: - More minor forum module stuff Index: ucp_attachments.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/ucp/includes/ucp/ucp_attachments.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ucp_attachments.php 22 Dec 2004 05:15:03 -0000 1.4 --- ucp_attachments.php 24 Dec 2004 04:52:45 -0000 1.5 *************** *** 85,92 **** global $table_prefix; ! define('MODULE_FORUM_TOPICS_TABLE', $table_prefix . 'module_forum_topics'); $sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title FROM ' . ATTACHMENTS_TABLE . ' a ! LEFT JOIN ' . MODULE_FORUM_TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0) LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id --- 85,92 ---- global $table_prefix; ! define('TOPICS_TABLE', $table_prefix . 'module_forum_topics'); $sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title FROM ' . ATTACHMENTS_TABLE . ' a ! LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0) LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id |
|
From: Josh G. <os...@us...> - 2004-12-24 04:53:06
|
Update of /cvsroot/nanuke/nanuke0.x/modules/ucp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/ucp Modified Files: module.php Log Message: - More minor forum module stuff Index: module.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/ucp/module.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** module.php 22 Dec 2004 05:15:04 -0000 1.12 --- module.php 24 Dec 2004 04:52:45 -0000 1.13 *************** *** 173,176 **** --- 173,179 ---- $ucp = new control_panel_module(); + + // NA-Nuke: get redirect path fo logging in/out + $redirect_url = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "index.$phpEx$SID"); // Basic "global" modes *************** *** 206,213 **** if ($user->data['user_id'] != ANONYMOUS) { ! redirect("index.$phpEx$SID"); } ! login_box("index.$phpEx$SID"); break; --- 209,216 ---- if ($user->data['user_id'] != ANONYMOUS) { ! redirect($redirect_url); } ! login_box($redirect_url); break; *************** *** 225,231 **** } ! meta_refresh(3, "index.$phpEx$SID"); ! $message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . "index.$phpEx$SID" . '">', '</a> '); trigger_error($message); break; --- 228,234 ---- } ! meta_refresh(3, $redirect_url); ! $message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect_url . '">', '</a> '); trigger_error($message); break; |
|
From: Josh G. <os...@us...> - 2004-12-24 04:53:04
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/includes/ucp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/forum/includes/ucp Modified Files: ucp_main.php Log Message: - More minor forum module stuff Index: ucp_main.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/includes/ucp/ucp_main.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ucp_main.php 10 Dec 2004 17:38:51 -0000 1.3 --- ucp_main.php 24 Dec 2004 04:52:44 -0000 1.4 *************** *** 32,36 **** { $sql = 'SELECT mark_time ! FROM ' . MODULE_FORUM_FORUMS_TRACK_TABLE . ' WHERE forum_id = 0 AND user_id = ' . $user->data['user_id']; --- 32,36 ---- { $sql = 'SELECT mark_time ! FROM ' . FORUMS_TRACK_TABLE . ' WHERE forum_id = 0 AND user_id = ' . $user->data['user_id']; *************** *** 47,51 **** default: ! $sql_from = '(' . MODULE_FORUM_TOPICS_TABLE . ' t LEFT JOIN ' . MODULE_FORUM_TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))'; break; } --- 47,51 ---- default: ! $sql_from = '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))'; break; } *************** *** 55,59 **** else { ! $sql_from = MODULE_FORUM_TOPICS_TABLE . ' t '; $sql_select = ''; } --- 55,59 ---- else { ! $sql_from = TOPICS_TABLE . ' t '; $sql_select = ''; } *************** *** 89,93 **** $sql = 'SELECT forum_id ! FROM ' . MODULE_FORUM_FORUMS_TABLE . ' WHERE forum_type = ' . FORUM_POST . ' AND forum_id IN (' . implode(', ', $forum_ary) . ')'; --- 89,93 ---- $sql = 'SELECT forum_id ! FROM ' . FORUMS_TABLE . ' WHERE forum_type = ' . FORUM_POST . ' AND forum_id IN (' . implode(', ', $forum_ary) . ')'; *************** *** 188,192 **** // Grab all the relevant data $sql = 'SELECT COUNT(p.post_id) AS num_posts ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . MODULE_FORUM_FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND f.forum_id = p.forum_id --- 188,192 ---- // Grab all the relevant data $sql = 'SELECT COUNT(p.post_id) AS num_posts ! FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND f.forum_id = p.forum_id *************** *** 198,202 **** $sql = 'SELECT f.forum_id, f.forum_name, COUNT(post_id) AS num_posts ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . MODULE_FORUM_FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND f.forum_id = p.forum_id --- 198,202 ---- $sql = 'SELECT f.forum_id, f.forum_name, COUNT(post_id) AS num_posts ! FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND f.forum_id = p.forum_id *************** *** 210,214 **** $sql = 'SELECT t.topic_id, t.topic_title, COUNT(p.post_id) AS num_posts ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . MODULE_FORUM_TOPICS_TABLE . ' t, ' . MODULE_FORUM_FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND t.topic_id = p.topic_id --- 210,214 ---- $sql = 'SELECT t.topic_id, t.topic_title, COUNT(p.post_id) AS num_posts ! FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f WHERE p.poster_id = ' . $user->data['user_id'] . " AND t.topic_id = p.topic_id *************** *** 329,333 **** default: ! $sql_from = '(' . MODULE_FORUM_FORUMS_TABLE . ' f LEFT JOIN ' . MODULE_FORUM_FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; break; } --- 329,333 ---- default: ! $sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; break; } *************** *** 336,340 **** else { ! $sql_from = MODULE_FORUM_FORUMS_TABLE . ' f '; $lastread_select = ''; --- 336,340 ---- else { ! $sql_from = FORUMS_TABLE . ' f '; $lastread_select = ''; *************** *** 343,347 **** $sql = "SELECT f.*$lastread_select ! FROM $sql_from, " . MODULE_FORUM_FORUMS_WATCH_TABLE . ' fw WHERE fw.user_id = ' . $user->data['user_id'] . ' AND f.forum_id = fw.forum_id --- 343,347 ---- $sql = "SELECT f.*$lastread_select ! FROM $sql_from, " . FORUMS_WATCH_TABLE . ' fw WHERE fw.user_id = ' . $user->data['user_id'] . ' AND f.forum_id = fw.forum_id *************** *** 408,412 **** $sql = 'SELECT COUNT(topic_id) as topics_count ! FROM ' . MODULE_FORUM_TOPICS_WATCH_TABLE . ' WHERE user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); --- 408,412 ---- $sql = 'SELECT COUNT(topic_id) as topics_count ! FROM ' . TOPICS_WATCH_TABLE . ' WHERE user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); *************** *** 423,428 **** } ! $sql_from = ($config['load_db_lastread'] || $config['load_db_track']) ? '(' . MODULE_FORUM_TOPICS_TABLE . ' t LEFT JOIN ' . MODULE_FORUM_TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : MODULE_FORUM_TOPICS_TABLE . ' t'; ! $sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . MODULE_FORUM_FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . '), ' : ''; $sql_t_select = ($config['load_db_lastread'] || $config['load_db_track']) ? ', tt.mark_type, tt.mark_time' : ''; --- 423,428 ---- } ! $sql_from = ($config['load_db_lastread'] || $config['load_db_track']) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t'; ! $sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . '), ' : ''; $sql_t_select = ($config['load_db_lastread'] || $config['load_db_track']) ? ', tt.mark_type, tt.mark_time' : ''; *************** *** 430,434 **** $sql = "SELECT t.* $sql_f_select $sql_t_select ! FROM $sql_from $sql_f_tracking " . MODULE_FORUM_TOPICS_WATCH_TABLE . ' tw WHERE tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id --- 430,434 ---- $sql = "SELECT t.* $sql_f_select $sql_t_select ! FROM $sql_from $sql_f_tracking " . TOPICS_WATCH_TABLE . ' tw WHERE tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id |
|
From: Josh G. <os...@us...> - 2004-12-24 04:53:04
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/forum/styles/subSilver/template Modified Files: viewforum_topicrow_loop.html Log Message: - More minor forum module stuff Index: viewforum_topicrow_loop.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template/viewforum_topicrow_loop.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** viewforum_topicrow_loop.html 23 Dec 2004 05:37:06 -0000 1.1 --- viewforum_topicrow_loop.html 24 Dec 2004 04:52:45 -0000 1.2 *************** *** 15,18 **** --- 15,20 ---- <!-- IF topicrow.TOPIC_STATUS == 'folder' --> <img src="{T_THEME_PATH}/images/folder.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> + <!-- ELSEIF topicrow.TOPIC_STATUS == 'folder_posted' --> + <img src="{T_THEME_PATH}/images/folder_posted.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> <!-- ELSE --> {topicrow.TOPIC_STATUS} |
|
From: Josh G. <os...@us...> - 2004-12-24 04:53:04
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/forum Modified Files: module.php posting.php viewforum.php viewtopic.php Log Message: - More minor forum module stuff Index: module.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/module.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** module.php 23 Dec 2004 05:37:06 -0000 1.5 --- module.php 24 Dec 2004 04:52:44 -0000 1.6 *************** *** 34,49 **** // Module table constants ! define('MODULE_FORUM_BOOKMARKS_TABLE', $table_prefix.'module_forum_bookmarks'); ! define('MODULE_FORUM_FORUM_LOG_TABLE', $table_prefix.'module_forum_forum_log'); ! define('MODULE_FORUM_FORUMS_TABLE', $table_prefix.'module_forum_forums'); ! define('MODULE_FORUM_FORUMS_ACCESS_TABLE', $table_prefix.'module_forum_forums_access'); ! define('MODULE_FORUM_FORUMS_MARKING_TABLE', $table_prefix.'module_forum_forums_marking'); ! define('MODULE_FORUM_FORUMS_TRACK_TABLE', $table_prefix.'module_forum_forums_marking'); ! define('MODULE_FORUM_FORUMS_WATCH_TABLE', $table_prefix.'module_forum_forums_watch'); ! define('MODULE_FORUM_MODERATOR_CACHE_TABLE', $table_prefix.'module_forum_moderator_cache'); ! define('MODULE_FORUM_POSTS_TABLE', $table_prefix.'module_forum_posts'); ! define('MODULE_FORUM_TOPICS_TABLE', $table_prefix.'module_forum_topics'); ! define('MODULE_FORUM_TOPICS_TRACK_TABLE', $table_prefix.'module_forum_topics_marking'); ! define('MODULE_FORUM_TOPICS_WATCH_TABLE', $table_prefix.'module_forum_topics_watch'); // Other forum-related constants... --- 34,49 ---- // Module table constants ! define('BOOKMARKS_TABLE', $table_prefix.'module_forum_bookmarks'); ! define('FORUM_LOG_TABLE', $table_prefix.'module_forum_forum_log'); ! define('FORUMS_TABLE', $table_prefix.'module_forum_forums'); ! define('FORUMS_ACCESS_TABLE', $table_prefix.'module_forum_forums_access'); ! define('FORUMS_MARKING_TABLE', $table_prefix.'module_forum_forums_marking'); ! define('FORUMS_TRACK_TABLE', $table_prefix.'module_forum_forums_marking'); ! define('FORUMS_WATCH_TABLE', $table_prefix.'module_forum_forums_watch'); ! define('MODERATOR_CACHE_TABLE', $table_prefix.'module_forum_moderator_cache'); ! define('POSTS_TABLE', $table_prefix.'module_forum_posts'); ! define('TOPICS_TABLE', $table_prefix.'module_forum_topics'); ! define('TOPICS_TRACK_TABLE', $table_prefix.'module_forum_topics_marking'); ! define('TOPICS_WATCH_TABLE', $table_prefix.'module_forum_topics_watch'); // Other forum-related constants... *************** *** 173,177 **** // First we'll just create the tables // ! $db->create_table(MODULE_FORUM_BOOKMARKS_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), --- 173,177 ---- // First we'll just create the tables // ! $db->create_table(BOOKMARKS_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 179,183 **** 'index' => array('order_id', 'topic_id,user_id') )); ! $db->create_table(MODULE_FORUM_FORUMS_TABLE, array( array('field' => 'forum_id', 'type' => 'smallint(5)', 'null' => false, 'auto_increment' => true), array('field' => 'parent_id', 'type' => 'smallint(5)', 'null' => false), --- 179,183 ---- 'index' => array('order_id', 'topic_id,user_id') )); ! $db->create_table(FORUMS_TABLE, array( array('field' => 'forum_id', 'type' => 'smallint(5)', 'null' => false, 'auto_increment' => true), array('field' => 'parent_id', 'type' => 'smallint(5)', 'null' => false), *************** *** 218,222 **** 'index' => array('left_id, right_id', 'forum_last_post_id') )); ! $db->create_table(MODULE_FORUM_FORUMS_ACCESS_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), --- 218,222 ---- 'index' => array('left_id, right_id', 'forum_last_post_id') )); ! $db->create_table(FORUMS_ACCESS_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 224,228 **** 'primary_keys' => array('forum_id', 'user_id', 'session_id') )); ! $db->create_table(MODULE_FORUM_FORUMS_MARKING_TABLE, array( array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), --- 224,228 ---- 'primary_keys' => array('forum_id', 'user_id', 'session_id') )); ! $db->create_table(FORUMS_MARKING_TABLE, array( array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), *************** *** 230,234 **** 'primary_keys' => array('user_id', 'forum_id') )); ! $db->create_table(MODULE_FORUM_FORUMS_WATCH_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), --- 230,234 ---- 'primary_keys' => array('user_id', 'forum_id') )); ! $db->create_table(FORUMS_WATCH_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 236,240 **** 'index' => array('forum_id', 'user_id', 'notify_status') )); ! $db->create_table(MODULE_FORUM_FORUM_LOG_TABLE, array( array('field' => 'log_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'log_type', 'type' => 'tinyint(4)', 'null' => false), --- 236,240 ---- 'index' => array('forum_id', 'user_id', 'notify_status') )); ! $db->create_table(FORUM_LOG_TABLE, array( array('field' => 'log_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'log_type', 'type' => 'tinyint(4)', 'null' => false), *************** *** 249,253 **** 'index' => array('log_type', 'forum_id', 'topic_id', 'reportee_id', 'user_id') )); ! $db->create_table(MODULE_FORUM_MODERATOR_CACHE_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), --- 249,253 ---- 'index' => array('log_type', 'forum_id', 'topic_id', 'reportee_id', 'user_id') )); ! $db->create_table(MODERATOR_CACHE_TABLE, array( array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 258,262 **** 'index' => array('display_on_index', 'forum_id') )); ! $db->create_table(MODULE_FORUM_POSTS_TABLE, array( array('field' => 'post_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), --- 258,262 ---- 'index' => array('display_on_index', 'forum_id') )); ! $db->create_table(POSTS_TABLE, array( array('field' => 'post_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 289,293 **** 'index' => array('forum_id', 'topic_id', 'poster_ip', 'poster_id', 'post_approved', 'post_time') )); ! $db->create_table(MODULE_FORUM_TOPICS_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), --- 289,293 ---- 'index' => array('forum_id', 'topic_id', 'poster_ip', 'poster_id', 'post_approved', 'post_time') )); ! $db->create_table(TOPICS_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'forum_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 324,328 **** 'index' => array('forum_id', 'forum_id, topic_type', 'topic_last_post_time') )); ! $db->create_table(MODULE_FORUM_TOPICS_TRACK_TABLE, array( array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), --- 324,328 ---- 'index' => array('forum_id', 'forum_id, topic_type', 'topic_last_post_time') )); ! $db->create_table(TOPICS_TRACK_TABLE, array( array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 331,335 **** 'primary_keys' => array('user_id', 'topic_id') )); ! $db->create_table(MODULE_FORUM_TOPICS_WATCH_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), --- 331,335 ---- 'primary_keys' => array('user_id', 'topic_id') )); ! $db->create_table(TOPICS_WATCH_TABLE, array( array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'user_id', 'type' => 'mediumint(8)', 'null' => false), *************** *** 427,432 **** $db->sql_query("INSERT INTO " . ACL_OPTIONS_TABLE . " (auth_option, is_local, is_global) VALUES ('m_ip', 1, 1)"); $db->sql_query("INSERT INTO " . ACL_OPTIONS_TABLE . " (auth_option, is_local, is_global) VALUES ('m_info', 1, 1)"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_FORUMS_TABLE . " (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time) VALUES (1, 'My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', " . time() . ")"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_FORUMS_TABLE . " (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time) SELECT 2, 'Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, username, 972086460 FROM " . USERS_TABLE . " WHERE user_id = 2"); $db->sql_query("INSERT INTO " . RANKS_TABLE . " (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL)"); $db->sql_query("INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 1, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html')"); --- 427,432 ---- $db->sql_query("INSERT INTO " . ACL_OPTIONS_TABLE . " (auth_option, is_local, is_global) VALUES ('m_ip', 1, 1)"); $db->sql_query("INSERT INTO " . ACL_OPTIONS_TABLE . " (auth_option, is_local, is_global) VALUES ('m_info', 1, 1)"); ! $db->sql_query("INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time) VALUES (1, 'My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', " . time() . ")"); ! $db->sql_query("INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time) SELECT 2, 'Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, username, 972086460 FROM " . USERS_TABLE . " WHERE user_id = 2"); $db->sql_query("INSERT INTO " . RANKS_TABLE . " (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL)"); $db->sql_query("INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 1, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html')"); *************** *** 449,455 **** $db->sql_query("INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 1, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_list', 'f_read')"); $db->sql_query("INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 2, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_list', 'f_read')"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_MODERATOR_CACHE_TABLE . " (user_id, forum_id, username) VALUES (2, 2, 'Admin')"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_TOPICS_TABLE . " (topic_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_post_time, topic_last_view_time) SELECT 1, 'Welcome to NA-Nuke 2', 2, " . time() . ", 0, 0, 0, 2, 0, 0, 1, username, 1, 2, username, 972086460, 972086460 FROM " . USERS_TABLE . " WHERE user_id = 2"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_POSTS_TABLE . " (post_id, topic_id, forum_id, poster_id, post_time, post_username, poster_ip, post_subject, post_text) VALUES (1, 1, 2, 2, " . time() . ", NULL, '127.0.0.1', 'Welcome to NA-Nuke 2', 'This is an example post in your NA-Nuke 2.2 installation. You may delete this post, this topic and even this forum if you like since everything seems to be working!')"); $db->sql_query("INSERT INTO " . SEARCH_WORD_TABLE . " (word_id, word_text, word_common) VALUES (1, 'example', 0)"); $db->sql_query("INSERT INTO " . SEARCH_WORD_TABLE . " (word_id, word_text, word_common) VALUES (2, 'post', 0)"); --- 449,455 ---- $db->sql_query("INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 1, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_list', 'f_read')"); $db->sql_query("INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 2, auth_option_id, 1 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('f_list', 'f_read')"); ! $db->sql_query("INSERT INTO " . MODERATOR_CACHE_TABLE . " (user_id, forum_id, username) VALUES (2, 2, 'Admin')"); ! $db->sql_query("INSERT INTO " . TOPICS_TABLE . " (topic_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_post_time, topic_last_view_time) SELECT 1, 'Welcome to NA-Nuke 2', 2, " . time() . ", 0, 0, 0, 2, 0, 0, 1, username, 1, 2, username, 972086460, 972086460 FROM " . USERS_TABLE . " WHERE user_id = 2"); ! $db->sql_query("INSERT INTO " . POSTS_TABLE . " (post_id, topic_id, forum_id, poster_id, post_time, post_username, poster_ip, post_subject, post_text) VALUES (1, 1, 2, 2, " . time() . ", NULL, '127.0.0.1', 'Welcome to NA-Nuke 2', 'This is an example post in your NA-Nuke 2.2 installation. You may delete this post, this topic and even this forum if you like since everything seems to be working!')"); $db->sql_query("INSERT INTO " . SEARCH_WORD_TABLE . " (word_id, word_text, word_common) VALUES (1, 'example', 0)"); $db->sql_query("INSERT INTO " . SEARCH_WORD_TABLE . " (word_id, word_text, word_common) VALUES (2, 'post', 0)"); *************** *** 479,483 **** $db->sql_query("INSERT INTO " . CONTROL_PANEL_MODULES_TABLE . " (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, 'front\r\nforum_view\r\ntopic_view\r\npost_details', 'acl_m_')"); $db->sql_query("INSERT INTO " . CONTROL_PANEL_MODULES_TABLE . " (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'QUEUE', 'queue', 2, 1, 'unapproved_topics\r\nunapproved_posts\r\nreports', 'acl_m_approve')"); ! $db->sql_query("INSERT INTO " . MODULE_FORUM_MODERATOR_CACHE_TABLE . " (user_id, forum_id, username) SELECT 2, 2, username FROM " . USERS_TABLE . " WHERE user_id = 2"); } // End function install } // End class Module_forum --- 479,483 ---- $db->sql_query("INSERT INTO " . CONTROL_PANEL_MODULES_TABLE . " (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, 'front\r\nforum_view\r\ntopic_view\r\npost_details', 'acl_m_')"); $db->sql_query("INSERT INTO " . CONTROL_PANEL_MODULES_TABLE . " (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'QUEUE', 'queue', 2, 1, 'unapproved_topics\r\nunapproved_posts\r\nreports', 'acl_m_approve')"); ! $db->sql_query("INSERT INTO " . MODERATOR_CACHE_TABLE . " (user_id, forum_id, username) SELECT 2, 2, username FROM " . USERS_TABLE . " WHERE user_id = 2"); } // End function install } // End class Module_forum Index: viewforum.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/viewforum.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** viewforum.php 23 Dec 2004 03:09:23 -0000 1.2 --- viewforum.php 24 Dec 2004 04:52:44 -0000 1.3 *************** *** 41,45 **** { $sql = 'SELECT * ! FROM ' . MODULE_FORUM_FORUMS_TABLE . ' WHERE forum_id = ' . $forum_id; } --- 41,45 ---- { $sql = 'SELECT * ! FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $forum_id; } *************** *** 77,81 **** } ! $sql_from = ($sql_lastread) ? '((' . MODULE_FORUM_FORUMS_TABLE . ' f LEFT JOIN ' . MODULE_FORUM_FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ")) $sql_lastread)" : '(' . MODULE_FORUM_FORUMS_TABLE . ' f LEFT JOIN ' . MODULE_FORUM_FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . '))'; $sql = "SELECT f.*, fw.notify_status $lastread_select --- 77,81 ---- } ! $sql_from = ($sql_lastread) ? '((' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ")) $sql_lastread)" : '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . '))'; $sql = "SELECT f.*, fw.notify_status $lastread_select *************** *** 104,108 **** if ($forum_data['forum_flags'] & 1) { ! $sql = 'UPDATE ' . MODULE_FORUM_FORUMS_TABLE . ' SET forum_posts = forum_posts + 1 WHERE forum_id = ' . $forum_id; --- 104,108 ---- if ($forum_data['forum_flags'] & 1) { ! $sql = 'UPDATE ' . FORUMS_TABLE . ' SET forum_posts = forum_posts + 1 WHERE forum_id = ' . $forum_id; *************** *** 141,145 **** // Build navigation links ! generate_forum_nav($forum_data); // Forum Rules --- 141,145 ---- // Build navigation links ! generate_forum_nav($forum_data, true); // Forum Rules *************** *** 224,228 **** $sql = 'SELECT COUNT(topic_id) AS num_topics ! FROM ' . MODULE_FORUM_TOPICS_TABLE . " WHERE forum_id = $forum_id AND topic_type <> " . POST_ANNOUNCE . " --- 224,228 ---- $sql = 'SELECT COUNT(topic_id) AS num_topics ! FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id AND topic_type <> " . POST_ANNOUNCE . " *************** *** 313,317 **** default: ! $sql_from = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['user_id'] != ANONYMOUS) ? '(' . MODULE_FORUM_TOPICS_TABLE . ' t LEFT JOIN ' . MODULE_FORUM_TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : MODULE_FORUM_TOPICS_TABLE . ' t '; } --- 313,317 ---- default: ! $sql_from = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['user_id'] != ANONYMOUS) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t '; } Index: posting.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/posting.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** posting.php 23 Dec 2004 05:37:06 -0000 1.2 --- posting.php 24 Dec 2004 04:52:44 -0000 1.3 *************** *** 50,54 **** if ($cancel || ($current_time - $lastclick < 2 && $submit)) { ! $redirect = ($post_id) ? "viewtopic.$phpEx$SID&p=$post_id#$post_id" : (($topic_id) ? "viewtopic.$phpEx$SID&t=$topic_id" : (($forum_id) ? "viewforum.$phpEx$SID&f=$forum_id" : "index.$phpEx$SID")); redirect($redirect); } --- 50,60 ---- if ($cancel || ($current_time - $lastclick < 2 && $submit)) { ! $redirect = ($post_id) ! ? "index.$phpEx$SID&mod=forum&com=viewtopic&p=$post_id#$post_id" ! : (($topic_id) ! ? "index.$phpEx$SID&mod=forum&com=viewtopic&t=$topic_id" ! : (($forum_id) ! ? "index.$phpEx$SID&mod=forum&com=viewforum&f=$forum_id" ! : "index.$phpEx$SID&mod=forum")); redirect($redirect); } *************** *** 65,69 **** case 'post': $sql = 'SELECT * ! FROM ' . MODULE_FORUM_FORUMS_TABLE . " WHERE forum_id = $forum_id"; break; --- 71,75 ---- case 'post': $sql = 'SELECT * ! FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; break; *************** *** 77,81 **** $sql = 'SELECT f.*, t.* ! FROM ' . MODULE_FORUM_TOPICS_TABLE . ' t, ' . MODULE_FORUM_FORUMS_TABLE . " f WHERE t.topic_id = $topic_id AND (f.forum_id = t.forum_id --- 83,87 ---- $sql = 'SELECT f.*, t.* ! FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE t.topic_id = $topic_id AND (f.forum_id = t.forum_id *************** *** 92,96 **** $sql = 'SELECT f.*, t.*, p.*, u.username, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . MODULE_FORUM_TOPICS_TABLE . ' t, ' . MODULE_FORUM_FORUMS_TABLE . ' f, ' . USERS_TABLE . " u WHERE p.post_id = $post_id AND t.topic_id = p.topic_id --- 98,102 ---- $sql = 'SELECT f.*, t.*, p.*, u.username, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield ! FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u WHERE p.post_id = $post_id AND t.topic_id = p.topic_id *************** *** 107,111 **** case 'popup': $sql = 'SELECT forum_style ! FROM ' . MODULE_FORUM_FORUMS_TABLE . ' WHERE forum_id = ' . $forum_id; break; --- 113,117 ---- case 'popup': $sql = 'SELECT forum_style ! FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $forum_id; break; *************** *** 262,266 **** { $sql = 'SELECT topic_id ! FROM ' . MODULE_FORUM_TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . $topic_id . ' AND user_id = ' . $user->data['user_id']; --- 268,272 ---- { $sql = 'SELECT topic_id ! FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . $topic_id . ' AND user_id = ' . $user->data['user_id']; *************** *** 342,356 **** if ($topic_first_post_id == $topic_last_post_id) { ! $meta_info = "viewforum.$phpEx$SID&f=$forum_id"; $message = $user->lang['POST_DELETED']; } else { ! $meta_info = "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p=$next_post_id#$next_post_id"; ! $message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p=$next_post_id#$next_post_id\">", '</a>'); } meta_refresh(3, $meta_info); ! $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&f=$forum_id\">", '</a>'); trigger_error($message); } --- 348,362 ---- if ($topic_first_post_id == $topic_last_post_id) { ! $meta_info = "index.$phpEx$SID&mod=forum&com=viewforum&f=$forum_id"; $message = $user->lang['POST_DELETED']; } else { ! $meta_info = "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&p=$next_post_id#$next_post_id"; ! $message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&p=$next_post_id#$next_post_id\">", '</a>'); } meta_refresh(3, $meta_info); ! $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], "<a href=\"index.$phpEx$SID&mod=forum&com=viewforum&f=$forum_id\">", '</a>'); trigger_error($message); } *************** *** 391,400 **** $db->sql_transaction(); ! $db->sql_query('UPDATE ' . MODULE_FORUM_POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $topic_last_post_id AND topic_id = $topic_id"); ! $db->sql_query('UPDATE ' . MODULE_FORUM_TOPICS_TABLE . " SET topic_last_post_time = $current_time, topic_bumped = 1, --- 397,406 ---- $db->sql_transaction(); ! $db->sql_query('UPDATE ' . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $topic_last_post_id AND topic_id = $topic_id"); ! $db->sql_query('UPDATE ' . TOPICS_TABLE . " SET topic_last_post_time = $current_time, topic_bumped = 1, *************** *** 402,406 **** WHERE topic_id = $topic_id"); ! $db->sql_query('UPDATE ' . MODULE_FORUM_FORUMS_TABLE . ' SET ' . implode(', ', update_last_post_information('forum', $forum_id)) . " WHERE forum_id = $forum_id"); --- 408,412 ---- WHERE topic_id = $topic_id"); ! $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET ' . implode(', ', update_last_post_information('forum', $forum_id)) . " WHERE forum_id = $forum_id"); *************** *** 416,420 **** add_log('mod', $forum_id, $topic_id, sprintf($user->lang['LOGM_BUMP'], $topic_title)); ! meta_refresh(3, "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id"); $message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="viewtopic.' . $phpEx . $SID . "&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id\">", '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID .'&f=' . $forum_id . '">', '</a>'); --- 422,426 ---- add_log('mod', $forum_id, $topic_id, sprintf($user->lang['LOGM_BUMP'], $topic_title)); ! meta_refresh(3, "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id"); $message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="viewtopic.' . $phpEx . $SID . "&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id\">", '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID .'&f=' . $forum_id . '">', '</a>'); *************** *** 447,451 **** $db->sql_query($sql); ! $meta_info = ($mode == 'post') ? "viewforum.$phpEx$SID&f=$forum_id" : "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; meta_refresh(3, $meta_info); --- 453,457 ---- $db->sql_query($sql); ! $meta_info = ($mode == 'post') ? "index.$phpEx$SID&mod=forum&com=viewforum&f=$forum_id" : "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id"; meta_refresh(3, $meta_info); *************** *** 563,567 **** ); ! $sql = 'UPDATE ' . MODULE_FORUM_TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $topic_sql) . " WHERE topic_id = $topic_id"; --- 569,573 ---- ); ! $sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $topic_sql) . " WHERE topic_id = $topic_id"; *************** *** 624,628 **** { $sql = 'SELECT post_time AS last_post_time ! FROM ' . MODULE_FORUM_POSTS_TABLE . " WHERE poster_ip = '" . $user->ip . "' AND post_time > " . ($current_time - $config['flood_interval']); --- 630,634 ---- { $sql = 'SELECT post_time AS last_post_time ! FROM ' . POSTS_TABLE . " WHERE poster_ip = '" . $user->ip . "' AND post_time > " . ($current_time - $config['flood_interval']); *************** *** 731,735 **** { $sql = 'SELECT topic_type, forum_id ! FROM ' . MODULE_FORUM_TOPICS_TABLE . " WHERE topic_id = $topic_id"; $result = $db->sql_query_limit($sql, 1); --- 737,741 ---- { $sql = 'SELECT topic_type, forum_id ! FROM ' . TOPICS_TABLE . " WHERE topic_id = $topic_id"; $result = $db->sql_query_limit($sql, 1); *************** *** 775,779 **** if ($change_topic_status != $topic_status) { ! $sql = 'UPDATE ' . MODULE_FORUM_TOPICS_TABLE . " SET topic_status = $change_topic_status WHERE topic_id = $topic_id --- 781,785 ---- if ($change_topic_status != $topic_status) { ! $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_status = $change_topic_status WHERE topic_id = $topic_id *************** *** 1044,1048 **** // Build Navigation Links ! generate_forum_nav($forum_data); // Build Forum Rules --- 1050,1069 ---- // Build Navigation Links ! generate_forum_nav($forum_data, false); ! ! // Assign navlinks for "reply to topic" page ! if ($mode == 'reply' || $mode == 'quote') ! { ! $template->assign_block_vars('navlinks', array( ! 'NAVNAME' => $topic_title, ! 'U_NAVPAGE' => $nanuke_root_path . "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id", ! 'S_CURRENT_PAGE' => false ! )); ! $template->assign_block_vars('navlinks', array( ! 'NAVNAME' => $user->lang['POST_REPLY'], ! 'U_NAVPAGE' => '', ! 'S_CURRENT_PAGE' => true ! )); ! } // Build Forum Rules *************** *** 1079,1084 **** 'EDIT_REASON' => $post_edit_reason, ! 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=" . $forum_id, ! 'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&$forum_id&t=$topic_id" : '', 'U_PROGRESS_BAR' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&mode=popup", // do NOT replace & with & here --- 1100,1105 ---- 'EDIT_REASON' => $post_edit_reason, ! 'U_VIEW_FORUM' => "index.$phpEx$SID&mod=forum&com=viewforum&f=" . $forum_id, ! 'U_VIEWTOPIC' => ($mode != 'post') ? "index.$phpEx$SID&mod=forum&com=viewtopic&$forum_id&t=$topic_id" : '', 'U_PROGRESS_BAR' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&mode=popup", // do NOT replace & with & here *************** *** 1196,1200 **** // Collect the necessary informations for updating the tables ! $sql_data[MODULE_FORUM_FORUMS_TABLE] = ''; switch ($post_mode) { --- 1217,1221 ---- // Collect the necessary informations for updating the tables ! $sql_data[FORUMS_TABLE] = ''; switch ($post_mode) { *************** *** 1205,1220 **** if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= 'forum_posts = forum_posts - 1, forum_topics_real = forum_topics_real - 1'; ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_topics = forum_topics - 1' : ''; } ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= ($sql_data[MODULE_FORUM_FORUMS_TABLE]) ? ', ' : ''; ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= implode(', ', update_last_post_information('forum', $forum_id)); ! $sql_data[MODULE_FORUM_TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); break; case 'delete_first_post': $sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id --- 1226,1241 ---- if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[FORUMS_TABLE] .= 'forum_posts = forum_posts - 1, forum_topics_real = forum_topics_real - 1'; ! $sql_data[FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_topics = forum_topics - 1' : ''; } ! $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : ''; ! $sql_data[FORUMS_TABLE] .= implode(', ', update_last_post_information('forum', $forum_id)); ! $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); break; case 'delete_first_post': $sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username ! FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id *************** *** 1227,1235 **** if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[MODULE_FORUM_TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; ! $sql_data[MODULE_FORUM_TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $next_post_id = (int) $row['post_id']; --- 1248,1256 ---- if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; ! $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $next_post_id = (int) $row['post_id']; *************** *** 1239,1253 **** if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= ($sql_data[MODULE_FORUM_FORUMS_TABLE]) ? ', ' : ''; ! $sql_data[MODULE_FORUM_FORUMS_TABLE] .= implode(', ', update_last_post_information('forum', $forum_id)); ! $sql_data[MODULE_FORUM_TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $update = update_last_post_information('topic', $topic_id); if (sizeof($update)) { ! $sql_data[MODULE_FORUM_TOPICS_TABLE] .= ', ' . implode(', ', $update); $next_post_id = (int) str_replace('topic_last_post_id = ', '', $update[0]); } --- 1260,1274 ---- if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : ''; ! $sql_data[FORUMS_TABLE] .= implode(', ', update_last_post_information('forum', $forum_id)); ! $sql_data[TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $update = update_last_post_information('topic', $topic_id); if (sizeof($update)) { ! $sql_data[TOPICS_TABLE] .= ', ' . implode(', ', $update); $next_post_id = (int) str_replace('topic_last_post_id = ', '', $update[0]); } *************** *** 1255,1259 **** { $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . MODULE_FORUM_POSTS_TABLE . " WHERE topic_id = $topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : ''); --- 1276,1280 ---- { $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . POSTS_TABLE . " WHERE topic_id = $topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : ''); *************** *** 1268,1272 **** case 'delete': $sql = 'SELECT post_id ! FROM ' . MODULE_FORUM_POSTS_TABLE . " WHERE topic_id = $topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . ' --- 1289,1293 ---- case 'delete': $sql = 'SELECT post_id ! FROM ' . POSTS_TABLE . " WHERE topic_id = $topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . ' *************** *** 1280,1287 **** if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[MODULE_FORUM_TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $next_post_id = (int) $row['post_id']; } --- 1301,1308 ---- if ($data['topic_type'] != POST_GLOBAL) { ! $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } ! $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $next_post_id = (int) $row['post_id']; } *************** *** 1292,1296 **** $db->sql_transaction(); ! $where_sql = array(MODULE_FORUM_FORUMS_TABLE => "forum_id = $forum_id", MODULE_FORUM_TOPICS_TABLE => "topic_id = $topic_id", USERS_TABLE => 'user_id = ' . $data['poster_id']); foreach ($sql_data as $table => $update_sql) --- 1313,1317 ---- $db->sql_transaction(); ! $where_sql = array(FORUMS_TABLE => "forum_id = $forum_id", TOPICS_TABLE => "topic_id = $topic_id", USERS_TABLE => 'user_id = ' . $data['poster_id']); foreach ($sql_data as $table => $update_sql) *************** *** 1346,1350 **** case 'post': case 'reply': ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'poster_id' => (int) $user->data['user_id'], --- 1367,1371 ---- case 'post': case 'reply': ! $sql_data[POSTS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'poster_id' => (int) $user->data['user_id'], *************** *** 1374,1382 **** if (!$auth->acl_gets('m_', 'a_') || $data['post_edit_reason']) { ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array( 'post_edit_time' => $current_time ); ! $sql_data[MODULE_FORUM_POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1'; } --- 1395,1403 ---- if (!$auth->acl_gets('m_', 'a_') || $data['post_edit_reason']) { ! $sql_data[POSTS_TABLE]['sql'] = array( 'post_edit_time' => $current_time ); ! $sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1'; } *************** *** 1384,1402 **** if ($data['post_edit_reason']) { ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array( 'post_edit_time' => $current_time ); ! $sql_data[MODULE_FORUM_POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1'; } case 'edit_topic': ! if (!isset($sql_data[MODULE_FORUM_POSTS_TABLE]['sql'])) { ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array(); } ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array_merge($sql_data[MODULE_FORUM_POSTS_TABLE]['sql'], array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'poster_id' => $data['poster_id'], --- 1405,1423 ---- if ($data['post_edit_reason']) { ! $sql_data[POSTS_TABLE]['sql'] = array( 'post_edit_time' => $current_time ); ! $sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1'; } case 'edit_topic': ! if (!isset($sql_data[POSTS_TABLE]['sql'])) { ! $sql_data[POSTS_TABLE]['sql'] = array(); } ! $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'poster_id' => $data['poster_id'], *************** *** 1422,1426 **** if ($update_message) { ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql']['post_text'] = $data['message']; } --- 1443,1447 ---- if ($update_message) { ! $sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message']; } *************** *** 1432,1436 **** { case 'post': ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'] = array( 'topic_poster' => (int) $user->data['user_id'], 'topic_time' => $current_time, --- 1453,1457 ---- { case 'post': ! $sql_data[TOPICS_TABLE]['sql'] = array( 'topic_poster' => (int) $user->data['user_id'], 'topic_time' => $current_time, *************** *** 1447,1451 **** if (isset($poll['poll_options']) && !empty($poll['poll_options'])) { ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'] = array_merge($sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'], array( 'poll_title' => $poll['poll_title'], 'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time, --- 1468,1472 ---- if (isset($poll['poll_options']) && !empty($poll['poll_options'])) { ! $sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array( 'poll_title' => $poll['poll_title'], 'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time, *************** *** 1459,1473 **** if (!$auth->acl_get('f_moderate', $data['forum_id'])) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); break; case 'reply': ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : ''); $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); if (!$auth->acl_get('f_moderate', $data['forum_id'])) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } break; --- 1480,1494 ---- if (!$auth->acl_get('f_moderate', $data['forum_id'])) { ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); break; case 'reply': ! $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : ''); $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); if (!$auth->acl_get('f_moderate', $data['forum_id'])) { ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } break; *************** *** 1476,1480 **** case 'edit_first_post': ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'icon_id' => $data['icon_id'], --- 1497,1501 ---- case 'edit_first_post': ! $sql_data[TOPICS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'icon_id' => $data['icon_id'], *************** *** 1500,1513 **** if ($post_mode == 'post') { ! $sql = 'INSERT INTO ' . MODULE_FORUM_TOPICS_TABLE . ' ' . ! $db->sql_build_array('INSERT', $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql']); $db->sql_query($sql); $data['topic_id'] = $db->sql_nextid(); ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array_merge($sql_data[MODULE_FORUM_POSTS_TABLE]['sql'], array( 'topic_id' => $data['topic_id']) ); ! unset($sql_data[MODULE_FORUM_TOPICS_TABLE]['sql']); } --- 1521,1534 ---- if ($post_mode == 'post') { ! $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . ! $db->sql_build_array('INSERT', $sql_data[TOPICS_TABLE]['sql']); $db->sql_query($sql); $data['topic_id'] = $db->sql_nextid(); ! $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( 'topic_id' => $data['topic_id']) ); ! unset($sql_data[TOPICS_TABLE]['sql']); } *************** *** 1517,1526 **** if ($post_mode == 'reply') { ! $sql_data[MODULE_FORUM_POSTS_TABLE]['sql'] = array_merge($sql_data[MODULE_FORUM_POSTS_TABLE]['sql'], array( 'topic_id' => $data['topic_id']) ); } ! $sql = 'INSERT INTO ' . MODULE_FORUM_POSTS_TABLE . ' ' . ! $db->sql_build_array('INSERT', $sql_data[MODULE_FORUM_POSTS_TABLE]['sql']); // $sql = str_replace('\\"', '"', $sql); // $sql = str_replace('\\ ', ' ', $sql); --- 1538,1547 ---- if ($post_mode == 'reply') { ! $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( 'topic_id' => $data['topic_id']) ); } ! $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . ! $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']); // $sql = str_replace('\\"', '"', $sql); // $sql = str_replace('\\ ', ' ', $sql); *************** *** 1531,1535 **** if ($post_mode == 'post') { ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'] = array( 'topic_first_post_id' => $data['post_id'], 'topic_last_post_id' => $data['post_id'], --- 1552,1556 ---- if ($post_mode == 'post') { ! $sql_data[TOPICS_TABLE]['sql'] = array( 'topic_first_post_id' => $data['post_id'], 'topic_last_post_id' => $data['post_id'], *************** *** 1540,1544 **** } ! unset($sql_data[MODULE_FORUM_POSTS_TABLE]['sql']); } --- 1561,1565 ---- } ! unset($sql_data[POSTS_TABLE]['sql']); } *************** *** 1549,1553 **** { $sql = 'SELECT topic_type, topic_replies_real, topic_approved ! FROM ' . MODULE_FORUM_TOPICS_TABLE . ' WHERE topic_id = ' . $data['topic_id']; $result = $db->sql_query($sql); --- 1570,1574 ---- { $sql = 'SELECT topic_type, topic_replies_real, topic_approved ! FROM ' . TOPICS_TABLE . ' WHERE topic_id = ' . $data['topic_id']; $result = $db->sql_query($sql); *************** *** 1560,1570 **** // Decrement topic/post count $make_global = true; ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'] = array(); ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($row['topic_replies_real'] + 1); ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real - 1' . (($row['topic_approved']) ? ', forum_topics = forum_topics - 1' : ''); // Update forum_ids for all posts ! $sql = 'UPDATE ' . MODULE_FORUM_POSTS_TABLE . ' SET forum_id = 0 WHERE topic_id = ' . $data['topic_id']; --- 1581,1591 ---- // Decrement topic/post count $make_global = true; ! $sql_data[FORUMS_TABLE]['stat'] = array(); ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($row['topic_replies_real'] + 1); ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real - 1' . (($row['topic_approved']) ? ', forum_topics = forum_topics - 1' : ''); // Update forum_ids for all posts ! $sql = 'UPDATE ' . POSTS_TABLE . ' SET forum_id = 0 WHERE topic_id = ' . $data['topic_id']; *************** *** 1576,1586 **** // Increment topic/post count $make_global = true; ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'] = array(); ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + ' . ($row['topic_replies_real'] + 1); ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . (($row['topic_approved']) ? ', forum_topics = forum_topics + 1' : ''); // Update forum_ids for all posts ! $sql = 'UPDATE ' . MODULE_FORUM_POSTS_TABLE . ' SET forum_id = ' . $data['forum_id'] . ' WHERE topic_id = ' . $data['topic_id']; --- 1597,1607 ---- // Increment topic/post count $make_global = true; ! $sql_data[FORUMS_TABLE]['stat'] = array(); ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + ' . ($row['topic_replies_real'] + 1); ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . (($row['topic_approved']) ? ', forum_topics = forum_topics + 1' : ''); // Update forum_ids for all posts ! $sql = 'UPDATE ' . POSTS_TABLE . ' SET forum_id = ' . $data['forum_id'] . ' WHERE topic_id = ' . $data['topic_id']; *************** *** 1590,1605 **** // Update the topics table ! if (isset($sql_data[MODULE_FORUM_TOPICS_TABLE]['sql'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_TOPICS_TABLE . ' ! SET ' . $db->sql_build_array('UPDATE', $sql_data[MODULE_FORUM_TOPICS_TABLE]['sql']) . ' WHERE topic_id = ' . $data['topic_id']); } // Update the posts table ! if (isset($sql_data[MODULE_FORUM_POSTS_TABLE]['sql'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_POSTS_TABLE . ' ! SET ' . $db->sql_build_array('UPDATE', $sql_data[MODULE_FORUM_POSTS_TABLE]['sql']) . ' WHERE post_id = ' . $data['post_id']); } --- 1611,1626 ---- // Update the topics table ! if (isset($sql_data[TOPICS_TABLE]['sql'])) { ! $db->sql_query('UPDATE ' . TOPICS_TABLE . ' ! SET ' . $db->sql_build_array('UPDATE', $sql_data[TOPICS_TABLE]['sql']) . ' WHERE topic_id = ' . $data['topic_id']); } // Update the posts table ! if (isset($sql_data[POSTS_TABLE]['sql'])) { ! $db->sql_query('UPDATE ' . POSTS_TABLE . ' ! SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . ' WHERE post_id = ' . $data['post_id']); } *************** *** 1695,1704 **** if (sizeof($data['attachment_data'])) { ! $sql = 'UPDATE ' . MODULE_FORUM_POSTS_TABLE . ' SET post_attachment = 1 WHERE post_id = ' . $data['post_id']; $db->sql_query($sql); ! $sql = 'UPDATE ' . MODULE_FORUM_TOPICS_TABLE . ' SET topic_attachment = 1 WHERE topic_id = ' . $data['topic_id']; --- 1716,1725 ---- if (sizeof($data['attachment_data'])) { ! $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_attachment = 1 WHERE post_id = ' . $data['post_id']; $db->sql_query($sql); ! $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_attachment = 1 WHERE topic_id = ' . $data['topic_id']; *************** *** 1719,1723 **** if ($post_mode == 'edit_last_post') { ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = implode(', ', update_last_post_information('forum', $data['forum_id'])); } else if (!$auth->acl_get('f_moderate', $data['forum_id'])) --- 1740,1744 ---- if ($post_mode == 'edit_last_post') { ! $sql_data[FORUMS_TABLE]['stat'][] = implode(', ', update_last_post_information('forum', $data['forum_id'])); } else if (!$auth->acl_get('f_moderate', $data['forum_id'])) *************** *** 1727,1731 **** $update_sql .= ', forum_last_poster_id = ' . $user->data['user_id']; $update_sql .= ", forum_last_poster_name = '" . (($user->data['user_id'] == ANONYMOUS) ? $db->sql_escape(stripslashes($username)) : $db->sql_escape($user->data['username'])) . "'"; ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = $update_sql; } } --- 1748,1752 ---- $update_sql .= ', forum_last_poster_id = ' . $user->data['user_id']; $update_sql .= ", forum_last_poster_name = '" . (($user->data['user_id'] == ANONYMOUS) ? $db->sql_escape(stripslashes($username)) : $db->sql_escape($user->data['username'])) . "'"; ! $sql_data[FORUMS_TABLE]['stat'][] = $update_sql; } } *************** *** 1734,1738 **** if (sizeof($update)) { ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['stat'][] = implode(', ', $update); } } --- 1755,1759 ---- if (sizeof($update)) { ! $sql_data[TOPICS_TABLE]['stat'][] = implode(', ', $update); } } *************** *** 1740,1744 **** if ($make_global) { ! $sql_data[MODULE_FORUM_FORUMS_TABLE]['stat'][] = implode(', ', update_last_post_information('forum', $data['forum_id'])); } --- 1761,1765 ---- if ($make_global) { ! $sql_data[FORUMS_TABLE]['stat'][] = implode(', ', update_last_post_information('forum', $data['forum_id'])); } *************** *** 1748,1752 **** if (sizeof($update)) { ! $sql_data[MODULE_FORUM_TOPICS_TABLE]['stat'][] = implode(', ', $update); } } --- 1769,1773 ---- if (sizeof($update)) { ! $sql_data[TOPICS_TABLE]['stat'][] = implode(', ', $update); } } *************** *** 1770,1774 **** $db->sql_transaction(); ! $where_sql = array(MODULE_FORUM_POSTS_TABLE => 'post_id = ' . $data['post_id'], MODULE_FORUM_TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], MODULE_FORUM_FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $user->data['user_id']); foreach ($sql_data as $table => $update_ary) --- 1791,1795 ---- $db->sql_transaction(); ! $where_sql = array(POSTS_TABLE => 'post_id = ' . $data['post_id'], TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $user->data['user_id']); foreach ($sql_data as $table => $update_ary) *************** *** 1783,1787 **** if ($make_global) { ! $db->sql_query('DELETE FROM ' . MODULE_FORUM_TOPICS_TABLE . ' WHERE topic_moved_id = ' . $data['topic_id']); } --- 1804,1808 ---- if ($make_global) { ! $db->sql_query('DELETE FROM ' . TOPICS_TABLE . ' WHERE topic_moved_id = ' . $data['topic_id']); } *************** *** 1806,1810 **** if (!$data['notify_set'] && $data['notify']) { ! $sql = 'INSERT INTO ' . MODULE_FORUM_TOPICS_WATCH_TABLE . ' (user_id, topic_id) VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')'; $db->sql_query($sql); --- 1827,1831 ---- if (!$data['notify_set'] && $data['notify']) { ! $sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id) VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')'; $db->sql_query($sql); *************** *** 1812,1816 **** else if ($data['notify_set'] && !$data['notify']) { ! $sql = 'DELETE FROM ' . MODULE_FORUM_TOPICS_WATCH_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . ' AND topic_id = ' . $data['topic_id']; --- 1833,1837 ---- else if ($data['notify_set'] && !$data['notify']) { ! $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . ' AND topic_id = ' . $data['topic_id']; *************** *** 1830,1838 **** if ($mode == 'post') { ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}viewtopic.$phpEx$SID&f=" . $data['forum_id'] . '&t=' . $data['topic_id'] : "{$nanuke_root_path}viewforum.$phpEx$SID&f=" . $data['forum_id']; } else { ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}&p={$data['post_id']}#{$data['post_id']}" : "{$nanuke_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}"; } --- 1851,1859 ---- if ($mode == 'post') { ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewtopic&f=" . $data['forum_id'] . '&t=' . $data['topic_id'] : "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewforum&f=" . $data['forum_id']; } else { ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewtopic&f={$data['forum_id']}&t={$data['topic_id']}&p={$data['post_id']}#{$data['post_id']}" : "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewtopic&f={$data['forum_id']}&t={$data['topic_id']}"; } Index: viewtopic.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/viewtopic.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** viewtopic.php 23 Dec 2004 05:37:06 -0000 1.2 --- viewtopic.php 24 Dec 2004 04:52:44 -0000 1.3 *************** *** 31,36 **** $view = request_var('view', ''); $rate = request_var('rate', 0); ! $sort_days = request_var('st', 0); ! $sort_key = request_var('sk', 't'); $sort_dir = request_var('sd', 'a'); $update = request_var('update', false); --- 31,35 ---- $view = request_var('view', ''); $rate = request_var('rate', 0); ! $sort_days = request_var('st', ((!empty($user->data['user_show_days'])) ? $user->data['user_show_days'] : 0));$sort_key = request_var('sk', 't'); [...995 lines suppressed...] ! if (isset($user->data['session_page']) && !preg_match("#&t=$topic_id#", $user->data['session_page'])) { ! $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_views = topic_views + 1, topic_last_view_time = ' . time() . " WHERE topic_id = $topic_id"; *************** *** 1313,1318 **** if (sizeof($update_count)) { ! $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' ! SET download_count = download_count + 1 WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')'; $db->sql_query($sql); --- 1335,1340 ---- if (sizeof($update_count)) { ! $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' ! SET download_count = download_count + 1 WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')'; $db->sql_query($sql); |
|
From: Josh G. <os...@us...> - 2004-12-24 04:52:55
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/modules/forum/includes Modified Files: functions.php functions_display.php Log Message: - More minor forum module stuff Index: functions.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/includes/functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.php 23 Dec 2004 03:09:22 -0000 1.2 --- functions.php 24 Dec 2004 04:52:43 -0000 1.3 *************** *** 24,28 **** global $template, $db, $user, $phpEx, $SID, $start, $nanuke_root_path; ! $table_sql = ($mode == 'forum') ? MODULE_FORUM_FORUMS_WATCH_TABLE : MODULE_FORUM_TOPICS_WATCH_TABLE; $where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id'; $u_url = ($mode == 'forum') ? 'f' : 't'; --- 24,28 ---- global $template, $db, $user, $phpEx, $SID, $start, $nanuke_root_path; ! $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; $where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id'; $u_url = ($mode == 'forum') ? 'f' : 't'; *************** *** 218,220 **** --- 218,382 ---- return $unread_topic; } + + // Marks a topic or form as read + function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) + { + global $config, $db, $user; + + if ($user->data['user_id'] == ANONYMOUS) + { + return; + } + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // Default tracking type + $type = TRACK_NORMAL; // commented out in phpbb cvs... err + $current_time = ($marktime) ? $marktime : time(); + $topic_id = (int) $topic_id; + + switch ($mode) + { + case 'mark': + if ($config['load_db_lastread']) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')'; + $result = $db->sql_query($sql); + + $sql_update = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_update[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + if (sizeof($sql_update)) + { + $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . " + SET mark_time = $current_time + WHERE user_id = " . $user->data['user_id'] . ' + AND forum_id IN (' . implode(', ', $sql_update) . ')'; + $db->sql_query($sql); + } + + if ($sql_insert = array_diff($forum_id, $sql_update)) + { + foreach ($sql_insert as $forum_id) + { + $sql = ''; + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + $sql .= (($sql != '') ? ', ' : '') . '(' . $user->data['user_id'] . ", $forum_id, $current_time)"; + $sql = 'VALUES ' . $sql; + break; + + case 'mssql': + case 'sqlite': + $sql .= (($sql != '') ? ' UNION ALL ' : '') . ' SELECT ' . $user->data['user_id'] . ", $forum_id, $current_time"; + break; + + default: + $sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' (user_id, forum_id, mark_time) + VALUES (' . $user->data['user_id'] . ", $forum_id, $current_time)"; + $db->sql_query($sql); + $sql = ''; + } + + if ($sql) + { + $sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . " (user_id, forum_id, mark_time) $sql"; + $db->sql_query($sql); + } + } + } + unset($sql_update); + unset($sql_insert); + } + else + { + $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + + foreach ($forum_id as $f_id) + { + unset($tracking[$f_id]); + $tracking[$f_id][0] = base_convert($current_time - $config['board_startdate'], 10, 36); + } + + $user->set_cookie('track', serialize($tracking), time() + 31536000); + unset($tracking); + } + break; + + case 'post': + // Mark a topic as read and mark it as a topic where the user has made a post. + $type = TRACK_POSTED; + + case 'topic': + $forum_id = (int) $forum_id[0]; + + // Mark a topic as read + if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED)) + { + $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . " + SET mark_time = $current_time + WHERE topic_id = $topic_id + AND user_id = " . $user->data['user_id'] . " + AND mark_time < $current_time"; + if (!$db->sql_query($sql) || !$db->sql_affectedrows()) + { + $type = (!isset($type)) ? TRACK_NORMAL : $type; + + $db->sql_return_on_error(true); + + $sql = 'INSERT INTO ' . TOPICS_TRACK_TABLE . ' (user_id, topic_id, mark_type, mark_time) + VALUES (' . $user->data['user_id'] . ", $topic_id, $type, $current_time)"; + $db->sql_query($sql); + + $db->sql_return_on_error(false); + } + } + + if (!$config['load_db_lastread']) + { + $tracking = array(); + if (isset($_COOKIE[$config['cookie_name'] . '_track'])) + { + $tracking = unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])); + + // If the cookie grows larger than 2000 characters we will remove + // the smallest value + if (strlen($_COOKIE[$config['cookie_name'] . '_track']) > 2000) + { + foreach ($tracking as $f => $t_ary) + { + if (!isset($m_value) || min($t_ary) < $m_value) + { + $m_value = min($t_ary); + $m_tkey = array_search($m_value, $t_ary); + $m_fkey = $f; + } + } + unset($tracking[$m_fkey][$m_tkey]); + } + } + + if (base_convert($tracking[$forum_id][0], 36, 10) < $current_time) + { + $tracking[$forum_id][base_convert($topic_id, 10, 36)] = base_convert($current_time - $config['board_startdate'], 10, 36); + + $user->set_cookie('track', serialize($tracking), time() + 31536000); + } + unset($tracking); + } + break; + } + } ?> Index: functions_display.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/includes/functions_display.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_display.php 23 Dec 2004 03:09:22 -0000 1.2 --- functions_display.php 24 Dec 2004 04:52:43 -0000 1.3 *************** *** 50,54 **** default: ! $sql_from = '(' . MODULE_FORUM_FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; break; } --- 50,54 ---- default: ! $sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; break; } *************** *** 57,61 **** else { ! $sql_from = MODULE_FORUM_FORUMS_TABLE . ' f '; $lastread_select = $sql_lastread = ''; --- 57,61 ---- else { ! $sql_from = FORUMS_TABLE . ' f '; $lastread_select = $sql_lastread = ''; *************** *** 425,429 **** // Create forum navigation links for given forum, create parent // list if currently null, assign basic forum info to template ! function generate_forum_nav(&$forum_data) { global $db, $user, $template, $phpEx, $SID, $nanuke_root_path; --- 425,429 ---- // Create forum navigation links for given forum, create parent // list if currently null, assign basic forum info to template ! function generate_forum_nav(&$forum_data, $on_viewforum) { global $db, $user, $template, $phpEx, $SID, $nanuke_root_path; *************** *** 465,469 **** // 'FORUM_ID' => $forum_data['forum_id'], 'U_NAVPAGE' => "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewforum&f=" . $forum_data['forum_id'], ! 'S_CURRENT_PAGE' => true )); --- 465,469 ---- // 'FORUM_ID' => $forum_data['forum_id'], 'U_NAVPAGE' => "{$nanuke_root_path}index.$phpEx$SID&mod=forum&com=viewforum&f=" . $forum_data['forum_id'], ! 'S_CURRENT_PAGE' => $on_viewforum )); *************** *** 489,493 **** { $sql = 'SELECT forum_id, forum_name, forum_type ! FROM ' . MODULE_FORUM_FORUMS_TABLE . ' WHERE left_id < ' . $forum_data['left_id'] . ' AND right_id > ' . $forum_data['right_id'] . ' --- 489,493 ---- { $sql = 'SELECT forum_id, forum_name, forum_type ! FROM ' . FORUMS_TABLE . ' WHERE left_id < ' . $forum_data['left_id'] . ' AND right_id > ' . $forum_data['right_id'] . ' *************** *** 503,507 **** $forum_data['forum_parents'] = serialize($forum_parents); ! $sql = 'UPDATE ' . MODULE_FORUM_FORUMS_TABLE . " SET forum_parents = '" . $db->sql_escape($forum_data['forum_parents']) . "' WHERE parent_id = " . $forum_data['parent_id']; --- 503,507 ---- $forum_data['forum_parents'] = serialize($forum_parents); ! $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_parents = '" . $db->sql_escape($forum_data['forum_parents']) . "' WHERE parent_id = " . $forum_data['parent_id']; *************** *** 539,543 **** $sql = 'SELECT * ! FROM ' . MODULE_FORUM_MODERATOR_CACHE_TABLE . " WHERE display_on_index = 1 $forum_sql"; --- 539,543 ---- $sql = 'SELECT * ! FROM ' . MODERATOR_CACHE_TABLE . " WHERE display_on_index = 1 $forum_sql"; |
|
From: Josh G. <os...@us...> - 2004-12-24 04:52:54
|
Update of /cvsroot/nanuke/nanuke0.x/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5486/includes Modified Files: functions.php functions_posting.php Log Message: - More minor forum module stuff Index: functions.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/functions.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** functions.php 23 Dec 2004 05:37:05 -0000 1.14 --- functions.php 24 Dec 2004 04:52:43 -0000 1.15 *************** *** 224,390 **** } - // Marks a topic or form as read - function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) - { - global $config, $db, $user; - - if ($user->data['user_id'] == ANONYMOUS) - { - return; - } - - if (!is_array($forum_id)) - { - $forum_id = array($forum_id); - } - - // Default tracking type - // $type = TRACK_NORMAL; - $current_time = ($marktime) ? $marktime : time(); - $topic_id = (int) $topic_id; - - switch ($mode) - { - case 'mark': - if ($config['load_db_lastread']) - { - $sql = 'SELECT forum_id - FROM ' . FORUMS_TRACK_TABLE . ' - WHERE user_id = ' . $user->data['user_id'] . ' - AND forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')'; - $result = $db->sql_query($sql); - - $sql_update = array(); - while ($row = $db->sql_fetchrow($result)) - { - $sql_update[] = $row['forum_id']; - } - $db->sql_freeresult($result); - - if (sizeof($sql_update)) - { - $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . " - SET mark_time = $current_time - WHERE user_id = " . $user->data['user_id'] . ' - AND forum_id IN (' . implode(', ', $sql_update) . ')'; - $db->sql_query($sql); - } - - if ($sql_insert = array_diff($forum_id, $sql_update)) - { - foreach ($sql_insert as $forum_id) - { - $sql = ''; - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - $sql .= (($sql != '') ? ', ' : '') . '(' . $user->data['user_id'] . ", $forum_id, $current_time)"; - $sql = 'VALUES ' . $sql; - break; - - case 'mssql': - case 'sqlite': - $sql .= (($sql != '') ? ' UNION ALL ' : '') . ' SELECT ' . $user->data['user_id'] . ", $forum_id, $current_time"; - break; - - default: - $sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . ' (user_id, forum_id, mark_time) - VALUES (' . $user->data['user_id'] . ", $forum_id, $current_time)"; - $db->sql_query($sql); - $sql = ''; - } - - if ($sql) - { - $sql = 'INSERT INTO ' . FORUMS_TRACK_TABLE . " (user_id, forum_id, mark_time) $sql"; - $db->sql_query($sql); - } - } - } - unset($sql_update); - unset($sql_insert); - } - else - { - $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); - - foreach ($forum_id as $f_id) - { - unset($tracking[$f_id]); - $tracking[$f_id][0] = base_convert($current_time - $config['board_startdate'], 10, 36); - } - - $user->set_cookie('track', serialize($tracking), time() + 31536000); - unset($tracking); - } - break; - - case 'post': - // Mark a topic as read and mark it as a topic where the user has made a post. - $type = TRACK_POSTED; - - case 'topic': - $forum_id = (int) $forum_id[0]; - - // Mark a topic as read - if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED)) - { - $sql = 'UPDATE ' . MODULE_FORUM_TOPICS_TRACK_TABLE . " - SET mark_time = $current_time - WHERE topic_id = $topic_id - AND user_id = " . $user->data['user_id'] . " - AND mark_time < $current_time"; - if (!$db->sql_query($sql) || !$db->sql_affectedrows()) - { - $type = (!isset($type)) ? TRACK_NORMAL : $type; - - $db->sql_return_on_error(true); - - $sql = 'INSERT INTO ' . MODULE_FORUM_TOPICS_TRACK_TABLE . ' (user_id, topic_id, mark_type, mark_time) - VALUES (' . $user->data['user_id'] . ", $topic_id, $type, $current_time)"; - $db->sql_query($sql); - - $db->sql_return_on_error(false); - } - } - - if (!$config['load_db_lastread']) - { - $tracking = array(); - if (isset($_COOKIE[$config['cookie_name'] . '_track'])) - { - $tracking = unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])); - - // If the cookie grows larger than 2000 characters we will remove - // the smallest value - if (strlen($_COOKIE[$config['cookie_name'] . '_track']) > 2000) - { - foreach ($tracking as $f => $t_ary) - { - if (!isset($m_value) || min($t_ary) < $m_value) - { - $m_value = min($t_ary); - $m_tkey = array_search($m_value, $t_ary); - $m_fkey = $f; - } - } - unset($tracking[$m_fkey][$m_tkey]); - } - } - - if (base_convert($tracking[$forum_id][0], 36, 10) < $current_time) - { - $tracking[$forum_id][base_convert($topic_id, 10, 36)] = base_convert($current_time - $config['board_startdate'], 10, 36); - - $user->set_cookie('track', serialize($tracking), time() + 31536000); - } - unset($tracking); - } - break; - } - } - - // Pagination routine, generates page number sequence // tpl_prefix is for using different pagination blocks at one page --- 224,227 ---- Index: functions_posting.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/functions_posting.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions_posting.php 23 Dec 2004 05:37:06 -0000 1.5 --- functions_posting.php 24 Dec 2004 04:52:43 -0000 1.6 *************** *** 99,103 **** $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . MODULE_FORUM_POSTS_TABLE . " WHERE post_approved = 1 AND {$type}_id = $id"; --- 99,103 ---- $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . POSTS_TABLE . " WHERE post_approved = 1 AND {$type}_id = $id"; *************** *** 108,112 **** { $sql = 'SELECT p.post_id, p.poster_id, p.post_time, u.username, p.post_username ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND p.post_id = ' . $row['last_post_id']; --- 108,112 ---- { $sql = 'SELECT p.post_id, p.poster_id, p.post_time, u.username, p.post_username ! FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND p.post_id = ' . $row['last_post_id']; *************** *** 793,797 **** // Go ahead and pull all data for this topic $sql = 'SELECT u.username, u.user_id, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id --- 793,797 ---- // Go ahead and pull all data for this topic $sql = 'SELECT u.username, u.user_id, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time ! FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id *************** *** 905,909 **** // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . (($topic_notification) ? MODULE_FORUM_TOPICS_WATCH_TABLE : MODULE_FORUM_FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " AND w.user_id NOT IN ($sql_ignore_users) --- 905,909 ---- // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " AND w.user_id NOT IN ($sql_ignore_users) *************** *** 937,941 **** $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . MODULE_FORUM_FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id AND fw.user_id NOT IN ($sql_ignore_users) --- 937,941 ---- $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id AND fw.user_id NOT IN ($sql_ignore_users) *************** *** 1056,1060 **** if (isset($update_notification['topic']) && sizeof($update_notification['topic'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_TOPICS_WATCH_TABLE . " SET notify_status = 1 WHERE topic_id = $topic_id --- 1056,1060 ---- if (isset($update_notification['topic']) && sizeof($update_notification['topic'])) { ! $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . " SET notify_status = 1 WHERE topic_id = $topic_id *************** *** 1064,1068 **** if (isset($update_notification['forum']) && sizeof($update_notification['forum'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_FORUMS_WATCH_TABLE . " SET notify_status = 1 WHERE forum_id = $forum_id --- 1064,1068 ---- if (isset($update_notification['forum']) && sizeof($update_notification['forum'])) { ! $db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . " SET notify_status = 1 WHERE forum_id = $forum_id *************** *** 1073,1077 **** if (isset($delete_ids['topic']) && sizeof($delete_ids['topic'])) { ! $db->sql_query('DELETE FROM ' . MODULE_FORUM_TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); --- 1073,1077 ---- if (isset($delete_ids['topic']) && sizeof($delete_ids['topic'])) { ! $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); *************** *** 1080,1084 **** if (isset($delete_ids['forum']) && sizeof($delete_ids['forum'])) { ! $db->sql_query('DELETE FROM ' . MODULE_FORUM_FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); --- 1080,1084 ---- if (isset($delete_ids['forum']) && sizeof($delete_ids['forum'])) { ! $db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); |
|
From: Josh G. <os...@us...> - 2004-12-23 05:37:19
|
Update of /cvsroot/nanuke/nanuke0.x/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27920/docs Modified Files: todo Log Message: - More minor forum module stuff - Initial posting (and it works... YESSSSSSSSS!!!!!) Index: todo =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/docs/todo,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** todo 23 Dec 2004 03:09:22 -0000 1.15 --- todo 23 Dec 2004 05:37:05 -0000 1.16 *************** *** 11,14 **** --- 11,15 ---- reports, searching, etc. + * Fix login and logout not redirecting correctly * Fix "find member" popup (compose privmsg) * Fix hard-coded language strings in UCP->PM->viewmessage (move privmsg to folder text) |
|
From: Josh G. <os...@us...> - 2004-12-23 05:37:18
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27920/modules/forum/styles/subSilver/template Modified Files: viewforum_body.html Added Files: viewforum_topicrow_loop.html Removed Files: viewtopic_topicrow_loop.html Log Message: - More minor forum module stuff - Initial posting (and it works... YESSSSSSSSS!!!!!) Index: viewforum_body.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/styles/subSilver/template/viewforum_body.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** viewforum_body.html 22 Dec 2004 05:15:07 -0000 1.1 --- viewforum_body.html 23 Dec 2004 05:37:06 -0000 1.2 *************** *** 35,39 **** <!-- BEGIN topicrow --> ! <!-- INCLUDE viewtopic_topicrow_loop.html --> <!-- BEGINELSE --> --- 35,39 ---- <!-- BEGIN topicrow --> ! <!-- INCLUDE viewforum_topicrow_loop.html --> <!-- BEGINELSE --> *************** *** 127,131 **** <!-- BEGIN topicrow --> ! <!-- INCLUDE viewtopic_topicrow_loop.html --> <!-- BEGINELSE --> --- 127,131 ---- <!-- BEGIN topicrow --> ! <!-- INCLUDE viewforum_topicrow_loop.html --> <!-- BEGINELSE --> --- viewtopic_topicrow_loop.html DELETED --- --- NEW FILE: viewforum_topicrow_loop.html --- <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 --> <tr> <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td> </tr> <!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH eq 0 --> <tr> <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td> </tr> <!-- ENDIF --> <tr> <td class="row1" width="2.5%" align="center"> <!--// The TOPIC_STATUS values should be made prettier in viewforum.php --> <!-- IF topicrow.TOPIC_STATUS == 'folder' --> <img src="{T_THEME_PATH}/images/folder.gif" alt="{topicrow.TOPIC_STATUS_ALT}" title="{topicrow.TOPIC_STATUS_ALT}" /> <!-- ELSE --> {topicrow.TOPIC_STATUS} <!-- ENDIF --> </td> <!-- IF S_TOPIC_ICONS --> <td class="row1" width="2.5%" align="center">{topicrow.TOPIC_ICON_IMG}</td> <!-- ENDIF --> <td class="row1" width="55%"> <!-- IF topicrow.S_TOPIC_UNAPPROVED --> <a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> <!-- ENDIF --> <p class="topictitle"> <!-- <img src="{T_THEME_PATH}/images/icon_latest_reply.gif" alt="{L_VIEW_LATEST_POST}" title="{L_VIEW_LATEST_POST}" /> --> <!-- IF topicrow.S_VIEW_ATTACH --> <img src="{T_THEME_PATH}/images/icon_attach.gif" alt="{topicrow.ATTACH_ICON_ALT}" title="{topicrow.ATTACH_ICON_ALT}" /> <!-- ENDIF --> <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a> </p> <!-- IF topicrow.PAGINATION --> <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> <!-- ENDIF --> </td> <td class="row2" width="10%" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR}</p></td> <td class="row1" width="5%" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td> <td class="row2" width="5%" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td> <td class="row1" width="20%" align="center"> <p class="topicdetails">{topicrow.LAST_POST_TIME}</p> <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{topicrow.U_LAST_POST}"> <img src="{T_THEME_PATH}/images/icon_latest_reply.gif" alt="{L_VIEW_LATEST_POST}" title="{L_VIEW_LATEST_POST}" /> </a> </p> </td> </tr> |
|
From: Josh G. <os...@us...> - 2004-12-23 05:37:18
|
Update of /cvsroot/nanuke/nanuke0.x/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27920/styles/subSilver/template Modified Files: posting_body.html Log Message: - More minor forum module stuff - Initial posting (and it works... YESSSSSSSSS!!!!!) Index: posting_body.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/styles/subSilver/template/posting_body.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** posting_body.html 22 Dec 2004 05:15:06 -0000 1.4 --- posting_body.html 23 Dec 2004 05:37:06 -0000 1.5 *************** *** 413,417 **** </table> ! <!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> <!-- IF S_POST_FORM_ACTION --> </form> <!-- ENDIF --> --- 413,417 ---- </table> ! <!-- IF S_DISPLAY_REVIEW --><br /><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> <!-- IF S_POST_FORM_ACTION --> </form> <!-- ENDIF --> *************** *** 420,428 **** <!-- INCLUDE ucp_footer.html --> <!-- ELSE --> ! <table class="tablebg" width="100%" cellspacing="1"> ! <tr> ! <td class="row1"><div class="nav" style="float:left"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></div><div class="gensmall" style="float:right">{S_TIMEZONE}</div></td> ! </tr> ! </table> <!-- IF S_DISPLAY_ONLINE_LIST --> --- 420,424 ---- <!-- INCLUDE ucp_footer.html --> <!-- ELSE --> ! <!-- INCLUDE navbar.html --> <!-- IF S_DISPLAY_ONLINE_LIST --> |
|
From: Josh G. <os...@us...> - 2004-12-23 05:37:18
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27920/modules/forum Modified Files: module.php posting.php viewtopic.php Log Message: - More minor forum module stuff - Initial posting (and it works... YESSSSSSSSS!!!!!) Index: module.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/module.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** module.php 23 Dec 2004 03:09:23 -0000 1.4 --- module.php 23 Dec 2004 05:37:06 -0000 1.5 *************** *** 259,263 **** )); $db->create_table(MODULE_FORUM_POSTS_TABLE, array( ! array('field' => 'post_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), --- 259,263 ---- )); $db->create_table(MODULE_FORUM_POSTS_TABLE, array( ! array('field' => 'post_id', 'type' => 'mediumint(8)', 'null' => false, 'auto_increment' => true), array('field' => 'topic_id', 'type' => 'mediumint(8)', 'null' => false), array('field' => 'forum_id', 'type' => 'mediumint(5)', 'null' => false), Index: posting.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/posting.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** posting.php 23 Dec 2004 03:09:23 -0000 1.1 --- posting.php 23 Dec 2004 05:37:06 -0000 1.2 *************** *** 76,86 **** } ! $sql = 'SELECT t.*, f.* FROM ' . MODULE_FORUM_TOPICS_TABLE . ' t, ' . MODULE_FORUM_FORUMS_TABLE . " f WHERE t.topic_id = $topic_id ! AND (f.forum_id = t.forum_id OR f.forum_id = $forum_id)"; break; ! case 'quote': [...2067 lines suppressed...] ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}viewtopic.$phpEx$SID&f=" . $data['forum_id'] . '&t=' . $data['topic_id'] : "{$nanuke_root_path}viewforum.$phpEx$SID&f=" . $data['forum_id']; ! } ! else ! { ! $url = (!$auth->acl_get('f_moderate', $data['forum_id'])) ? "{$nanuke_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}&p={$data['post_id']}#{$data['post_id']}" : "{$nanuke_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}"; ! } ! meta_refresh(3, $url); ! ! $message = ($auth->acl_get('f_moderate', $data['forum_id'])) ? (($mode == 'edit') ? 'POST_EDITED_MOD' : 'POST_STORED_MOD') : (($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'); ! $message = $user->lang[$message] . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $url . '">', '</a>') : '') . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID .'&f=' . $data['forum_id'] . '">', '</a>'); trigger_error($message); } *************** *** 2031,2034 **** // FUNCTIONS // --------- - ?> --- 1866,1868 ---- Index: viewtopic.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/viewtopic.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** viewtopic.php 23 Dec 2004 03:09:23 -0000 1.1 --- viewtopic.php 23 Dec 2004 05:37:06 -0000 1.2 *************** *** 456,460 **** 'FORUM_LOCKED' => ($forum_status == ITEM_LOCKED) ? true : false, ! 'TOPIC_LOCKED' => ($forum_status == ITEM_LOCKED || $topic_status == ITEM_LOCKED) ? false : true, /* 'POST_IMG' => ($forum_status == ITEM_LOCKED) ? $user->img('btn_locked', 'FORUM_LOCKED') : $user->img('btn_post', 'POST_NEW_TOPIC'), 'QUOTE_IMG' => $user->img('btn_quote', 'REPLY_WITH_QUOTE'), --- 456,461 ---- 'FORUM_LOCKED' => ($forum_status == ITEM_LOCKED) ? true : false, ! 'TOPIC_LOCKED' => ($forum_status == ITEM_LOCKED || $topic_status == ITEM_LOCKED) ? true : false, ! /* 'POST_IMG' => ($forum_status == ITEM_LOCKED) ? $user->img('btn_locked', 'FORUM_LOCKED') : $user->img('btn_post', 'POST_NEW_TOPIC'), 'QUOTE_IMG' => $user->img('btn_quote', 'REPLY_WITH_QUOTE'), *************** *** 487,491 **** 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f=$forum_id", ! 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, 'U_VIEW_UNREAD_POST' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&view=unread#unread", --- 488,492 ---- 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f=$forum_id", ! 'U_TOPIC' => "{$server_path}index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, 'U_VIEW_UNREAD_POST' => "index.$phpEx$SID&mod=forum&com=viewtopic&f=$forum_id&t=$topic_id&view=unread#unread", *************** *** 721,725 **** if (empty($post_list)) { ! // trigger_error($user->lang['NO_TOPIC']); } --- 722,726 ---- if (empty($post_list)) { ! trigger_error($user->lang['NO_TOPIC']); } *************** *** 1054,1058 **** // i) The posters karma is below the minimum of the user ... not in 2.2.x // ii) The poster is on the users ignore list ! // iii) The post was made in a codepage different from the users if (isset($row['foe']) && $row['foe']) { --- 1055,1059 ---- // i) The posters karma is below the minimum of the user ... not in 2.2.x // ii) The poster is on the users ignore list ! // iii) The post was made in an encoding different from the users if (isset($row['foe']) && $row['foe']) { *************** *** 1078,1082 **** 'S_ROW_COUNT' => $i, ! 'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="viewtopic.' . $phpEx . $SID . '&p=' . $row['post_id'] . '&view=encoding#' . $row['post_id'] . '">', '</a>')) ); --- 1079,1083 ---- 'S_ROW_COUNT' => $i, ! 'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="index.' . $phpEx . $SID . '&mod=forum&com=viewtopic&p=' . $row['post_id'] . '&view=encoding#' . $row['post_id'] . '">', '</a>')) ); |
|
From: Josh G. <os...@us...> - 2004-12-23 05:37:17
|
Update of /cvsroot/nanuke/nanuke0.x/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27920/includes Modified Files: constants.php functions.php functions_posting.php Log Message: - More minor forum module stuff - Initial posting (and it works... YESSSSSSSSS!!!!!) Index: functions.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/functions.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** functions.php 23 Dec 2004 03:09:22 -0000 1.13 --- functions.php 23 Dec 2004 05:37:05 -0000 1.14 *************** *** 331,335 **** if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED)) { ! $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . " SET mark_time = $current_time WHERE topic_id = $topic_id --- 331,335 ---- if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED)) { ! $sql = 'UPDATE ' . MODULE_FORUM_TOPICS_TRACK_TABLE . " SET mark_time = $current_time WHERE topic_id = $topic_id *************** *** 342,346 **** $db->sql_return_on_error(true); ! $sql = 'INSERT INTO ' . TOPICS_TRACK_TABLE . ' (user_id, topic_id, mark_type, mark_time) VALUES (' . $user->data['user_id'] . ", $topic_id, $type, $current_time)"; $db->sql_query($sql); --- 342,346 ---- $db->sql_return_on_error(true); ! $sql = 'INSERT INTO ' . MODULE_FORUM_TOPICS_TRACK_TABLE . ' (user_id, topic_id, mark_type, mark_time) VALUES (' . $user->data['user_id'] . ", $topic_id, $type, $current_time)"; $db->sql_query($sql); Index: functions_posting.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/functions_posting.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_posting.php 23 Dec 2004 03:09:22 -0000 1.4 --- functions_posting.php 23 Dec 2004 05:37:06 -0000 1.5 *************** *** 99,103 **** $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . POSTS_TABLE . " WHERE post_approved = 1 AND {$type}_id = $id"; --- 99,103 ---- $sql = 'SELECT MAX(post_id) as last_post_id ! FROM ' . MODULE_FORUM_POSTS_TABLE . " WHERE post_approved = 1 AND {$type}_id = $id"; *************** *** 108,112 **** { $sql = 'SELECT p.post_id, p.poster_id, p.post_time, u.username, p.post_username ! FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND p.post_id = ' . $row['last_post_id']; --- 108,112 ---- { $sql = 'SELECT p.post_id, p.poster_id, p.post_time, u.username, p.post_username ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND p.post_id = ' . $row['last_post_id']; *************** *** 563,566 **** --- 563,567 ---- foreach ($attachment_data as $i => $attachment) { + print_r($attachment); $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; } *************** *** 632,636 **** function posting_gen_attachment_entry(&$attachment_data, &$filename_data) { ! global $template, $config, $nanuke_root_path, $SID, $phpEx; $template->assign_vars(array( --- 633,637 ---- function posting_gen_attachment_entry(&$attachment_data, &$filename_data) { ! global $template, $config, $phpbb_root_path, $SID, $phpEx; $template->assign_vars(array( *************** *** 648,652 **** { $hidden = ''; ! $attach_row['real_filename'] = stripslashes($attach_row['real_filename']); foreach ($attach_row as $key => $value) --- 649,653 ---- { $hidden = ''; ! $attach_row['real_filename'] = stripslashes(basename($attach_row['real_filename'])); foreach ($attach_row as $key => $value) *************** *** 655,663 **** } ! $download_link = (!$attach_row['attach_id']) ? $config['upload_dir'] . '/' . $attach_row['physical_filename'] : $nanuke_root_path . "download.$phpEx$SID&id=" . intval($attach_row['attach_id']); $template->assign_block_vars('attach_row', array( ! 'FILENAME' => $attach_row['real_filename'], ! 'ATTACH_FILENAME' => $attach_row['physical_filename'], 'FILE_COMMENT' => $attach_row['comment'], 'ATTACH_ID' => $attach_row['attach_id'], --- 656,664 ---- } ! $download_link = (!$attach_row['attach_id']) ? $phpbb_root_path . $config['upload_dir'] . '/' . basename($attach_row['physical_filename']) : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row['attach_id']); $template->assign_block_vars('attach_row', array( ! 'FILENAME' => basename($attach_row['real_filename']), ! 'ATTACH_FILENAME' => basename($attach_row['physical_filename']), 'FILE_COMMENT' => $attach_row['comment'], 'ATTACH_ID' => $attach_row['attach_id'], *************** *** 785,789 **** // Topic Review ! /*function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { global $user, $auth, $db, $template, $bbcode, $template; --- 786,790 ---- // Topic Review ! function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { global $user, $auth, $db, $template, $bbcode, $template; *************** *** 792,796 **** // Go ahead and pull all data for this topic $sql = 'SELECT u.username, u.user_id, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time ! FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id --- 793,797 ---- // Go ahead and pull all data for this topic $sql = 'SELECT u.username, u.user_id, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time ! FROM ' . MODULE_FORUM_POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id *************** *** 849,853 **** 'POSTER_NAME' => $poster, 'POST_SUBJECT' => $post_subject, ! 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), 'POST_DATE' => $user->format_date($row['post_time']), 'MESSAGE' => str_replace("\n", '<br />', $message), --- 850,854 ---- 'POSTER_NAME' => $poster, 'POST_SUBJECT' => $post_subject, ! // 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), 'POST_DATE' => $user->format_date($row['post_time']), 'MESSAGE' => str_replace("\n", '<br />', $message), *************** *** 863,867 **** if ($mode == 'topic_review') { ! $template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE'])); } --- 864,868 ---- if ($mode == 'topic_review') { ! // $template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE'])); } *************** *** 904,908 **** // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " AND w.user_id NOT IN ($sql_ignore_users) --- 905,909 ---- // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . (($topic_notification) ? MODULE_FORUM_TOPICS_WATCH_TABLE : MODULE_FORUM_FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " AND w.user_id NOT IN ($sql_ignore_users) *************** *** 936,940 **** $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id AND fw.user_id NOT IN ($sql_ignore_users) --- 937,941 ---- $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber ! FROM ' . MODULE_FORUM_FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id AND fw.user_id NOT IN ($sql_ignore_users) *************** *** 1055,1059 **** if (isset($update_notification['topic']) && sizeof($update_notification['topic'])) { ! $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . " SET notify_status = 1 WHERE topic_id = $topic_id --- 1056,1060 ---- if (isset($update_notification['topic']) && sizeof($update_notification['topic'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_TOPICS_WATCH_TABLE . " SET notify_status = 1 WHERE topic_id = $topic_id *************** *** 1063,1067 **** if (isset($update_notification['forum']) && sizeof($update_notification['forum'])) { ! $db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . " SET notify_status = 1 WHERE forum_id = $forum_id --- 1064,1068 ---- if (isset($update_notification['forum']) && sizeof($update_notification['forum'])) { ! $db->sql_query('UPDATE ' . MODULE_FORUM_FORUMS_WATCH_TABLE . " SET notify_status = 1 WHERE forum_id = $forum_id *************** *** 1072,1076 **** if (isset($delete_ids['topic']) && sizeof($delete_ids['topic'])) { ! $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); --- 1073,1077 ---- if (isset($delete_ids['topic']) && sizeof($delete_ids['topic'])) { ! $db->sql_query('DELETE FROM ' . MODULE_FORUM_TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); *************** *** 1079,1083 **** if (isset($delete_ids['forum']) && sizeof($delete_ids['forum'])) { ! $db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); --- 1080,1084 ---- if (isset($delete_ids['forum']) && sizeof($delete_ids['forum'])) { ! $db->sql_query('DELETE FROM ' . MODULE_FORUM_FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); *************** *** 1086,1089 **** $db->sql_transaction('commit'); } - */ ?> \ No newline at end of file --- 1087,1089 ---- Index: constants.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/includes/constants.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** constants.php 10 Dec 2004 16:19:28 -0000 1.5 --- constants.php 23 Dec 2004 05:37:05 -0000 1.6 *************** *** 138,141 **** --- 138,142 ---- define('CONFIG_TABLE', $table_prefix.'config'); define('CONTROL_PANEL_MODULES_TABLE', $table_prefix . 'control_panel_modules'); + define('DISALLOW_TABLE', $table_prefix.'disallow'); // define('DRAFTS_TABLE', $table_prefix.'drafts'); define('EXTENSIONS_TABLE', $table_prefix.'extensions'); |
|
From: Josh G. <os...@us...> - 2004-12-23 03:09:50
|
Update of /cvsroot/nanuke/nanuke0.x/styles/subSilver/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29060/styles/subSilver/template Modified Files: ucp_footer.html ucp_pm_viewfolder.html Log Message: - Forum module stuff Index: ucp_footer.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/styles/subSilver/template/ucp_footer.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ucp_footer.html 22 Dec 2004 05:15:06 -0000 1.2 --- ucp_footer.html 23 Dec 2004 03:09:23 -0000 1.3 *************** *** 4,8 **** <br clear="all" /> ! <!-- INCLUDE navbar_bottom.html --> <!-- INCLUDE overall_footer.html --> \ No newline at end of file --- 4,8 ---- <br clear="all" /> ! <!-- INCLUDE navbar.html --> <!-- INCLUDE overall_footer.html --> \ No newline at end of file Index: ucp_pm_viewfolder.html =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/styles/subSilver/template/ucp_pm_viewfolder.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ucp_pm_viewfolder.html 14 Dec 2004 04:23:00 -0000 1.3 --- ucp_pm_viewfolder.html 23 Dec 2004 03:09:23 -0000 1.4 *************** *** 39,43 **** <tr> <td class="row1" width="25" align="center" nowrap="nowrap"> ! <!-- IF messagerow.FOLDER_IMG_TYPE = 'folder_new' --> <img src="{T_THEME_PATH}/images/folder_new_big.gif" alt="{messagerow.FOLDER_IMG_ALT}" title="{messagerow.FOLDER_IMG_ALT}" /> <!-- ELSE --> --- 39,43 ---- <tr> <td class="row1" width="25" align="center" nowrap="nowrap"> ! <!-- IF messagerow.FOLDER_IMG_TYPE == 'folder_new' --> <img src="{T_THEME_PATH}/images/folder_new_big.gif" alt="{messagerow.FOLDER_IMG_ALT}" title="{messagerow.FOLDER_IMG_ALT}" /> <!-- ELSE --> |
|
From: Josh G. <os...@us...> - 2004-12-23 03:09:50
|
Update of /cvsroot/nanuke/nanuke0.x/modules/forum/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29060/modules/forum/includes Modified Files: functions.php functions_display.php Log Message: - Forum module stuff Index: functions.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/includes/functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions.php 22 Dec 2004 05:15:07 -0000 1.1 --- functions.php 23 Dec 2004 03:09:22 -0000 1.2 *************** *** 126,128 **** --- 126,220 ---- return; } + + function topic_status(&$topic_row, $replies, $mark_time_topic, $mark_time_forum, &$folder_img, &$folder_alt, &$topic_type) + { + global $user, $config; + + $folder = $folder_new = ''; + $unread_topic = false; + + if ($topic_row['topic_status'] == ITEM_MOVED) + { + $topic_type = $user->lang['VIEW_TOPIC_MOVED']; + $folder_img = 'folder_moved'; + $folder_alt = 'VIEW_TOPIC_MOVED'; + } + else + { + switch ($topic_row['topic_type']) + { + case POST_GLOBAL: + case POST_ANNOUNCE: + $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; + $folder = 'folder_announce'; + $folder_new = 'folder_announce_new'; + break; + + case POST_STICKY: + $topic_type = $user->lang['VIEW_TOPIC_STICKY']; + $folder = 'folder_sticky'; + $folder_new = 'folder_sticky_new'; + break; + + default: + if ($replies >= $config['module_forum_hot_threshold']) + { + $folder = 'folder_hot'; + $folder_new = 'folder_hot_new'; + } + else + { + $folder = 'folder'; + $folder_new = 'folder_new'; + } + break; + } + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder = 'folder_locked'; + $folder_new = 'folder_locked_new'; + } + + if ($user->data['user_id'] != ANONYMOUS) + { + $unread_topic = $new_votes = true; + + if ($mark_time_topic >= $topic_row['topic_last_post_time'] || $mark_time_forum >= $topic_row['topic_last_post_time']) //|| ($topic_row['topic_last_post_time'] == $topic_row['poll_last_vote'] && $replies)) + { + $unread_topic = false; + } + /* + if ($topic_row['poll_start'] && ($mark_time_topic >= $topic_row['poll_last_vote'] || $mark_time_forum >= $topic_row['poll_last_vote'])) + { + $new_votes = false; + } + */ + } + else + { + $unread_topic = false; + //$unread_topic = $new_votes = false; + } + + // $folder_new .= ($new_votes) ? '_vote' : ''; + + $folder_img = ($unread_topic) ? $folder_new : $folder; + $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS'); + + // Posted image? + if (!empty($topic_row['mark_type'])) + { + $folder_img .= '_posted'; + } + } + + if ($topic_row['poll_start']) + { + $topic_type .= $user->lang['VIEW_TOPIC_POLL']; + } + + return $unread_topic; + } ?> Index: functions_display.php =================================================================== RCS file: /cvsroot/nanuke/nanuke0.x/modules/forum/includes/functions_display.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions_display.php 22 Dec 2004 05:15:07 -0000 1.1 --- functions_display.php 23 Dec 2004 03:09:22 -0000 1.2 *************** *** 394,489 **** } - function topic_status(&$topic_row, $replies, $mark_time_topic, $mark_time_forum, &$folder_img, &$folder_alt, &$topic_type) - { - global $user, $config; - - $folder = $folder_new = ''; - $unread_topic = false; - - if ($topic_row['topic_status'] == ITEM_MOVED) - { - $topic_type = $user->lang['VIEW_TOPIC_MOVED']; - $folder_img = 'folder_moved'; - $folder_alt = 'VIEW_TOPIC_MOVED'; - } - else - { - switch ($topic_row['topic_type']) - { - case POST_GLOBAL: - case POST_ANNOUNCE: - $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; - $folder = 'folder_announce'; - $folder_new = 'folder_announce_new'; - break; - - case POST_STICKY: - $topic_type = $user->lang['VIEW_TOPIC_STICKY']; - $folder = 'folder_sticky'; - $folder_new = 'folder_sticky_new'; - break; - - default: - if ($replies >= $config['module_forum_hot_threshold']) - { - $folder = 'folder_hot'; - $folder_new = 'folder_hot_new'; - } - else - { - $folder = 'folder'; - $folder_new = 'folder_new'; - } - break; - } - - if ($topic_row['topic_status'] == ITEM_LOCKED) - { - $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; - $folder = 'folder_locked'; - $folder_new = 'folder_locked_new'; - } - - if ($user->data['user_id'] != ANONYMOUS) - { - $unread_topic = $new_votes = true; - - if ($mark_time_topic >= $topic_row['topic_last_post_time'] || $mark_time_forum >= $topic_row['topic_last_post_time']) //|| ($topic_row['topic_last_post_time'] == $topic_row['poll_last_vote'] && $replies)) - { - $unread_topic = false; - } - /* - if ($topic_row['poll_start'] && ($mark_time_topic >= $topic_row['poll_last_vote'] || $mark_time_forum >= $topic_row['poll_last_vote'])) - { - $new_votes = false; - } - */ - } - else - { - $unread_topic = false; - //$unread_topic = $new_votes = false; - } - - // $folder_new .= ($new_votes) ? '_vote' : ''; - - $folder_img = ($unread_topic) ? $folder_new : $folder; - $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS'); - - // Posted image? - if (!empty($topic_row['mark_type'])) - { - $folder_img .= '_posted'; - } - } - - if ($topic_row['poll_start']) - { - $topic_type .= $user->lang['VIEW_TOPIC_POLL']; - } - - return $unread_topic; - } - // Create forum rules for given forum function generate_forum_rules(&$forum_data) --- 394,397 ---- |