Thats a firewall issue (52130).
Either turn it off and try to connect or manually configure your settings. ie: IP address
edit: That is a different error than in your first post but codes can have more than 1 meaning.
52130 Error can be firewall blocking or security.
You stated WEP64
This would make sense as to why you can't connect. That is the security settings in your router. WEP64 must have a code of exactly 10 numbers and letters A_F and it has to be in the #1slot (usually there are 4 slots).
That must be entered in the wii settings exactly the same or disable it in your router. (at least until you figure out whats blocking your connection). In the wii settings if the security window is greyed out (you cant enter anything into it) then security in your router is off.
If it is not grey (meaning you can type in this area) your router has security turned on.
Linksys Routers have SPI Firewall on by default. You must manually turn it off in the router, save your settings then try to connect.
If you now get 52731 error: In the Wii settings you clear all the old connection setups. Start from scratch and make a new connection. This is a good start as there are other things to try.
Any changes you make must be saved in order to work.
Also dial-up and Sattelite are not compatible with the Wii.
Any settings in your router will be lost if you have reset it at anytime.
The Wii is very complicated to get online for alot of people.