--- imsg_edt.inc.t 2011-05-09 10:43:12.000000000 -0400 +++ /home/droy//workspace/fud302/FUDforum/src/imsg_edt.inc.t 2011-04-19 11:03:56.671622631 -0400 @@ -2,7 +2,7 @@ /** * copyright : (C) 2001-2010 Advanced Internet Designs Inc. * email : forum@prohost.org -* $Id: imsg_edt.inc.t,v 1.3 2011/05/09 14:43:12 droy Exp $ +* $Id: imsg_edt.inc.t 5013 2010-10-01 20:44:28Z naudefj $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -391,7 +391,7 @@ static function approve($id) { /* Fetch info about the message, poll (if one exists), thread & forum. */ - $mtf = db_sab('SELECT /* USE MASTER */ + $mtf = db_sab('SELECT m.id, m.poster_id, m.apr, m.subject, m.foff, m.length, m.file_id, m.thread_id, m.poll_id, m.attach_cnt, m.post_stamp, m.reply_to, m.mlist_msg_id, m.msg_opt, t.forum_id, t.last_post_id, t.root_msg_id, t.last_post_date, t.thread_opt, --- postcheck.inc.t 2011-05-09 10:23:06.000000000 -0400 +++ /home/droy/workspace/fud302/FUDforum/src/postcheck.inc.t 2011-04-19 11:03:56.676622988 -0400 @@ -2,7 +2,7 @@ /** * copyright : (C) 2001-2010 Advanced Internet Designs Inc. * email : forum@prohost.org -* $Id: postcheck.inc.t,v 1.3 2011/05/09 14:23:06 droy Exp $ +* $Id: postcheck.inc.t 4994 2010-09-02 17:33:29Z naudefj $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -65,7 +65,7 @@ /* Check for duplicate topics (exclude replies and edits). */ if (($GLOBALS['FUD_OPT_3'] & 67108864) && $_POST['reply_to'] == 0 && $_POST['msg_id'] == 0) { - $c = q_singleval('SELECT /* USE MASTER */ count(*) FROM {SQL_TABLE_PREFIX}msg WHERE subject='. _esc($_POST['msg_subject']) .' AND reply_to=0 AND poster_id='. _uid .' AND post_stamp >= '. (__request_timestamp__ - 86400)); + $c = q_singleval('SELECT count(*) FROM {SQL_TABLE_PREFIX}msg WHERE subject='. _esc($_POST['msg_subject']) .' AND reply_to=0 AND poster_id='. _uid .' AND post_stamp >= '. (__request_timestamp__ - 86400)); if ( $c > 0 ) { set_err('msg_body', '{TEMPLATE: postcheck_dup_err}'); } --- msg.php.t 2011-05-09 10:22:57.000000000 -0400 +++ /home/droy/workspace/fud302/FUDforum/src/msg.php.t 2011-04-19 11:03:56.669622936 -0400 @@ -2,7 +2,7 @@ /** * copyright : (C) 2001-2010 Advanced Internet Designs Inc. * email : forum@prohost.org -* $Id: msg.php.t,v 1.3 2011/05/09 14:22:57 droy Exp $ +* $Id: msg.php.t 5067 2010-11-06 07:37:22Z naudefj $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -35,14 +35,14 @@ if (!empty($_GET['goto'])) { if ($_GET['goto'] === 'end' && $th) { - list($pos, $mid) = db_saq('SELECT /* USE MASTER */ replies+1,last_post_id FROM {SQL_TABLE_PREFIX}thread WHERE id='. $th); + list($pos, $mid) = db_saq('SELECT replies+1,last_post_id FROM {SQL_TABLE_PREFIX}thread WHERE id='. $th); $mid = '#msg_'. $mid; $msg_page_focus = 1; } else if ($_GET['goto']) { /* Verify that the thread & msg id are valid. */ if (!$th) { - $th = (int) q_singleval('SELECT /* USE MASTER */ thread_id FROM {SQL_TABLE_PREFIX}msg WHERE id='. $_GET['goto']); + $th = (int) q_singleval('SELECT thread_id FROM {SQL_TABLE_PREFIX}msg WHERE id='. $_GET['goto']); } - if (!($pos = q_singleval('SELECT /* USE MASTER */ count(*) FROM {SQL_TABLE_PREFIX}msg WHERE thread_id='. $th .' AND id<='. $_GET['goto'] .' AND apr=1'))) { + if (!($pos = q_singleval('SELECT count(*) FROM {SQL_TABLE_PREFIX}msg WHERE thread_id='. $th .' AND id<='. $_GET['goto'] .' AND apr=1'))) { invl_inp_err(); } if ($msg_page_focus !== null) { --- post.php.t 2011-05-09 09:55:32.000000000 -0400 +++ /home/droy/workspace/fud302/FUDforum/src/post.php.t 2011-04-19 11:03:56.667622611 -0400 @@ -2,7 +2,7 @@ /** * copyright : (C) 2001-2010 Advanced Internet Designs Inc. * email : forum@prohost.org -* $Id: post.php.t,v 1.3 2011/05/09 13:55:32 droy Exp $ +* $Id: post.php.t 5064 2010-11-05 14:32:16Z naudefj $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -13,7 +13,7 @@ { $check_time = __request_timestamp__-$GLOBALS['FLOOD_CHECK_TIME']; - if (($v = q_singleval('SELECT /* USE MASTER */ post_stamp FROM {SQL_TABLE_PREFIX}msg WHERE ip_addr=\''. get_ip() .'\' AND poster_id='. _uid .' AND post_stamp>'. $check_time .' ORDER BY post_stamp DESC LIMIT 1'))) { + if (($v = q_singleval('SELECT post_stamp FROM {SQL_TABLE_PREFIX}msg WHERE ip_addr=\''. get_ip() .'\' AND poster_id='. _uid .' AND post_stamp>'. $check_time .' ORDER BY post_stamp DESC LIMIT 1'))) { return ($v - $check_time); } @@ -38,7 +38,7 @@ /* Replying or editing a message. */ if ($reply_to || $msg_id) { - if (($msg = db_sab('SELECT /* USE MASTER */ * FROM {SQL_TABLE_PREFIX}msg WHERE id='.($reply_to ? $reply_to : $msg_id)))) { + if (($msg = db_sab('SELECT * FROM {SQL_TABLE_PREFIX}msg WHERE id='.($reply_to ? $reply_to : $msg_id)))) { $msg->body = read_msg_body($msg->foff, $msg->length, $msg->file_id); } else { error_dialog('{TEMPLATE: imsg_err_message_title}', '{TEMPLATE: imsg_err_message_msg}'); @@ -48,7 +48,7 @@ } if ($th_id) { - $thr = db_sab('SELECT /* USE MASTER */ t.forum_id, t.replies, t.thread_opt, t.root_msg_id, t.orderexpiry, t.tdescr, m.subject FROM {SQL_TABLE_PREFIX}thread t INNER JOIN {SQL_TABLE_PREFIX}msg m ON t.root_msg_id=m.id WHERE t.id='. $th_id); + $thr = db_sab('SELECT t.forum_id, t.replies, t.thread_opt, t.root_msg_id, t.orderexpiry, t.tdescr, m.subject FROM {SQL_TABLE_PREFIX}thread t INNER JOIN {SQL_TABLE_PREFIX}msg m ON t.root_msg_id=m.id WHERE t.id='. $th_id); if (!$thr) { invl_inp_err(); } @@ -58,14 +58,14 @@ } else { std_error('systemerr'); } - $frm = db_sab('SELECT /* USE MASTER */ id, cat_id, name, max_attach_size, forum_opt, max_file_attachments, post_passwd, message_threshold FROM {SQL_TABLE_PREFIX}forum WHERE id='. $frm_id); + $frm = db_sab('SELECT id, cat_id, name, max_attach_size, forum_opt, max_file_attachments, post_passwd, message_threshold FROM {SQL_TABLE_PREFIX}forum WHERE id='. $frm_id); if (!$frm) { std_error('systemerr'); } $frm->forum_opt = (int)$frm->forum_opt; /* Fetch permissions & moderation status. */ - $MOD = (int) ($is_a || ($usr->users_opt & 524288 && q_singleval('SELECT /* USE MASTER */ id FROM {SQL_TABLE_PREFIX}mod WHERE user_id='. _uid .' AND forum_id='. $frm->id))); + $MOD = (int) ($is_a || ($usr->users_opt & 524288 && q_singleval('SELECT id FROM {SQL_TABLE_PREFIX}mod WHERE user_id='. _uid .' AND forum_id='. $frm->id))); $perms = perms_from_obj(db_sab('SELECT group_cache_opt, '. $MOD .' as md FROM {SQL_TABLE_PREFIX}group_cache WHERE user_id IN('. _uid .',2147483647) AND resource_id='. $frm->id .' ORDER BY user_id ASC LIMIT 1'), $is_a); /* More Security. */ @@ -116,7 +116,7 @@ $msg_show_sig = !$msg_id ? ($usr->users_opt & 2048) : ($msg->msg_opt & 1); if ($msg_id || $reply_to) { - $msg_poster_notif = (($usr->users_opt & 2) && !q_singleval('SELECT /* USE MASTER */ id FROM {SQL_TABLE_PREFIX}msg WHERE thread_id='. $msg->thread_id .' AND poster_id='. _uid)) || is_notified(_uid, $msg->thread_id); + $msg_poster_notif = (($usr->users_opt & 2) && !q_singleval('SELECT id FROM {SQL_TABLE_PREFIX}msg WHERE thread_id='. $msg->thread_id .' AND poster_id='. _uid)) || is_notified(_uid, $msg->thread_id); } else { $msg_poster_notif = ($usr->users_opt & 2); } @@ -138,7 +138,7 @@ $_POST['msg_icon'] = $msg->icon; if ($msg->attach_cnt) { - $r = q('SELECT /* USE MASTER */ id FROM {SQL_TABLE_PREFIX}attach WHERE message_id='. $msg->id .' AND attach_opt=0'); + $r = q('SELECT id FROM {SQL_TABLE_PREFIX}attach WHERE message_id='. $msg->id .' AND attach_opt=0'); while ($fa_id = db_rowarr($r)) { $attach_list[$fa_id[0]] = $fa_id[0]; } @@ -207,7 +207,7 @@ } } } else if ($msg_id) { /* If checksum fails and we're editing a message, get attachment data from db. */ - $r = q('SELECT /* USE MASTER */ id FROM {SQL_TABLE_PREFIX}attach WHERE message_id='. $msg_id .' AND attach_opt=0'); + $r = q('SELECT id FROM {SQL_TABLE_PREFIX}attach WHERE message_id='. $msg_id .' AND attach_opt=0'); while ($fa_id = db_rowarr($r)) { $attach_list[$fa_id[0]] = $fa_id[0]; } @@ -431,7 +431,7 @@ } else { $t = d_thread_view; - if ($msg_id && ($frm->forum_opt & 2) && !q_singleval('SELECT /* USE MASTER */ apr FROM {SQL_TABLE_PREFIX}msg WHERE id='. $msg_id)) { /* Editing unapproved message in moderated forum. */ + if ($msg_id && ($frm->forum_opt & 2) && !q_singleval('SELECT apr FROM {SQL_TABLE_PREFIX}msg WHERE id='. $msg_id)) { /* Editing unapproved message in moderated forum. */ check_return($usr->returnto); } @@ -530,7 +530,7 @@ if ($perms & 128) { if (!$pl_id) { $poll = '{TEMPLATE: create_poll}'; - } else if (($poll = db_saq('SELECT /* USE MASTER */ id, name FROM {SQL_TABLE_PREFIX}poll WHERE id='. $pl_id))) { + } else if (($poll = db_saq('SELECT id, name FROM {SQL_TABLE_PREFIX}poll WHERE id='. $pl_id))) { $poll = '{TEMPLATE: edit_poll}'; } }