Ejemplo 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;
}
Ejemplo n.º 2
0
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */
include_once $CONFIG['lib'] . '/tinynews.php';
?>
<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));
    ?>