[Feed-collector-svn] SF.net SVN: feed-collector: [93] trunk
Status: Beta
Brought to you by:
c167
|
From: <c1...@us...> - 2007-01-05 00:35:49
|
Revision: 93
http://feed-collector.svn.sourceforge.net/feed-collector/?rev=93&view=rev
Author: c167
Date: 2007-01-04 16:35:47 -0800 (Thu, 04 Jan 2007)
Log Message:
-----------
some big changes
Modified Paths:
--------------
trunk/class/Tag_manager.php
trunk/class/User_manager.php
trunk/page_main.php
trunk/styles/default/page_add_tag-screen.css
trunk/styles/default/page_add_tag.tpl
trunk/styles/default/page_login.tpl
trunk/styles/default/page_personal-screen.css
trunk/styles/default/page_personal.tpl
trunk/styles/default/page_register.tpl
trunk/styles/default/page_show_all_feeds-screen.css
trunk/styles/default/page_show_all_feeds.tpl
trunk/styles/default/page_show_feed-screen.css
trunk/styles/default/page_show_feed.tpl
trunk/styles/default/page_show_feed_tag-screen.css
trunk/styles/default/page_show_feed_tag.tpl
trunk/update_feeds.php
Modified: trunk/class/Tag_manager.php
===================================================================
--- trunk/class/Tag_manager.php 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/class/Tag_manager.php 2007-01-05 00:35:47 UTC (rev 93)
@@ -79,9 +79,9 @@
return false;
}
while ($row = $query->fetchRow()) {
- if (!isset ($row['tag'])) {
+ /*if (!isset ($row['tag']) or empty($row['tag'])) {
return false;
- }
+ }*/
$return[] = $row['tag'];
}
return $return;
Modified: trunk/class/User_manager.php
===================================================================
--- trunk/class/User_manager.php 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/class/User_manager.php 2007-01-05 00:35:47 UTC (rev 93)
@@ -43,33 +43,29 @@
* @access protected
*/
protected $mdb;
-
-
+
/**
* The userid
* @access protected
*/
protected $uid = null;
-
+
/**
* The username
* @access protected
*/
protected $username = null;
-
+
/**
* The users language
* @access protected
*/
protected $language = null;
-
+
/**
* The standard-constructor
- *
* @param Object $db The PEAR::MDB2
- *
* @return void
- * @version 1.1
* @access public
*/
public function __construct($mdb) {
@@ -80,7 +76,8 @@
* Return the content of the colums of a users personal page, deserialised
* @param int $id The users user-id
* @param boolean $serialised If the output should be serialised or as arrays
- * @return mixed
+ * @return mixed
+ * @access public
*/
public function getUserCols($id, $serialised = false) {
$info = $this->mdb->query("SELECT columns FROM users WHERE id = \"$id\";");
@@ -101,6 +98,7 @@
* @param int $userid
* @param String $column
* @return boolean
+ * @access public
*/
public function updateUserCols($userid, $column) {
$cols = $this->mdb->query("UPDATE `users` SET `columns` = '$column' WHERE `users`.`ID` = '$userid'LIMIT 1 ;");
@@ -120,14 +118,17 @@
* @access public
*/
public function reg_registrateUser($username, $email, $passwd, $language) {
- $add = $this->mdb5->query(sprintf("INSERT INTO `users` (`ID`, `name`, `email`, `pass`, `language`, `state`) " .
- "VALUES (null, `%s`, `%s`, `%s`, `%s`, `active`);", $username, $email, $passwd, $language));
+ $add = $this->mdb->query(sprintf("INSERT INTO `users` ( `ID` , `name` , `email` , `pass` , `language` , `columns` , `state` , `last_action` )" .
+ "VALUES (NULL , '%s', '%s', '%s', '%s', '', 'active', '0');", $username, $email, $passwd, $language));
+
if (PEAR :: isError($add)) {
+ echo $add->getMessage();
+ echo "<br />" . $add->getDebugInfo();
return false;
}
return true;
}
-
+
/**
* Checks if the passwords a new user enters are totaly equal
* @param String $passwd1 The first password
@@ -136,30 +137,36 @@
* @access public
*/
public function reg_checkPasswordEquality($passwd1, $passwd2) {
- if(strlen($passwd1) == strlen($passwd2)) {
- if($passwd1 === $passwd2) {
+ if (strlen($passwd1) == strlen($passwd2)) {
+ if ($passwd1 === $passwd2) {
return true;
}
}
return false;
}
-
+
/**
* Encryptes the password. if it gets passwords already enrypted, it returns them
* @param String $passwd The password password
* @return Mixed
* @access public
*/
- public function reg_encryptPassword ($passwd) {
- if(strlen($passwd) == 32) {
- return array('pass' => $passwd, 'encrypted' => false);
+ public function reg_encryptPassword($passwd) {
+ if (strlen($passwd) == 32) {
+ return array (
+ 'pass' => $passwd,
+ 'encrypted' => false
+ );
}
- return array('pass' => md5($passwd), 'encrypted' => true);
+ return array (
+ 'pass' => md5($passwd
+ ), 'encrypted' => true);
}
/**
* Returns the number of users from the db
* @return int
+ * @access public
*/
public function getNumberOfUsers() {
$number = $this->mdb->queryOne("SELECT COUNT(*) FROM users;");
@@ -179,11 +186,15 @@
public function loginUser($username, $passwd) {
$query = $this->mdb->query("SELECT id,name,pass,state FROM users WHERE name = '$username';");
if (PEAR :: isError($query)) {
- return array('state' => LOGIN_WRONG_VALUES);
+ return array (
+ 'state' => LOGIN_WRONG_VALUES
+ );
}
$row = $query->fetchRow();
- if($row['state'] == "inactive") {
- return array('state' => LOGIN_INACTIVE);
+ if ($row['state'] == "inactive") {
+ return array (
+ 'state' => LOGIN_INACTIVE
+ );
}
if ($passwd == $row['pass']) {
$this->uid = $row['id'];
@@ -197,72 +208,76 @@
);
}
}
-
+
/**
* Logs out a user
* @return boolean
+ * @access public
*/
public function logOut() {
- if(is_null($this->uid)) {
+ if (is_null($this->uid)) {
return false;
}
$this->uid = null;
return true;
}
-
+
/**
* Sets the time of the users last action
* @return boolean
+ * @access public
*/
public function updateUserAction() {
- if(is_null($this->uid)) {
+ if (is_null($this->uid)) {
return false;
}
$query = $this->mdb->query(sprintf("UPDATE `users` SET `last_action` = '%d' WHERE `users`.`ID` = %d LIMIT 1 ;", time(), $this->uid));
- if(PEAR :: isError($query)) {
+ if (PEAR :: isError($query)) {
return false;
}
return true;
}
-
+
/**
* returns the time of the users last action
* @return int
+ * @access public
*/
public function getUserActionTime() {
- if(is_null($this->uid)) {
+ if (is_null($this->uid)) {
return false;
}
$query = $this->mdb->queryOne(sprintf("SELECT last_action FROM users WHERE id= %d LIMIT 1;", $this->uid));
}
-
+
/**
* Returns the username
* @return String/boolean on error
+ * @access public
*/
public function getUsername() {
- if(is_null($this->uid)) {
+ if (is_null($this->uid)) {
return false;
}
- if(is_null($this->username)) {
- $this->username = $this->mdb2->queryOne("SELECT name FROM users WHERE id = ".$this->uid.";");
+ if (is_null($this->username)) {
+ $this->username = $this->mdb2->queryOne("SELECT name FROM users WHERE id = " . $this->uid . ";");
}
return $this->username;
-
+
}
-
+
/**
* Returns the users language
* @return String
* @access public
*/
public function getUserLanguage() {
- if(is_null($this->language)) {
+ if (is_null($this->language)) {
$this->language = $this->mdb->queryOne(sprintf("SELECT language FROM users WHERE id = '%s';", $this->uid));
}
return $this->language;
}
-
+
/**
* Creates the Column-Strings
* @param Array $array The users column-array
@@ -271,13 +286,27 @@
*/
public function createColumnString($array) {
$return = "";
- for($i = 0; $i < count($array); $i++) {
+ for ($i = 0; $i < count($array); $i++) {
$return .= $array[$i];
- if($i !== count($array)-1) {
+ if ($i !== count($array) - 1) {
$return .= "|";
}
}
return $return;
}
+
+ /**
+ * Set the User-ID
+ * @param Int $id The user-id
+ * @return boolean
+ * @access public
+ */
+ public function setUserId($id) {
+ if(is_null($this->uid)) {
+ $this->uid = $id;
+ return true;
+ }
+ return false;
+ }
}
?>
\ No newline at end of file
Modified: trunk/page_main.php
===================================================================
--- trunk/page_main.php 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/page_main.php 2007-01-05 00:35:47 UTC (rev 93)
@@ -35,8 +35,6 @@
echo $db->getMessage();
echo "<br />";
echo $db->getDebugInfo();
-} else {
- //$log->log(_("Successfully connected to the database"), PEAR_LOG_DEGUB);
}
$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
@@ -72,10 +70,12 @@
require_once "class/User_manager.php";
$user = new User_manager($db);
+
############
# LANGUAGE #
############
if (true === HTTP_Session :: get("logged_in", false)) {
+ $user->setUserId(HTTP_Session :: get("uid"));
$language = $user->getUserLanguage();
if(!in_array($language, $langs)) {
$language = "en_EN";
@@ -83,10 +83,10 @@
} else {
$language = HTTP :: negotiateLanguage($langs, "en_EN");
}
-
+/*
bindtextdomain("page_main", dirname($_SERVER['SCRIPT_FILENAME'])."i18n");
setlocale(LC_ALL, $language);
-
+*/
$page = "main";
//
// Now we're going to replace the placeholders in the template with the important content
@@ -106,25 +106,19 @@
$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", _("Feed-Collector"), _("{ stay up to date with all your news feeds! }"));
+$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);
// midHeader title right
if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <form action=\"./page_login.php\" method=\"post\"><span>%s</span> <input type=\"submit\" name=\"submit\" value=\"%s\" /><br />\n" .
- " <input type=\"text\" name=\"username\" value=\"%s\" size=\"20\" /><br />\n" .
- " <input type=\"password\" name=\"passwd\" value=\"%s\" /><br />\n" .
- " <input type=\"hidden\" name=\"cameFrom\" value=\"%s\" />" .
- " </form>\n" .
- " </div>", _("Login:"), _("Submit!"), _("Username"), _("Password"), basename($_SERVER['PHP_SELF']));
+ $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
} else {
if(HTTP_Session :: get("username", false) == false) {
$username = $user->getUsername();
} else {
$username = HTTP_Session :: get("username");
}
- $midHeader_title_right = sprintf(" <span>%s %s</span><br />\n" .
- " <div id=\"userinfo\">%s %s</div>", _("Hello"), $username, _("Your last login was at"), date("H:m:i", HTTP_Session :: get("lastLogin")));
+ $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
}
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
@@ -133,7 +127,8 @@
" <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"));
+" <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 {
@@ -202,7 +197,7 @@
$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_feeds.php?feed=%s\"><!--•-->%s</a> %s (%d%s)</li>\n", $newest['feed_db_name'], $newest['feed_name'], date(("m.d.y H:m:s"), $newest['added']), $newest['items'], _(" Items"));
+ $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(("m.d.y H:m:s"), $newest['added']), $newest['items'], _(" Items"));
}
$box_4 .= " </ul>";
$design = str_replace("<!-- box 4 -->", $box_4, $design);
Modified: trunk/styles/default/page_add_tag-screen.css
===================================================================
--- trunk/styles/default/page_add_tag-screen.css 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_add_tag-screen.css 2007-01-05 00:35:47 UTC (rev 93)
@@ -135,6 +135,15 @@
padding: 0;
}
+.headerLogin {
+ border: 1px solid rgb(255,255,255);
+ text-align: right;
+ padding: 1ex;
+ position: absolute;
+ right: 1.5em;
+ top: 3.5em;
+}
+
.headerLinks {
text-align: right;
margin: 0;
Modified: trunk/styles/default/page_add_tag.tpl
===================================================================
--- trunk/styles/default/page_add_tag.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_add_tag.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -28,7 +28,7 @@
<br class="doNotDisplay doNotPrint" />
- <div class="headerLinks">
+ <div class="headerLogin">
<!-- midHeader title right -->
</div>
</div>
Modified: trunk/styles/default/page_login.tpl
===================================================================
--- trunk/styles/default/page_login.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_login.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -8,8 +8,6 @@
<meta name="generator" content="haran" />
<link rel="stylesheet" type="text/css" href="./styles/default/page_login-screen.css" media="screen, tv, projection" title="Default" />
- <link rel="stylesheet alternative" type="text/css" href="./styles/default/page_login-print.css" media="screen" title="Print Preview" />
- <link rel="stylesheet" type="text/css" href="./styles/default/page_login-print.css" media="print" />
<title><!-- title --></title>
</head>
@@ -27,7 +25,6 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
<br class="doNotDisplay doNotPrint" />
Modified: trunk/styles/default/page_personal-screen.css
===================================================================
--- trunk/styles/default/page_personal-screen.css 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_personal-screen.css 2007-01-05 00:35:47 UTC (rev 93)
@@ -135,6 +135,15 @@
padding: 0;
}
+.headerLogin {
+ border: 1px solid rgb(255,255,255);
+ text-align: right;
+ padding: 1ex;
+ position: absolute;
+ right: 1.5em;
+ top: 3.5em;
+}
+
.headerLinks {
text-align: right;
margin: 0;
Modified: trunk/styles/default/page_personal.tpl
===================================================================
--- trunk/styles/default/page_personal.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_personal.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -8,8 +8,6 @@
<meta name="generator" content="haran" />
<link rel="stylesheet" type="text/css" href="./styles/default/page_personal-screen.css" media="screen, tv, projection" title="Default" />
- <link rel="stylesheet alternative" type="text/css" href="./styles/default/page_personal-print.css" media="screen" title="Print Preview" />
- <link rel="stylesheet" type="text/css" href="./styles/default/page_personal-print.css" media="print" />
<script type="text/javascript" src="js.js" />
<title><!-- title --></title>
@@ -28,7 +26,6 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
<br class="doNotDisplay doNotPrint" />
Modified: trunk/styles/default/page_register.tpl
===================================================================
--- trunk/styles/default/page_register.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_register.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -8,8 +8,6 @@
<meta name="generator" content="haran" />
<link rel="stylesheet" type="text/css" href="./styles/default/page_register-screen.css" media="screen, tv, projection" title="Default" />
- <link rel="stylesheet alternative" type="text/css" href="./styles/default/page_register-print.css" media="screen" title="Print Preview" />
- <link rel="stylesheet" type="text/css" href="./styles/default/page_register-print.css" media="print" />
<title><!-- title --></title>
</head>
@@ -27,14 +25,9 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
<br class="doNotDisplay doNotPrint" />
- <div class="headerLinks">
-<!-- midHeader title right -->
- </div>
-
<div class="subHeader">
<!-- navigation -->
</div>
Modified: trunk/styles/default/page_show_all_feeds-screen.css
===================================================================
--- trunk/styles/default/page_show_all_feeds-screen.css 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_all_feeds-screen.css 2007-01-05 00:35:47 UTC (rev 93)
@@ -144,6 +144,15 @@
.headerLogin {
border: 1px solid rgb(255,255,255);
text-align: right;
+ padding: 1ex;
+ position: absolute;
+ right: 1.5em;
+ top: 3.5em;
+}
+
+.headerLogin {
+ border: 1px solid rgb(255,255,255);
+ text-align: right;
margin: 0;
/* padding: 0 0 2ex 0;*/
padding-bottom: 1ex;
Modified: trunk/styles/default/page_show_all_feeds.tpl
===================================================================
--- trunk/styles/default/page_show_all_feeds.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_all_feeds.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -25,7 +25,7 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
+
<br class="doNotDisplay doNotPrint" />
<div class="headerLogin">
Modified: trunk/styles/default/page_show_feed-screen.css
===================================================================
--- trunk/styles/default/page_show_feed-screen.css 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_feed-screen.css 2007-01-05 00:35:47 UTC (rev 93)
@@ -139,6 +139,15 @@
font-style: italic;
margin: 0 0 1ex 0;
padding: 0;
+}
+
+.headerLogin {
+ border: 1px solid rgb(255,255,255);
+ text-align: right;
+ padding: 1ex;
+ position: absolute;
+ right: 1.5em;
+ top: 3.5em;
}
.headerLinks {
Modified: trunk/styles/default/page_show_feed.tpl
===================================================================
--- trunk/styles/default/page_show_feed.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_feed.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -8,10 +8,7 @@
<meta name="generator" content="haran" />
<link rel="stylesheet" type="text/css" href="./styles/default/page_show_feed-screen.css" media="screen, tv, projection" title="Default" />
- <link rel="stylesheet alternative" type="text/css" href="./styles/default/page_show_feed-print.css" media="screen" title="Print Preview" />
- <link rel="stylesheet" type="text/css" href="./styles/default/page_show_feed-print.css" media="print" />
- <script type="text/javascript" src="js.js" />
<title><!-- title --></title>
</head>
@@ -28,7 +25,6 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
<br class="doNotDisplay doNotPrint" />
Modified: trunk/styles/default/page_show_feed_tag-screen.css
===================================================================
--- trunk/styles/default/page_show_feed_tag-screen.css 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_feed_tag-screen.css 2007-01-05 00:35:47 UTC (rev 93)
@@ -139,6 +139,15 @@
font-style: italic;
margin: 0 0 1ex 0;
padding: 0;
+}
+
+.headerLogin {
+ border: 1px solid rgb(255,255,255);
+ text-align: right;
+ padding: 1ex;
+ position: absolute;
+ right: 1.5em;
+ top: 3.5em;
}
.headerLinks {
Modified: trunk/styles/default/page_show_feed_tag.tpl
===================================================================
--- trunk/styles/default/page_show_feed_tag.tpl 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/styles/default/page_show_feed_tag.tpl 2007-01-05 00:35:47 UTC (rev 93)
@@ -9,7 +9,6 @@
<link rel="stylesheet" type="text/css" href="./styles/default/page_show_feed_tag-screen.css" media="screen, tv, projection" title="Default" />
- <script type="text/javascript" src="js.js" />
<title><!-- title --></title>
</head>
@@ -26,7 +25,6 @@
<div class="midHeader">
<!-- midHeader title left -->
- </div>
<br class="doNotDisplay doNotPrint" />
Modified: trunk/update_feeds.php
===================================================================
--- trunk/update_feeds.php 2007-01-05 00:15:40 UTC (rev 92)
+++ trunk/update_feeds.php 2007-01-05 00:35:47 UTC (rev 93)
@@ -19,7 +19,6 @@
echo "\t<head>\n\t\t<title>update</title>\n\t\t<meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=UTF-8\" />\n\t</head>\n\t<body>\n";
}
error_reporting(E_ALL);
-//error_reporting(E_STRICT);
// We need some PEAR-classes
require_once "MDB2.php";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|