authenticate("U_Display, U_Groups, U_PostsPer, U_PicturePosts, U_FlatPosts, U_TempRead, U_TimeOffset,U_ShowSigs"); isset($user['U_Username']) && $Username = $user['U_Username']; isset($user['U_PicturePosts']) && $PicturePosts = $user['U_PicturePosts']; isset($user['U_Groups']) && $Groups = $user['U_Groups']; isset($user['U_StyleSheet']) && $mystyle = $user['U_StyleSheet']; isset($user['U_Status']) && $userstatus = $user['U_Status']; isset($user['U_TempRead']) && $read = $user['U_TempRead']; isset($user['U_FlatPosts']) && $Totaldisplay = $user['U_FlatPosts']; isset($user['U_Number']) && $usernumber = $user['U_Number']; isset($user['U_PostsPer']) && $PostsPer = $user['U_PostsPer']; isset($user['U_TimeOffset']) && $useroffset = $user['U_TimeOffset']; isset($user['U_ShowSigs']) && $ShowSigs = $user['U_ShowSigs']; isset($user['U_TimeOffset']) && $toffset = $user['U_TimeOffset']; $html = new html; // ------------------------------------------------------------- // If we didn't get a board or number then we give them an error if (!$Board) { $html -> not_right($ubbt_lang['NO_B_INFO'],$Cat); } // ------------------------------------------------------------ // Update the last visit to this board $Username_q = addslashes($Username); $LastViewed = "$Board"."Last"; $Board_q = addslashes($Board); if ( ($Username) && (!strstr(${$config['cookieprefix']."w3t_visit"},"-$Board=") ) ) { $query = " SELECT L_Last FROM {$config['tbprefix']}Last WHERE L_Uid = '{$user['U_Number']}' AND L_Board = '$Board_q' "; $sth = $dbh -> do_query($query); list($oldlast) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); // --------------------------------------- // Set a cookie, or register a session var if ($config['tracking'] == "sessions") { session_register("{$config['cookieprefix']}w3t_visit"); ${$config['cookieprefix']."w3t_visit"} .= "-$Board=$oldlast-"; } else { ${$config['cookieprefix']."w3t_visit"} .= "-$Board=$oldlast-"; setcookie("{$config['cookieprefix']}w3t_visit",${$config['cookieprefix']."w3t_visit"},0,$config['cookiepath']); } $unread = $oldlast; // Since we didn't find a cookie that means they bypassed the postlist // screen so we need to update the last visited timestamp $currtime = $html -> get_date(); $query = " DELETE FROM {$config['tbprefix']}Last WHERE L_Uid = '{$user['U_Number']}' AND L_Board = '$Board_q' "; $dbh -> do_query($query); $query = " INSERT INTO {$config['tbprefix']}Last (L_Uid,L_Last,L_Board) VALUES ('{$user['U_Number']}',$currtime,'$Board_q') "; $dbh -> do_query($query); } // ---------------------------------------------- // Set the default of viewing pictures with posts if (!$PicturePosts) { $PicturePosts = $theme['PicturePosts']; } // ---------------------------------------- // Need to figure out the active thread age $activethread = ""; if ( ($o) && ($o != "all") ) { $time = $html -> get_date(); $time = $time - ($o * 86400); $activethread = "AND B_Last_Post > $time"; } // ---------------------------------------------------------------- // If they are logged in then we check their groups, otherwise they // get set to the guest group if (!$Groups) { $Groups = "-4-"; } // -------------------------------------------------------------- // Let's make sure they are supposed to be looking at this board $Grouparray = split("-",$Groups); $gsize = sizeof($Grouparray); $groupquery = "AND ("; $g = 0; for ($i=0; $i<$gsize;$i++) { if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; }; $g++; if ($g > 1) { $groupquery .= " OR "; } $groupquery .= "Bo_Read_Perm LIKE '%-$Grouparray[$i]-%'"; } $groupquery .= ")"; // ----------------------------------------- // Grab the main post number for this thread $query = " SELECT B_Main FROM {$config['tbprefix']}Posts WHERE B_Number = '$Number' AND B_Board = '$Board' "; $sth = $dbh -> do_query($query); list ($current) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); // ------------------------------------------------ // Keep the current thread number for page linking $pagelinker = $current; // ------------------------------------------------------------- // If we didn't find the main post, then this post doesn't exist if (!$current) { $html -> not_right($ubbt_lang['POST_PROB'],$Cat); } // --------------------------- // Grab some forum information $query = " SELECT Bo_Title,Bo_Write_Perm,Bo_CatName,Bo_Cat,Bo_Reply_Perm,Bo_Read_Perm,Bo_Markup,Bo_HTML,Bo_SpecialHeader,Bo_StyleSheet FROM {$config['tbprefix']}Boards WHERE Bo_Keyword = '$Board_q' $groupquery "; $sth = $dbh -> do_query($query); list($title,$CanWrite,$CatName,$CatNumber,$CanReply,$ReadPerm,$Markup,$HTML,$fheader,$fstyle) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); // ---------------------------------- // Grab all moderators for this board $query = " SELECT t1.Mod_Uid,t2.U_Username FROM {$config['tbprefix']}Moderators AS t1, {$config['tbprefix']}Users AS t2 WHERE t1.Mod_Board='$Board_q' AND t1.Mod_Uid = t2.U_Number "; $sth = $dbh -> do_query($query); $moderatorlist = ","; while (list($modid,$modname) = $dbh -> fetch_array($sth)) { $moderator[$modid] = $modname; $moderatorlist .="$modid,"; } if (!$title) { $html -> not_right($ubbt_lang['BAD_GROUP'],$Cat); } // ------------------------------------------------- // Here we need to figure out what stylesheet to use 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; // ---------------- // SHow moderators? $modarray = split(",",$moderatorlist); $modsize = sizeof($modarray); $comma =0; $modlist = ""; $modcheck = ","; for ($i=0;$i<$modsize;$i++) { if ($modarray[$i]) { if ($comma) { $modlist .= ", "; } $modcheck .= "{$modarray[$i]},"; $modlist .= "{$moderator[$modarray[$i]]}"; $comma++; } else { $modlist .= " "; } } // Let's see if the can post or reply $replyperm = $ubbt_lang['CANTREPLY']; $writeperm = $ubbt_lang['CANTWRITE']; for ($i=0; $i<$gsize; $i++) { if (strstr($CanReply,"-$Grouparray[$i]-") ) { $replyperm = $ubbt_lang['CANREPLY']; $canreply = 1; } if (strstr($CanWrite,"-$Grouparray[$i]-") ) { $writeperm = $ubbt_lang['CANWRITE']; $canwrite = 1; } if (($canwrite) && ($canreply)) { break; } } if ($Markup == "On") { $ubbcode = "{$ubbt_lang['UBBCODE']} {$ubbt_lang['ENABLED']}"; } else { $ubbcode = "{$ubbt_lang['UBBCODE']} {$ubbt_lang['DISABLED']}"; } if ($HTML == "On") { $htmlcode = "{$ubbt_lang['HTMLIS']} {$ubbt_lang['ENABLED']}"; } else { $htmlcode = "{$ubbt_lang['HTMLIS']} {$ubbt_lang['DISABLED']}"; } // --------------------------------------------------------------- // If they are a normal user then they can only see approved posts $ismod = "no"; $Viewable = "AND B_Approved = 'yes'"; # Added by LK $PostViewable = "AND t1.B_Approved = 'yes'"; if ($userstatus == "Administrator") { $Viewable = ""; # Added by LK $PostViewable = ""; } if ($userstatus == "Moderator") { // Check if they moderate this board if (preg_match("/(,|^){$user['U_Number']}(,|$)/i",$moderatorlist)) { $Viewable = ""; # Added by LK $PostViewable = ""; $ismod = "yes"; } } // ---------------------------------------------------- // If we don't have a post number then we can't view it if (!$Number) { $html -> not_right($ubbt_lang['POST_PROB'],$Cat); } // ------------------------------------------------------------ // If we are showing thread views, we need to update the counter if (empty($vc)) { $query = " UPDATE {$config['tbprefix']}Posts SET B_Counter = B_Counter + 1 WHERE B_Main = $current "; $dbh -> do_query($query); } // ---------------------------------------------------- // Mark this message as read appending it to the others if (!$Totaldisplay) { $Totaldisplay = $theme['flatposts']; } // ----------------------------------------------------------- // Check if there are any replies in this thread, and how many $query = " SELECT B_Replies,B_Counter,B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating FROM {$config['tbprefix']}Posts WHERE B_Number = '$current' "; $sth = $dbh -> do_query($query); list($checkreplies,$count,$posted,$tsubject,$Rating,$Rates,$stars) = $dbh -> fetch_array($sth); $length = $checkreplies + 1; $ThreadRating = ""; if ($stars) { for ($x=1;$x<=$stars;$x++) { $ThreadRating .= "\"*\""; } } // ------------------------------------ // Let's see if they rated this thread $username_q = addslashes($Username); $query = " SELECT R_Rating FROM {$config['tbprefix']}Ratings WHERE R_What = '$current' AND R_Rater = '$usernumber' AND R_Type = 't' "; $sth = $dbh -> do_query($query); list($myrating) = $dbh -> fetch_array($sth); // ----------------------------------- // Figure out what we need to display if (!$myrating) { $ratinghtml = << {$ubbt_lang['RATETHIS']} EOF; } else { $ratinghtml = "{$ubbt_lang['YOURATED']} $myrating."; } // If we didn't get a fpart then we need to figure out what fpart // this post is on if ( (empty($fpart)) && ($length > $Totaldisplay) ) { $query = " SELECT COUNT(*) FROM {$config['tbprefix']}Posts WHERE B_Main=$current AND B_Number<=$Number "; $sti = $dbh -> do_query($query); list($totalreplies) = $dbh -> fetch_array($sti); $fpart = intval($totalreplies / $Totaldisplay) + 1; } if (!$fpart) { $fpart = 1; } if ($config['newcounter']) { $check = ",$Number,"; if ( (!strstr($read,$check)) && ($posted > $unread) ) { $read = $read . ",$Number,"; } // ----------------------------------------------------------- // Check if there are any replies in this thread, and how many $query = " SELECT B_Number FROM {$config['tbprefix']}Posts WHERE B_Main = '$current' "; $sth = $dbh -> do_query($query); $checkreplies = $dbh -> total_rows($sth); // ------------------------------------------------------------------- // We need to mark every post on this page as read and assign the total // number of posts to the lenght variable for later use. Also we need // to make sure that we are only marking posts as read that appear on // this page for ($i=0; $i < $checkreplies; $i++) { if ( ($fpart != "all") && ($i >= ($Totaldisplay * $fpart) ) ) { break; } list($Marknumber) = $dbh -> fetch_array($sth); $check = ",$Marknumber,"; if ( (!stristr($read,$check)) && ($posted > $unread) ) { $notread[$Marknumber] = "true"; $read = $read . ",$Marknumber,"; } } $dbh -> finish_sth($sth); // ---------------------------------------------------------- // Now we need to update their TempRead field in the database $read_q = addslashes($read); $query = " UPDATE {$config['tbprefix']}Users SET U_TempRead = '$read_q' WHERE U_Username = '$Username_q' "; $dbh -> do_query($query); } // -------------------------- // Give the start of the page $Extra = $Board ."_SEP_".$current."_SEP_" .$tsubject; $html -> send_header("$tsubject",$Cat,0,$user,$Extra,$ReadPerm); // -------------------- // Give the jumper box $jumpbox = $html -> jump_box($Cat,$groupquery,$Board); // Find out how many are browsing this forum $query = " SELECT O_Type,O_Extra,COUNT(*) FROM {$config['tbprefix']}Online WHERE O_Extra LIKE '$Board%' GROUP BY O_Type "; $sth = $dbh -> do_query($query); $a = "0"; $r = "0"; while (list($Type,$Extra,$onlinecount) = $dbh -> fetch_array($sth)) { ${$Type} = $onlinecount; } // -------------------------------------------------------------------- // If dateslip is on, we sort by Last_Post, otherwise we sort by Posted if (!$config['dateslip']) { $sort_opt = array( 1 => 'B_Subject DESC', 2 => 'B_Subject ASC', 3 => 'B_Posterid DESC', 4 => 'B_Posterid ASC', 5 => 'B_Posted DESC', 6 => 'B_Posted ASC' ); $sort_by = $sort_opt[$sb]; if (!$sort_by) { $sort_by = "B_Posted DESC"; } } else { $sort_opt = array( 1 => 'B_Subject DESC', 2 => 'B_Subject ASC', 3 => 'B_Posterid DESC', 4 => 'B_Posterid ASC', 5 => 'B_Last_Post DESC', 6 => 'B_Last_Post ASC', 7 => 'B_Counter DESC', 8 => 'B_Counter ASC', 9 => 'B_Replies DESC', 10 => 'B_Replies ASC', 11 => 'B_RealRating DESC', 12 => 'B_RealRating ASC' ); $sort_by = $sort_opt[$sb]; if(!$sort_by) {$sort_by = "B_Last_Post DESC";} } // --------------------------------------------------------------------- // Now we calculate which posts to grab for this page. We want to grab // one from the previous page and one from the next page so we know what // the previous and nexts posts will be // But only if we didn't come from the search engine if ($Search != "true") { if (!$PostsPer) { $PostsPer = $theme['postsperpage']; } if ($page < 1) { $Totalgrab = $PostsPer + 2; $Posts = $PostsPer + 2; } else { $Startat = $page * $PostsPer - 1; $Posts = $PostsPer + 2; $Totalgrab = "$Startat, $Posts"; } $limit = "LIMIT $Totalgrab"; $query = " SELECT B_Number FROM {$config['tbprefix']}Posts WHERE B_Topic = 1 AND B_Board = '$Board_q' $activethread $Viewable ORDER BY $sort_by $limit "; $sth = $dbh -> do_query($query); $total = $dbh -> total_rows($sth); $nextoption = "greynext.gif"; $prevoption = "greyprevious.gif"; $linktext = $ubbt_lang['INDEX_ICON']; $newpage = 0; // In case we are linking to an old post, we need to force the link // to the first page in postlist.php $currentlinkstart = ""; $currentlinkstop = ""; for ($i = 0; $i < $total; $i++) { $OldNumber = $PNumber; list ($PNumber) = $dbh -> fetch_array($sth); if (!$length) { $length = $Rlength; } // ----------------------------------------------- // Check to see if they get a previous link button if ( ( ($PNumber == $current) && ($page == 0) && ($i > 0) ) || ( ($PNumber == $current) && ($page != 0) ) ) { if ($i == 1) { $whichpage = $page - 1; } else { $whichpage = $page; } if ($whichpage < 0) { $whichpage = 0; } $prevlinkstart = ""; $prevoption = "previous.gif"; $prevlinkstop = ""; $previous = 1; } // ----------------------------------------------------------------------- // If we are on the current thread then we give the link for all threads // unless they came from the search engine, then we give them a link back // to that if ($PNumber == $current) { $currentlinkstart = ""; $currentlinkstop = ""; $alttext = $ubbt_lang['ALL_THREADS']; // --------------------------- // Now we grab the next thread $i++; list ($PNumber) = $dbh -> fetch_array($sth); // --------------------------------------------------------------- // If there is a next thread then give them a link to it otherwise // they get the greyed out image $nextoption = "next.gif"; if ($PNumber) { if ( ($i == $total) && ($i > $PostsPer) ) { $whichpage = $page + 1; } else { $whichpage = $page; } $nextlinkstart = ""; $nextoption = "next.gif"; $nextlinkstop = ""; } else { $nextoption = "greynext.gif"; } // -------------------------------------------------------------------- // If we got here then we are listing the original thread starting post // so we set original to 1 $original = 1; break; } } } else { // ------------------------------------------------------ // Otherwise we came from the search so we can only return $nextoption = "greynext.gif"; $Words = rawurlencode($Words); $Forum = rawurlencode($Forum); $Match = rawurlencode($Match); $currentlinkstart = ""; $currentlinkstop = ""; $linktext = $ubbt_lang['INDEX_ICON']; $prevoption = "greyprevious.gif"; } $dbh -> finish_sth($sth); // ------------------------------------------- // Let's see how many posts are in this thread $pages = $length / $Totaldisplay; $decimal = 0; if (stristr("$pages",".")) { list ($pages,$decimal) = split("\.",$pages); } if ($decimal > 0) { $pages++; } if ($pages > 1) { $pageprint = "{$ubbt_lang['FLAT_PAGES']}"; $StartPage = $fpart - 10; $EndPage = $fpart + 10; if ($StartPage < 1) { $EndPage = $EndPage - $StartPage; $StartPage = 1; } if ($EndPage > $pages) { $EndPage = $pages; $StartPage = $EndPage - 20; } if ($StartPage < 1) { $StartPage = 1; } if ($StartPage > 1) { $prev = $StartPage - 1; $pageprint .= "<< "; } for ($i=$StartPage; $i<=$EndPage; $i++) { if ($i == $fpart) { $pageprint .= "$i | "; } else { $pageprint .= "$i | "; } } if ($EndPage < $page) { $next = $EndPage + 1; $pageprint .= ">> "; } if ($fpart == "all") { $pageprint .= "({$ubbt_lang['SHOW_ALL_F']})"; } else { $pageprint .= "({$ubbt_lang['SHOW_ALL_F']})"; } } if (!$pageprint) { $pageprint = "{$ubbt_lang['FLAT_PAGES']} 1"; } // ------------------------------------------------- // Only certain options for users that are logged in if ($Username) { $addfavoption = " {$ubbt_lang['ADD_FAV']}
"; } // ----------------------------------------------------------------- // We need to know how many posts of this thread to display per page if ($fpart <= 1) { $Totalgrab = $Totaldisplay; } else { $Startat = $Totaldisplay * ($fpart - 1); $Totalgrab = "$Startat, $Totaldisplay"; } $Limit = "LIMIT $Totalgrab"; if ($fpart == "all") { $Limit = ""; } $threadnumber = $Number; // ----------------------- // Cycle through the posts # Query changed by LK for adding LoginName $query = " SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName,t4.U_Username FROM ( {$config['tbprefix']}Posts AS t1, {$config['tbprefix']}Users AS t2 ) LEFT JOIN {$config['tbprefix']}Posts AS t3 ON ( t1.B_Parent = t3.B_Number ) LEFT JOIN {$config['tbprefix']}Users AS t4 ON ( t3.B_PosterId = t4.U_Number ) WHERE t1.B_Main = $current AND t1.B_PosterId = t2.U_Number $PostViewable ORDER BY t1.B_Number $Limit "; $sth = $dbh -> do_query($query); $totalthread = $dbh -> total_rows($sth); for ($i=0; $i <$totalthread; $i++) { # Changed by LK, added ParentUser list ($Number,$Username,$Posted,$IP,$Subject,$Body,$File,$Open,$Approved,$Picture,$Reged,$Title,$Color,$Icon,$Poll,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditBy,$Location,$TotalPosts,$Registered,$Rating,$Rates,$stars,$picwidth,$picheight,$usernum,$downloads,$anonname,$ParentUser) = $dbh -> fetch_array($sth); $rateimage = ""; $postrow[$i] = ""; $postrow[$i]['Registered'] = ""; $postrow[$i]['Location'] = ""; $postrow[$i]['filelink'] = ""; $postrow[$i]['Parentlink'] = ""; $postrow[$i]['Rating'] = ""; $postrow[$i]['UserStatus'] = ""; $postrow[$i]['Picture'] = ""; $postrow[$i]['TotalPosts'] = ""; $postrow[$i]['Signature'] = ""; $postrow[$i]['replylinkstart'] = ""; $postrow[$i]['replylinkstop'] = ""; $postrow[$i]['editlinkstart'] = ""; $postrow[$i]['editlinkstop'] = ""; $postrow[$i]['quotelinkstart'] = ""; $postrow[$i]['quotelinkstop'] = ""; $postrow[$i]['addfavlinkstart'] = ""; $postrow[$i]['addfavlinkstop'] = ""; $postrow[$i]['notifylinkstart'] = ""; $postrow[$i]['notifylinkstop'] = ""; $postrow[$i]['mailpostlink'] = ""; # Added by LK $postrow[$i]['ParentUser'] = "-"; if ($ParentUser) $postrow[$i]['ParentUser'] = "(Re: $ParentUser)"; # End LK if ( ($Reged == 'y') && ($usernum != 1)){ if (isset($Registered)) { $postrow[$i]['Registered'] = $html -> convert_time($Registered,$useroffset); list ($one,$two,$three) = split(" ",$postrow[$i]['Registered']); if (stristr($three," ")) { list ($three,$four) = split(" ",$three); } if ($theme['timeformat'] == "long") { $regedon = "$two $three $four"; } else { $regedon = "$one"; } if ($theme['timeformat'] == "short5") { $regedon = "$two"; } $postrow[$i]['Registered'] = "{$ubbt_lang['REGED_ON']} $regedon"; } $postrow[$i]['TotalPosts'] = "{$ubbt_lang['POSTS_TEXT']}: $TotalPosts"; if ($Location) { $postrow[$i]['Location'] = "{$ubbt_lang['USER_LOC']} $Location"; } # Changed for efficiency by LK if ($Signature && $ShowSigs != "no") { $Signature = str_replace("\n","
",$Signature); $Signature = "

--------------------
$Signature"; } else $Signature = ""; $postrow[$i]['Signature'] = $Signature; // --------------------------------------------------------- // We need to know if this was made by an admin or moderator $postrow[$i]['UserStatus'] = ""; if ($PostStatus == "Administrator") { $postrow[$i]['UserStatus'] = "\"{$ubbt_lang['USER_ADMIN']}\""; } elseif ( ($PostStatus == "Moderator") && (stristr($modcheck,",$usernum,")) ) { $postrow[$i]['UserStatus'] = "\"{$ubbt_lang['USER_MOD']}\""; } if ( ($stars) && ($config['uratings'] == "1") ) { for ($x=1;$x<=$stars;$x++) { $rateimage .= "\"*\""; } $postrow[$i]['Rating'] = $rateimage; } if ( ($Picture) && ($Picture != "http://") && ( ($PicturePosts == 1) || ($PicturePosts == "on") ) ) { $picsize = ""; if ($picwidth && $picheight) { $picsize = "width=\"$picwidth\" height=\"$picheight\""; } else { $picsize = "width=\"{$theme['PictureWidth']}\" height=\"{$theme['PictureHeight']}\""; } $postrow[$i]['Picture'] = "\"\""; } else { $Picture = ""; } } $PrintLastEdit = ""; if ($LastEdit) { $LastEdit = $html -> convert_time($LastEdit,$toffset); $PrintLastEdit = "

{$ubbt_lang['EDITED_BY']} $LastEditBy ($LastEdit)"; } $postrow[$i]['PrintLastEdit'] = $PrintLastEdit; $newimage = ""; $time = $html -> convert_time($Posted,$toffset); $postrow[$i]['time'] = $time; $PUsername = $Username; if ($Color) { $PUsername = "$PUsername"; } // ------------------------------------------------------------------ // If we came from the search engine then we bold the search keywords if ($Search == "true" && $Match != 'Username') { $searchwords = split(" +",$Words); $size = sizeof($searchwords); for ($x=0; $x<$size; $x++) { if (!$searchwords[$x]) { continue; } $Body = @str_replace($searchwords[$x],"".$searchwords[$x]."",$Body); $Body = preg_replace("/(<(a|img)\s*[^>]+)($searchwords[$x])<\/i><\/b>([^>]*>)/i","\\1\\3\\4",$Body); } } if (isset($notread[$Number])) { if ( ($notread[$Number] == "true") && ($Posted > $unread) ) { $postrow[$i]['newimage'] = "\"{$ubbt_lang['NEW_TEXT']}\""; }; } // ------------------------------------------ // Set both the reply and edit buttons to off $reply = "off"; $edit = "off"; // ------------------- // Can they post here? $gsize = sizeof($Grouparray); for ($y=0; $y <$gsize; $y++) { if ( (strstr($CanWrite,"-$Grouparray[$y]-") ) || (strstr($CanReply,"-$Grouparray[$y]-") ) ){ $makepost = "yes"; break; } } if ( ($makepost == "yes") && ($Open != "C") && ($Open != "M") ) { $reply = "on"; } // ----------------------------------------------------------- // If this thread has been moved we need to send them properly if ($Open == "M") { @list($NewBoard,$NewNumber,$Body) = split("-ML-",$Body); $Body = "{$ubbt_lang['POINTER']}$Body"; } // --------------------------- // Do they get an edit button? if ($user['U_Username']) { if ( ($user['U_Number'] == $usernum) || ($ismod == "yes") || ($user['U_Status'] == "Administrator") ) { $edit = "on"; } } // ------------------------- // Mark it if it isn't approved if ($Approved == "no") { $Subject = "({$ubbt_lang['NOT_APPROVED']}) $Subject"; } $postrow[$i]['Subject'] = $Subject; // --------------------------------------------------------------- // If this is a new post then we need to set subject class accordingly if (isset($postrow[$i]['newimage'])) { $postrow[$i]['subjectclass'] = "newsubjecttable"; } else { $postrow[$i]['subjectclass'] = "subjecttable"; $postrow[$i]['newimage'] = ""; } if (!$Icon) { $Icon = "book.gif"; } $postrow[$i]['Icon'] = $Icon; $postrow[$i]['Icon'] = $Icon; // -------------------------------------------------------------- // If it is an anonymous post, don't give a link to their profile if ($Reged == "n") { if (!$config['anonnames']) { $Username = $ubbt_lang['ANON_TEXT']; } else { $Username = $anonname; } $Title = $ubbt_lang['UNREGED_USER']; } else { $Username = "$PUsername"; } $postrow[$i]['Username'] = $Username; # added by LK $Title = stripslashes($Title); $postrow[$i]['Title'] = $Title; if ( ($config['showip'] == 1) && $IP) { $postrow[$i]['IP'] = "($IP)"; } elseif ( ($config['showip'] == 2) && ( ($user['U_Status'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) { $postrow[$i]['IP'] = "($IP)"; } elseif ( ($config['showip'] == 3) && ($user['U_Status'] == "Administrator") && ($IP) ) { $postrow[$i]['IP'] = "($IP)"; } else { } if ($File) { $File = rawurlencode($File); if (!$downloads) { $downloads = "0"; } $postrow[$i]['filelink'] = "{$ubbt_lang['FILE_ATTACH']} ($downloads {$ubbt_lang['DOWNLOADS']})"; } $Parentlink = ""; if ($ParentPost) { $postrow[$i]['Subject'] = "$Subject"; } $editlinkstart = ""; $editlinkstop = ""; $replylinkstart = ""; $replylinkstop = ""; $quotelinkstart = ""; $quotelinkstop = ""; if ($edit == "on") { $postrow[$i]['editlinkstart'] = ""; $postrow[$i]['editlinkstop'] = ""; } if ($reply == "on") { $postrow[$i]['replylinkstart'] = ""; $postrow[$i]['replylinkstop'] = ""; $postrow[$i]['quotelinkstart'] = ""; $postrow[$i]['quotelinkstop'] = ""; } // ----------------------------------------------------------------------- // If there is a poll in this post, we need to give a link to view results if ($Poll) { $Body = str_replace("","
{$ubbt_lang['VIEW_POLL']}",$Body); $Body = str_replace("\$ubbt_lang{'SUB_VOTE'}","{$ubbt_lang['SUB_VOTE']}",$Body); } $postrow[$i]['Body'] = $Body; // ------------------------------------------------- // Only certain options for users that are logged in $addfavlinkstart = ""; $addfavlinkstop = ""; $mailpostlink = ""; $notifylinkstart = ""; $notifylinkstop = ""; if ($user['U_Username']) { $postrow[$i]['addfavlinkstart'] = ""; $postrow[$i]['addfavlinkstop'] = ""; if ($config['mailpost']) { $postrow[$i]['mailpostlink'] = " \"{$ubbt_lang['EMAIL_POST']}\" "; } $postrow[$i]['notifylinkstart'] = ""; $postrow[$i]['notifylinkstop'] = ""; } // Now we can show the post $postrow[$i]['Number'] = $Number; } $postrowsize = $i; $dbh -> finish_sth($sth); // --------------------- // Grab the tablewrapper list($tbopen,$tbclose) = $html -> table_wrapper(); // finish out the page if (!$debug) { include("$thispath/templates/$tempstyle/showflat.tmpl"); } // Send the footer $html -> send_footer(); ?>