=================================================================== RCS file: /home/cvsd/home/cvs/wolboard/wolboard.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -p -r1.8 -r1.9 --- wolboard/wolboard.php 2002/04/13 22:49:49 1.8 +++ wolboard/wolboard.php 2002/04/25 08:42:46 1.9 @@ -3,14 +3,15 @@ Module: WolBoard.php3 Author: Martin Karas a.k.a. Wolcano - Date: 14.03.2002 + Date: 24.04.2002 Mail: wolcano@pobox.sk - Version: v5.1 + Version: v5.2 License: not chosen yet - this file is strictly private, you may not copy/change/distribute it without authors explicit premission. Description: Simple message-board. Can store data in files or PEAR-compliant DB (not fully implemented yet) + Copyright: Platon SDG http://www.platon.sk TODO: (see TODO file) @@ -24,11 +25,8 @@ :== :: Database specification: - create table messages - - create table users - - + See "sql/" files. + Input parameters: $pagesize - # of messages per page $page - #th page @@ -56,8 +54,10 @@ $archive - archive file prefix $archive_no - index of archived file $submit_type - submit button type + $reply_to - index of message you want to reply (inserts quoted message) CHANGE LOG: + * 5.2 - added "reply" link * 5.1 - updated SQL queries - sprtinf()-ed and quote()-ed all SQL queries - some bug fixes @@ -78,7 +78,7 @@ // IMPORTANT CONSTANTS (change if needed) - $WB_version = "5.1"; + $WB_version = "5.2"; $WB_name = "Wol's Message Board"; $strip_slashes = 0; $DEFAULT_HEAD_FRAME = ""; @@ -97,7 +97,7 @@ $min_msgs_in_board = 50; // Database defaults - $use_db = 1; + $use_db = 0; $db_message_table = "wolboard_messages"; $db_user_table = "wolboard_users"; //$db_host = "db.host.sk"; @@ -206,6 +206,20 @@ ); } // create_link() + function create_reply($msg_arr) { + /* + $msg_arr keys: time, name, message, email + */ + $quote_string = "> "; + $ret = $msg_arr["name"] . + " (" . + format_time($msg_arr["time"]) . + ")
\n$quote_string" . + eregi_replace("\n", "\n$quote_string", $msg_arr["message"]) . + "
"; + return $ret; + } // create_reply($msg_arr) + function wait_read_lock($f, $max_wait = 9999) { $start = time(); while ((!flock($f, 1)) && ($start + $max_wait < time())) @@ -309,7 +323,7 @@ } // get_time($str) function get_pass($str) { - return rawurldecode(trim(strtr(strrchr($str, ":"), ":", ";"))); + return rawurldecode(trim(strtr(strrchr($str, ":"), ":", " "))); } // get_pass($str) function get_email($str) { @@ -805,7 +819,7 @@ } } - function show_data_form($user_file, $self, $nick, + function show_data_form($user_file, $self, $nick, $message, $style, $WB_name, $autorefresh, $pagesize, $use_db = 0, $db_conn = 0) { // TODO !!!!!! global $headframe; @@ -827,7 +841,8 @@ Current time is " target=""> - + Nick > - - - ">New nick + + + "; if ($message["email"] != "") @@ -1058,6 +1074,13 @@ Current time is delete\n"; + echo "reply\n"; echo ""; echo "\t" . $message["message"] . "\n"; echo "\n"; @@ -1186,6 +1209,12 @@ Current time is