function new_story() { $title = StoryTime::titleGenerator(); $uri = StoryTime::URIGenerator(); $story = array('uri' => $uri, 'title' => $title, 'body' => '', 'started_at' => $this->db->now()); $id = $this->db->insert('story', $story); if (!$id) { echo $this->db->getLastError(); } else { Http::redirect('/Main/story/' . $uri); } }
function createStory() { $user = (new UserModel())->getLoggedInUser(); if (!$user) { echo "not logged in"; } $title = StoryTime::titleGenerator(); $uri = StoryTime::URIGenerator(); $title_array = array('uri' => $uri, 'title' => $title); load_template('header', array('user' => $user, 'title' => 'Create Story')); load_view('CreateStory', $title_array); load_template('footer'); }
function regen() { $title = StoryTime::titleGenerator(); echo $title; }