+ sprintf(tmp, "%.2f kB (%.2f MB)", total_memory / 1024, total_memory / 1024 / 1024);
+ content[1] = tmp;
+ table_add(table, content);
+
+ content[0] = get_language_string(user, "NS_NETINFO_CHANNEL");
+ sprintf(tmp, "%d %.2f kB (%d * %lu B = %.2f kB)", channel_count, channel_memory / 1024, channel_count, sizeof(struct ChanNode), channel_memory / 1024);
+ content[1] = tmp;
+ table_add(table, content);
+
+ content[0] = get_language_string(user, "NS_NETINFO_CHANNEL_BAN");
+ sprintf(tmp, "%d %.2f kB (%d * %lu B = %.2f kB)", channel_ban_count, channel_ban_memory / 1024, channel_ban_count, sizeof(struct BanNode), channel_ban_memory / 1024);
+ content[1] = tmp;
+ table_add(table, content);
+
+ content[0] = get_language_string(user, "NS_NETINFO_USER");
+ sprintf(tmp, "%d %.2f kB (%d * %lu B = %.2f kB)", user_count, user_memory / 1024, user_count, sizeof(struct UserNode), user_memory / 1024);
+ content[1] = tmp;
+ table_add(table, content);
+
+ content[0] = get_language_string(user, "NS_NETINFO_CHANUSER");
+ sprintf(tmp, "%d %.2f kB (%d * %lu B = %.2f kB)", chanuser_count, chanuser_memory / 1024, chanuser_count, sizeof(struct ChanUser), chanuser_memory / 1024);
+ content[1] = tmp;
+ table_add(table, content);
+
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ printf_mysql_query("SHOW TABLE STATUS");
+ res = mysql_use();
+ int mysql_entrys[4];
+ float mysql_length[5];
+ total_memory = 0;
+ mysql_entrys[0] = 0; mysql_entrys[1] = 0; mysql_entrys[2] = 0; mysql_entrys[3] = 0;
+ mysql_length[0] = 0; mysql_length[1] = 0; mysql_length[2] = 0; mysql_length[3] = 0; mysql_length[4] = 0;
+ while ((row = mysql_fetch_row(res)) != NULL) {
+ if(!stricmp(row[0], "channels")) {
+ mysql_entrys[0] = atoi(row[4]);
+ mysql_length[0] = atof(row[6]);
+ total_memory += atof(row[6]);
+ } else if(!stricmp(row[0], "bans")) {
+ mysql_entrys[1] = atoi(row[4]);
+ mysql_length[1] = atof(row[6]);
+ total_memory += atof(row[6]);
+ } else if(!stricmp(row[0], "users")) {
+ mysql_entrys[2] = atoi(row[4]);
+ mysql_length[2] = atof(row[6]);
+ total_memory += atof(row[6]);
+ } else if(!stricmp(row[0], "chanusers")) {
+ mysql_entrys[3] = atoi(row[4]);
+ mysql_length[3] = atof(row[6]);
+ total_memory += atof(row[6]);
+ } else {
+ mysql_length[4] += atof(row[6]);
+ total_memory += atof(row[6]);
+ }
+ }
+
+ content[0] = get_language_string(user, "NS_NETINFO_DATABASE");
+ sprintf(tmp, "%.2f kB (%.2f MB)", total_memory / 1024, total_memory / 1024 / 1024);