]>
src.bluestatic.org Git - bugdar.git/blob - docs/update_bug_table_cache.php
4 require_once('./global.php');
6 $comments = $db->query("SELECT * FROM " . TABLE_PREFIX
. "comment ORDER BY bugid, dateline ASC");
8 foreach ($comments as $comment)
10 if (!isset($replace["$comment[bugid]"]))
12 $replace["$comment[bugid]"] = array(
13 'initialreport' => $comment['commentid'],
14 'dateline' => $comment['dateline'],
15 'lastposttime' => $comment['dateline'],
16 'lastpostby' => $comment['userid']
19 if (!$comment['hidden'] AND !isset($replace["$comment[bugid]"]['hiddenlastposttime']))
21 $replace["$comment[bugid]"]['hiddenlastposttime'] = $comment['dateline'];
22 $replace["$comment[bugid]"]['hiddenlastpostby'] = $comment['userid'];
25 $replace["$comment[bugid]"]['lastposttime'] = $comment['dateline'];
28 foreach ($replace AS $bugid => $newfields)
31 UPDATE " . TABLE_PREFIX
. "bug
32 SET initialreport = $newfields[initialreport],
33 dateline = $newfields[dateline],
34 lastposttime = $newfields[lastposttime],
35 lastpostby = $newfields[lastpostby],
36 hiddenlastposttime = $newfields[hiddenlastposttime],
37 hiddenlastpostby = $newfields[hiddenlastpostby]
40 echo "<p
>Updated
$bugid</p
>";