print "<A>\n"; } else { print "<A HREF={$loginscript}?forum={$table}&url={$mainfile}?forum={$table}>{$l10nstr['27']}</A>\n"; /* connect to system */ } print "</TABLE></CENTER>\n"; print "<P dir=RTL align=right>\n"; if (!empty($name)) { print "<A HREF={$editscript}?forum={$table}&ancestor=0>{$l10nstr['28']}</A></BR>\n"; /* new message */ } $FirstMsg = $_GET['start']; $ShowMsg = $_GET['show']; if ($ShowMsg) { /* we have to show a specific message */ $ThreadTop = GetThreadTop($ShowMsg); } PrintMsg(0, 0); $Pages = SetPages(); $pgnum = array_search($FirstMsg, $Pages); print "<BR><CENTER>"; print "<TABLE dir=RTL width=80% border=0 cellpadding=0 bgcolor=lightblue><TR>\n"; if ($ShowMsg) { print "<TD align center><A HREF={$mainfile}?forum={$table}</A>{$l10nstr['29']}</A>\n"; /* general display */ } else { if ($pgnum > 0) { $prev = $Pages[$pgnum - 1]; print "<TD><A HREF={$mainfile}?forum={$table}&strart={$prev}><< {$l10nstr['30']}</A>\n"; /* previouse page */ }
if ($inf) { $flags |= 1; /* first bit is email inform */ } $query = "INSERT INTO {$table} (ancestor, title, date, time, lastmod, name, contents, url1, urldesc1, url2, urldesc2, url3, urldesc3, flags) "; $query .= " VALUES ('{$ancestor}', '{$title}', '{$date}', CURRENT_TIME(), NOW(), '{$name}', '{$contents}', '{$url1}', '{$urldesc1}', '{$url2}', '{$urldesc2}', '{$url3}', '{$urldesc3}', '{$flags}')"; $result = mysql_query($query); if (!$result) { echo mysql_error(); exit; } /* | Message was added, now change last modification time of top of thread. | For this we must first find top of thread, we start searching from current message ancestor. */ $num = GetThreadTop($ancestor); /* first check how many days past since thread started, we do not jump threads older then 3 days */ $query = "SELECT TO_DAYS('{$date}') - TO_DAYS(date) FROM {$table} WHERE num='{$num}'"; $result = mysql_query($query); if (!$result) { echo mysql_error(); exit; } $line = mysql_fetch_array($result, MYSQL_NUM); $dif = $line[0]; if ($dif < 10) { $query = "UPDATE {$table} SET lastmod=NOW() WHERE num='{$num}'"; $result = mysql_query($query); if (!$result) { echo mysql_error(); exit;