X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_web.php;h=e7e0e54dcad6a744916c0b4a76e3d57ec97af04f;hb=979dc6190296b0c7ffdfe17031f2d32318da7e2b;hp=97afbaad0776d2c22ccd44010f29268fabbe6087;hpb=1b92a34cf5410903805474d427466ca4063f8b6c;p=gwvp-mini.git diff --git a/gwvpmini/gwvpmini_web.php b/gwvpmini/gwvpmini_web.php index 97afbaa..e7e0e54 100644 --- a/gwvpmini/gwvpmini_web.php +++ b/gwvpmini/gwvpmini_web.php @@ -13,7 +13,7 @@ $MENU_ITEMS["00home"]["link"] = "$BASE_URL"; function gwvpmini_goWeb() { - global $CALL_ME_FUNCTIONS; + global $CALL_ME_FUNCTIONS, $force_ssl; // first we determine if we have a valid setup and run the installer if not /*if(!gwvpmini_issetup()) { @@ -24,6 +24,15 @@ function gwvpmini_goWeb() // next, we go thru the CALL_ME_FUNCTIONS - the purpose of call_me_functions is to determine if a function should be called based on // the functions return (i.e. if function returns false, its not it, otherwise it returns a function name we have to call) // this is important for our plugin structure later on - the key on the array serves an an ordering method + + if($force_ssl) { + if(!isset($_SERVER['HTTPS'])) { + header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"], true); + return; + } + } + + ksort($CALL_ME_FUNCTIONS); foreach($CALL_ME_FUNCTIONS as $key => $val) { //error_log("checking callmefunction $key as $val"); @@ -264,7 +273,22 @@ function gwvpmini_fourZeroFour() * @param array $atts Optional, additional key/value attributes to include in the IMG tag * @return String containing either just a URL or a complete image tag * @source http://gravatar.com/site/implement/images/php/ - */ + */ +function gwvpmini_HtmlGravatar($email, $size, $htmlappend="") +{ + + global $use_gravatar; + + if($use_gravatar) { + error_log("call to gravatar with yes"); + } else { + error_log("call to gravatar with no"); + } + + if($use_gravatar == false) return ""; + return get_gravatar( $email, $size, 'mm', 'g', true)."$htmlappend"; +} + function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) { $url = 'http://en.gravatar.com/avatar/'; $url .= md5( strtolower( trim( $email ) ) );