Пример #1
0
function getTagList($postId)
{
    global $currentTag;
    $tags = fetchPostTags($postId);
    $list = "";
    $id = 0;
    foreach ($tags as $tag) {
        if ($id++ > 0) {
            $list .= ", ";
        }
        $list .= '<a class="tagLink';
        if ($currentTag == $tag['id']) {
            $list .= ' current';
        }
        $list .= '" href="/blog/tags/' . $tag['id'] . '">' . $tag['name'] . '</a>';
    }
    return $list;
}
Пример #2
0
        $tags = mysql_query("SELECT * FROM tags;") or die(mysql_error());
        while ($tag = mysql_fetch_array($tags)) {
            echo '<input class="checkbox" type="checkbox" name="tags[]" value="' . $tag['id'] . '">' . $tag['name'] . '<br>';
        }
        ?>
<br>
<input type="submit" value="Post">
</form>
<?php 
    } else {
        if ($resource2 === "edit") {
            echo '<a href="/admin/blog">&lt;&lt;&lt; Back to Blog Management</a><br><br>';
            if (sizeof($URI) > 0) {
                $postID = array_shift($URI);
                $post = fetchPost($postID);
                $postTags = fetchPostTags($postID);
                ?>
<form action="/admin/editblogpost" method="post">
<table cellspacing=0>
    <tr><td>Title:</td><td><input type="text" name="title" value="<?php 
                echo $post['title'];
                ?>
"></td></tr>
    <tr><td>Time Posted:</td><td><input type="text" name="post_date" value="<?php 
                echo $post['post_date'];
                ?>
"></td></tr>
    <tr><td>Intro Content:</td><td><textarea style="height:200px;" name="intro_content"><?php 
                echo unParse($post['intro_content']);
                ?>
</textarea></td></tr>