there are 2 approaches you can take here- decide which would be the best for your situation:
since he has been potty trained for so long, and recognizes that it is for attention, then don't give him the attention he is seeking! well, at least not when it comes to accidents- other attention is great. If he soils himself, have him climb in to an empty bathtub (to make cleanup easier for you), hand him some wipes, and some clean clothes and have him clean himself up. he can put his soiled clothes into a plastic bag for you. keep it simple and matter of fact- no drama or emotion. he'll tire of it very quickly.
or, make him go every hour and explain that it is because you don't want him to have accidents. If he protests, tell him he has to at least try, and if he goes all day without having an accident then tomorrow you'll let him go longer. keep it simple and matter of fact. again, he will tire of it very quickly.
Hi, My son is 3 and half too and he is potty trainned during the day but night at night either. And he has been having accidents during the day as well. I'm not sure why. But I just tell him not to wait and hold it in and then I make him sit on the toilet. I don't take anything away from him. I don't agree with taking toys away and punishing because its something that they have to learn on there own. I try not to get mad either. I just keep redirecting him to where he needs to go. Look at the bright light-he'll be trained before he goes to kindergarten. I am going to discuss the situation with my pedtrician, you might what to speak to him or her as well to see what they have to say.Keep me posted. hope all works out-it does HAPPY HOLIDAYS!!!!!!!