<td nowrap="nowrap" align="center"><?php echo $row["forum_topics"]; ?> </td> <td nowrap="nowrap" align="center"><?php echo $row["forum_replies"]; ?> </td> <td width="225"> <?php if ($message_date !== null) { echo $message_date->format("{$df} {$tf}"); $last = new Date_Span(); $last->setFromDateDiff($now, $message_date); echo '<br /><font color=#999966>(' . $AppUI->_('Last post') . ' '; printf("%.1f", $last->format("%d")); echo ' ' . $AppUI->_('days ago') . ') </font>'; $id = $row['message_parent'] < 0 ? $row['message_id'] : $row['message_parent']; echo '<br />> <a href="?m=forums&a=viewer&forum_id=' . $row['forum_id'] . '&message_id=' . $id . '">'; echo '<font color=#777777>' . $row['message_body']; echo $row['message_length'] > $max_msg_length ? '...' : ''; echo '</font></a>'; } else { echo $AppUI->_('No posts'); } ?> </td> </tr> <?php }
/** * A method to run maintenance. */ function run() { // Print a blank line in the debug log file when maintenance starts OA::debug(); // Do not run if distributed stats are enabled if (!empty($this->aConf['lb']['enabled'])) { OA::debug('Distributed stats enabled, not running maintenance tasks', PEAR_LOG_INFO); return; } // Acquire the maintenance lock $oLock =& OA_DB_AdvisoryLock::factory(); if ($oLock->get(OA_DB_ADVISORYLOCK_MAINTENANCE)) { OA::switchLogIdent('maintenance'); OA::debug(); OA::debug('Running Maintenance Engine', PEAR_LOG_INFO); // Attempt to increase PHP memory OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance')); // Set UTC timezone OA_setTimeZoneUTC(); // Get last run $oLastRun = $this->getLastRun(); // Update the timestamp for old maintenance code and auto-maintenance $this->updateLastRun(); // Record the current time, and register with the OA_ServiceLocator $oDate = new Date(); $oServiceLocator =& OA_ServiceLocator::instance(); $oServiceLocator->register('now', $oDate); // Check the operation interval is valid $result = OX_OperationInterval::checkOperationIntervalValue($this->aConf['maintenance']['operationInterval']); if (PEAR::isError($result)) { // Unable to continue! $oLock->release(); OA::debug('Aborting maintenance: Invalid Operation Interval length', PEAR_LOG_CRIT); exit; } // Run the Maintenance Statistics Engine (MSE) process $this->_runMSE(); // Run the "midnight" tasks, if required $runSync = false; if ($this->isMidnightMaintenance($oLastRun)) { $this->_runMidnightTasks(); $runSync = true; } // Release lock before starting MPE $oLock->release(); // Run the Maintenance Priority Engine (MPE) process, ensuring that the // process always runs, even if instant update of priorities is disabled $this->_runMPE(); // Log the completion of the entire ME process OA::switchLogIdent('maintenance'); $oEndDate = new Date(); $oDateSpan = new Date_Span(); $oDateSpan->setFromDateDiff($oDate, $oEndDate); OA::debug('Maintenance Engine Completed (Started at ' . $oDate->format('%Y-%m-%d %H:%M:%S') . ' ' . $oDate->tz->getShortName() . ', taking ' . $oDateSpan->format('%H:%M:%S') . ')', PEAR_LOG_INFO); OA::switchLogIdent(); // Run the Revive Adserver Sync process, to get details of any updates // to Revive Adserver, if the process is due to be run (because the // "midnight" tasks were triggered); this happens as the very last // thing to ensure that network issues or timeouts with the sync server // don't affect the normal running of the MSE & MPE, which are important // to have run properly! if ($runSync) { $this->_runReviveSync(); } } else { OA::switchLogIdent('maintenance'); OA::debug('Maintenance Engine not run: could not acquire lock', PEAR_LOG_INFO); OA::switchLogIdent(); } }
</td> <td bgcolor="#dddddd" width="10%"><?php echo $row['user_username']; ?> </td> <td align="center" width="10%"><?php echo $row['replies']; ?> </td> <td bgcolor="#dddddd" width="150" nowrap="nowrap"> <?php if ($row['latest_reply']) { echo $last->format($df . ' ' . $tf) . '<br /><font color=#999966>('; $span = new Date_Span(); $span->setFromDateDiff($now, $last); printf('%.1f', $span->format('%d')); echo ' ' . $AppUI->_('days ago') . ')</font>'; } else { echo $AppUI->_('No replies'); } ?> </td> </tr> <?php } } ?> </table> <input type="hidden" name="dosql" value="do_watch_forum" /> <input type="hidden" name="watch" value="topic" />
</td> <td bgcolor="#dddddd" width="10%"><?php echo $row["user_username"]; ?> </td> <td align="center" width="10%"><?php echo $row["replies"]; ?> </td> <td bgcolor="#dddddd" width="150" nowrap="nowrap"> <?php if ($row["latest_reply"]) { echo $last->format("{$df} {$tf}") . '<br /><font color=#999966>('; $span = new Date_Span(); $span->setFromDateDiff($now, $last); printf("%.1f", $span->format("%d")); echo ' ' . $AppUI->_('days ago'); echo ')</font>'; } else { echo $AppUI->_("No replies"); } ?> </td> </tr> <?php //JBF } } ?> </table>
<td nowrap="nowrap" align="center"><?php echo $row['forum_topics']; ?> </td> <td nowrap="nowrap" align="center"><?php echo $row['forum_replies']; ?> </td> <td width="225"> <?php if ($message_date !== null) { echo $message_date->format("{$df} {$tf}"); $last = new Date_Span(); $last->setFromDateDiff($now, $message_date); echo ' <font color=#999966>('; printf('%.1f', $last->format('%d')); echo ' ' . $AppUI->_('days ago') . ')</font>'; $id = $row['message_parent'] < 0 ? $row['message_id'] : $row['message_parent']; echo '<br /><a href="?m=forums&a=viewer&forum_id=' . $row['forum_id'] . '&message_id=' . $id . '">'; echo '<img style="padding-top: 8px" class="ico" src="images/discuss_private.gif"> '; echo '<font color=#777777>' . $row['message_body'] . ($row['message_length'] > $max_msg_length ? '...' : '') . '</font></a>'; } else { echo $AppUI->_('No posts'); } ?> </td> </tr> <?php } ?>