Zesstra | 83f011d | 2016-04-24 20:09:05 +0200 | [diff] [blame^] | 1 | #pragma strict_types, save_types, rtt_checks, pedantic |
| 2 | #pragma no_clone, no_shadow, no_inherit |
| 3 | |
| 4 | #include <www.h> |
| 5 | |
| 6 | private string MakeLink(mixed entry) |
| 7 | { |
| 8 | string nm; |
| 9 | int idx; |
| 10 | |
| 11 | entry[1] = regreplace(entry[1], "<", "\\<", 1); |
| 12 | entry[1] = regreplace(entry[1], ">", "\\>", 1); |
| 13 | nm = getuid(entry[0]); |
| 14 | if(nm == " R O O T ") return "<TT>"+entry[1][0..2]+"</TT>"+entry[1][3..]; |
| 15 | idx = strstr(lower_case(entry[1]), nm); |
| 16 | return "<TT>"+entry[1][0..2]+"</TT>"+entry[1][3..idx-1] |
| 17 | + "<A HREF=\""+MUDWWW+"?"+REQ+"="+R_FINGER+"&"+USER+"="+nm+"\"><B>" |
| 18 | + entry[1][idx..idx = idx+sizeof(nm)] |
| 19 | + "</B></A>" |
| 20 | + entry[1][idx+1..]; |
| 21 | } |
| 22 | |
| 23 | public string Request(mapping cmds) |
| 24 | { |
| 25 | string *who, *list; int i, s; |
| 26 | if (!sizeof(cmds)) return ERROR("Anfrage ungültig!"); |
| 27 | who = allocate(s = sizeof(list = WHO)); |
| 28 | for(i = s; i--; i > 0) |
| 29 | who[i] = MakeLink(list[s - i - 1]); |
| 30 | // who = map(WHO, #'MakeLink/*'*/); |
| 31 | return "<H2>Wer ist gerade in "MUDNAME"?</H2><HR>" |
| 32 | + "<OL><LI>"+implode(who, "\n<LI>")+"</OL>"; |
| 33 | } |