Ejemplo n.º 1
0
function get_article_info($dbc, $id)
{
    $query = "SELECT * FROM article where id = {$id}";
    $result = mysqli_query($dbc, $query) or die('Error querying database.');
    if ($row = mysqli_fetch_array($result)) {
        $article_info[title] = $row[title];
        $article_info[create_time] = $row[create_time];
        $article_info[deleted] = $row[deleted];
        $article_info[publish_time] = $row[publish_time] == '' ? '尚未发布' : $row[publish_time];
        $article_info[creators] = render_authors($dbc, $id, 'creator');
        return $article_info;
    }
}
Ejemplo n.º 2
0
 $result = mysqli_query($dbc, $query) or die('Error querying database.');
 //echo '<ul>';
 $row_num = 1;
 $color = true;
 while ($row = mysqli_fetch_array($result)) {
     if ($color) {
         echo '<tr>';
     } else {
         echo '<tr class="info">';
     }
     $color = !$color;
     echo '<td>' . $row_num++ . '</td>';
     echo '<td>' . render_authors($dbc, $row[id], 'creator') . '</td>';
     echo '<td>' . render_authors($dbc, $row[id], 'author') . '</td>';
     echo '<td>' . render_authors($dbc, $row[id], 'reviewer') . '</td>';
     echo '<td>' . render_authors($dbc, $row[id], 'publisher') . '</td>';
     echo '<td><a  href="article.php?id=' . $row['id'] . '">' . $row['title'] . '</a>';
     if ($recycle) {
         echo '&nbsp;<a  href="' . $_SERVER['PHP_SELF'] . '?recycle=' . $row['id'] . '"><i class="icon-share"></i></a>';
     }
     echo '</td>';
     echo '<td>' . get_abstract($dbc, $row['id']) . '</td>';
     echo '<td>' . $row['create_time'] . '</td>';
     //echo '<a class="btn" href="article.php?id=' . $row['id'] . '"><i class="icon-edit"></i></a>';
     if ($role == 'creator') {
         if ($recycle) {
             echo '<td><a   href="' . $_SERVER['PHP_SELF'] . '?delete=' . $row['id'] . '"><i class="icon-trash"></i></a>';
         } else {
             echo '<td><a  href="' . $_SERVER['PHP_SELF'] . '?recycle=' . $row['id'] . '"><i class="icon-trash"></i></a></td></tr>';
         }
     }
Ejemplo n.º 3
0
    echo render_authors($dbc, $id, 'creator', ',&nbsp;&nbsp;');
    ?>
;&nbsp;&nbsp;
                        <strong>作者:&nbsp;</strong>
    <?php 
    echo render_authors($dbc, $id, 'author', ',&nbsp;&nbsp;');
    ?>
;&nbsp;&nbsp;     
                        <strong>评审:&nbsp;</strong>
                        <?php 
    echo render_authors($dbc, $id, 'reviewer', ',&nbsp;&nbsp;');
    ?>
;&nbsp;&nbsp;     
                        <strong>发布者:&nbsp;</strong>
                        <?php 
    echo render_authors($dbc, $id, 'publisher', ',&nbsp;&nbsp;');
    ?>
.     
                    <p>&nbsp;&nbsp;<strong>创建时间:</strong><?php 
    echo $article_info[create_time];
    ?>
 ;&nbsp;&nbsp; <strong>发布时间:</strong><?php 
    echo $article_info[publish_time];
    ?>
</font></p>            

                    </font>
                    <p>
                        <?php 
    if ($has_right_to_edit) {
        echo '<a class="btn btn-primary" href="article_metadata.php?id=' . $id . '"><i class="icon-th-list icon-white"></i>&nbsp;编辑元信息</a>';