Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ALTER TABLE nickhost ADD INDEX idx_host (host);
-- initial
insert into nickhost (nick, host, reg, cnt)
select nick, host, reg, count(1) cnt from messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS trigger_nickhost;
Expand Down
2 changes: 1 addition & 1 deletion zlo_search/DB Scripts/misc/fixNicks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ delete from nickhost;

insert into nickhost (nick, host, reg, cnt)
select nick, host, reg, count(1) cnt from messages
group by nick, host;
group by nick, host, reg;
6 changes: 3 additions & 3 deletions zlo_search/DB Scripts/move_to_one_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ALTER TABLE anime_nickhost ADD INDEX idx_host (host);
-- initial
insert into anime_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(1) cnt from anime_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS anime_trigger_nickhost;
Expand Down Expand Up @@ -159,7 +159,7 @@ ALTER TABLE velo_nickhost ADD INDEX idx_host (host);
-- initial
insert into velo_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(1) cnt from velo_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS velo_trigger_nickhost;
Expand Down Expand Up @@ -232,7 +232,7 @@ ALTER TABLE sport_nickhost ADD INDEX idx_host (host);
-- initial
insert into sport_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(1) cnt from sport_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS sport_trigger_nickhost;
Expand Down
2 changes: 1 addition & 1 deletion zlo_search/DB Scripts/move_to_one_db_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
-- initial
insert into %(site)s_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from %(site)s_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS %(site)s_trigger_nickhost;
Expand Down
16 changes: 8 additions & 8 deletions zlo_search/DB Scripts/move_to_one_db_generated.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ALTER TABLE anime_nickhost ADD INDEX idx_host (host);
-- initial
insert into anime_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from anime_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS anime_trigger_nickhost;
Expand Down Expand Up @@ -160,7 +160,7 @@ ALTER TABLE dev_nickhost ADD INDEX idx_host (host);
-- initial
insert into dev_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from dev_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS dev_trigger_nickhost;
Expand Down Expand Up @@ -233,7 +233,7 @@ ALTER TABLE games_nickhost ADD INDEX idx_host (host);
-- initial
insert into games_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from games_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS games_trigger_nickhost;
Expand Down Expand Up @@ -306,7 +306,7 @@ ALTER TABLE np_nickhost ADD INDEX idx_host (host);
-- initial
insert into np_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from np_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS np_trigger_nickhost;
Expand Down Expand Up @@ -379,7 +379,7 @@ ALTER TABLE sport_nickhost ADD INDEX idx_host (host);
-- initial
insert into sport_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from sport_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS sport_trigger_nickhost;
Expand Down Expand Up @@ -452,7 +452,7 @@ ALTER TABLE takeoff_nickhost ADD INDEX idx_host (host);
-- initial
insert into takeoff_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from takeoff_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS takeoff_trigger_nickhost;
Expand Down Expand Up @@ -525,7 +525,7 @@ ALTER TABLE velo_nickhost ADD INDEX idx_host (host);
-- initial
insert into velo_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from velo_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS velo_trigger_nickhost;
Expand Down Expand Up @@ -598,7 +598,7 @@ ALTER TABLE zlo_nickhost ADD INDEX idx_host (host);
-- initial
insert into zlo_nickhost (nick, host, reg, cnt)
select nick, host, reg, count(*) cnt from zlo_messages
group by nick, host;
group by nick, host, reg;

-- trigger
DROP TRIGGER IF EXISTS zlo_trigger_nickhost;
Expand Down
8 changes: 4 additions & 4 deletions zlo_web/src/main/java/info/xonix/zlo/web/logic/ImgLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void renderPreviewAndCache(String url, HttpServletResponse resp, S
err = true;
} else {
// log.info("renderPreviewAndCache " + url + ": cached");
resp.setContentType("image/jpeg");
resp.setContentType("image/png");
FileUtils.copyFile(previewFile, outputStream);
}
} else {
Expand All @@ -81,9 +81,9 @@ public static void renderPreviewAndCache(String url, HttpServletResponse resp, S
err = true;
}
if (previewImg != null) {
resp.setContentType("image/jpeg");
ImageIO.write(previewImg, "jpg", previewFile);
ImageIO.write(previewImg, "jpg", outputStream);
resp.setContentType("image/png");
ImageIO.write(previewImg, "png", previewFile);
ImageIO.write(previewImg, "png", outputStream);
}
}
} catch (Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion zlo_web/src/main/webapp/stats.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<c:when test="${byNick}">
<sql:query var="res">
select nick, user_id, reg, COUNT(*) cnt from ${messagesTbl}${' '}${msgDateWhereClause}
group by nick
group by nick, user_id, reg
order by cnt desc;
<sql:param>${periodDays}</sql:param>
</sql:query>
Expand Down