Question for REG! Please help!

I am currently reviewing Unit 5 for REG - specifically, S corp and partnership basis - and I'm having trouble understanding how to compute the adjusted basis for shareholders and partners. Specific S corporation questions: Do direct shareholder loans to the S corporation increase that shareholder's basis? Why don't S corporation loans or shareholder guarantees increase a shareholder's basis? If someone could give me a quick summary on what increases/decreases each basis that would be extremely helpful! I would really appreciate any help! Thanks!