You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql='select count(cl_from), cl_to from categorylinks where cl_to in (%s) and cl_type="file" and cl_from in (select log_page from logging_userindex where log_type="upload" and log_user=(select user_id from user where user_name="%s")) group by cl_to;'% (sqlin, username)
28
+
sql='select count(cl_from), cl_to from categorylinks where cl_to in (%s) and cl_type="file" and cl_from in (select log_page from logging_userindex where log_type="upload" and log_user=%d) group by cl_to;'% (sqlin, userId)
29
29
cur.execute(sql)
30
30
data=cur.fetchall()
31
31
response= {}
@@ -36,23 +36,23 @@ def featuredImages(username):
36
36
response[award] =0
37
37
returnresponse
38
38
39
-
defarticlesUsingImages(username):
39
+
defarticlesUsingImages(userId):
40
40
withconn.cursor() ascur:
41
-
sql='select count(*) from globalimagelinks where gil_to in (select log_title from logging_userindex where log_type="upload" and log_user=(select user_id from user where user_name="%s"));'%username
41
+
sql='select count(*) from globalimagelinks where gil_to in (select log_title from logging_userindex where log_type="upload" and log_user=%d);'%userId
42
42
cur.execute(sql)
43
43
data=cur.fetchall()
44
44
returndata[0][0]
45
45
46
-
defuniqueUsedImages(username):
46
+
defuniqueUsedImages(userId):
47
47
withconn.cursor() ascur:
48
-
sql='select count(distinct gil_to) from globalimagelinks where gil_to in (select log_title from logging_userindex where log_type="upload" and log_user=(select user_id from user where user_name="%s"));'%username
48
+
sql='select count(distinct gil_to) from globalimagelinks where gil_to in (select log_title from logging_userindex where log_type="upload" and log_user=%d);'%userId
49
49
cur.execute(sql)
50
50
data=cur.fetchall()
51
51
returndata[0][0]
52
52
53
-
defimagesEditedBySomeoneElse(username):
53
+
defimagesEditedBySomeoneElse(userId):
54
54
withconn.cursor() ascur:
55
-
sql='select count(*) from revision where rev_page in (select log_page from logging_userindex where log_type="upload" and log_user=(select user_id from user where user_name="%s")) and rev_user!=(select user_id from user where user_name="%s") group by rev_page having count(*)>1'% (username, username)
55
+
sql='select count(*) from revision where rev_page in (select log_page from logging_userindex where log_type="upload" and log_user=%d) and rev_user!=%d group by rev_page having count(*)>1'% (userId, userId)
56
56
cur.execute(sql)
57
57
data=cur.fetchall()
58
58
returnlen(data)
@@ -64,6 +64,13 @@ def deletedUploads(username):
64
64
data=cur.fetchall()
65
65
returndata[0][0]
66
66
67
+
defgetUserId(username):
68
+
withconn.cursor() ascur:
69
+
sql='select user_id from user where user_name="%s";'%username
0 commit comments