switching user references to link-to-user references
[gwvp-mini.git] / gwvpmini / gwvpmini_view.php
index 96ee359..007261e 100644 (file)
@@ -50,9 +50,17 @@ function gwvpmini_RepoViewPageBody()
        else $proto = "http://";
        $sname = $_SERVER["SERVER_NAME"];
        
-       echo "<br><h2>$repo_view_call by owner</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>";
+       $owner = gwvpmini_GetRepoOwnerDetailsFromName($repo_view_call);
+       $desc = gwvpmini_GetRepoDescFromName($repo_view_call);
+       
+       $owner_name = $owner["username"];
+       
+       error_log("STUFF:".print_r($owner,true));
+       $cloneurl = "git clone $proto$sname$BASE_URL/git/$repo_view_call.git";
+       echo "<textarea rows=1 cols=".strlen($cloneurl).">$cloneurl</textarea><br>";\r
+       
+       echo "<h2>".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name</h2>";
+       echo "<b>$desc</b><br>";
        //echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";
        $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%H\" -10", "r");
        $commitids = array();
@@ -76,19 +84,23 @@ function gwvpmini_RepoViewPageBody()
                echo "<table border=\"1\">";
                echo "<tr><th>Committed By</th><th>Date</th><th>Commit Log Entry</th></tr>";
                foreach($commitids as $ids) {
-                       $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%at%n%ce%n%s\" $ids -1", "r");
+                       $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%at%n%ce%n%an%n%s\" $ids -1", "r");
                        if($rs) {
                                $flin1 = trim(fgets($rs));
-                               $flin2 = gwvpmini_emailToUserLink(trim(fgets($rs)));
+                               $flin2 = trim(fgets($rs));
+                               $flin3 = trim(fgets($rs));
                                while(!feof($rs)) {
-                                       $flin3 = fread($rs, 8192);
+                                       $flin4 = fread($rs, 8192);
+                               }
+                               $flon =  gwvpmini_emailToUserLink($flin2);
+                               if(!$flon) {
+                                       $flon = "$flin3 (external)";
                                }
                        }
-                       echo "<tr><td>$flin2</td><td>$flin1</td><td>$flin3</td></tr>";
+                       echo "<tr><td>".get_gravatar($flin2, 18, 'mm', 'g', true)."$flon</td><td>$flin1</td><td>$flin4</td></tr>";
                }
                echo "</table>";
        }
-       
 }
 \r