<!--**************** NEWS AND EVENTS SECTION ******************--> <?php $newsItems = News::find_all(); ?> <div class="col-md-3 content-fix"> <div class="content-fix-scroll" style="width: 337px;"> <div class="content-fix-wrap"> <div class="content-fix-inner" style="width: 305px;"> <h2 class="content-sub-heading">NEWS AND EVENTS</h2> <ul> <?php foreach ($newsItems as $news) { echo '<li><a href="' . $news->url . '">' . $news->title . '</a></li>'; } ?> </ul> </div> </div> </div> </div> <!--**************** END OF NEWS AND EVENTS SECTION ******************-->
public function news($reload = false) { if ($reload or !$this->news_cache) { $id = mysql_real_escape_string($this->id); $this->news_cache = News::find_all("news.user_id = '{$id}'"); } return $this->news_cache; }
<?php require_once 'init.php'; $script = Script::find_by_code('forums'); $script->start(); ob_start(); $time = date("H:i:s"); echo "[{$time}] News Posts\r\n\r\n"; $newsPosts = News::find_all("news.published = true AND news.publish_at <= NOW() and news.ipb_id IS NULL"); foreach ($newsPosts as $news) { $response = $news->forumSync(); var_dump($response); $script->addlog("Posting on forums for [{$news}] {$news->title}"); echo " * {$news->title}\r\n"; } $script = Script::find_by_code('forums'); $output = ob_get_clean(); $script->finish($output);