7 static CMD_BIND(neonserv_cmd_oplog) {
9 int duration = (argc ? strToTime(user, argv[0]) : 0);
10 if(argc > (duration ? 1 : 0))
11 str_match = merge_argv(argv, (duration ? 1 : 0), argc);
14 if(!duration) duration = (60*60*24);
17 printf_mysql_query("SELECT `godlog_time`, `user_user`, `channel_name`, `godlog_cmd` FROM `godlog` LEFT JOIN `channels` ON `godlog_cid` = `channel_id` LEFT JOIN `users` ON `godlog_uid` = `user_id` WHERE `godlog_time` > '%lu' ORDER BY `godlog_time` ASC", ((unsigned long) time(0) - duration));
19 int skip = mysql_num_rows(res) - 100;
24 if(skip < 0) skip = 0;
25 reply(getTextBot(), user, "NS_EVENTS_HEADER");
26 while ((row = mysql_fetch_row(res)) != NULL) {
31 if(*str_match && match(str_match, row[3])) continue;
33 event_time = (time_t) atol(row[0]);
34 timeinfo = localtime(&event_time);
35 strftime(timeBuf, 80, "%X %x", timeinfo);
36 reply(getTextBot(), user, "[%s] [%s%s%s]: %s", timeBuf, row[1], (row[2] ? ":" : ""), (row[2] ? row[2] : ""), row[3]);
38 reply(getTextBot(), user, "NS_TABLE_COUNT", count);