Exemplo n.º 1
0
function render_segment_summary($dbc, $row)
{
    $segment_title = $row[title];
    $segment_id = $row[id];
    $segment_content = tcmks_substr($row[content]);
    echo "<h4>";
    $articles = get_articles_by_seg($dbc, $segment_id, false);
    if (count($articles) != 0) {
        echo render_articles_by_seg($dbc, $segment_id, false);
        echo "&nbsp;/&nbsp;";
        echo "<a target=\"_blank\" href = \"article.php?view&id=" . $articles[0] . "#s{$segment_id}\">" . $segment_title . "</a>";
    } else {
        echo "<a target=\"_blank\" href = \"segment.php?id={$segment_id}\">" . $segment_title . "</a>";
    }
    echo "</h4>";
    render_user_action($dbc, $row[user_id], '创建于', $row[create_time]);
    echo "<p>" . $segment_content . "...</p>";
}
Exemplo n.º 2
0
    $result = mysqli_query($dbc, $query) or die('Error querying database.');
    $row_num = 1;
    $color = true;
    while ($row = mysqli_fetch_array($result)) {
        if ($color) {
            echo '<tr>';
        } else {
            echo '<tr class="info">';
        }
        $color = !$color;
        $segment_id = $row['id'];
        echo '<td>' . $row_num++ . '</td>';
        echo '<td>';
        echo "<a href=\"editor.php?act=edit&id={$segment_id}\">" . $row[title] . "</a>";
        echo '</td>';
        echo '<td>' . render_articles_by_seg($dbc, $row['id']) . '</td>';
        echo '<td>' . tcmks_substr($row['content']) . '</td>';
        echo '<td>' . render_tags($dbc, $row['id']) . '</td>';
        echo '<td>' . $row[create_time] . '</td>';
        echo '<td>';
        if (!is_segment_used($dbc, $row['id'])) {
            echo '<a   href="' . $_SERVER['PHP_SELF'] . '?delete_segment=' . $row['id'] . '"><i class="icon-trash"></i></a>';
        }
        echo '</td>';
    }
    ?>
        </tbody>
    </table>

    <?php 
} else {