2007-10-02 21:59:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RatingsTheme extends Themelet {
|
2008-03-24 04:03:34 +00:00
|
|
|
public function get_rater_html($image_id, $rating) {
|
2007-10-02 21:59:20 +00:00
|
|
|
$i_image_id = int_escape($image_id);
|
2007-10-02 22:29:32 +00:00
|
|
|
$s_checked = $rating == 's' ? " checked" : "";
|
|
|
|
$q_checked = $rating == 'q' ? " checked" : "";
|
|
|
|
$e_checked = $rating == 'e' ? " checked" : "";
|
2007-10-02 21:59:20 +00:00
|
|
|
$html = "
|
2008-04-08 16:54:13 +00:00
|
|
|
<tr>
|
|
|
|
<td>Rating</td>
|
|
|
|
<td>
|
|
|
|
<input type='radio' name='rating' value='s' id='s'$s_checked><label for='s'>Safe</label>
|
|
|
|
<input type='radio' name='rating' value='q' id='q'$q_checked><label for='q'>Questionable</label>
|
|
|
|
<input type='radio' name='rating' value='e' id='e'$e_checked><label for='e'>Explicit</label>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2007-10-02 21:59:20 +00:00
|
|
|
";
|
2008-03-24 04:03:34 +00:00
|
|
|
return $html;
|
2007-10-02 21:59:20 +00:00
|
|
|
}
|
2007-11-04 08:16:41 +00:00
|
|
|
|
2009-08-02 08:19:43 +01:00
|
|
|
public function display_bulk_rater() {
|
|
|
|
global $page;
|
|
|
|
$html = "
|
2010-09-22 12:56:19 +01:00
|
|
|
".make_form(make_link("admin/bulk_rate"))."
|
2009-08-02 08:19:43 +01:00
|
|
|
<table style='width: 300px'>
|
|
|
|
<tr>
|
|
|
|
<td>Search</td>
|
|
|
|
<td>
|
|
|
|
<input type='text' name='query'>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Rating</td>
|
|
|
|
<td>
|
|
|
|
<select name='rating'>
|
|
|
|
<option value='s'>Safe</option>
|
|
|
|
<option value='q'>Questionable</option>
|
|
|
|
<option value='e'>Explicit</option>
|
|
|
|
<option value='u'>Unrated</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan='2'><input type='submit' value='Go'></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
$page->add_block(new Block("Bulk Rating", $html));
|
|
|
|
}
|
|
|
|
|
2007-11-04 08:16:41 +00:00
|
|
|
public function rating_to_name($rating) {
|
|
|
|
switch($rating) {
|
|
|
|
case 's': return "Safe";
|
|
|
|
case 'q': return "Questionable";
|
|
|
|
case 'e': return "Explicit";
|
|
|
|
default: return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
2007-10-02 21:59:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|