<?php if (Input::exists()) { if (token::check(Input::get('token'))) { $val = new Validation(); $validation = $val->check($_POST, array('message' => array('required' => true))); if ($validation->passed()) { foreach ($db->get('users', array('1', '=', '1'))->results() as $userAcc) { try { Notifaction::createMessage(Input::get('message'), $userAcc->id); Session::flash('complete', 'You sent a mass message!'); Redirect::to('?page=notification'); } catch (Exception $e) { } } } } } ?> <!DOCTYPE html> <html lang="en"> <head> <?php include 'inc/templates/head.php'; ?> </head> <body> <div class="col-md-3"><?php include 'inc/templates/nav.php'; ?> </div>
$fIndex = $bbs->fatherForumMeta($fid, 'id,name,parent_id,notopic'); $tpl->assign('fName', $fIndex[count($fIndex) - 1]['name']); $tpl->assign('fIndex', $fIndex); //发帖操作 $go = $_POST['go']; if (!empty($go)) { $title = $_POST['title']; $content = $_POST['content']; if (trim($title) == '') { throw new Exception('标题不能为空'); } if (trim($content) == '') { throw new Exception('内容不能为空'); } $token = new token($USER); $ok = $token->check($_POST['token']); if (!$ok) { throw new EXception('会话已过期,请重新发布'); } $token->delete(); $bbs = new bbs($USER); $ok = $bbs->newtopic($fid, $title, $content); if (!$ok) { throw new Exception('未知原因发帖失败,请重试或联系管理员'); } $tpl->assign('tid', $ok); $tpl->display('tpl:topicsuccess'); } else { throw new Exception(''); } } catch (Exception $err) {