[Feed-collector-svn] SF.net SVN: feed-collector: [123] trunk
Status: Beta
Brought to you by:
c167
From: <C1...@us...> - 2007-06-05 18:05:19
|
Revision: 123 http://feed-collector.svn.sourceforge.net/feed-collector/?rev=123&view=rev Author: C167 Date: 2007-06-05 11:05:20 -0700 (Tue, 05 Jun 2007) Log Message: ----------- some changes, still page_show_all_feeds.php not working Modified Paths: -------------- trunk/page_main.php trunk/page_show_all_feeds.php trunk/styles/default/page_footer.tpl trunk/styles/default/page_header.tpl trunk/styles/default/page_show_all_feeds.tpl Modified: trunk/page_main.php =================================================================== --- trunk/page_main.php 2007-06-04 22:54:40 UTC (rev 122) +++ trunk/page_main.php 2007-06-05 18:05:20 UTC (rev 123) @@ -11,6 +11,7 @@ require_once "inc/config.php"; error_reporting(E_ALL); + /* DATABASE */ require_once "./inc/database.php"; @@ -43,13 +44,9 @@ // Now we're going to replace the placeholders in the template with the important content // -// get the design -$design = "styles/$style/page_$page.tpl"; - # header // title $smarty->assign('title', "Feed-Collector"); -//$design = str_replace("<!-- title -->", $title, $design); # body // related sites Modified: trunk/page_show_all_feeds.php =================================================================== --- trunk/page_show_all_feeds.php 2007-06-04 22:54:40 UTC (rev 122) +++ trunk/page_show_all_feeds.php 2007-06-05 18:05:20 UTC (rev 123) @@ -11,135 +11,118 @@ require_once "inc/config.php"; error_reporting(E_ALL); -############ -# DATABASE # -############ + +/* DATABASE */ require_once "./inc/database.php"; -########### -# SESSION # -########### +/* SESSION */ require_once "./inc/session.php"; -######### -# FEEDS # -######### +/* FEEDS */ require_once "class/Feed_manager.php"; $feed = new Feed_manager($db); -############ -# LANGUAGE # -############ +/* HTTP-Basis */ require_once "HTTP.php"; -$language = HTTP :: negotiateLanguage($langs, "en_EN"); +//$language = HTTP :: negotiateLanguage($langs, "en_EN"); -################ -# User-Manager # -################ +/* User-Manager */ require_once "class/User_manager.php"; -$user = new User_manager($db); +$user_manager = new User_manager($db); -############### -# Tag-Manager # -############### +/* Tag-Manager */ require_once "class/Tag_manager.php"; $tag_manager = new Tag_Manager($db); -#################################### -# Working with the users feed-list # -#################################### +/* Working with the users feed-list */ if(isset($_POST) and isset($_POST['feed'])) { $_POST['feed'] = $user->createColumnString($_POST['feed']); $user->updateUserCols(HTTP_Session :: get("uid"), $_POST['feed']); } +/* STYLE */ +require_once "inc/styles.php"; + $page = "show_all_feeds"; -############ -# LANGUAGE # -############ +/* LANGUAGE */ require_once "./inc/language.php"; +/* SMARTY */ +require_once "inc/smarty.php"; + // // Now we're going to replace the placeholders in the template with the important content // -// get the design -$design = file_get_contents("styles/default/page_show_all_feeds.tpl", 'r'); - # header // title -$title = "Feed-Collector"; -$design = str_replace("<!-- title -->", $title, $design); +$smarty->assign('title', "Feed-Collector"); # body // related sites require_once "./inc/upperBar.php"; -$design = str_replace("<!-- related sites -->", $related_sites, $design); // midHeader title left -$midHeader_title_left = sprintf(" <h1 class=\"headerTitle\">%s</h1>\n <div class=\"headerSubTitle\" title=\"Message'\">\n %s\n </div>", _("Feed-Collector"), _("{ stay up to date with all your news feeds! }")); -$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design); +$smarty->assign('page_title', _("Feed-Collector")); +$smarty->assign('sub_title', _("{ stay up to date with all your news feeds! }")); // midHeader title right require_once "./inc/userstatus_display.php"; -$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design); // navigation require_once "inc/navigation.php"; -$design = str_replace("<!-- navigation -->", $navigation, $design); # Main copy // main -if (true === HTTP_Session :: get("logged_in", false)) { - $main = createSelectionForm($feed, $tag_manager, $user); +$feeds = $feed->getFeeds(); +if(false !== $feeds) { + $n_cols = 4; + if (true === HTTP_Session :: get("logged_in", false)) { + $n_cols = 5; + $user_cols = $user_manager->getUserCols(HTTP_Session :: get("uid")); + } + $smarty->assign('cb_name', "feed[]"); + $smarty->assign('feed_list_str', _("Feed list")); + $smarty->assign('site_str', _("Site")); + $smarty->assign('tags_str', _("Tags")); + $smarty->assign('language', _("Language")); + $smarty->assign('n_cols', $n_cols); + $feed_list = array(); + $i = 0; + foreach($feeds as $list) { + $feed_list[$i] = $list; + if(true === HTTP_Session :: get("logged_in", false) and in_array($list['feed_url'], $user_cols)) { + $feed_list[$i]['checked'] = true; + } + if(false === $tag_manager->hasTags($list['feed_url'])) { + $feed_list['has_tags'] = false; + } else { + $feed_list[$i]['tag_list'] = $tag_manager->getTags($list['feed_url']); + } + } + $smarty->assign('feed_list', $feed_list); } else { - $main = createSelectionTable($feed, $tag_manager); + $smarty->assign('error', true); } -$design = str_replace("<!-- main -->", $main, $design); // page-navigation //$page_navigation = displayPageNavi($maxpages, detectActualPage($maxpages)); //$design = str_replace("<!-- page-navigation -->", $page_navigation, $design); # footer -require_once "./inc/footer.php"; -$design = str_replace("<!-- footer -->", $footer, $design); +$smarty->assign('admin_email', $admin['email']); +$smarty->assign('updated', _("Updated")); -echo $design; +$smarty->display("page_show_all_feeds.tpl"); -function createSelectionForm($feed, $tag_manager, $user_manager) { - $feeds = $feed->getFeeds(); - if (false === $feeds) { - return "error!!!"; - } - $return = sprintf(" <form action=\"%s\" method=\"post\">\n", $_SERVER['PHP_SELF']); - $return .= sprintf(" <table summary=\"\" >\n" . - " <tr>\n" . - " <th colspan=\"5\" class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"%s\" /></th>\n" . - " </tr>\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", _("Submit"), _("Feed List"), _("Site"), _("Tags"), _("Languages")); + +//---------------------------- foreach ($feeds as $list) { + $return = ""; $user_cols = $user_manager->getUserCols(HTTP_Session :: get("uid")); - - $return .= " <tr>\n"; - if(in_array($list['feed_url'], $user_cols)) { - $return .= sprintf(" <td class=\"checked\"><input type=\"checkbox\" name=\"feed[]\" value=\"%s\" checked=\"checked\" /></td>\n", $list['feed_url']); - } else { - $return .= sprintf(" <td><input type=\"checkbox\" name=\"feed[]\" value=\"%s\" /></td>\n", $list['feed_url']); - } - - $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(in_array($list['feed_url'], $user_cols)) {} if (false === $tag_manager->hasTags($list['feed_url'])) { - $return .= " <td> </td>\n"; } else { $tags = $tag_manager->getTags($list['feed_url']); if (count($tags) == 1) { @@ -164,9 +147,8 @@ " <th colspan=\"5\" class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"%s\" /></th>\n" . " </tr>\n" . " </table>\n </form>", _("Submit")); - return $return; -} + function createSelectionTable($feed, $tag_manager) { $items = $feed->getFeeds(); if (false === $items) { @@ -241,4 +223,4 @@ settype($page, 'int'); return $page; } -?> \ No newline at end of file +?> Modified: trunk/styles/default/page_footer.tpl =================================================================== --- trunk/styles/default/page_footer.tpl 2007-06-04 22:54:40 UTC (rev 122) +++ trunk/styles/default/page_footer.tpl 2007-06-05 18:05:20 UTC (rev 123) @@ -7,8 +7,8 @@ </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> + {html_image file="styles/default/images/valid-xhtml11-blue.png" alt="Valid XHTML 1.1" href="http://validator.w3.org/check?uri=referer"} + {html_image file="styles/default/images/valid-css2-blue.png" alt="Valid CSS 2" href="http://jigsaw.w3.org/css-validator/"} </span> </div> </body> Modified: trunk/styles/default/page_header.tpl =================================================================== --- trunk/styles/default/page_header.tpl 2007-06-04 22:54:40 UTC (rev 122) +++ trunk/styles/default/page_header.tpl 2007-06-05 18:05:20 UTC (rev 123) @@ -1,3 +1,4 @@ + <body> <!-- For non-visual user agents: --> <div id="top"><a href="#main-copy" class="doNotDisplay doNotPrint">Skip to main content.</a></div> Modified: trunk/styles/default/page_show_all_feeds.tpl =================================================================== --- trunk/styles/default/page_show_all_feeds.tpl 2007-06-04 22:54:40 UTC (rev 122) +++ trunk/styles/default/page_show_all_feeds.tpl 2007-06-05 18:05:20 UTC (rev 123) @@ -1,66 +1,77 @@ -<?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" /> +{include file="html_header.tpl"} +{include file="page_header.tpl"} + + <!-- ##### Main Copy ##### --> - <link rel="stylesheet" type="text/css" href="./styles/default/page_show_all_feeds-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/common-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/header-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/main_copy-screen.css" media="screen, tv, projection" title="Default" /> - <link rel="stylesheet" type="text/css" href="./styles/default/footer-screen.css" media="screen, tv, projection" title="Default" /> - - <title><!-- title --></title> - </head> - - <body> - <!-- For non-visual user agents: --> - <div id="top"><a href="#main-copy" class="doNotDisplay doNotPrint">Skip to main content.</a></div> - - <!-- ##### Header ##### --> - - <div id="header"> - <div class="superHeader"> -<!-- related sites --> - </div> - - <div class="midHeader"> -<!-- midHeader title left --> - - <br class="doNotDisplay doNotPrint" /> - - <div class="headerLogin"> -<!-- midHeader title right --> - </div> - </div> - - <div class="subHeader"> - <span class="doNotDisplay">Navigation:</span> -<!-- navigation --> - </div> - </div> - - <!-- ##### Main Copy ##### --> - <div id="main-copy"> <div class="rowOfBoxes"> +{if !$error} <div id="feed_form"> -<!-- main --> - </div> + {assign var="n_cols" value=3} + {if true === $smarty.session.logged_in} + {assign var="n_cols" value=4} + {/if} + <form action="{$smarty.server.PHP_SELF}" method="post"> + <table summary="{$feeds_table_summary|default:"feed form"}" > + <thead> + {if $smarty.session.logged_in} + <tr> + <th colspan="{$n_cols}" class="submit"><input type="submit" name="Submit" value="{$submit}" /></th> + </tr> + {/if} + <tr> + {if $smarty.session.logged_in === true} + <th> </th> + {/if} + <th>{$feed_list_str}</th> + <th>{$site_str}</th> + <th>{$tags_str}</th> + <th class="language_flag">{html_image file="pic/lang/International.gif" alt=$languages}</th> + </tr> + </thead> + {if $smarty.session.logged_in} + <tfoot> + <tr> + <th colspan="{$n_cols}" class="submit"><input type="submit" name="Submit" value="{$submit}" /></th> + </tr> + </tfoot> + {/if} + <tbody> +{foreach from=$feed_list item=i name="feed_list"} + <tr> + {if $smarty.session.logged_in == false} + {if $i.checked === true} + <td class="checked"><input type="checkbox" name="{$cb_name}" value="{$i.feed_url}" checked="checked" /></td> + {else} + <td><input type="checkbox" name="{$cb_name}" value="{$i.feed_url}" /></td> + {/if} + {/if} + <td><a href="./page_show_feed?feed={$i.feed_url}">{$i.feed_name}</a></td> + <td><a href="{$i.site_url}">{$i.site_name}</a></td> + {if $i.has_tags === true} + <td> + {foreach from=$i.tag_list item=j name="tag_list"} + <a href="./page_show_feed_tag.php?tag={$j|escape:"url"}">{$j}</a></td> + {/foreach} + </td> + {else} + <td> </td> + {/if} + </tr> +{/foreach} + </tbody> + </table> + </form> + </div> </div> <div id="page-navigation"> -<!-- page-navigation --> +{foreach from=$navigation_list item=i name="navi_list"} + +{/foreach} </div> - </div> +{else} - <!-- ##### Footer ##### --> - - <div id="footer"> -<!-- footer --> +{/if} </div> - </body> -</html> +{include file="page_footer.tpl"} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |