if ($mode == 'own') { $where = 'news.author=' . $_SESSION['userid']; } $query = 'news.id, news.active, news.start, news.end, news.author, person.first_name as author_first_name, person.last_name as author_last_name, news.topic, news.text from news join person on
function current_news() { include_once $GLOBALS['root'] . 'news/func.php'; $news_data = select_news('now'); $content = ''; foreach ($news_data as $i => $data) { $news = new news($data); $news->format(); $content .= $news->tmpl(); } return $content; }
<?php /* * This file is part of Infoschool - a web based school intranet. * Copyright (C) 2005 Maikel Linke */ include 'var.php'; $output->secure(); $news = new news(); if (isset($_POST['news_data'])) { $data = $_POST['news_data']; $news->insert($data); redirect('own.php'); } $news->create(); $news->format(); $content = $news->tmpl('form_new.html'); $output->out($content);