} render('user-posts', array('title' => 'My blog posts - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'heading' => 'My posts', 'page' => $page, 'posts' => $posts, 'about' => $author->about, 'name' => $author->name, 'bodyclass' => 'userposts', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Profile for: ' . $author->name, 'pagination' => has_pagination($total, $perpage, $page))); } else { $login = site_url() . 'login'; header("location: {$login}"); } }); // Show admin/draft get('/admin/draft', function () { if (login()) { config('views.root', 'system/admin/views'); $name = $_SESSION[config("site.url")]['user']; $page = from($_GET, 'page'); $page = $page ? (int) $page : 1; $perpage = config('profile.perpage'); $posts = get_draft($name, $page, $perpage); $total = get_count($name, 'dirname'); $author = get_author($name); if (isset($author[0])) { $author = $author[0]; } else { $author = default_profile($name); } if (empty($posts) || $page < 1) { render('user-draft', array('title' => 'My draft - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'page' => $page, 'heading' => 'My draft', 'posts' => null, 'about' => $author->about, 'name' => $author->name, 'bodyclass' => 'userdraft', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Draft for: ' . $author->name)); die; } render('user-draft', array('title' => 'My draft - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'heading' => 'My draft', 'page' => $page, 'posts' => $posts, 'about' => $author->about, 'name' => $author->name, 'bodyclass' => 'userdraft', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Draft for: ' . $author->name)); } else { $login = site_url() . 'login'; header("location: {$login}");
} else { $draft_id = start_new_edit($post_id); } ?> <script type='text/javascript'> var bas_ref = 'http://shpow.com/droll/add.php'; var query = '?draft_id=' + <?php echo $draft_id; ?> ; window.location = bas_ref + query; </script> <?php } else { $draft = get_draft($draft_id); // do escapage for passing variables to javascript $subject = js_escape($draft['subject']); $summary = js_escape($draft['summary']); $post_text = js_escape($draft['post_text']); ?> <form> <input type='text' id='subject_text' name='subject_text' class='input_long' /> <textarea id='summary_text' name='summary_text' class='summary_textarea input_long'></textarea> <textarea id='post_text' name='post_text' class='post_textarea input_long'></textarea>