Let's say that I added the following options:
zlib
chit.clan.home = (home clan)
zlib
chit.clan.type = (valid options are: text, dropdown)
zlib
chit.clan.show = (valid options are: always, never, traveling)
traveling only shows the clan when you are away from home.
If chit.clan.home is not existent, it will be set to get_clan_name(), but can be changed from that default in the usual way.
If I show the clan, I append either the clan's name as text or the following whitelist drop-down in an appropriate place. This causes exactly one extra server hit in a session. It won't refresh the whitelist unless the mafia session restarts.
Code:
static {
buffer whitedrop;
string clanlist = visit_url("clan_signup.php");
if(index_of(clanlist, "<select name=whichclan>") >= 0 && index_of(clanlist, "<input type=submit class=button value='Go to Clan'>") >= 0) {
whitedrop.append("<select style='max-width:90%;font-size:smaller;' onchange='if (this.selectedIndex>0) { top.mainpane.document.location.href=\"showclan.php?pwd=");
whitedrop.append(my_hash());
whitedrop.append("&action=joinclan&confirm=on&whichclan=\" + this.options[this.selectedIndex].value; this.options[0].selected=true;}'><option>-change clan-</option>");
whitedrop.append(substring(clanlist, index_of(clanlist, "<select name=whichclan>")+23, index_of(clanlist, "<input type=submit class=button value='Go to Clan'>"))); // This is the whitelist
}
}
What do folks think about that? Too complicated? Am I overthinking? Would something simpler be better? I could do without the clan drop down entirely if the extra option only complicates things. I could do without
chit.clan.type if there was no drop-down option.
What should be the default value for
chit.clan.show?