]> git.wh0rd.org Git - tt-rss.git/commitdiff
schema: add created field to ttrss_users
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 Nov 2007 05:11:59 +0000 (06:11 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 Nov 2007 05:11:59 +0000 (06:11 +0100)
backend.php
modules/pref-users.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
schema/versions/mysql/26.sql
schema/versions/pgsql/26.sql

index 272daeb32d037f81cb89c6ffa8b1171f008483a4..482b46feb719d4bbb5fd999897d6216f5a0528af 100644 (file)
                        SUBSTRING(last_login,1,16) AS last_login,
                        access_level,
                        (SELECT COUNT(int_id) FROM ttrss_user_entries 
-                               WHERE owner_uid = id) AS stored_articles
+                               WHERE owner_uid = id) AS stored_articles,
+                       SUBSTRING(created,1,16) AS created
                        FROM ttrss_users 
                        WHERE id = '$uid'");
                        
 
                $last_login = date(get_pref($link, 'LONG_DATE_FORMAT'),
                        strtotime(db_fetch_result($result, 0, "last_login")));
+
+               $created = date(get_pref($link, 'LONG_DATE_FORMAT'),
+                       strtotime(db_fetch_result($result, 0, "created")));
+
                $access_level = db_fetch_result($result, 0, "access_level");
                $stored_articles = db_fetch_result($result, 0, "stored_articles");
 
 #              print "<tr><td>Username</td><td>$login</td></tr>";
 #              print "<tr><td>Access level</td><td>$access_level</td></tr>";
-               print "<tr><td>Last logged in</td><td>$last_login</td></tr>";
-               print "<tr><td>Stored articles</td><td>$stored_articles</td></tr>";
+               print "<tr><td>".__('Registered')."</td><td>$created</td></tr>";
+               print "<tr><td>".__('Last logged in')."</td><td>$last_login</td></tr>";
+               print "<tr><td>".__('Stored articles')."</td><td>$stored_articles</td></tr>";
 
                $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds
                        WHERE owner_uid = '$uid'");
 
                $num_feeds = db_fetch_result($result, 0, "num_feeds");
 
-               print "<tr><td>Subscribed feeds count</td><td>$num_feeds</td></tr>";
+               print "<tr><td>".__('Subscribed feeds count')."</td><td>$num_feeds</td></tr>";
 
 /*             $result = db_query($link, "SELECT 
                        SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size 
 
                print "</table>";
 
-               print "<h1>Subscribed feeds</h1>";
+               print "<h1>".__('Subscribed feeds')."</h1>";
 
                $result = db_query($link, "SELECT id,title,site_url FROM ttrss_feeds
                        WHERE owner_uid = '$uid' ORDER BY title");
index fdc6d495263312218a1c469841f3b43c2a81eca7..ec6690a98358645cc28d0635f2a689c26a987f0a 100644 (file)
                                if (db_num_rows($result) == 0) {
 
                                        db_query($link, "INSERT INTO ttrss_users 
-                                               (login,pwd_hash,access_level,last_login)
-                                               VALUES ('$login', '$pwd_hash', 0, NOW())");
+                                               (login,pwd_hash,access_level,last_login,created)
+                                               VALUES ('$login', '$pwd_hash', 0, null, NOW())");
        
        
                                        $result = db_query($link, "SELECT id FROM ttrss_users WHERE 
index cf29e01211ea8e1219bd64a16b40c30bfccc5908..970afb06e5e13ea848276d875f547b47423284f8 100644 (file)
@@ -41,6 +41,7 @@ create table ttrss_users (id integer primary key not null auto_increment,
        email varchar(250) not null default '',
        email_digest bool not null default false,
        last_digest_sent datetime default null,
+       created datetime default null,
        index (theme_id),
        foreign key (theme_id) references ttrss_themes(id)) TYPE=InnoDB;
 
index af8f1c54f247a215623c2ebfbebadfc7461e4467..fabf3716ef69890f2fbc91950c005ea26281e12e 100644 (file)
@@ -37,6 +37,7 @@ create table ttrss_users (id serial not null primary key,
        email varchar(250) not null default '',
        email_digest boolean not null default false,
        last_digest_sent timestamp default null,
+       created timestamp default null,
        theme_id integer references ttrss_themes(id) default null);
 
 insert into ttrss_users (login,pwd_hash,access_level) values ('admin', 
index d7593c5e978dee63016308fe3e48ae4e6b32a3ef..513be9a6e96a8c6e66336b13ce9315e6bc5b5c70 100644 (file)
@@ -1,3 +1,6 @@
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3);
 
+alter table ttrss_users add column created datetime;
+alter table ttrss_users alter column created set default null;
+
 update ttrss_version set schema_version = 26;
index d7593c5e978dee63016308fe3e48ae4e6b32a3ef..48b966190fc572b3fd66001c97828439dd8111d2 100644 (file)
@@ -1,3 +1,6 @@
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3);
 
+alter table ttrss_users add column created timestamp;
+alter table ttrss_users alter column created set default null;
+
 update ttrss_version set schema_version = 26;