Exemplo n.º 1
0
/**
* getArticleByTitle
*   Searches for an article by title.
* @param string  $title   A URL Prepared title. @see prepareTitle
* @return string    The article handle on success, false if not found
**/
function getArticleByTitle($title)
{
    $articles = getArticles(getArticleCount(), 0, 'title');
    foreach ($articles as $articleTitle => $article) {
        if (prepareTitle($articleTitle) == $title) {
            return $article;
        }
    }
    return false;
}
Exemplo n.º 2
0
<html>
<head>
    <title>TinyNews</title>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8" />
</head>
<body>
<h1><img src="images/knewsticker.png"> TinyNews<a></h1>
<div align="right"><?php 
echo getArticleCount();
?>
 articles <a href="rss.php">RSS Feed</a></div>
<?php 
foreach (getArticles(10) as $key => $article) {
    ?>
    <div class="title"><a href="article.php/<?php 
    echo prepareTitle(getArticleTitle($article));
    ?>
"><?php 
    echo getArticleTitle($article);
    ?>
</a></div>
    <div class="published">Published: <?php 
    echo date("F d Y H:i:s", getArticlePublished($article));
    ?>
</div>
    <div class="intro"><?php 
    echo getArticleIntro($article);
    ?>
</div>
<?php 
}
Exemplo n.º 3
0
echo $CONFIG['site']['url'];
?>
</link>
<copyright>W&amp;C Information Consultants CC</copyright>
<?php 
foreach (getArticles(10) as $key => $article) {
    ?>
    <item>
        <title><?php 
    echo htmlentities(strip_tags(getArticleTitle($article)));
    ?>
</title>
        <description><?php 
    echo htmlentities(strip_tags(getArticleIntro($article), 'ENT_QUOTES'));
    ?>
</description>
        <link><?php 
    echo $CONFIG['site']['url'] . 'article.php/' . prepareTitle(getArticleTitle($article));
    ?>
</link>
        <pubDate><?php 
    echo strftime("%a, %d %b %Y %T %Z", getArticlePublished($article));
    ?>
</pubDate>
     </item>
<?php 
}
?>
</channel>
</rss>