mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-05-19 00:30:21 -07:00
Fix the threadfix pages
This commit is contained in:
parent
2f1bc75f2b
commit
a6a22e7ea9
@ -6,10 +6,10 @@
|
|||||||
require 'lib/layout.php';
|
require 'lib/layout.php';
|
||||||
|
|
||||||
print "$header<br>";
|
print "$header<br>";
|
||||||
|
|
||||||
if (!$isadmin) {
|
if (!$isadmin) {
|
||||||
|
|
||||||
print "
|
print "
|
||||||
$tblstart
|
$tblstart
|
||||||
$tccell1>This feature is restricted.</td>
|
$tccell1>This feature is restricted.</td>
|
||||||
$tblend
|
$tblend
|
||||||
@ -24,7 +24,7 @@
|
|||||||
print adminlinkbar("admin-threads.php");
|
print adminlinkbar("admin-threads.php");
|
||||||
|
|
||||||
if (!$_POST['run']) {
|
if (!$_POST['run']) {
|
||||||
print "<form action=\"admin-threads.php\" method=\"post\">
|
print "<form action=\"admin-threads.php\" method=\"post\">
|
||||||
$tblstart
|
$tblstart
|
||||||
<tr>$tccellh>Thread Repair System</td></tr>
|
<tr>$tccellh>Thread Repair System</td></tr>
|
||||||
<tr>$tccell1>
|
<tr>$tccell1>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$q = "SELECT `posts`.`thread`, (COUNT(`posts`.`id`)) AS 'real', ((COUNT(`posts`.`id`) - 1) - `threads`.`replies`) AS 'offset', `threads`.`replies`, `threads`.`title` AS `threadname` FROM `posts` LEFT JOIN `threads` ON `posts`.`thread` = `threads`.`id` GROUP BY `thread` ORDER BY `offset` DESC";
|
$q = "SELECT `posts`.`thread`, (COUNT(`posts`.`id`)) AS 'real', ((CAST(COUNT(`posts`.`id`) AS SIGNED) - 1) - CAST(`threads`.`replies` AS SIGNED)) AS 'offset', `threads`.`replies`, `threads`.`title` AS `threadname` FROM `posts` LEFT JOIN `threads` ON `posts`.`thread` = `threads`.`id` GROUP BY `thread` HAVING `offset` <> 0 OR `offset` IS NULL ORDER BY ISNULL(`threadname`) ASC, `thread` DESC";
|
||||||
$sql = mysql_query($q) or die(mysql_error());
|
$sql = mysql_query($q) or die(mysql_error());
|
||||||
|
|
||||||
$count = "";
|
$count = "";
|
||||||
@ -65,33 +65,28 @@
|
|||||||
|
|
||||||
$status = "";
|
$status = "";
|
||||||
|
|
||||||
if ($data['offset'] != 0) {
|
if ($data['offset'] != 0 || $data['offset'] === null) {
|
||||||
|
|
||||||
if ($data['offset'] >= 10000000) {
|
if ($data['replies'] === null) {
|
||||||
$data['offset'] = ($data['real'] - 1) - $data['replies'];
|
$status = "<font color=\"#ff8080\">Invalid thread</font>";
|
||||||
// $status = "<font color=\"#ff8080\">First post missing or otherwise broken</font>";
|
} else {
|
||||||
// $data['offset'] = " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$status) {
|
|
||||||
$status = mysql_query("UPDATE `threads` SET `replies` = '". ($data['real'] - 1) ."' WHERE `id` = '". $data['thread'] ."'") or "<font color=#ff0000>Error</font>: ". mysql_error();
|
$status = mysql_query("UPDATE `threads` SET `replies` = '". ($data['real'] - 1) ."' WHERE `id` = '". $data['thread'] ."'") or "<font color=#ff0000>Error</font>: ". mysql_error();
|
||||||
if ($status == 1) $status = "<font color=#80ff80>Updated</font>";
|
if ($status == 1) $status = "<font color=#80ff80>Updated</font>";
|
||||||
// $status = "Not updated";
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "
|
print "
|
||||||
<tr>
|
<tr>
|
||||||
$tccell1>". $data['thread'] ."</td>
|
$tccell1><a href=\"thread.php?id=". $data['thread'] ."\">". $data['thread'] ."</a></td>
|
||||||
$tccell2l><a href=\"thread.php?id=". $data['thread'] ."\">". $data['threadname'] ."</a></td>
|
$tccell2l><a href=\"thread.php?id=". $data['thread'] ."\">". ($data['threadname'] !== null ? $data['threadname'] : "<em>(Deleted thread)</em>") ."</a></td>
|
||||||
$tccell1r>". $data['replies'] ."</td>
|
$tccell1>". ($data['replies'] !== null ? $data['replies'] + 1 : "—") ."</td>
|
||||||
$tccell1r>". $data['real'] ."</td>
|
$tccell1>". ($data['real']) ."</td>
|
||||||
$tccell2r><b>". $data['offset'] ."</b></td>
|
$tccell2><b>". ($data['offset'] !== null ? $data['offset'] : "—") ."</b></td>
|
||||||
$tccell1l>$status</td>
|
$tccell1>$status</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,9 +101,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "$tblend
|
print "$tblend
|
||||||
$footer
|
$footer
|
||||||
";
|
";
|
||||||
printtimedif($startingtime);
|
printtimedif($startingtime);
|
||||||
?>
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
require 'lib/layout.php';
|
require 'lib/layout.php';
|
||||||
|
|
||||||
print "$header<br>";
|
print "$header<br>";
|
||||||
|
|
||||||
if (!$isadmin) {
|
if (!$isadmin) {
|
||||||
|
|
||||||
print "
|
print "
|
||||||
$tblstart
|
$tblstart
|
||||||
$tccell1>This feature is restricted.</td>
|
$tccell1>This feature is restricted.</td>
|
||||||
$tblend
|
$tblend
|
||||||
@ -23,7 +23,7 @@
|
|||||||
print adminlinkbar("admin-threads2.php");
|
print adminlinkbar("admin-threads2.php");
|
||||||
|
|
||||||
if (!$_POST['run']) {
|
if (!$_POST['run']) {
|
||||||
print "<form action=\"admin-threads2.php\" method=\"post\">
|
print "<form action=\"admin-threads2.php\" method=\"post\">
|
||||||
$tblstart
|
$tblstart
|
||||||
<tr>$tccellh>Thread Repair System II</td></tr>
|
<tr>$tccellh>Thread Repair System II</td></tr>
|
||||||
<tr>$tccell1>
|
<tr>$tccell1>
|
||||||
@ -57,8 +57,8 @@
|
|||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$q = "SELECT `threads`.`id`, `threads`.`title` , `threads`.`lastpostdate` , `posts`.`date` as realdate, (`posts`.`date` - `threads`.`lastpostdate`) AS `diff` FROM `threads` LEFT JOIN (SELECT MAX(`date`) as `date`, `thread` FROM `posts` GROUP BY `thread`) as `posts` ON `posts`.`thread` = `threads`.`id` ORDER BY `diff` DESC";
|
$q = "SELECT `threads`.`id`, `threads`.`title` , `threads`.`lastpostdate` , `posts`.`date` as realdate FROM `threads` LEFT JOIN (SELECT MAX(`date`) as `date`, `thread` FROM `posts` GROUP BY `thread`) as `posts` ON `posts`.`thread` = `threads`.`id` ORDER BY `threads`.`id` DESC";
|
||||||
$sql = mysql_query($q) or die(mysql_error());
|
$sql = mysql_query($q) or die(mysql_error());
|
||||||
|
|
||||||
$count = "";
|
$count = "";
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
if ($data['lastpostdate'] != $data['realdate']) {
|
if ($data['lastpostdate'] != $data['realdate']) {
|
||||||
|
|
||||||
if ($data['lastpostdate'] == "0" && $data['realdate'] == NULL) {
|
if ($data['lastpostdate'] == "0" && $data['realdate'] === null) {
|
||||||
$status = "<font color=#ff8888>Broken thread</font>";
|
$status = "<font color=#ff8888>Broken thread</font>";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -89,7 +89,7 @@
|
|||||||
$tccell1>". ($data['realdate'] ? date($dateformat, $data['realdate'] + $tzoff) : "-") ."</td>
|
$tccell1>". ($data['realdate'] ? date($dateformat, $data['realdate'] + $tzoff) : "-") ."</td>
|
||||||
$tccell1>". timeunits2($data['lastpostdate'] - $data['realdate']) ."</td>
|
$tccell1>". timeunits2($data['lastpostdate'] - $data['realdate']) ."</td>
|
||||||
$tccell2l>$status</td>
|
$tccell2l>$status</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,9 +100,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "$tblend
|
print "$tblend
|
||||||
$footer
|
$footer
|
||||||
";
|
";
|
||||||
printtimedif($startingtime);
|
printtimedif($startingtime);
|
||||||
?>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user