load list of voters in-place with ajax
This commit is contained in:
parent
48e40a6712
commit
bc253eef04
@ -52,14 +52,15 @@ class NumericScore extends Extension {
|
||||
$x = $database->get_all(
|
||||
"SELECT users.name as username, user_id, score
|
||||
FROM numeric_score_votes
|
||||
ORDER BY score
|
||||
JOIN users ON numeric_score_votes.user_id=users.id
|
||||
WHERE image_id=?",
|
||||
array($image_id));
|
||||
$html = "<table>";
|
||||
$html = "<table style='width: 100%;'>";
|
||||
foreach($x as $vote) {
|
||||
$html .= "<tr><td>";
|
||||
$html .= "<a href='".make_link("user/{$vote['username']}")."'>{$vote['username']}</a>";
|
||||
$html .= "</td><td>";
|
||||
$html .= "</td><td width='10'>";
|
||||
$html .= $vote['score'];
|
||||
$html .= "</td></tr>";
|
||||
}
|
||||
|
@ -38,7 +38,12 @@ class NumericScoreTheme extends Themelet {
|
||||
<input type='submit' value='Remove All Votes'>
|
||||
</form>
|
||||
|
||||
<br><a href='".make_link("numeric_score_votes/$i_image_id")."'>See All Votes</a>
|
||||
<br><div id='votes-content'>
|
||||
<a
|
||||
href='".make_link("numeric_score_votes/$i_image_id")."'
|
||||
onclick='$(\"#votes-content\").load(\"".make_link("numeric_score_votes/$i_image_id")."\"); return false;'
|
||||
>See All Votes</a>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
return $html;
|
||||
|
Loading…
x
Reference in New Issue
Block a user