7 static CMD_BIND(neonserv_cmd_oplog) {
9 int duration = (argc ? strToTime(user, argv[0]) : (60*60*24));
11 str_match = merge_argv(argv, (duration ? 1 : 0), argc);
16 printf_mysql_query("SELECT `godlog_time`, `user_user`, `channel_channel`, `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));
18 int skip = mysql_num_rows(res) - 100;
23 if(skip < 0) skip = 0;
24 reply(getTextBot(), user, "NS_EVENTS_HEADER");
25 while ((row = mysql_fetch_row(res)) != NULL) {
30 if(match(str_match, row[3])) continue;
32 event_time = (time_t) atol(row[0]);
33 timeinfo = localtime(&event_time);
34 strftime(timeBuf, 80, "%X %x", timeinfo);
35 reply(getTextBot(), user, "[%s] [%s%s%s]: %s", timeBuf, row[1], (row[2] ? ":" : ""), (row[2] ? row[2] : ""), row[3]);
37 reply(getTextBot(), user, "NS_TABLE_COUNT", count);