authenticate("U_EReplies,U_TextCols,U_TextRows,U_Preview,U_Groups"); $Username = $user['U_Username']; if (!${$config['cookieprefix']."w3t_language"}) { ${$config['cookieprefix']."w3t_language"}= $config['language']; } // ------------------ // Check for any bans $html = new html; $userob -> check_ban($user['U_Number'],$Cat); // ------------------ // Let's get the groups if (!$user['U_Groups']) { $user['U_Groups'] = "-4-"; } // ----------------------------------------------------- // Let's find out if they get the default preview or not. $Preview = ""; isset($user['U_Preview']) && $Preview = $user['U_Preview']; if (!$Preview) { $Preview = $config['preview']; } if ($user['U_EReplies'] == "On"){ $Eselected = "checked=\"checked\""; } if ( ($Preview == 1) || ($Preview == "on") ){ $Pselected = "checked=\"checked\""; } !empty($user['U_TextCols']) && $TextCols = $user['U_TextCols']; !empty($user['U_TextRows']) && $TextRows = $user['U_TextRows']; if (!isset($TextCols)) { $TextCols = $theme['TextCols']; } if (!isset($TextRows)) { $TextRows = $theme['TextRows']; } // ----------------- // Get the post info $Board_q = addslashes($Board); $query = " SELECT t2.U_Username,t1.B_Main,t1.B_Subject,t1.B_Body,t1.B_Approved,t2.U_Number FROM {$config['tbprefix']}Posts AS t1, {$config['tbprefix']}Users AS t2 WHERE t1.B_Number = $Number AND t1.B_Board = '$Board_q' AND t2.U_Number = t1.B_Posterid "; $sth = $dbh -> do_query($query); // --------------- // AAssign the stuff list($ResUsername,$Main,$Subject,$Body,$Approved,$ParentUser) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); if (!$Subject && $Subject != "0") { exit; } if ($ResUsername == "**DONOTDELETE**") { $ResUsername = $ubbt_lang['ANON_TEXT']; } // ----------------------------------------------------- // Make sure we only put one Re: in front of the subject if (!preg_match("/^Re:/",$Subject)){ $Subject = "Re: ".$Subject; } // --------------------------------------------------------------- // If we are quoting then we need to wrap the body in quote markup $QuoteBody = ""; if ($q == 1) { $QuoteBody = $html -> undo_markup($Body); $QuoteBody = str_replace("
","\n",$QuoteBody); $QuoteBody = "[{$ubbt_lang['TEXT_QUOTE']}]$QuoteBody [/{$ubbt_lang['TEXT_QUOTE']}]"; } // ---------------------- // Convert "'s to " $Subject = str_replace("\"",""",$Subject); $Body = str_replace("\"",""",$Body); // -------------------------------------------------------------- // Let's make sure they are supposed to be making replies here $Grouparray = split("-",$user['U_Groups']); $gsize = sizeof($Grouparray); $groupquery = "AND ("; $g = 0; for ($i=0; $i<=$gsize;$i++) { if (!isset($Grouparray[$i])) { continue; } if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; }; $g++; if ($g > 1) { $groupquery .= " OR "; } $groupquery .= "Bo_Reply_Perm LIKE '%-$Grouparray[$i]-%'"; } $groupquery .= ")"; // ------------------ // Get the board info $query = " SELECT Bo_Title,Bo_HTML,Bo_Markup,Bo_Read_Perm,Bo_SpecialHeader,Bo_StyleSheet FROM {$config['tbprefix']}Boards WHERE Bo_Keyword = '$Board_q' $groupquery "; $sth = $dbh -> do_query($query); // ---------------- // Assign the stuff list($Title,$HTML,$Markup,$ReadPerm,$fheader,$fstyle) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); // ------------------------------------------------- // Here we need to figure out what stylesheet to use $mystyle = ""; isset($user['U_StyleSheet']) && $mystyle = $user['U_StyleSheet']; if (!$mystyle) { $mystyle = "usedefault"; } if ($mystyle == "usedefault") { $mystyle = $fstyle; if ($mystyle == "usedefault") { $mystyle = $theme['stylesheet']; } } // fstyle will now be a global variable to use in send_header $fstyle = $mystyle; // ---------------------------------------------------------- // Find out if they are supposed to be replying on this board if (!$Title) { $html -> not_right($ubbt_lang['READ_PERM'],$Cat); } if (isset(${$config['cookieprefix']."ubbt_pass"})) { if (${$config['cookieprefix']."ubbt_pass"} == "invalid") { if (!$config['under13']) { $html -> not_right($ubbt_lang['UNDER13'],$Cat); } else { $html -> not_right($ubbt_lang['NO_COPPA'],$Cat); } } } // ------------------------------------------------------ // IF This post isn't approved yet, you can't reply to it if ($Approved == "no") { $html -> not_right($ubbt_lang['NOT_APP'],$Cat); } // --------------- // Send the header $Extra = $Board . "_SEP_" .$Number. "_SEP_" .$Subject; $html -> send_header("{$ubbt_lang['REPLY_HEAD']} ($Subject)",$Cat,0,$user,$Extra,$ReadPerm); // ------------------------------- // Check if HTML is enabled or not if($HTML == "Off") { $htmlstatus = " {$ubbt_lang['NO_HTML']}"; } else { $htmlstatus = " {$ubbt_lang['YES_HTML']}"; } // -------------------------------------------- // Markup is disabled, so we better let them know if($Markup == "Off"){ $markupstatus = " {$ubbt_lang['NO_MARKUP']}"; } else { $markupstatus = " {$ubbt_lang['YES_MARKUP']} {$ubbt_lang['MARK_POSTS']}."; } // ------------------------------------------------------------------------- // If we are allowing anonymous users to choose a name to post under, we let // them know here. if ( ($config['anonnames']) && (!$Username) ) { $choosename = " {$ubbt_lang['CHOOSE_NAME']}"; } // ---------------------------------------------------------------------- // If The Guest group can post here then we set the Username to Anonymous // and we set the reged flag to "n"; $Reged = 'y'; if (!$Username) { $postername = $ubbt_lang['ANON_TEXT']; $Reged = 'n'; } else { $postername = $user['U_Username']; } $addtofav = ""; if ($postername != $ubbt_lang['ANON_TEXT']) { $addtofav = " {$ubbt_lang['ADDTOFAV']}

"; } if ( ($postername == $ubbt_lang['ANON_TEXT']) && ($config['anonnames']) ) { $postname = ""; } else { $postname = "$postername"; $postname .= ""; } $iconselect = $html -> icon_select(); $instant_ubbcode = $html -> instant_ubbcode(); // ------------------------------------- // What options do they have for posting if ( ($config['markupoption'] == 1) || ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") ) { $markupselect = "{$ubbt_lang['MAKE_POST']}
"; $markupselect .= "

"; } // ------------------------------------ // No options, we use the board default else { if ( ($HTML == "Off") && ($Markup == "On") ) { $markupselect = ""; } elseif ( ($HTML == "On") && ($Markup == "On") ) { $markupselect =""; } elseif ( ($HTML == "Off") && ($Markup == "Off") ) { $markupselect =""; } else { $markupselect = ""; } } $formmethod = "
"; if ( ($config['files']) && ($Reged == "y") && (ini_get('file_uploads')) ) { $canattach = " {$ubbt_lang['CAN_ATTACH']}"; $formmethod = ""; } $Body = str_replace(""","\"",$Body); // --------------------- // Grab the tablewrapper list($tbopen,$tbclose) = $html -> table_wrapper(); if (!$debug) { include("$thispath/templates/$tempstyle/newreply.tmpl"); } $html -> send_footer(); ?>