[Feed-collector-svn] SF.net SVN: feed-collector: [83] trunk
Status: Beta
Brought to you by:
c167
From: <c1...@us...> - 2007-01-02 15:00:46
|
Revision: 83 http://feed-collector.svn.sourceforge.net/feed-collector/?rev=83&view=rev Author: c167 Date: 2007-01-02 06:56:03 -0800 (Tue, 02 Jan 2007) Log Message: ----------- some changes Modified Paths: -------------- trunk/page_add_tag.php trunk/page_main.php trunk/page_show_all_feeds.php trunk/page_show_feed.php trunk/page_show_feed_tag.php trunk/styles/default/page_show_all_feeds.tpl trunk/styles/default/page_show_feed_tag-screen.css trunk/styles/default/page_show_feed_tag.tpl trunk/update_feeds.php Modified: trunk/page_add_tag.php =================================================================== --- trunk/page_add_tag.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/page_add_tag.php 2007-01-02 14:56:03 UTC (rev 83) @@ -76,32 +76,32 @@ require_once "class/User_manager.php"; $user = new User_manager($db); -if(false === HTTP_Session :: get("logged_in", false)) { +if (false === HTTP_Session :: get("logged_in", false)) { HTTP :: redirect("./page_login.php"); } $main = ""; - if (!$tag_manager->hasTags($_GET['feed'])) { - $main .= sprintf("hi"); - // there are no tags yet, please add one... +if (!$tag_manager->hasTags($_GET['feed'])) { + $main .= sprintf("hi"); + // there are no tags yet, please add one... +} else { + $main .= sprintf(" <div id=\"tags\">\n" . + " <div id=\"tags_title\">%s</div>\n", _("Tags")); + $tags = $tag_manager->getTags($_GET['feed']); + if (count($tags) == 1) { + $main .= sprintf(" <a href=\"./page_show_feed_tag.php?tag=%s\">%s</a>", $tags[0], $tags[0]); } else { - $main .= sprintf(" <div id=\"tags\">\n" . - " <div id=\"tags_title\">%s</div>\n", _("Tags")); - $tags = $tag_manager->getTags($_GET['feed']); - if (count($tags) == 1) { - $main .= sprintf(" <a href=\"./page_show_feed_tag.php?tag=%s\">%s</a>", $tags[0], $tags[0]); - } else { - foreach ($tags as $id => $tag) { - $main .= " <a href=\"./page_show_feed_tag.php?tag=$tag\">$tag</a>"; - if ($id !== (count($tags) - 1)) { - $main .= ", "; - } - $main .= "\n"; + foreach ($tags as $id => $tag) { + $main .= " <a href=\"./page_show_feed_tag.php?tag=$tag\">$tag</a>"; + if ($id !== (count($tags) - 1)) { + $main .= ", "; } + $main .= "\n"; } - $main .= " </div>\n"; } + $main .= " </div>\n"; +} if (isset ($_POST['tag'])) { $tag_manager->addTag($_POST['tag'], HTTP_Session :: get("username"), $_GET['feed']); } @@ -159,22 +159,7 @@ " <input type=\"submit\" value=\"%s\" name=\"submit\" />\n" . " </div>\n" . " </form>\n" . - " </div>\n", $_SERVER['PHP_SELF']."?feed=".$_GET['feed'], _("Add Tag"), _("tag name"), _("Submit!")); + " </div>\n", $_SERVER['PHP_SELF'] . "?feed=" . $_GET['feed'], _("Add Tag"), _("tag name"), _("Submit!")); return $form; } - -function filterInput($input, $type) { - $inhalt = trim($inhalt); - $inhalt = htmlspecialchars($inhalt); - switch ($type) { - case "username" : - - break; - case "mail" : - - break; - } - - return $inhalt; -} ?> \ No newline at end of file Modified: trunk/page_main.php =================================================================== --- trunk/page_main.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/page_main.php 2007-01-02 14:56:03 UTC (rev 83) @@ -128,7 +128,7 @@ " <a href=\"./page_show_all_feeds.php\">%s</a> |\n" . " <a href=\"./page_show_feed_tag.php\">%s</a> |\n" . " <a href=\"./page_add_new_feed.php\">%s</a> |\n" . -" <a href=\"./page_show_all_tags.php\">%s</a> |\n", _("Home"), _("Show Feeds"), _("Feeds by TAG"), _("Add a Feed"), _("Show TAGs")); +" <a href=\"./page_show_all_tags.php\">%s</a> |\n", _("Home"), _("Show all Feeds"), _("Feeds by TAG"), _("Add a Feed"), _("Show TAGs")); if (false === HTTP_Session :: get("logged_in", false)) { $navigation .= sprintf(" <a href=\"./page_login.php\">%s</a> |\n <a href=\"./page_register.php\">%s</a>", _("Login"), _("Register")); } else { Modified: trunk/page_show_all_feeds.php =================================================================== --- trunk/page_show_all_feeds.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/page_show_all_feeds.php 2007-01-02 14:56:03 UTC (rev 83) @@ -79,6 +79,8 @@ require_once "class/Tag_manager.php"; $tag_manager = new Tag_Manager($db); +HTTP_Session :: set("logged_in", true); + //$maxpages = $feed->getFeedsMaxPages(10); $page = "main"; @@ -118,18 +120,22 @@ $design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design); // navigation -$navigation = sprintf(" <a href=\"./page_main.php\" class=\"highlight\">%s</a> |\n <a href=\"./page_show_feeds.php\">%s</a> |\n <a href=\"./page_search.php\">%s</a> |\n <a href=\"./index.html\">%s</a> |\n <a href=\"./index.html\">%s</a> |\n", _("Home"), _("Show Feeds"), _("Search"), _("Show TAGs"), _("About")); +$navigation = sprintf(" <a href=\"./page_main.php\" class=\"highlight\">%s</a> |\n" . +" <a href=\"./page_show_all_feeds.php\">%s</a> |\n" . +" <a href=\"./page_show_feed_tag.php\">%s</a> |\n" . +" <a href=\"./page_add_new_feed.php\">%s</a> |\n" . +" <a href=\"./page_show_all_tags.php\">%s</a> |\n", _("Home"), _("Show all Feeds"), _("Feeds by TAG"), _("Add a Feed"), _("Show TAGs")); if (false === HTTP_Session :: get("logged_in", false)) { $navigation .= sprintf(" <a href=\"./page_login.php\">%s</a> |\n <a href=\"./page_register.php\">%s</a>", _("Login"), _("Register")); } else { - $navigation .= sprintf(" <a href=\"./page_profile.php\">%s</a>", _("Profile")); + $navigation .= sprintf(" <a href=\"./page_personal.php\">%s</a> |\n <a href=\"./page_logout.php?returnto=page_main.php\">%s</a>", _("Personal Page"), _("LogOut")); } $design = str_replace("<!-- navigation -->", $navigation, $design); # Main copy // main if (true === HTTP_Session :: get("logged_in")) { - $main = createSelectionForm(); + $main = createSelectionForm($feed, $tag_manager); } else { $main = createSelectionTable($feed, /*30, detectActualPage($maxpages),*/ $tag_manager); @@ -152,41 +158,43 @@ if (false === $items) { return "error!!!"; } - $return = sprintf(" <form action=\"$PHP_SELF\" method=\"post\">"); - $return .= sprintf(" <table summary=\"\">\n" . - " <tr>\n" . - " <th>%s</th>\n" . - " <th>%s</th>\n" . - " <th>%s</th>\n" . - " <th class=\"language_flag\"><img src=\"pic/lang/International.gif\" alt=\"%s\" /></th>\n" . - " </tr>\n", _("Feed List"), _("Site"), _("Feed"), _("Tags"), _("Languages")); + $return = sprintf(" <form action=\"%s\" method=\"post\">\n", $_SERVER['PHP_SELF']); + $return .= sprintf(" <table summary=\"\">\n" . + " <tr>\n" . + " <th> </th>\n" . + " <th>%s</th>\n" . + " <th>%s</th>\n" . + " <th>%s</th>\n" . + " <th class=\"language_flag\"><img src=\"pic/lang/International.gif\" alt=\"%s\" /></th>\n" . + " </tr>\n", _("Feed List"), _("Site"), _("Tags"), _("Languages")); foreach ($items as $list) { - $return .= sprintf(" <tr>\n" . - " <td><a href=\"./page_show_feed?feed=%s\">%s</a></td>\n" . - " <td><a href=\"%s\">%s</a></td>\n", $list['feed_url'], $list['feed_name'], $list['site_url'], $list['site_name']); + $return .= " <tr>\n"; + + $return .= sprintf( + " <td><a href=\"./page_show_feed?feed=%s\">%s</a></td>\n" . + " <td><a href=\"%s\">%s</a></td>\n", $list['feed_url'], $list['feed_name'], $list['site_url'], $list['site_name']); if (false === $tag_manager->hasTags($list['feed_url'])) { - $return .= " <td> </td>\n"; + $return .= " <td> </td>\n"; } else { $tags = $tag_manager->getTags($list['feed_url']); if (count($tags) == 1) { - $return .= sprintf(" <td><a href=\"./page_show_feed_tag.php?tag=%s\">%s</a></td>\n", $tags[0], $tags[0]); + $return .= sprintf(" <td><a href=\"./page_show_feed_tag.php?tag=%s\">%s</a></td>\n", $tags[0], $tags[0]); } else { - $return .= " <td>\n"; + $return .= " <td>"; foreach ($tags as $id => $tag) { - $return .= " <a href=\"./page_show_feed_tag.php?tag=$tag\">$tag</a>"; + $return .= "<a href=\"./page_show_feed_tag.php?tag=$tag\">$tag</a>"; if ($id !== (count($tags) - 1)) { $return .= ", "; } - //$main .= "\n"; } - $return .= " </td>\n"; + $return .= "</td>\n"; } } - $return .= sprintf(" <td><img src=\"pic/lang/%s.gif\" alt=\"%s\" /></td>\n" . - " </tr>\n", $list['site_lang'], $list['site_lang']); + $return .= sprintf(" <td><img src=\"pic/lang/%s.gif\" alt=\"%s\" /></td>\n" . + " </tr>\n", $list['site_lang'], $list['site_lang']); } - $return .= " </table>"; + $return .= " </table>\n </form>"; return $return; } Modified: trunk/page_show_feed.php =================================================================== --- trunk/page_show_feed.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/page_show_feed.php 2007-01-02 14:56:03 UTC (rev 83) @@ -112,11 +112,15 @@ $design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design); // navigation -$navigation = sprintf(" <span class=\"doNotDisplay\">Navigation:</span>\n <a href=\"./page_main.php\">%s</a> |\n <a href=\"./page_show_feeds.php\" class=\"highlight\">%s</a> |\n <a href=\"./page_search.php\">%s</a> |\n <a href=\"./index.html\">%s</a> |\n <a href=\"./index.html\">%s</a> |\n", _("Home"), _("Show Feeds"), _("Search"), _("Show TAGs"), _("About")); +$navigation = sprintf(" <a href=\"./page_main.php\" class=\"highlight\">%s</a> |\n" . +" <a href=\"./page_show_all_feeds.php\">%s</a> |\n" . +" <a href=\"./page_show_feed_tag.php\">%s</a> |\n" . +" <a href=\"./page_add_new_feed.php\">%s</a> |\n" . +" <a href=\"./page_show_all_tags.php\">%s</a> |\n", _("Home"), _("Show all Feeds"), _("Feeds by TAG"), _("Add a Feed"), _("Show TAGs")); if (false === HTTP_Session :: get("logged_in", false)) { $navigation .= sprintf(" <a href=\"./page_login.php\">%s</a> |\n <a href=\"./page_register.php\">%s</a>", _("Login"), _("Register")); } else { - $navigation .= sprintf(" <a href=\"./page_profile.php\">%s</a>", _("Profile")); + $navigation .= sprintf(" <a href=\"./page_personal.php\">%s</a> |\n <a href=\"./page_logout.php?returnto=page_main.php\">%s</a>", _("Personal Page"), _("LogOut")); } $design = str_replace("<!-- navigation -->", $navigation, $design); @@ -137,7 +141,7 @@ $rightSideBar = sprintf(" <p class=\"sideBarTitle\">%s</p>\n\n <div class=\"sideBarText\"><strong>%s</strong><br />\n", _("Tags"), $feedinfo['feed_name']); $tags = $tag_manager->getTags($_GET['feed']); if (false == $tags) { -$rightSideBar .= sprintf("%s <a href=\"./page_add_tag.php?feed=%s\">%s</a>", _("No tag submitted yet, you can add one "), $_GET['feed'], _("here!")); + $rightSideBar .= sprintf("%s <a href=\"./page_add_tag.php?feed=%s\">%s</a>", _("No tag submitted yet, you can add one "), $_GET['feed'], _("here!")); } else { foreach ($tags as $tag) { $rightSideBar .= sprintf(" <a href=\"./page_show_feed_tag.php?tag=%s\">%s</a>, \n", $tag, $tag); Modified: trunk/page_show_feed_tag.php =================================================================== --- trunk/page_show_feed_tag.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/page_show_feed_tag.php 2007-01-02 14:56:03 UTC (rev 83) @@ -75,10 +75,11 @@ // // Now we're going to replace the placeholders in the template with the important content // -$_GET['tag'] = "heise"; if (!isset ($_GET['tag'])) { - //HTTP :: redirect("./page_show_all_feeds.php"); + $form = displaySearchForm(); + $main = sprintf(" <p class=\"space\">%s</p>", _("You did not select a tag, please select one on the input-field on the right side of the site... -->")); } else { + $form = displaySearchForm(); $main = createFeedsTable($_GET['tag'], $tag_manager, $feed); } @@ -120,16 +121,13 @@ } $design = str_replace("<!-- navigation -->", $navigation, $design); -/* - * At this point we have to decide wether we display only one Feed or some more, perhaps loaded and movable by AJAX... - */ # Main copy // main $design = str_replace("<!-- main -->", $main, $design); -// page-navigation -//$page_navigation = displayPageNavi($maxpages, detectActualPage($maxpages), $_GET['feed']); -//$design = str_replace("<!-- page-navigation -->", $page_navigation, $design); +# sideBar +// rightSideBar +$design = str_replace("<!-- rightSideBar -->", $form, $design); # footer // footer @@ -143,29 +141,21 @@ if (false === $feeds) { return "error!!!"; } - $return = sprintf(" <p class=\"tagname\">%s</p>\n", $_GET['tag']); - $return .= sprintf(" <table summary=\"%s\">\n" . - " <tr>\n" . - " <th>%s</th>\n" . - " <th><img src=\"./pic/lang/International.gif\" alt=\"%s\" /></th>\n" . - " </tr>\n", $tag, _("Feed"), _("Language")); + $return = sprintf(" <p class=\"tagname\">%s</p>\n", $_GET['tag']); + $return .= sprintf(" <table summary=\"%s\">\n" . + " <tr>\n" . + " <th>%s</th>\n" . + " <th><img src=\"./pic/lang/International.gif\" alt=\"%s\" /></th>\n" . + " </tr>\n", $tag, _("Feed"), _("Language")); $feeds = $feed_manager->getSpecFeeds($feeds); - for($i = 0; $i < count($feeds); $i++) { - $return .= sprintf(" <tr>\n" . - " <td><a id=\"n%d\" href=\"./page_show_feed.php?feed=%s\">%s</a></td>\n" . - " <td><img src=\"./pic/lang/%s.gif\" alt=\"%s\" /></td>\n" . - " </tr>\n", $feeds[$i]['id'], $feeds[$i]['feed_url'], $feeds[$i]['feed_name'], $feeds[$i]['feed_lang'], $feeds[$i]['feed_lang']); - + for ($i = 0; $i < count($feeds); $i++) { + $return .= sprintf(" <tr>\n" . + " <td><a id=\"n%d\" href=\"./page_show_feed.php?feed=%s\">%s</a></td>\n" . + " <td><img src=\"./pic/lang/%s.gif\" alt=\"%s\" /></td>\n" . + " </tr>\n", $feeds[$i]['id'], $feeds[$i]['feed_url'], $feeds[$i]['feed_name'], $feeds[$i]['feed_lang'], $feeds[$i]['feed_lang']); + } - /* - for ($i = count($feeds) - 1; $i >= 0; $i--) { - //foreach ($items as $list) { - $return .= sprintf(" <tr>\n" . - " <td><a id=\"n%d\" href=\"%s\">%s</a></td>\n" . - " </tr>\n", $feeds[$i]['id'], $feeds[$i]['url'], $feeds[$i]['title'], $feeds[$i]['summary']); - } -*/ - $return .= " </table>"; + $return .= " </table>"; return $return; } @@ -183,30 +173,22 @@ return $number; } -function displayPageNavi($maxpages, $page, $feedname) { - $return = _("Page: "); - for ($i = 1; $i <= $maxpages; $i++) { - if ($i !== 1) { - $return .= " | "; - } - if ($i !== $page) { - $return .= sprintf(" [<a href=\"./page_show_feed.php?feed=%s&page=%d\">%d</a>]", $feedname, $i, $i); - } else { - $return .= sprintf(" [%d]", $i); - } - } - return $return; -} +function displaySearchForm() { -function detectActualPage($maxpages) { - if (!isset ($_GET['page'])) { - return 1; - } - if ($maxpages < $_GET['page']) { - return $maxpages; - } - $page = $_GET['page']; - settype($page, 'int'); - return $page; + $rightSideBar = sprintf(" <p class=\"sideBarTitle\">%s</p>\n\n", _("Tags")); + $rightSideBar .= sprintf(" <div id=\"searchTag_form\">\n" . + " <form action=\"%s\" method=\"get\" accept-charset=\"UTF-8\">\n" . + " <div id=\"formtitle\">%s</div>\n" . + " <div class=\"left\">\n" . + " </div>\n" . + " <div class=\"right\">\n" . + " <div class=\"formField\" ><input type=\"text\" name=\"tag\" size=\"10\" maxlength=\"20\" /></div>\n" . + " </div>\n" . + " <div id=\"formButtons\">\n" . + " <input type=\"submit\" value=\"%s\" name=\"submit\" />\n" . + " </div>\n" . + " </form>\n" . + " </div>\n", $_SERVER['PHP_SELF'], _("Select a Tag"), _("Submit!")); + return $rightSideBar; } ?> \ No newline at end of file Modified: trunk/styles/default/page_show_all_feeds.tpl =================================================================== --- trunk/styles/default/page_show_all_feeds.tpl 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/styles/default/page_show_all_feeds.tpl 2007-01-02 14:56:03 UTC (rev 83) @@ -32,6 +32,7 @@ <div class="headerLogin"> <!-- midHeader title right --> + </div> </div> <div class="subHeader"> Modified: trunk/styles/default/page_show_feed_tag-screen.css =================================================================== --- trunk/styles/default/page_show_feed_tag-screen.css 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/styles/default/page_show_feed_tag-screen.css 2007-01-02 14:56:03 UTC (rev 83) @@ -187,6 +187,58 @@ background-color: transparent; text-decoration: none; } + +/* ##### Right Side Bar ##### */ + +.rightSideBar { + width: 13em; + margin: 2ex 0.75ex 0 0; + padding: 0; + float: right; + clear: right; + border: 1px solid rgb(216,210,195); +} + +[class~="rightSideBar"] { + margin-right: 1.5ex; +} + +.rightSideBar .sideBarTitle { + color: black; + background-color: rgb(230,223,207); + font-weight: bold; + margin: 1.25ex 1ex; + padding: 0.9ex 1ex; +} + +.rightSideBar a { + color: rgb(166,140,83); + background-color: transparent; + text-decoration: underline; + font-weight: bold; +} + +.rightSideBar a:hover { + text-decoration: none; +} + +.rightSideBar .sideBarText { + line-height: 1.5em; + margin: 0; + padding: 0 2ex 1em 2ex; +} + +.rightSideBar .more { + text-decoration: none; + text-align: right; + margin: 0; + padding: 0 2ex 1em 2ex; + display: block; +} + +.rightSideBar .more:hover { + text-decoration: underline; +} /* ##### Main Copy ##### */ Modified: trunk/styles/default/page_show_feed_tag.tpl =================================================================== --- trunk/styles/default/page_show_feed_tag.tpl 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/styles/default/page_show_feed_tag.tpl 2007-01-02 14:56:03 UTC (rev 83) @@ -44,11 +44,10 @@ <!-- ##### Main Copy ##### --> <div id="main-copy"> -<!-- main --> - - <div id="page-navigation"> -<!-- page-navigation --> + <div class="rightSideBar"> +<!-- rightSideBar --> </div> +<!-- main --> </div> Modified: trunk/update_feeds.php =================================================================== --- trunk/update_feeds.php 2006-12-30 09:06:45 UTC (rev 82) +++ trunk/update_feeds.php 2007-01-02 14:56:03 UTC (rev 83) @@ -96,6 +96,7 @@ } $log->log(sprintf(_("We have got %d feeds in the database"), $nummberoffeeds), PEAR_LOG_NOTICE); $added_overall = 0; + echo $conf['error_prepend'] . "-----------------------------------------------------" . $conf['error_append'] . $conf['linebreak']; ########################## # Starting the main part # ########################## @@ -194,7 +195,7 @@ $log->log(_("The script is not allowed to update the feeds.<br />" . "This means that the feeds won't be updated, the lists are not up to date"), PEAR_LOG_WARNING); } -echo $conf['error_prepend'] . "-----------------------------------------------------" . $conf['error_append'] . $conf['linebreak']; +echo $conf['error_prepend'] . "=====================================================" . $conf['error_append'] . $conf['linebreak']; $log->log(sprintf("Added %d items", $added_overall), PEAR_LOG_NOTICE); $db->disconnect(); $log->log(_("Disconnected from the Database"), PEAR_LOG_NOTICE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |