I've been boarding dogs for many years and have finally figured out the best thing for diarrhea dogs.

No food for 24 hours....it gives the gut a chance to heal and rest...just water. No cookies, no chewies...nothing.
After 24 hours...I give a cup or two of well cooked white rice. If everything is going well, and there are no more signs of diarrhea...then for the next meal..it's the white rice and some cooked chicken breast. Usually 3 to 1 rice and chicken.
If by the next meal everything is good...then I start slowly phasing in their kibble...add about 1/2 cup to the rice and chicken mix...and by the next meal...all kibble.
You can give him Pepto Bismal (use the caplets) or Immodium...so the dog can make it through the night without having an accident.
Canned pumpkin is good, and I've used it also...but it can also loosen things up in some dogs.
I'm sure you are right, he probably ate some dead thing or some animal turds...and now he's paying for it.
Gina