$row_data .= '</td>'; $row_data .= '<td>'; $category_name = getFrontpage_type($publisher_articles_reports[$i]->articleID); $row_data .= ' ' . $category_name; $row_data .= '</td>'; $row_data .= '<td>'; $row_data .= getArticle_authors_info($publisher_articles_reports[$i]->articleID, 'fullname'); $row_data .= '</td>'; $row_data .= '<td>'; $row_data .= getUser_info($publisher_articles_reports[$i]->edited_by, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="brown">'; $row_data .= ' ' . friendlydate2($publisher_articles_reports[$i]->created); $row_data .= '</td>'; $row_data .= '<td>'; $date = $publisher_articles_reports[$i]->modified ? friendlyDate2($publisher_articles_reports[$i]->modified) : '0'; $row_data .= $date; $row_data .= '</td>'; $row_data .= '<td>'; $row_data .= $publisher_articles_reports[$i]->status; $row_data .= '</td>'; $row_data .= '</tr">'; } } $dateprepared = time(); $dateprepared = friendlyDate($dateprepared); $rpt_title = "Lists of published articles for the month of {$month} {$year}."; // Generate the page now $tpl = new template_parser('../templates/reports/preview_publisher_reports.tpl.php'); $tags = array('{ARTICLE_TITLE}' => ' Article Title', '{CATEGORY}' => ' Category', '{FRONTPAGE}' => 'Frontpage', '{WRITTEN_BY}' => ' Written by', '{EDITED_BY}' => 'Edited by', '{FULLNAME}' => $fullname, '{POSITION}' => $position, '{DATE_CREATED}' => ' Date Written', '{LAST_MODIFIED}' => 'Last Modified', '{STATUS}' => 'Status ', '{DATE_PREPARED}' => $dateprepared, '{REPORT_TITLE}' => $rpt_title, '{LINK}' => $link, '{PAGELINK}' => $pagelink->pagelinks, '{TABLE_DATA}' => $row_data, '{STYLESHEET}' => $stylesheet, '{SITENAME}' => 'CMS Adminss', '{FOOTER}' => 'footer.php'); $tpl->parse_template($tags);
$category_name = getCategory_name($article_versions[$i]->articleID); $row_data .= ' ' . $category_name; $row_data .= '</td>'; $row_data .= '<td class="cyan">'; $author_name = getArticle_authors($article_versions[$i]->articleID); $row_data .= ' ' . $author_name; $row_data .= '</td>'; $row_data .= '<td class="blue2">'; $category_name = getFrontpage_type($article_versions[$i]->articleID); $row_data .= ' ' . $category_name; $row_data .= '</td>'; $row_data .= '<td class="green">'; $row_data .= ' ' . getstage_name($article_versions[$i]->stageID); $row_data .= '</td>'; $row_data .= '<td class="brown">'; $row_data .= ' ' . friendlyDate2($article_versions[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="black">'; $date = $article_versions[$i]->dateline ? friendlyDate2($article_versions[$i]->dateline) : '0'; $row_data .= ' ' . $date; $row_data .= '</td>'; $row_data .= '</tr>'; } } $link = " preview_newscontents.php"; $rpt_header = "List of Live articles as of {$month2} {$year}"; // start generating page $tpl = new template_parser('../templates/reports/report_newscontents.tpl.php'); $tags = array('{ARTICLE_TITLE}' => 'Article Title', '{AUTHOR}' => 'Author', '{CATEGORY}' => 'Category', '{FRONTPAGE}' => 'Frontpage', '{STAGEID}' => 'Stage', '{DATE_CREATED}' => 'Date Written', '{DATE_PUBLISHED}' => 'Date Published', '{LINK}' => $link, '{RESULT_MSG}' => $result_msg, '{RPT_HEADER}' => $rpt_header, '{TABLE_DATA}' => $row_data); $tpl->parse_template($tags); print $tpl->display();
$row_data .= 'class="green">'; break; case 'published': $row_data .= 'class="viola">'; break; default: $row_data .= 'class="black">'; break; } $row_data .= ' ' . $status; $row_data .= '</td>'; $row_data .= '<td class="brown">'; $row_data .= ' ' . friendlydate($my_articles[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="black">'; $date = $my_articles[$i]->modified ? friendlyDate2($my_articles[$i]->modified) : '0'; $row_data .= ' ' . $date; $row_data .= '</td>'; $row_data .= '</tr">'; } } /** * Create an array of article status for the option lists */ $status = array("approved", "revise", "reject", "edited", "published", "live"); foreach ($status as $idx => $value) { if ($value == $_SESSION['optstatus']) { $optstatus .= "<option value='{$value}' selected>{$value}</option>"; } else { $optstatus .= "<option value='{$value}' >{$value}</option>"; }
$row_data .= '</td>'; $row_data .= '<td class="viola">'; $category_name = getCategory_name($reports[$i]->articleID); $row_data .= $category_name; $row_data .= '</td>'; $row_data .= '<td class="brown" >'; $row_data .= getArticle_authors_info($reports[$i]->articleID, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="cyan">'; $row_data .= getUser_info($reports[$i]->edited_by, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="black">'; $row_data .= friendlyDate2($reports[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="brown">'; $date = $reports[$i]->modified ? friendlyDate2($reports[$i]->modified) : '0'; $row_data .= $date; $row_data .= '</td>'; $row_data .= '<td class="green">'; $row_data .= $reports[$i]->status; $row_data .= '</td>'; $row_data .= '</tr>'; } } } } /** * Populate all the years into an array.. */ $sql = " select distinct(created_year) from articles "; if (!($result = $db->query($sql))) {
$row_data .= '<td '; $status = $other_contents[$i]->status; switch ($status) { case 'Published': $row_data .= 'class="green">'; break; case 'Unpublished': $row_data .= 'class="red">'; break; } $row_data .= ' ' . $status; $row_data .= '</td>'; $row_data .= '<td>'; $from = getUser_info($other_contents[$i]->author, 'fullname'); $row_data .= ' ' . $from; $row_data .= '</td>'; $row_data .= '<td>'; $row_data .= friendlyDate($other_contents[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="black">'; $date = $other_contents[$i]->last_modified ? friendlyDate2($other_contents[$i]->last_modified) : '0'; $row_data .= ' ' . $date; $row_data .= '</td>'; $row_data .= '</tr>'; } } // ok baby, let start compiling the page now..go! go! go! {mh} $tpl = new template_parser('../templates/other_site_content.tpl.php'); $tags = array('{TITLE}' => 'Subject', '{STATUS}' => 'Status', '{CATEGORY}' => 'Category', '{SITENAME}' => 'CMS Adminss', '{DATE_CREATED}' => 'Date Created', '{LAST_MODIFIED}' => 'Last Modified', '{AUTHOR}' => 'Author', '{MESSAGE}' => $message, '{NUMITEMS}' => '' . $totalrows, '{TABLE_DATA}' => $row_data, '{PAGELINK}' => $pagelink->pagelinks, '{TOPNAV}' => 'top_menu.php', '{FOOTER}' => 'footer.php'); $tpl->parse_template($tags); print $tpl->display();
$row_data .= '</td>'; $row_data .= '<td class="viola">'; $category_name = getCategory_name($newsdirector_articles_reports[$i]->articleID); $row_data .= $category_name; $row_data .= '</td>'; $row_data .= '<td class="brown" >'; $row_data .= getArticle_authors_info($newsdirector_articles_reports[$i]->articleID, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="cyan">'; $row_data .= getUser_info($newsdirector_articles_reports[$i]->edited_by, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="black">'; $row_data .= friendlyDate2($newsdirector_articles_reports[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="brown">'; $date = $newsdirector_articles_reports[$i]->modified ? friendlyDate2($newsdirector_articles_reports[$i]->modified) : '0'; $row_data .= $date; $row_data .= '</td>'; $row_data .= '<td '; switch ($newsdirector_articles_reports[$i]->status) { case 'revise': $row_data .= 'class="blue">'; break; case 'rejected': $row_data .= 'class="red">'; break; case 'approved': $row_data .= 'class="green">'; break; default: $row_data .= 'class="black">';
$row_data .= '</td>'; $row_data .= '<td class="viola" >'; $category_name = getFrontpage_type($my_articles[$i]->articleID); $row_data .= ' ' . $category_name; $row_data .= '</td>'; $row_data .= '<td class="black">'; $row_data .= getArticle_authors_info($my_articles[$i]->articleID, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="brown">'; $row_data .= getUser_info($my_articles[$i]->edited_by, 'fullname'); $row_data .= '</td>'; $row_data .= '<td class="blue2">'; $row_data .= ' ' . friendlyDate2($my_articles[$i]->created); $row_data .= '</td>'; $row_data .= '<td class="black">'; $date = $my_articles[$i]->dateline ? friendlyDate2($my_articles[$i]->dateline) : '0'; $row_data .= $date; $row_data .= '</td>'; $row_data .= '<td class="green">'; $row_data .= $my_articles[$i]->status; $row_data .= '</td>'; $row_data .= '</tr">'; } } } /** * Populate all the years into an array.. */ $sql = " select distinct(created_year) from articles "; if (!($result = $db->query($sql))) { die('Error:' . $db->error());
break; } $row_data .= '<td class="brown">'; $row_data .= ' ' . friendlyDate2($article_versions[$i]->created); $row_data .= '</td>'; switch ($_SESSION['stageID']) { case 6: // published date of the article..can be viewd by the admin only??? $row_data .= '<td class="green">'; $date = $article_versions[$i]->dateline ? friendlyDate2($article_versions[$i]->dateline) : '0'; $row_data .= ' ' . $date; $row_data .= '</td>'; break; default: $row_data .= '<td class="black">'; $date = $article_versions[$i]->modified ? friendlyDate2($article_versions[$i]->modified) : '0'; $row_data .= ' ' . $date; $row_data .= '</td>'; break; } $row_data .= '</tr>'; } } /** * Populate all the content users into an array.. */ $sql = " select * from content_users order by fullname"; if (!($result = $db->query($sql))) { die('Error:' . $db->error()); } $users = array();