Public snipts »
cmoist's
snipts
showing 1-2 of 2 snipts
-
∞ Simple CSS error messages with as little html markup as possible.
<!-- Use as shown below. Assumes the use of any 16x16 icons. Larger or smaller may have to adjust line-height and padding. Markup is half the size of my old version, which used nested tags to dictate padding necessary for bg images. Feel free to remove redundant selectors. They are present to ensure this will work stand-alone. --> <style type="text/css"> .error, .confirm { font: normal normal 300 13px/16px Arial, Helvetica, sans-serif; margin: 10px 0; padding: 5px; text-indent: 25px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .error { background: #FEF1EC url(../assets/images/exclamation_frame.png) no-repeat 8px 5px; border: 1px solid #CD0A0A; color: #CD0A0A; } .confirm { background: #D8FFD3 url(../assets/images/tick_circle_frame.png) no-repeat 8px 5px; border: 1px solid #337C2A; color: #337C2A; } </style> <p class="error">Some error!</p> <p class="confirm">Some confirmation!</p>
-
∞ Generate Title and Meta Tags Function
<?php //Place this in a functions file and use it to generate each //page's title tag and meta data //pass it like this: //titleAndMetaTags("Description","Keywords","Title"); function titleAndMetaTags($description="", $keywords="", $subtitle="") { //variables $standard_title = "Standard Title"; $title_wrapper = "My Site | "; $use_wrapper = true; //true, false...use the standard title wrapper above $name = "Your Name"; $standard_desc = "Description to fall back on"; $standard_keys = "Keywords to fall back on"; //comma separated $index = true; //true = INDEX,FOLLOW, false = NOINDEX,NOFOLLOW !empty($description) ? $meta_desc = $description : $meta_desc = $standard_desc; !empty($keywords) ? $meta_keys = $keywords : $meta_keys = $standard_keys; if ($use_wrapper) { !empty($subtitle) ? $title = $title_wrapper . $subtitle : $title = $standard_title; } else { !empty($subtitle) ? $title = $subtitle : $title = $standard_title; } echo "<title>" . $title . "</title>\n"; echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>\n"; echo "<meta name=\"description\" content=\"" . $meta_desc . "\">\n"; echo "<meta name=\"keywords\" content=\"" . $meta_keys . "\">\n"; echo "<meta name=\"robots\" content=\""; if ($index) {echo "INDEX,FOLLOW";} else {echo "NOINDEX,NOFOLLOW";} echo "\">\n"; echo "<meta name=\"author\" content=\"" . $name . "\">\n"; echo "<meta name=\"copyright\" content=\"©" . date('Y') . " " . $name . "\">\n"; echo "<meta name=\"designer\" content=\"" . $name . "\">\n"; } ?>



High Performance MySQL