Esempio n. 1
0
 * obtain list of the category 
 */
$sql = "select * from category order by category_name ASC";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$categories = array();
while ($categories[] = $db->fetcharray()) {
}
$totalcategories = count($categories);
$categorylist = '';
for ($i = 0; $i < $totalcategories - 1; $i++) {
    foreach ($categories as $field => $value) {
        if ($field == 'category_name') {
            $categorylist .= '<li><a href="' . VIEW_CATEGORY_URL . $categories[$i]->categoryID . '">' . $categories[$i]->category_name . '</a></li>';
        }
    }
}
/*
 * Get the default stylesheets
 */
include 'admin/template.configuration.php';
$stylesheet = ' themes/' . $default_template_name . '/' . $default_template_stylesheet;
$db->close();
$gerger->stop();
$pagegenerated = $gerger->display();
// Generate the page now
$tpl = new template_parser('themes/templates/advertise.tpl.php');
$tags = array('{DATELINE}' => niceDate($headline[0]->dateline), '{ARTICLEID}' => $headline[0]->articleID, '{HEADLINE}' => $headline[0]->title, '{AUTHOR}' => 'By ' . getArticle_authors_info($headline[0]->articleID, 'fullname') . ' / BR</p>', '{ARTICLE_BODY}' => makeAShortIntro(strip_tags($headline[0]->article_body)), '{PHOTO}' => $photo, '{VIEW_ARTICLE_URL}' => $my_profile[0]->homeaddress, '{OTHER_HEADLINES}' => $other_headlines, '{OTHER_TOPSTORIES}' => $other_topstories, '{QUOTE_OF_THE_DAY}' => $quote, '{SUBSECTIONS}' => $subsections, '{ADS_148x300}' => $ads148x300, '{MESSAGE}' => $message, '{PAGE_GENERATED}' => '&nbsp;' . $pagegenerated, '{SPONSORED_LINKS}' => $sponsoredlinks, '{SUBSECTIONS}' => $subsections, '{CATEGORY}' => $categorylist, '{FOOTER}' => 'themes/templates/footer.tpl.php', '{STYLESHEET}' => $stylesheet);
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 2
0
    }
    //
    $viewpollresult .= '<input type="button" class="button2" onClick=popupWindow("' . "admin/create_poll_graph.php?topic_id=" . $topicid . '","win1",640,350,"yes","yes"); name="submit" value="Results"  class="button" />';
    if ($npoll > 1) {
        $viewpollresult .= '<br><a href="#"  onClick=popupWindow("view_more_poll.php","win2",300,300,"yes","yes");>';
        $viewpollresult .= '&nbsp;<b class="whitetext">View more poll&gt;&gt;</b>';
        $viewpollresult .= '</a>';
    }
    $polls .= '<form name="pollform" method="post" action="admin/save_poll_response2.php">';
    $polls .= '	<input type="hidden" name="topicid" value="' . $topicid . '" >';
    $polls .= $topic;
    $polls .= '<br>';
    $polls .= $optlabel;
    $polls .= '<input type="submit" class="button2" name="submit" value="Vote"  class="button" />';
    $polls .= $viewpollresult;
} else {
    $polls = '<b>No Polls available</b>';
}
/*
 * Get the default stylesheets
 */
include 'admin/template.configuration.php';
$stylesheet = ' themes/' . $default_template_name . '/' . $default_template_stylesheet;
$db->close();
$gerger->stop();
$pagegenerated = $gerger->display();
// Generate the page now
$tpl = new template_parser('themes/templates/index.tpl.php');
$tags = array('{FULLSTORY}' => $fullstory, '{DATELINE}' => niceDate($headline[0]->dateline), '{ARTICLEID}' => ' ' . $headline[0]->articleID, '{HEADLINE}' => $headline[0]->title, '{AUTHOR}' => 'By ' . getArticle_authors_info($headline[0]->articleID, 'fullname') . '</p>', '{ARTICLE_BODY}' => makeAShortIntro(strip_tags($headline[0]->article_body)), '{PHOTO}' => $photo, '{VIEW_ARTICLE_URL}' => $my_profile[0]->homeaddress, '{OTHER_HEADLINES}' => $other_headlines, '{OTHER_TOPSTORIES}' => $other_topstories, '{OUR_SEGMENTS}' => $segments, '{TOPICID}' => $topicid, '{POLLS}' => $polls, '{POLL_LABELS}' => $optlabel, '{POLL_TOPIC}' => $topic, '{VIEW_POLL_RESULT}' => $viewpollresult, '{QUOTE_MESSAGE}' => $quote_message, '{QUOTE_AUTHOR}' => $quote_author, '{SUBSECTIONS}' => $subsections, '{ADVERTISEMENTS}' => $ads, '{ADS_148x300}' => $ads148x300, '{ADS_800x140}' => $ads800x140, '{PAGE_GENERATED}' => '&nbsp;' . $pagegenerated, '{SPONSORED_LINKS}' => $sponsoredlinks, '{SUBSECTIONS}' => $subsections, '{CATEGORY}' => $categorylist, '{FOOTER}' => 'themes/templates/footer.tpl.php', '{STYLESHEET}' => $stylesheet, '{ENGINE_ LINK}' => '<a href="http://www.google.com"><img src="images/logo_google.png"></a>');
$tpl->parse_template($tags);
print $tpl->display();
 $row_data .= '<td>';
 $row_data .= '<a href="' . VIEW_ARTICLE_URL . $publisher_articles_reports[$i]->articleID . '">';
 $title = getArticleTitle($publisher_articles_reports[$i]->articleID);
 $row_data .= '&nbsp;' . $title;
 $row_data .= '</a>';
 $row_data .= '</td>';
 $row_data .= '<td class="blue2">';
 $category_name = getCategory_name($publisher_articles_reports[$i]->articleID);
 $row_data .= $category_name;
 $row_data .= '</td>';
 $row_data .= '<td>';
 $category_name = getFrontpage_type($publisher_articles_reports[$i]->articleID);
 $row_data .= '&nbsp;' . $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 .= '&nbsp;' . 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">';
Esempio n. 4
0
<?php

require 'admin/coreclass.php';
$articleID = $_GET['articleID'];
$db = new database();
$sql = "select * from article_versions ";
$sql .= " where articleID=" . intval($articleID);
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
while ($article[] = $db->fetcharray()) {
}
$db->freeresult();
$title = $article[0]->title;
$author = getArticle_authors_info($article[0]->articleID, 'fullname');
$dateline = friendlyDate3($article[0]->dateline);
$body = strip_tags($article[0]->article_body, '');
$doc = new document_generator('templates/preview.rtf');
$tags = array('<TITLE>' => $title, '<AUTHOR>' => $author, '<DATELINE>' => $dateline, '<BODY>' => $body);
$doc->doc_tags($tags);
echo $doc->display();
Esempio n. 5
0
 if ($my_articles[$i]->articleID) {
     $i % 2 == 0 ? $bgcolor = "" : ($bgcolor = "#F5F5F5");
     $row_data .= '<tr class="tdhover" id= "tdata" bgcolor = "' . $bgcolor . '">';
     $row_data .= '<td>';
     $row_data .= $i + 1;
     $row_data .= '</td>';
     $row_data .= '<td class="blue">';
     $title = getArticleTitle($my_articles[$i]->articleID);
     $row_data .= '&nbsp;' . $title;
     $row_data .= '</td>';
     $row_data .= '<td class="blue2">';
     $category_name = getCategory_name($my_articles[$i]->articleID);
     $row_data .= $category_name;
     $row_data .= '</td>';
     $row_data .= '<td>';
     $row_data .= getArticle_authors_info($my_articles[$i]->articleID, 'fullname');
     $row_data .= '</td>';
     $row_data .= '<td ';
     switch ($my_articles[$i]->status) {
         case 'revise':
             $row_data .= 'class="blue">';
             break;
         case 'rejected':
             $row_data .= 'class="red">';
             break;
         case 'approved':
             $row_data .= 'class="green">';
             break;
         case 'published':
             $row_data .= 'class="viola">';
             break;
Esempio n. 6
0
 for ($i = 0; $i < count($reports); $i++) {
     if ($reports[$i]->article_versionID) {
         $i % 2 == 0 ? $bgcolor = "" : ($bgcolor = "#F5F5F5");
         $row_data .= '<tr class="tdhover" id= "tdata" bgcolor = "' . $bgcolor . '">';
         $row_data .= '<td>';
         $row_data .= $i + 1;
         $row_data .= '</td>';
         $row_data .= '<td class="blue">';
         $row_data .= $reports[$i]->title;
         $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>';
Esempio n. 7
0
while ($links[] = $db->fetcharray()) {
}
$db->freeresult();
$sponsoredlinks = '';
$n = count($links) - 1;
for ($i = 0; $i < $n; $i++) {
    // Count the active banners
    foreach ($links as $field => $values) {
        if ($field == 'clientID') {
            if (checkhttptext($links[$i]->website)) {
                $url = splithttptext($links[$i]->website);
                $sponsoredlinks .= '<li><a href="' . $links[$i]->website . '">' . $url[1] . '</a></li>';
            } else {
                $sponsoredlinks .= '<li><a href="http://' . $links[$i]->website . '">' . $links[$i]->website . '</a></li>';
            }
        }
    }
}
/*
 * Get the default stylesheets
 */
include 'admin/template.configuration.php';
$stylesheet = ' themes/' . $default_template_name . '/' . $default_template_stylesheet;
$db->close();
$gerger->stop();
$pagegenerated = $gerger->display();
// Generate the page now
$tpl = new template_parser('themes/templates/view_article.tpl.php');
$tags = array('{LINK}' => $link, '{DATELINE}' => niceDate($dateline), '{TITLE}' => $view_article[0]->title, '{AUTHOR}' => getArticle_authors_info($view_article[0]->articleID, 'fullname') . '</p>', '{ARTICLE_BODY}' => $view_article[0]->article_body, '{HEADING_CATEGORY}' => $heading_category, '{OTHER_HEADLINES_CAT}' => $other_headlines_cat, '{OTHER_HEADLINES}' => $other_headlines, '{PAGE_GENERATED}' => '&nbsp;' . $pagegenerated, '{PHOTO}' => $photo, '{VIEW_ARTICLE_URL}' => $my_profile[0]->homeaddress, '{OTHER_TOPSTORIES}' => $other_topstories, '{QUOTE_OF_THE_DAY}' => $quote, '{SUBSECTIONS}' => $subsections, '{ADVERTISEMENTS}' => $advertisements, '{ADS_148x300}' => $ads148x300, '{ADS_600x140}' => $ads600x140, '{ADS_180x700}' => $ads180x700, '{SPONSORED_LINKS}' => $sponsoredlinks, '{SUBSECTIONS}' => $subsections, '{CATEGORY}' => $categorylist, '{FOOTER}' => 'themes/templates/footer.tpl.php', '{STYLESHEET}' => $stylesheet);
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 8
0
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$articleID = $_GET['articleID'];
$db = new database();
// TODO; MUST allow the article to preview no matter what stages been set on..
// so, we hav to change the code into a flexible style....bwahahah!!
// Get the writers name of the article
$articleID = $_SESSION['articleID'];
$title = $_SESSION['title'];
$article_body = $_SESSION['article_body'];
$created = $_SESSION['created'];
$writer_name = getArticle_authors_info($articleID, 'fullname');
$category_name = getCategory_name($articleID);
/**
 * Get the image sets of the article
 */
$sql = " select * from stockphotos s, ";
$sql .= " article_imgs ai ";
$sql .= " where ai.articleID=" . $_SESSION['articleID'];
$sql .= " and ai.imageID = s.imageID ";
$sql .= "and ai.show_image = 1";
$db->query($sql);
$article_images = array();
while ($article_images[] = $db->fetcharray()) {
}
$thumbnail = '';
for ($i = 0; $i < count($article_images) - 1; $i++) {
 if ($newsdirector_articles_reports[$i]->articleID) {
     $i % 2 == 0 ? $bgcolor = "" : ($bgcolor = "#F5F5F5");
     $row_data .= '<tr class="tdhover" id= "tdata" bgcolor = "' . $bgcolor . '">';
     $row_data .= '<td>';
     $row_data .= $i + 1;
     $row_data .= '</td>';
     $row_data .= '<td class="blue">';
     $title = $newsdirector_articles_reports[$i]->title;
     $row_data .= '&nbsp;' . $title;
     $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">';
Esempio n. 10
0
}
if (isset($_POST['send'])) {
    $db = new database();
    $articleID = $_SESSION['articleID'];
    //$title = $_SESSION['title'];
    $categoryname = $_SESSION['category_name'];
    $article_body = $_SESSION['article_body'];
    $created = $_SESSION['created'];
    $dateline = $_SESSION['dateline'];
    $editorID = $_SESSION['edited_by'];
    $stageID = $_SESSION['stageID'];
    $articlestageID = $_SESSION['articlestageID'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    $date_msg_created = time();
    $writerID = getArticle_authors_info($articleID, 'userID');
    //print 'w='. $writerID;
    //print_r($_SESSION) ;
    // ok lets determine whether the article was approve or rejected..
    // this article was reject by the news-director..
    if ($_SESSION['status'] == 'Reject') {
        $sql = " update article_versions ";
        $sql .= " set article_versions.status = 'rejected' , ";
        $sql .= " article_versions.stageID = 4 ";
        $sql .= " where article_versions.articleID=" . $articleID;
        if (!($result = $db->query($sql))) {
            die('Error:' . $db->error());
        }
        $sql = " update articles ";
        $sql .= " set articles.stageID='4' , articles.status='rejected' ";
        $sql .= " where articles.articleID=" . intval($articleID);
Esempio n. 11
0
                $thumbnail .= '<div align="center"><img src="images/apply_f2.png"  border="0" alt="" align="" />';
                $thumbnail .= '<p class="orange"><b>Selected</b></p>';
                $thumbnail .= '</div>';
            } else {
                $thumbnail .= '<div align="center">&nbsp;';
                $thumbnail .= '<p>&nbsp;</p><p>&nbsp;</p>';
                $thumbnail .= '</div>';
            }
            $thumbnail .= '</div>';
        }
    }
}
// Get the category name
$category_name = getCategory_name($articleID);
// Get the writer of the article
$article_authors = getArticle_authors_info($articleID, 'fullname');
// link for print preview
//$link = "preview_article.php?articleID=$articleID";
// Retrieve the frontpage
$sql = " select * from frontpage_sections ";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$frontpage_sections = array();
while ($row = $db->fetcharray()) {
    $frontpage_sections[] = $row;
}
$db->freeresult();
// Populate all the frontpage-sections into an array..
$optfrontpage_sections = '';
$frontpage = array();
Esempio n. 12
0
         $row_data .= '<td>';
         $row_data .= '<input type="checkbox" name="cid[]" id="cb' . $i . '" value="' . $article_versions[$i]->articleID . '" onClick="isChecked(this.checked);"/>';
         $row_data .= '</td>';
         break;
 }
 $row_data .= '<td class="blue2">';
 $row_data .= '<a href="' . VIEW_ARTICLE_URL . $article_versions[$i]->articleID . '">';
 $row_data .= '&nbsp;' . $article_versions[$i]->title;
 $row_data .= '</a>';
 $row_data .= '</td>';
 $row_data .= '<td class="viola">';
 $category_name = getCategory_name($article_versions[$i]->articleID);
 $row_data .= '&nbsp;' . $category_name;
 $row_data .= '</td>';
 $row_data .= '<td class="cyan">';
 $author_name = getArticle_authors_info($article_versions[$i]->articleID, 'fullname');
 $row_data .= '&nbsp;' . $author_name;
 $row_data .= '</td>';
 $row_data .= '<td class="blue2">';
 $category_name = getFrontpage_type($article_versions[$i]->articleID);
 $row_data .= '&nbsp;' . $category_name;
 $row_data .= '</td>';
 $row_data .= '<td class="green">';
 $row_data .= '&nbsp;' . getStage_name($article_versions[$i]->stageID);
 $row_data .= '</td>';
 switch ($_SESSION['stageID']) {
     case 2:
     case 3:
     case 4:
         $row_data .= '<td ';
         $status = $article_versions[$i]->status;