Skip to content

Instantly share code, notes, and snippets.

-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
@stylephreak
stylephreak / tag.forceHttps
Created September 24, 2009 07:49
CMSMS tag - Forces a CMS Made Simple page to use https
// CMSMS tag - Forces a CMS Made Simple page to use https
if(emptyempty($_SERVER['HTTPS']))
{
// If not, redirect
$newurl = 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
header("location: $newurl");
exit();
}
@stylephreak
stylephreak / jQuery.fn.attrToClass
Created September 24, 2009 07:35
jQuery function that appends a class to each designated element by pulling it from a tag attribute.
//Appends a class to each designated element by pulling it from a tag attribute.
jQuery.fn.attrToClass = function(attribute) {
$(this).each(
function(intIndex){
$(this).addClass($(this).attr(attribute));
});
};
$(document).ready(function(){
// designate the tag and the attribute to be extracted