without explaining that they have to log in before the 'edit' buttons appear) */ $r = array('reason_web' => "Edit your journalisted profile", 'reason_email' => "Edit your journalisted profile", 'reason_email_subject' => "Edit your journalisted profile"); $P = person_signon($r); } else { $P = person_if_signed_on(); } if (!is_null($P)) { if (db_getOne("SELECT id FROM person_permission WHERE person_id=? AND ((journo_id=? AND permission='edit') OR permission='admin')", $P->id(), $journo['id'])) { $can_edit_page = TRUE; } } // if journo is not active, only allow viewing if logged-in user can edit page if ($journo['status'] == 'i') { // activate journo if they've met the requirements if (journo_checkActivation($journo['id'])) { $journo['status'] = 'a'; } } if ($journo['status'] != 'a' && !$can_edit_page) { spew_404($ref); exit(1); } $pageparams = array('rss' => array('Recent Articles' => journoRSS($journo)), 'head_extra_fn' => 'extra_head', 'pingbacks' => TRUE); if (get_http_var('allarticles') == 'yes') { $title = "All articles by " . $journo['prettyname']; page_header($title, $pageparams); ?> <div class="main"> <?php journo_emitAllArticles($journo);
$person_id = is_null($person) ? null : $person->id(); // uh-oh. queue it up for admin attention db_do("DELETE FROM article_error WHERE url=?", $this->url); db_do("INSERT INTO article_error (url,reason_code,submitted_by,article_id,expected_journo) VALUES (?,?,?,?,?)", $this->url, $reason, $person_id, $art_id, $journo_id); db_commit(); } } $item = new ArticleSubmitter($_journo); if (canEditJourno($_journo['id'])) { $title = "Add articles you have written"; } else { $title = "Submit missing articles for " . $_journo['prettyname']; } $newly_active = FALSE; if ($_journo['status'] == 'i') { $newly_active = journo_checkActivation($_journo['id']); } page_header($title); ?> <div class="main"> <h2><?php echo $title; ?> </h2> <?php if ($newly_active) { ?> <div class="infomessage"> <strong>Profile activated</strong> </div> <?php