From your history it seems that now your problem might be due to unoperated pile giving trouble.
There might be having some infection in the pile.
If pile is not coming out or if coming out while passing stool and going inside after defecation, there is no need of having surgery.
Go for treatment of infected pile after consulting surgeon.
Take plenty of water.
Avoid fried, chillies and junk food.
Take mild laxative daily at night.
Ok and take care.