Well this coulld be either a major or minor problem.
Well if its iceberg lettuce then you should stop feeding that too him. Iceberg lettuce is known to be bad for them, if you want to feed lettuce try romaine lettuce, they love that stuff. Also you wanna be careful with the amount of apple your feeding them. The acid in teh apples can cause lip sores on their mouths if you feed them too much, these can quickly become infected and will require veterinary treatment. Also fruit has lots of sugar in it, so it shouldn't be fed more than once or twice a week. I suggest you cut back on the apples and lettuce, and maybe the carrots too because they have lots of vitamin A in which can cause liver problems, but they usually like carrots so a little bit of carrot a day won;t do too much harm. Try feeding vitamin c rich veg like bell peppers and small amounts of brocolli.
Here's more information on the diet:
Well as for the major problem. If the pig looks ill or hunched up, and generally miserable, it should be taken to a vet immediatley as it could have a URI, upper respiratory infetion. The guine apig could also have an intestinal problem, such as a bacterial infection or it could've eaten spolied hay or vegetables, in which case again it needs to see a vet. These are usually the cases if its serious diarhea.
You need to keep the guinea pig drinking as otherwise it could die within hours of dehydration, so its very important that he's drinking. I would also seperate him off from teh otehr pigs, if it is a URI then you don;t want the other pigs to catch it. I would also suggest you take him to an exotic vet, to rule out URI's and bacterial infections. Regular vets don;t really know all that much about guinea pigs, so thats why an exotic vet it is best. If you can't find an exotic vet then a regular vet will do.
It it does turn out to be the lettuce or too much green-stuff then you should cut fruit and veg from his diet and feed him on pellets and timothy hay for a couple for a couple fo days, and the gradually reintroduce vegetables bakc into his diet.