[Feed-collector-svn] SF.net SVN: feed-collector: [122] trunk
Status: Beta
Brought to you by:
c167
From: <C1...@us...> - 2007-06-04 22:54:49
|
Revision: 122 http://feed-collector.svn.sourceforge.net/feed-collector/?rev=122&view=rev Author: C167 Date: 2007-06-04 15:54:40 -0700 (Mon, 04 Jun 2007) Log Message: ----------- page_main.php working again, smarty working... Modified Paths: -------------- trunk/inc/config.php trunk/page_main.php trunk/styles/default/page_header.tpl trunk/styles/default/page_main.tpl Added Paths: ----------- trunk/styles/default/page_footer.tpl Removed Paths: ------------- trunk/styles/default/footer.tpl trunk/styles/default/header.tpl Modified: trunk/inc/config.php =================================================================== --- trunk/inc/config.php 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/inc/config.php 2007-06-04 22:54:40 UTC (rev 122) @@ -20,6 +20,8 @@ $db['passwd'] = "feed-collector"; // The password of this user $db['database'] = "feed-collector"; // The name of the database +// admin-values +$admin['email'] = "ex...@do...d"; // Session-configuration $session['time']['expire'] = 60 * 60 * 24; $session['time']['idle'] = 60 * 60; Modified: trunk/page_main.php =================================================================== --- trunk/page_main.php 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/page_main.php 2007-06-04 22:54:40 UTC (rev 122) @@ -76,53 +76,57 @@ if (PEAR :: isError($latestnews)) { echo $latestnews->getMessage(); } -$latest_news = sprintf(" <h1>%s</h1>\n", _("Latest News")); +$smarty->assign('latest_news_str', _("Latest News")); +$i = 0; while ($news = $latestnews->fetchRow()) { - $latest_news .= sprintf(" <a href=\"./page_news.php?newsid=%d\" class=\"newsHeading\">%s</a>\n" . - " <p class=\"newsDate\">%s</p>\n" . - " <p class=\"newsSummary\">%s</p>\n\n", $news['id'], $news['headline'], date("D, d.m.Y - H:i", $news['published']), $news['summary']); + $latest_news_list[$i]['id'] = $news['id']; + $latest_news_list[$i]['headline'] = $news['headline']; + $latest_news_list[$i]['published'] = $news['published']; + $latest_news_list[$i]['summary'] = $news['summary']; + $i++; } -$latest_news .= sprintf(//" <div class=\"more\"><a href=\"./page_news.php\">%s</a></div>\n\n" . -" <p class=\"filler\"><!-- Filler para to extend left vertical line --></p>", _("More News »")); +$smarty->assign('latest_news_list', $latest_news_list); +$smarty->assign('more_news', _("More News")); -$design = str_replace("<!-- latest news -->", $latest_news, $design); +// area 1 +$smarty->assign('statistic', _("Statistic")); +$smarty->assign('feeds_in_db', _("Feeds in the Database")); +$smarty->assign('val_feeds_in_db', $feed->stat_countFeeds()); +$smarty->assign('items_over_all', _("Items over all")); +$smarty->assign('val_items_over_all', $feed->stat_countAllItems()); +$smarty->assign('avg_items_per_feed', _("Average items per feed")); +$smarty->assign('val_avg_items_per_feed', $feed->stat_avgItemsPerFeed()); +$smarty->assign('atom10', _("[ATOM 1.0] feeds")); +$smarty->assign('val_atom10', $feed->stat_countFeedTypes("ATOM 1.0")); +$smarty->assign('rdf09', _("[RDF 0.9] feeds")); +$smarty->assign('val_rdf09', $feed->stat_countFeedTypes("RDF 0.9")); +$smarty->assign('rss20', _("[RSS 2.0] feeds")); +$smarty->assign('val_rss20', $feed->stat_countFeedTypes("RSS 2.0")); +$smarty->assign('rss10', _("[RSS 1.0] feeds")); +$smarty->assign('val_rss10', $feed->stat_countFeedTypes("RSS 1.0")); -// box 1 -$box_1 = sprintf(" <h1>%s</h1>\n <p>%s %d<br />\n %s %d<br />\n %s %d<br />\n </p>\n <p>\n %s %d<br />\n %s %d<br />\n %s %d<br />\n %s %d</p>", _("Statistic"), _("Fedds in the Database: "), $feed->stat_countFeeds(), _("Items over all:"), $feed->stat_countAllItems(), _("Average items per feed:"), $feed->stat_avgItemsPerFeed(), _("[ATOM 1.0] feeds:"), $feed->stat_countFeedTypes("ATOM 1.0"), _("[RDF 0.9] feeds:"), $feed->stat_countFeedTypes("RDF 0.9"), _("[RSS 2.0] feeds:"), $feed->stat_countFeedTypes("RSS 2.0"), _("[RSS 1.0] feeds"), $feed->stat_countFeedTypes("RSS 1.0")); -$design = str_replace("<!-- box 1 -->", $box_1, $design); +// area 2 +$biggest_feeds = 10; +$smarty->assign('val_biggest_feeds', $biggest_feeds); +$smarty->assign('biggest_feeds', _("biggest feeds")); +$smarty->assign('biggest_feeds_list', $feed->getBiggestFeeds($biggest_feeds)); +$smarty->assign('items_str', _("Items")); -// box 2 -$biggestfeeds = 10; -$box_2 = sprintf(" <h1>%d %s</h1>\n <ul>\n", $biggestfeeds, _("biggest feeds")); -$biggest_feeds = $feed->getBiggestFeeds($biggestfeeds); -foreach ($biggest_feeds as $biggest) { - $box_2 .= sprintf(" <li><a href=\"./page_show_feed.php?feed=%s\">%s (%d%s)</a> </li>\n", $biggest['feed_db_name'], $biggest['feed_name'], $biggest['items'], _(" Items")); -} -$box_2 .= " </ul>\n"; -$design = str_replace("<!-- box 2 -->", $box_2, $design); +// area 3 +$random_feeds = 10; +$smarty->assign('val_rand_feeds', $random_feeds); +$smarty->assign('rand_feeds', _("random feeds")); +$smarty->assign('random_feeds_list', $feed->getRandomFeeds($random_feeds)); -// box 3 -$newestfeeds = 10; -$box_3 = sprintf(" <h1>%d %s</h1>\n <ul>\n", $newestfeeds, _("random feeds")); -$random_feeds = $feed->getRandomFeeds($newestfeeds); -foreach ($random_feeds as $randfeed) { - $box_3 .= sprintf(" <li><a href=\"./page_show_feed.php?feed=%s\">%s (%d%s)</a> </li>\n", $randfeed['feed_db_name'], $randfeed['feed_name'], $randfeed['items'], _(" Items")); -} -$box_3 .= " </ul>\n"; +// area 4 +$newest_feeds = 6; +$smarty->assign('val_newest_feeds', $newest_feeds); +$smarty->assign('newest_feeds', _("Newest feeds")); +$smarty->assign('newest_feeds_list', $feed->getNewestFeeds($newest_feeds)); -$design = str_replace("<!-- box 3 -->", $box_3, $design); - -// box 4 -$box_4 = sprintf(" <h1>%s</h1>\n <ul>\n", _("Newest feeds")); -$newest_feeds = $feed->getNewestFeeds(6); -foreach ($newest_feeds as $newest) { - $box_4 .= sprintf(" <li><a href=\"./page_show_feed.php?feed=%s\"><!--•-->%s</a> %s (%d%s)</li>\n", $newest['feed_db_name'], $newest['feed_name'], date(("d.m.y H:m:s"), $newest['added']), $newest['items'], _(" Items")); -} -$box_4 .= " </ul>"; -$design = str_replace("<!-- box 4 -->", $box_4, $design); - # footer +$smarty->assign('admin_email', $admin['email']); +$smarty->assign('updated', _("Updated")); -//echo $design; $smarty->display("page_main.tpl"); ?> Deleted: trunk/styles/default/footer.tpl =================================================================== --- trunk/styles/default/footer.tpl 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/styles/default/footer.tpl 2007-06-04 22:54:40 UTC (rev 122) @@ -1,15 +0,0 @@ - <!-- ##### Footer ##### --> - - <div id="footer"> - <span class="doNotPrint"> - For comments or questions about this website, please - {mailto address=$admin_email encode="javascript" title=$admin_email_title text="email the webmaster"} - </span> - • <strong>{$updated} »</strong> {$smarty.now|date_format:"%Y-%m-%d"} - <span class="doNotPrint"> - <a href="http://validator.w3.org/check?uri=referer"><img src="styles/default/images/valid-xhtml11-blue.png" alt="Valid XHTML 1.1" /></a> - <a href="http://jigsaw.w3.org/css-validator/"><img src="styles/default/images/valid-css2-blue.png" alt="Valid CSS 2" /></a> - </span> - </div> - </body> -</html> Deleted: trunk/styles/default/header.tpl =================================================================== --- trunk/styles/default/header.tpl 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/styles/default/header.tpl 2007-06-04 22:54:40 UTC (rev 122) @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > - <head> - <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" /> - <meta name="author" content="haran" /> - <meta name="generator" content="haran" /> - - <link rel="stylesheet" type="text/css" href="./styles/default/css/page_main-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/css/common-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/css/header-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/css/main_copy-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/css/footer-screen.css" media="screen, tv, projection" title="Default" /> - - <title>{$title}</title> - </head> Copied: trunk/styles/default/page_footer.tpl (from rev 119, trunk/styles/default/footer.tpl) =================================================================== --- trunk/styles/default/page_footer.tpl (rev 0) +++ trunk/styles/default/page_footer.tpl 2007-06-04 22:54:40 UTC (rev 122) @@ -0,0 +1,15 @@ + <!-- ##### Footer ##### --> + + <div id="footer"> + <span class="doNotPrint"> + For comments or questions about this website, please + {mailto address=$admin_email encode="javascript" title=$admin_email_title text="email the webmaster"}<br /> + </span> + • <strong>{$updated} »</strong> {$smarty.now|date_format:"%Y-%m-%d"}<br /> + <span class="doNotPrint"> + <a href="http://validator.w3.org/check?uri=referer"><img src="styles/default/images/valid-xhtml11-blue.png" alt="Valid XHTML 1.1" /></a> + <a href="http://jigsaw.w3.org/css-validator/"><img src="styles/default/images/valid-css2-blue.png" alt="Valid CSS 2" /></a> + </span> + </div> + </body> +</html> Modified: trunk/styles/default/page_header.tpl =================================================================== --- trunk/styles/default/page_header.tpl 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/styles/default/page_header.tpl 2007-06-04 22:54:40 UTC (rev 122) @@ -9,16 +9,16 @@ <span>{$related_sites_str}</span> {foreach from=$related_sites_list item=i name="related_sites"} {if $smarty.foreach.related_sites.last == 0 } - <a href="{$i.href|escape}" title="{$i.title}">{$i.text}</a> | + <a href="{$i.href|escape}" title="{$i.title}">{$i.text}</a> | {else} - <a href="{$i.href|escape}" title="{$i.title}">{$i.text}</a> +<a href="{$i.href|escape}" title="{$i.title}">{$i.text}</a> {/if} {/foreach} </div> <div class="midHeader"> <h1 class="headerTitle">{$page_title}</h1> - <div class="headerSubTitle" title=\"Message'\"> + <div class="headerSubTitle" title="Message"> {$sub_title} </div> Modified: trunk/styles/default/page_main.tpl =================================================================== --- trunk/styles/default/page_main.tpl 2007-06-04 18:04:39 UTC (rev 121) +++ trunk/styles/default/page_main.tpl 2007-06-04 22:54:40 UTC (rev 122) @@ -12,29 +12,59 @@ </div> <div class="oneThird"> -{foreach from=$related_sites_list item=i name="related_sites"} - + <h1>{$latest_news_str}</h1> +{foreach from=$latest_news_list item=i name="latest_news"} + <a href="./page_news.php?newsid={$i.id}" class="newsHeading">{$i.headline}</a> + <p class="newsDate">{$i.published|date_format:"%a, %d.%m.%Y - %H:%M"}</p> + <p class="newsSummary">{$i.summary}</p> {/foreach} - - <!-- latest news --> + <div class="more"><a href="./page_news.php">{$more_news} »</a></div> + <p class="filler"><!-- Filler para to extend left vertical line --></p> </div> </div> <div class="rowOfBoxes dividingBorderAbove"> <div class="quarter noBorderOnLeft"> -<!-- box 1 --> + <h1>{$statistic}</h1> + <p> + {$feeds_in_db}: {$val_feeds_in_db}<br /> + {$items_over_all}: {$val_items_over_all}<br /> + {$avg_items_per_feed}: {$val_avg_items_per_feed}<br /> + </p> + <p> + {$atom10}: {$val_atom10}<br /> + {$rdf09}: {$val_rdf09}<br /> + {$rss20}: {$val_rss20}<br /> + {$rss10}: {$val_rss10} + </p> </div> <div class="quarter"> -<!-- box 2 --> + <h1>{$val_biggest_feeds} {$biggest_feeds}</h1> + <ul> +{foreach from=$biggest_feeds_list item=i name="biggest_feeds"} + <li><a href="./page_show_feed.php?feed={$i.feed_db_name}">{$i.feed_name} ({$i.items} {$items_str})</a></li> +{/foreach} + </ul> </div> <div class="quarter"> -<!-- box 3 --> - </div> + <h1>{$val_rand_feeds} {$rand_feeds}</h1> + <ul> +{foreach from=$random_feeds_list item=i name="random_feeds"} + <li><a href="./page_show_feed.php?feed={$i.feed_db_name}">{$i.feed_name} ({$i.items} {$items_str})</a></li> +{/foreach} + </ul> + </div> <div class="quarter"> -<!-- box 4 --> + <h1>{$val_newest_feeds} {$newest_feeds}</h1> + <ul> +{foreach from=$newest_feeds_list item=i name="newest_feeds"} + <li><a href="./page_show_feed.php?feed={$i.feed_db_name}">{$i.feed_name}</a> {$i.added|date_format:"%d.%m.%y %H:%M:%S"} ({$i.items} {$items_str})</li> +{/foreach} + </ul> </div> </div> </div> +{include file="page_footer.tpl"} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |