diff options
-rw-r--r-- | pg.pgc | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -252,7 +252,7 @@ void pg_users_get(int channel) { EXEC SQL BEGIN DECLARE SECTION; int channel_id = channel; VARCHAR nick[0x100]; - int id = 0, words, characters, kicks, kicked, monolog_lines, monologs, seen_first, seen_last; + int id = 0, words, characters, kicks, kicked, monolog_lines, monologs, seen_first, seen_last, index, lines; EXEC SQL END DECLARE SECTION; EXEC SQL DECLARE usercursor CURSOR FOR SELECT id, nick, words, characters, kicks, kicked, monolog_lines, monologs, seen_first, seen_last @@ -275,6 +275,22 @@ void pg_users_get(int channel) { user->monologs = monologs; user->seen_first = seen_first; user->seen_last = seen_last; + + EXEC SQL DECLARE userlinescursor CURSOR FOR SELECT time_index, lines FROM user_hours WHERE user_id = :id; + EXEC SQL OPEN userlinescursor; + EXEC SQL FETCH NEXT FROM userlinescursor INTO :index, :lines; + + if(iserror()) + goto pg_userlines_error; + + do { + user->lines[index] = lines; + EXEC SQL FETCH NEXT FROM userlinescursor INTO :index, :lines; + } while(!iserror()); + +pg_userlines_error: + EXEC SQL CLOSE userlinescursor; + EXEC SQL FETCH NEXT FROM usercursor INTO :id, :nick, :words, :characters, :kicks, :kicked, :monolog_lines, :monologs, :seen_first, :seen_last; } while(!iserror()); |