Ejemplo n.º 1
0
        // PRINTS THE SH****
        ?>
                </div>
            </section>
            <?php 
    }
}
// TAG VIEW
if (isset($gettag)) {
    // if there's a tag -> tag view
    // save the content of the directory in the articles variable
    $articles = scandir($articlesdir, 1);
    // iterate through all articles
    foreach ($articles as $article) {
        // get the article tags
        $tags = ArticleGenerator::getTags($articlesdir, $article);
        // if the article has the requested tag
        if (in_array($gettag, $tags)) {
            // check if the file is a article file
            if (strlen($article) >= 3 && substr($article, -3) == ".md") {
                // generate the article
                ArticleGenerator::newArticle($articlesdir, $article, $getblog);
            }
        }
    }
} elseif ($getarticle == "") {
    // NORMAL VIEW if there's no article request -> normal view
    // save the content of the directory in the articles variable
    $articles = scandir($articlesdir, 1);
    // iterate through this variable
    $posts_amount = 0;
Ejemplo n.º 2
0
" name="date"
                                   id="date"/>
            </p>

            <p>Author:<br><br><input type="text"
                                     value="<?php 
    echo ArticleGenerator::getAuthor($directory, $article);
    ?>
"
                                     class="itextfield" name="author"
                                     id="author"/></p>

            <p>Tags:<br><br><input type="text"
                                   value="<?php 
    $tags = "";
    foreach (ArticleGenerator::getTags($directory, $article) as $tag) {
        $tags = $tags . ', ' . $tag;
    }
    $tags = substr($tags, 2);
    echo $tags;
    ?>
"
                                   class="itextfield" name="tags"
                                   id="tags"/></p>

            <p>Text:</p>
            <textarea class="itextarea" name="text" id="text">
                <?php 
    echo ArticleGenerator::getText($directory, $article);
    ?>
            </textarea>