From: Paul J R Date: Wed, 19 Sep 2012 01:48:25 +0000 (+1000) Subject: addded user details to top of repo view X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=2665125c8ddb042dcd87e804bf63b79cc423da0e;p=gwvp-mini.git addded user details to top of repo view --- diff --git a/gwvpmini/gwvpmini_db.php b/gwvpmini/gwvpmini_db.php index 3f63804..f87751c 100644 --- a/gwvpmini/gwvpmini_db.php +++ b/gwvpmini/gwvpmini_db.php @@ -241,6 +241,52 @@ function gwvpmini_GetRepoId($reponame) return $retval; } +function gwvpmini_GetRepoOwnerDetailsFromName($reponame) +{ + + /* + * $reposql = ' + CREATE TABLE "repos" ( + "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "repos_name" TEXT, + "repos_description" TEXT, + "repos_owner" INTEGER + )'; + + "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) + + */ + + $conn = gwvpmini_ConnectDB(); + + $sql = "select users.* from repos,users where repos_name='$reponame' and repos_owner=user_id"; + + $res = $conn->query($sql); + + $retval = -1; + if(!$res) return -1; + foreach($res as $row) { + $retval = array(); + error_log("STUFF2: ".print_r($row,true)); + $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"]; + } + + return $retval; +} function gwvpmini_setConfigVal($confname, $confval) { diff --git a/gwvpmini/gwvpmini_view.php b/gwvpmini/gwvpmini_view.php index 3703a72..70ce34d 100644 --- a/gwvpmini/gwvpmini_view.php +++ b/gwvpmini/gwvpmini_view.php @@ -50,7 +50,13 @@ function gwvpmini_RepoViewPageBody() else $proto = "http://"; $sname = $_SERVER["SERVER_NAME"]; - echo "

$repo_view_call by owner

"; + $owner = gwvpmini_GetRepoOwnerDetailsFromName($repo_view_call); + + $owner_name = $owner["username"]; + + error_log("STUFF:".print_r($owner,true)); + + echo "

".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name

"; echo "Desc
"; echo "
"; //echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";