Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
57972532
Commit
57972532
authored
Jul 19, 2009
by
Loui Chang
Browse files
Add voter list on packages for TUs and devs.
Signed-off-by:
Loui Chang
<
louipc.ist@gmail.com
>
parent
316f4b99
Changes
2
Hide whitespace changes
Inline
Side-by-side
web/html/voters.php
0 → 100644
View file @
57972532
<?php
set_include_path
(
get_include_path
()
.
PATH_SEPARATOR
.
'../lib'
);
include
(
'aur.inc'
);
include
(
'pkgfuncs.inc'
);
function
getvotes
(
$pkgid
)
{
$dbh
=
db_connect
();
$pkgid
=
mysql_real_escape_string
(
$pkgid
);
$result
=
db_query
(
"SELECT UsersID,Username FROM PackageVotes LEFT JOIN Users on (UsersID = ID) WHERE PackageID =
$pkgid
ORDER BY Username"
,
$dbh
);
return
$result
;
}
$SID
=
$_COOKIE
[
'AURSID'
];
$pkgid
=
$_GET
[
'ID'
];
$votes
=
getvotes
(
$pkgid
);
$account
=
account_from_sid
(
$SID
);
if
(
$account
==
'Trusted User'
||
$account
==
'Developer'
)
{
?>
<html>
<body>
<h3>
<?php
echo
account_from_sid
(
$SID
)
?>
</h3>
<h2>
Votes for
<a
href=
"packages.php?ID=
<?php
echo
$pkgid
?>
"
>
<?php
echo
pkgname_from_id
(
$pkgid
)
?>
</a></h2>
<?php
while
(
$row
=
mysql_fetch_assoc
(
$votes
))
{
$uid
=
$row
[
'UsersID'
];
$username
=
$row
[
'Username'
];
?>
<a
href=
"account.php?Action=AccountInfo&ID=
<?php
echo
$uid
?>
"
>
<?php
echo
$username
?>
</a><br
/>
<?php
}
?>
</body>
</html>
<?php
}
web/template/pkg_details.php
View file @
57972532
<?php
$pkgid
=
intval
(
$_REQUEST
[
'ID'
]);
if
(
$row
[
"Location"
]
==
"unsupported"
and
(
$uid
==
$row
[
"MaintainerUID"
]
or
(
$atype
==
"Developer"
or
$atype
==
"Trusted User"
)))
{
$edit_cat
=
"<a href='pkgedit.php?change_Category=1&ID="
;
$edit_cat
.
=
intval
(
$_REQUEST
[
"ID"
])
.
"'>"
.
$row
[
"Category"
]
.
"</a>"
;
$edit_cat
.
=
$pkgid
.
"'>"
.
$row
[
"Category"
]
.
"</a>"
;
$edit_cat
.
=
" <span class='fix'>("
;
$edit_cat
.
=
__
(
"change category"
)
.
")</span>"
;
}
...
...
@@ -21,6 +23,11 @@ if ($row["MaintainerUID"]) {
$maintainer
=
"None"
;
}
$votes
=
__
(
'Votes'
)
.
': '
.
$row
[
'NumVotes'
];
if
(
$atype
==
"Developer"
or
$atype
==
"Trusted User"
)
{
$votes
=
"<a href=
\"
voters.php?ID=
$pkgid
\"
>
$votes
</a>"
;
}
# In case of wanting to put a custom message
$msg
=
__
(
'unknown'
);
$license
=
empty
(
$row
[
'License'
])
?
$msg
:
$row
[
'License'
];
...
...
@@ -43,7 +50,11 @@ $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval(
<p>
<span class='f3'>
<?php
echo
$row
[
'Location'
]
.
' :: '
.
$edit_cat
?>
</span><br />
<span class='f3'>
<?php
echo
__
(
'Maintainer'
)
.
': '
.
$maintainer
?>
</span><br />
<span class='f3'>
<?php
echo
__
(
'Votes'
)
.
': '
.
$row
[
'NumVotes'
]
?>
</span>
<span class='f3'>
<?php
echo
$votes
?>
</span>
<?php
if
(
$atype
==
"Developer"
or
$atype
==
"Trusted User"
)
{
?>
<a href="
voters.php
?
ID=
<?php
echo
intval
(
$_REQUEST
[
'ID'
])
?>
"></a>
<?php
}
?>
</p>
<p><span class='f3'>
<?php
echo
__
(
'License'
)
.
': '
.
$license
?>
</span></p>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment