function listThreads($threads, $dostickies = true, $showforum = false) { global $haveStickies, $mobileLayout; $forumList = ""; $haveStickies = 0; $cellClass = 0; while ($thread = Fetch($threads)) { $forumList .= listThread($thread, $cellClass, $dostickies, $showforum); $cellClass = ($cellClass + 1) % 2; } if ($showforum) { $forum = "<th style=\"width: 25%;\">" . __("Forum") . "</th>"; } else { $forum = ""; } if ($mobileLayout) { return "\n\t\t<table class=\"outline margin width100\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th>" . __("Thread") . "</th>\n\t\t\t\t<th style=\"min-width:150px;width:15%;\">" . __("Last post") . "</th>\n\t\t\t</tr>\n\t\t\t{$forumList}\n\t\t</table>"; } else { return "\n\t\t<table class=\"outline margin width100\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th style=\"width: 20px;\"> </th>\n\t\t\t\t<th style=\"width: 16px;\"> </th>\n\t\t\t\t<th style=\"width: 35%;\">" . __("Title") . "</th>\n\t\t\t\t{$forum}\n\t\t\t\t<th>" . __("Started by") . "</th>\n\t\t\t\t<th>" . __("Replies") . "</th>\n\t\t\t\t<th>" . __("Views") . "</th>\n\t\t\t\t<th style=\"min-width:150px\">" . __("Last post") . "</th>\n\t\t\t</tr>\n\t\t\t{$forumList}\n\t\t</table>"; } }
lu.(_userfields) FROM {threads} t ".($loguserid ? "LEFT JOIN {threadsread} tr ON tr.thread=t.id AND tr.id={4}" : '')." LEFT JOIN {users} su ON su.id=t.user LEFT JOIN {users} lu ON lu.id=t.lastposter LEFT JOIN {forums} f ON f.id=t.forum WHERE t.user={0} AND f.minpower <= {1} ORDER BY lastpostdate DESC LIMIT {2u}, {3u}", $uid, $loguser["powerlevel"], $from, $tpp, $loguserid); */ $rThreads = Query("\tSELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.(title, id),\n\t\t\t\t\t\t" . ($loguserid ? "tr.date readdate," : '') . "\n\t\t\t\t\t\tsu.(_userfields),\n\t\t\t\t\t\tlu.(_userfields)\n\t\t\t\t\tFROM\n\t\t\t\t\t\tthreads t\n\t\t\t\t\t\t" . ($loguserid ? "LEFT JOIN threadsread tr ON tr.thread=t.id AND tr.id={2}" : '') . "\n\t\t\t\t\t\tLEFT JOIN users su ON su.id=t.user\n\t\t\t\t\t\tLEFT JOIN users lu ON lu.id=t.lastposter\n\t\t\t\t\t\tLEFT JOIN forums f ON f.id=t.forum\n\t\t\t\t\t{$cond} and f.minpower <= {3}\n\t\t\t\t\tORDER BY sticky DESC, lastpostdate DESC LIMIT {4u}, {5u}", $tagcode, $forum, $loguserid, $loguser["powerlevel"], $from, $tpp); $numonpage = NumRows($rThreads); $pagelinks = PageLinks(actionLink("tagsearch", "", "tag={$tag}&fid={$forum}&from="), $tpp, $from, $total); if ($pagelinks) { echo "<div class=\"smallFonts pages\">" . __("Pages:") . " " . $pagelinks . "</div>"; } if (NumRows($rThreads)) { $forumList = ""; $cellClass = 0; $haveStickies = 0; while ($thread = Fetch($rThreads)) { $forumList .= listThread($thread, $cellClass, false, !$forum); $cellClass = ($cellClass + 1) % 2; } Write("\n\t<table class=\"outline margin width100\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 20px;\"> </th>\n\t\t\t<th style=\"width: 16px;\"> </th>" . (!$forum ? "\n\t\t\t<th style=\"width: 35%;\">" . __("Title") . "</th>\n\t\t\t<th style=\"width: 25%;\">" . __("Forum") . "</th>" : "\t\t\t<th style=\"width: 60%;\">" . __("Title") . "</th>") . "\n\t\t\t<th>" . __("Started by") . "</th>\n\t\t\t<th>" . __("Replies") . "</th>\n\t\t\t<th>" . __("Views") . "</th>\n\t\t\t<th style=\"min-width:150px\">" . __("Last post") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $forumList); } else { Alert(format(__("Tag {0} was not found in any thread."), htmlspecialchars($tag)), __("No threads found.")); } if ($pagelinks) { Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks); }