svn: /pear/pearweb/trunk/public_html/ account-info.php
| From: | Daniel O'Connor | Date: | Fri, 19 Mar 2010 21:39:10 +0000 |
| Subject: | svn: /pear/pearweb/trunk/public_html/ account-info.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9313@lists.php.net to get a copy of this message | ||
clockwerx Fri, 19 Mar 2010 21:39:10 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=296446
Log:
Render actual karma; not just notes
Changed paths:
U pear/pearweb/trunk/public_html/account-info.php
Modified: pear/pearweb/trunk/public_html/account-info.php
===================================================================
--- pear/pearweb/trunk/public_html/account-info.php 2010-03-19 21:38:47 UTC (rev 296445)
+++ pear/pearweb/trunk/public_html/account-info.php 2010-03-19 21:39:10 UTC (rev 296446)
@@ -23,7 +23,12 @@
require_once 'Damblan/Karma.php';
require_once 'Damblan/URL.php';
require_once 'HTTP.php';
+require 'bugs/pear-bugs.php';
+include_once 'pear-database-user.php';
+
+$bugs = new PEAR_Bugs();
$site = new Damblan_URL();
+$karma = new Damblan_Karma($dbh);
$params = array('handle' => '', 'action' => '');
$site->getElements($params);
@@ -37,7 +42,8 @@
$dbh->setFetchmode(DB_FETCHMODE_ASSOC);
-include_once 'pear-database-user.php';
+
+$permissions = $karma->get($handle);
$row = user::info($handle);
if ($row === null) {
@@ -63,6 +69,9 @@
}
+
+
+
$extraHeaders = '<link rel="alternate"
href="/map/locationREST.php?handle=' . $handle . '"
type="application/rdf+xml" title="FOAF" />';
$extraHeaders .= '<link rel="alternate" href="/feeds/user_' . $handle .
'.rss" type="application/rdf+xml" title="Packages involving this user"
/>';
@@ -185,13 +194,12 @@
echo '</li>' . "\n";
}
-$karma =& new Damblan_Karma($dbh);
+
if ($karma->has($handle, 'pear.dev')) {
echo ' <li>Bug Statistics: <br />' . "\n";
echo ' <ul>' . "\n";
- require 'bugs/pear-bugs.php';
- $bugs = new PEAR_Bugs;
+
$info = $bugs->developerBugStats($handle);
echo ' <li>Rank: <strong><a
href="/bugs/stats_dev.php">#' . $info['rank'] . ' of ' .
count($info['rankings']) . '</a></strong> developers who have fixed bugs
<strong>(' .
$info['alltime'] . ' fixed bugs)</strong></li>' .
"\n";
@@ -226,7 +234,7 @@
<tr>
<th class="headrow" style="width: 50%">» Maintains These
Packages</th>
- <th class="headrow" style="width: 50%">» Notes Regarding
User</th>
+ <th class="headrow" style="width: 50%">Karma and History</th>
</tr>
<tr>
<td valign="top">
@@ -253,8 +261,17 @@
</ul>
</td>
<td valign="top">
+<?php if (!empty($permissions)) { ?>
+ <h4>Current Karma</h4>
+ <ul>
+ <?php foreach ($permissions as $permission) { ?>
+ <li><?php print $permission['level']; ?> by <?php print
$permission['granted_by']; ?><br /><span style="opacity:
0.3"><?php print substr($permission['granted_at'], 0, 10);
?></span></li>
+ <?php } ?>
+ </ul>
+<?php } ?>
+<h4>History and notes</h4>
<?php
-if (count($notes) == 0) {
+if (empty($notes)) {
echo '<p>There are no notes for this user.</p>';
}
?>
@@ -279,4 +296,4 @@
</table>
<?php
-response_footer();
\ No newline at end of file
+response_footer();