Rules are defined in a database table using the ACP, instead of being just written down on a page or in a topic. Each rule will have a certain amount of "points" or "demerits" associated with it, as well as an expiration. This also allows staff to quickly change rules without worrying about changing all the places they appear.
When a rule is violated and a warning issued, the warning is logged and an alert is sent to the user. The alert will contain the rule and its description, as well as a staff comment if the moderator chose to add one. The last thing in the PM will be a link to the warning in the "warning area" I mentioned earlier.
When viewing the warning area, users will see a list of their warnings that can be clicked on for more information. At the top will be the number of demerits on your account. Clicking on a warning will show all of the info about the warning. (Date/time, rule and description, demerits, expiration, removed content, link to content.) The moderator's identity is hidden from the user to protect them from flaming, but is visible to other staff members.
When a warning has expired, it will be hidden from the user completely. It will be visible only to staff members when looking through a member's entire history. The demerits associated with the warning will also be removed, and no trace of the warning will be left for the user.
In this way, users are able to learn from their mistakes without feeling that what they've done is unforgivable. Expired warnings are hidden so they won't haunt users for the rest of their time on the forums. The purpose of demerits is so that users know exactly what the state of their account is, and can change their behavior before a suspension or ban is issued.