X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_web.php;h=6d45c4a54f7b9b3c2d63ac8809f211ca24a7c3ca;hb=3a319290353bbe27aa901b4f1c48ccb44dca28ed;hp=b15822638fcb08c4c0032a30ac1f64b9438e5cde;hpb=6042a4d8bc6f911ceba615482d922b6e641602a2;p=gwvp-mini.git
diff --git a/gwvpmini/gwvpmini_web.php b/gwvpmini/gwvpmini_web.php
index b158226..6d45c4a 100644
--- a/gwvpmini/gwvpmini_web.php
+++ b/gwvpmini/gwvpmini_web.php
@@ -26,7 +26,7 @@ function gwvpmini_goWeb()
// this is important for our plugin structure later on - the key on the array serves an an ordering method
ksort($CALL_ME_FUNCTIONS);
foreach($CALL_ME_FUNCTIONS as $key => $val) {
- error_log("checking callmefunction $key as $val");
+ //error_log("checking callmefunction $key as $val");
$callme = $val();
if($callme !== false) {
$callme();
@@ -110,7 +110,7 @@ function gwvpmini_goMainPage($bodyFunction = null)
echo "";
- echo "
";
+ echo " |
";
if($bodyFunction == null) {
gwvpmini_BodyBuilder();
} else {
@@ -202,7 +202,7 @@ function gwvpmini_LoginBuilder()
if($login === false) {
gwvpmini_SingleLineLoginForm();
} else {
- echo "Hello ".$_SESSION["fullname"]." logout";
+ echo "Hello ".$_SESSION["fullname"]." logout";
}
}
@@ -224,21 +224,69 @@ function gwvpmini_BodyBuilder()
// builds the tail structure
function gwvpmini_TailBuilder()
{
- echo "Copyright 2011, PJR - licensed under GPL";
+ echo "
GWVP - Copyright 2011, 2012 PJR - GPL";
+}
+
+function gwvpmini_emailToUserLink($email)
+{
+ global $BASE_URL;
+
+ $username = gwvpmini_GetUserNameFromEmail($email);
+
+ if($username !== false) {
+ return "$username";
+ } else {
+ return false;
+ }
}
function gwvpmini_fourZeroThree()
{
error_log("403 called");
- header("HTTP/1.0 403 Permission Denied");
+ header("HTTP/1.1 403 Permission Denied");
}
function gwvpmini_fourZeroFour()
{
error_log("404 called");
- header("HTTP/1.0 404 No Such Thing");
+ header("HTTP/1.1 404 No Such Thing");
}
+/**
+ * Get either a Gravatar URL or complete image tag for a specified email address.
+ *
+ * @param string $email The email address
+ * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]
+ * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
+ * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
+ * @param boole $img True to return a complete IMG tag False for just the URL
+ * @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 == 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 ) ) );
+ $url .= "?s=$s&d=$d&r=$r";
+ if ( $img ) {
+ $url = ' $val )
+ $url .= ' ' . $key . '="' . $val . '"';
+ $url .= ' />';
+ }
+ return $url;
+}
+
?>
\ No newline at end of file
|