示例#1
0
 $row_data .= '<tr class="tdhover" id= "tdata" bgcolor = "' . $bgcolor . '">';
 $row_data .= '<td>';
 $row_data .= $j++;
 $row_data .= '</td>';
 $row_data .= '<td>';
 $row_data .= '<input type="checkbox" name="cid[]" id="cb' . $i . '" value="' . $my_articles[$i]->articleID . '" onClick="isChecked(this.checked);"/>';
 $row_data .= '</td>';
 $row_data .= '<td class="blue">';
 $row_data .= '<a href="' . VIEW_ARTICLE_URL . $my_articles[$i]->articleID . '">';
 $title = getArticleTitle($my_articles[$i]->articleID);
 $row_data .= '&nbsp;' . $title;
 $row_data .= '</a>';
 $row_data .= '</td>';
 $row_data .= '<td class="blue2">';
 $row_data .= '<a href="' . VIEW_CATEGORY_DETAIL_URL . $my_articles[$i]->categoryID . '">';
 $category_name = getCategory_info($my_articles[$i]->categoryID, 'category_name');
 $row_data .= '&nbsp;' . $category_name;
 $row_data .= '</a>';
 $row_data .= '</td>';
 $row_data .= '<td ';
 switch ($my_articles[$i]->stageID) {
     case 1:
         // draft
         $row_data .= 'class="black">';
         break;
     case 2:
         //writing
         $row_data .= 'class="cyan">';
         break;
     case 3:
         //editing
示例#2
0
$month = $_SESSION['month'];
$year = $_SESSION['year'];
$writer_articles_reports = $_SESSION['report_writer_articles'];
for ($i = 0; $i < count($writer_articles_reports) - 1; $i++) {
    if ($writer_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>';
        $title = getArticleTitle($writer_articles_reports[$i]->articleID);
        $row_data .= '&nbsp;' . $title;
        $row_data .= '</td>';
        $row_data .= '<td class="blue2">';
        $category_name = getCategory_info($writer_articles_reports[$i]->categoryID, 'category_name');
        $row_data .= '&nbsp;' . $category_name;
        $row_data .= '</td>';
        $row_data .= '<td ';
        $status = getArticle_version_info($writer_articles_reports[$i]->articleID, 'status');
        switch ($status) {
            case 'revise':
                $row_data .= 'class="blue">';
                break;
            case 'rejected':
                $row_data .= 'class="red">';
                break;
            case 'approved':
                $row_data .= 'class="green">';
                break;
            case 'published':
示例#3
0
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$db = new database();
if (isset($_POST['cid'])) {
    $n = count($_POST['cid']);
    for ($i = 0; $i < $n; $i++) {
        foreach ($_POST['cid'] as $key => $value) {
            if ($key == $i) {
                $x = getArticle_category($value);
                $catname = getCategory_info($value, 'category_name');
                if (count($x) > 0) {
                    // if this category contains an articles then,,,
                    echo '<script>alert( "Sorry, you cannot delete the ' . $catname . ' category because it contains some articles. " );history.go(-1);</script>';
                } else {
                    // else lets f*** him!!!
                    $sql = " delete from category where categoryID = '{$value}' ";
                    $db->query($sql);
                    $_SESSION['catnames'][$i] = $catname;
                    $_SESSION['task'] = 'delete';
                }
            }
        }
    }
}
header('location: category_manager.php');
示例#4
0
while ($row = $db->fetcharray()) {
    $my_profile[] = $row;
}
/**
 * Get content editor
 */
$sql = "select * from content_editor ";
$sql .= "where userID = " . $_SESSION['clickuserID'];
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$content_editor = array();
while ($row = $db->fetcharray()) {
    $content_editor[] = $row;
}
$category_assigned = getCategory_info($content_editor[0]->categoryID, 'category_name');
/**
 * Get all the news category
 */
$sql = " select * from category ";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$category = array();
while ($row = $db->fetcharray()) {
    $category[] = $row;
}
$db->freeresult();
/**
 * Populate all the news-category into an array..
 */
示例#5
0
    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>';
        }
    }
}
$categoryID = $_GET['categoryID'];
$heading_category = getCategory_info($categoryID, 'category_name');
/**
 * Get the other news on this category
 */
$categoryID = $_GET['categoryID'];
$sql = " select * from article_versions av , ";
$sql .= " article_category ac ";
$sql .= " where av.stageID = '6' ";
$sql .= " and ac.articleID = av.articleID ";
$sql .= "and av.articleID != '{$articleID}' ";
$sql .= " and ac.categoryID = " . intval($categoryID);
$sql .= " and av.published_day = '{$day}' ";
$sql .= " and av.published_month = '{$month}' ";
$sql .= " and av.published_year = '{$year}' ";
$sql .= " group by av.articleID ";
$sql .= " order by av.dateline DESC ";
示例#6
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $username = $_SESSION['username'];
    $usertype = $_SESSION['usertype'];
}
switch ($usertype) {
    case 'News Editor':
        $assigned_category = getCategory_info(getUser_assigned_category($userID), 'categoryID');
        $editor_on_category = true;
        // this user is an editor
        break;
}
//retrieve the users workflow he had been assign ...
$db = new database();
$sql = "select * from user_stage us,\r\n\t\tstages s\r\n\t\twhere us.userID = {$userID}\r\n\t\tand\ts.stageID = us.stageID ";
// print $sql;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$user_stage = array();
while ($row = $db->fetcharray()) {
    $user_stage[] = $row;
}
示例#7
0
    $view_article_detail[] = $row;
}
$db->freeresult();
print_r($_SESSION);
//print $sql;
// Save the session data
$_SESSION['articleID'] = $view_article_detail[0]->articleID;
$_SESSION['title'] = $view_article_detail[0]->title;
$_SESSION['article_body'] = $view_article_detail[0]->article_body;
$_SESSION['created'] = $view_article_detail[0]->created;
$_SESSION['created_day'] = $view_article_detail[0]->created_day;
$_SESSION['created_month'] = $view_article_detail[0]->created_month;
$_SESSION['created_year'] = $view_article_detail[0]->created_year;
$_SESSION['dateline'] = $view_article_detail[0]->dateline;
$_SESSION['edited_by'] = $view_article_detail[0]->edited_by;
$_SESSION['category'] = getCategory_info($view_article_detail[0]->categoryID, 'category_name');
$writer = getArticle_authors_info($view_article_detail[0]->articleID, 'fullname');
print $writer;
$_SESSION['created_by'] = $writer;
$articlestageID = $view_article_detail[0]->stageID;
$_SESSION['articlestageID'] = $articlestageID;
//print_r($_SESSION);
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_article, 'Viewing the article ' . addslashes($_SESSION['title']));
// lets get the current article stage
//print_r($_SESSION);
/**
 * Check the article if there is a revision lists..
 * if naa then allow the designated user to revise it :-) ..dah..
 */
示例#8
0
     if ($content_users[$i]->is_loggedin) {
         $row_data .= '<img src="images/tick.png" width="12" height="12" border="0" alt="" />';
     } else {
         $row_data .= '&nbsp;';
     }
     $row_data .= '</td>';
     $row_data .= '<td align="left">';
     if (!$content_users[$i]->is_enabled) {
         $row_data .= '<img src="images/publish_x.png" width="12" height="12" border="0" alt="" />';
     } else {
         $row_data .= '<img src="images/tick.png" width="12" height="12" border="0" alt="" />';
     }
     $row_data .= '</td>';
     $row_data .= '<td align="left" class="viola" >';
     $group_name = getGroup_name($content_users[$i]->usertypeID);
     $assigned_category = getCategory_info(getUser_assigned_category($content_users[$i]->userID), 'category_name');
     if ($assigned_category) {
         $row_data .= '&nbsp;' . $group_name . '<i>--' . $assigned_category . '</i>';
     } else {
         $row_data .= '&nbsp;' . $group_name;
     }
     $row_data .= '</td>';
     $row_data .= '<td class="red" >';
     $row_data .= '&nbsp;<a href="mailto:' . $content_users[$i]->email . '">' . $content_users[$i]->email;
     $row_data .= '</td>';
     $row_data .= '<td>';
     $lastvisitDate = $content_users[$i]->lastvisitDate ? friendlyDate($content_users[$i]->lastvisitDate) : '0';
     $row_data .= '&nbsp;' . $lastvisitDate;
     $row_data .= '</td>';
     $row_data .= '</tr>';
 }