addded user details to top of repo view
authorPaul J R <me@pjr.cc>
Wed, 19 Sep 2012 01:48:25 +0000 (11:48 +1000)
committerPaul J R <me@pjr.cc>
Wed, 19 Sep 2012 01:48:25 +0000 (11:48 +1000)
gwvpmini/gwvpmini_db.php
gwvpmini/gwvpmini_view.php

index 3f63804..f87751c 100644 (file)
@@ -241,6 +241,52 @@ function gwvpmini_GetRepoId($reponame)
        return $retval;
 }
 \r
+function gwvpmini_GetRepoOwnerDetailsFromName($reponame)\r
+{\r
+\r
+       /*\r
+        *      $reposql = '\r
+       CREATE TABLE "repos" (\r
+                       "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT,\r
+                       "repos_name" TEXT,\r
+                       "repos_description" TEXT,\r
+                       "repos_owner" INTEGER\r
+       )';
+       
+               "user_id" INTEGER PRIMARY KEY AUTOINCREMENT,
+       "user_full_name" TEXT,
+       "user_password" TEXT,
+       "user_username" TEXT,
+       "user_email" TEXT,
+       "user_desc" TEXT,
+       "user_level" TEXT,
+       "user_status" TEXT,
+       UNIQUE(user_username)\r
+\r
+       */\r
+\r
+       $conn = gwvpmini_ConnectDB();\r
+\r
+       $sql = "select users.* from repos,users where repos_name='$reponame' and repos_owner=user_id";\r
+\r
+       $res = $conn->query($sql);\r
+\r
+       $retval = -1;\r
+       if(!$res) return -1;\r
+       foreach($res as $row) {
+               $retval = array();
+               error_log("STUFF2: ".print_r($row,true));\r
+               $retval["id"] = $row["user_id"];
+               $retval["fullname"] = $row["user_full_name"];
+               $retval["username"] = $row["user_username"];
+               $retval["email"] = $row["user_email"];
+               $retval["desc"] = $row["user_desc"];
+               $retval["level"] = $row["user_level"];
+               $retval["status"] = $row["user_status"];\r
+       }\r
+\r
+       return $retval;\r
+}\r
 \r
 function gwvpmini_setConfigVal($confname, $confval)\r
 {\r
index 3703a72..70ce34d 100644 (file)
@@ -50,7 +50,13 @@ function gwvpmini_RepoViewPageBody()
        else $proto = "http://";
        $sname = $_SERVER["SERVER_NAME"];
        
-       echo "<br><h2>$repo_view_call by owner</h2>";
+       $owner = gwvpmini_GetRepoOwnerDetailsFromName($repo_view_call);
+       
+       $owner_name = $owner["username"];
+       
+       error_log("STUFF:".print_r($owner,true));
+       
+       echo "<br><h2>".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name</h2>";
        echo "<b>Desc</b><br>";
        echo "<textarea rows=1 cols=100>git clone $proto$sname$BASE_URL/git/$repo_view_call.git</textarea><br>";
        //echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";