everyone except the last one can be saved, assuming they can reliably count the number of hats in front of them. it's all about parity.
basically the last guy can relay exactly one bit of information by saying black or white, as he will always have to guess no matter what. now, for my solution each person concludes their own hat color from two bits (as in, units of information) of knowledge:
a) the parity of black hats in front of him (which he can simply count)
b) the parity of people who said "black" behind him (which he will have to keep track of)
now the last one says "black" if there is an odd number of black hats before him, and "white" if it's an even number. that way, he will induce that information b) of each person is the parity of black hats in front of him plus the person himself. that way, each person can conclude their own hat color using a NAND operation, ie, if a and b are the same (black+black or white+white) he has a white hat, otherwise he has a black hat.
example:
person | hat color | forward parity | backward parity |
0 | w | w | | |
1 | w | w | w | w NAND w = w |
2 | b | b | w | b NAND w = b |
3 | w | b | b | b NAND b = w |
4 | b | w | b | w NAND b = b |
5 | b | b | w | b NAND w = b |
6 | b | w | b | w NAND b = b |
7 | w | w | w | w NAND w = w |
[/center]
of course, the last guy will always be stuck with a 50/50 chance. and he can decide to screw everyone by inducing a wrong backward parity