2009-12-24 07:36:09 +00:00
|
|
|
<?php
|
|
|
|
class PoolsTheme extends Themelet {
|
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE ADD THE POOL INFO ON IMAGE
|
|
|
|
*/
|
|
|
|
public function pool_info($linksPools) {
|
2009-12-26 00:56:53 +00:00
|
|
|
global $page;
|
2009-12-30 07:07:10 +00:00
|
|
|
if(count($linksPools) > 0) {
|
|
|
|
$page->add_block(new Block("Pools", implode("<br>", $linksPools), "left"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_adder_html(Image $image, $pools) {
|
|
|
|
$editor = "";
|
|
|
|
$h = "";
|
|
|
|
foreach($pools as $pool) {
|
|
|
|
$h .= "<option value='".$pool['id']."'>".html_escape($pool['title'])."</option>";
|
|
|
|
}
|
|
|
|
$editor = "
|
|
|
|
<form method='POST' action='".make_link("pool/add_post")."'>
|
|
|
|
<select name='pool_id'>
|
|
|
|
$h
|
|
|
|
</select>
|
|
|
|
<input type='hidden' name='image_id' value='{$image->id}'>
|
|
|
|
<input type='submit' value='Add Image to Pool'>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
return $editor;
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE SHOWS THE LIST OF POOLS
|
|
|
|
*/
|
|
|
|
public function list_pools(Page $page, $pools, $pageNumber, $totalPages) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $user;
|
|
|
|
$html = '<table id="poolsList" class="zebra">'.
|
|
|
|
"<thead><tr>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<th>Name</th>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<th>Creator</th>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<th>Posts</th>".
|
2009-12-30 07:07:10 +00:00
|
|
|
"<th>Public</th>".
|
|
|
|
"</tr></thead>";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$n = 0;
|
2009-12-26 00:31:02 +00:00
|
|
|
foreach($pools as $pool) {
|
|
|
|
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
|
|
|
|
2009-12-26 00:56:53 +00:00
|
|
|
$pool_link = '<a href="'.make_link("pool/view/".$pool['id']).'">'.html_escape($pool['title'])."</a>";
|
|
|
|
$user_link = '<a href="'.make_link("user/".url_escape($pool['user_name'])).'">'.html_escape($pool['user_name'])."</a>";
|
2009-12-26 00:31:02 +00:00
|
|
|
$public = ($pool['public'] == "Y" ? "Yes" : "No");
|
|
|
|
|
|
|
|
$html .= "<tr class='$oe'>".
|
|
|
|
"<td class='left'>".$pool_link."</td>".
|
|
|
|
"<td>".$user_link."</td>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<td>".$pool['posts']."</td>".
|
2009-12-30 07:07:10 +00:00
|
|
|
"<td>".$public."</td>".
|
|
|
|
"</tr>";
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$html .= "</tbody></table>";
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
|
|
|
|
$nav_html = "
|
|
|
|
<a href=".make_link().">Index</a>
|
|
|
|
<br><a href=".make_link("pool/new").">Create Pool</a>
|
|
|
|
<br><a href=".make_link("pool/updated").">Pool Changes</a>
|
|
|
|
";
|
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$blockTitle = "Pools";
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->set_title(html_escape($blockTitle));
|
|
|
|
$page->set_heading(html_escape($blockTitle));
|
2009-12-26 00:31:02 +00:00
|
|
|
$page->add_block(new Block($blockTitle, $html, "main", 10));
|
2009-12-30 07:07:10 +00:00
|
|
|
$page->add_block(new Block("Navigation", $nav_html, "left", 10));
|
2009-12-24 07:36:09 +00:00
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$this->display_paginator($page, "pool/list", null, $pageNumber, $totalPages);
|
|
|
|
}
|
2009-12-24 07:36:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE NEW POOL COMPOSER
|
|
|
|
*/
|
|
|
|
public function new_pool_composer(Page $page) {
|
2009-12-30 07:07:10 +00:00
|
|
|
$create_html = "<form action=".make_link("pool/create")." method='POST'>
|
2009-12-26 00:31:02 +00:00
|
|
|
<table>
|
|
|
|
<tr><td>Title:</td><td><input type='text' name='title'></td></tr>
|
|
|
|
<tr><td>Public?</td><td><input name='public' type='checkbox' value='Y' checked='checked'/></td></tr>
|
|
|
|
<tr><td>Description:</td><td><textarea name='description'></textarea></td></tr>
|
|
|
|
<tr><td colspan='2'><input type='submit' value='Submit' /></td></tr>
|
|
|
|
</table>
|
2009-12-30 07:07:10 +00:00
|
|
|
";
|
2009-12-24 07:36:09 +00:00
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$blockTitle = "Create Pool";
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->set_title(html_escape($blockTitle));
|
|
|
|
$page->set_heading(html_escape($blockTitle));
|
2009-12-30 07:07:10 +00:00
|
|
|
$page->add_block(new Block("Create Pool", $create_html, "main", 20));
|
2009-12-26 00:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
private function display_top($pools, $heading, $check_all=false) {
|
|
|
|
global $page, $user;
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
$page->set_title($heading);
|
|
|
|
$page->set_heading($heading);
|
2009-12-30 07:07:10 +00:00
|
|
|
if(count($pools) == 1) {
|
|
|
|
$pool = $pools[0];
|
|
|
|
if($pool['public'] == "Y" || $user->is_admin()) {// IF THE POOL IS PUBLIC OR IS ADMIN SHOW EDIT PANEL
|
|
|
|
if(!$user->is_anonymous()) {// IF THE USER IS REGISTERED AND LOGGED IN SHOW EDIT PANEL
|
|
|
|
$this->sidebar_options($page, $pool, $check_all);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$page->add_block(new Block(html_escape($pool['title']), html_escape($pool['description']), "main", 10));
|
|
|
|
}
|
|
|
|
else {
|
2009-12-26 00:31:02 +00:00
|
|
|
$pool_info = "<table id='poolsList' class='zebra'>".
|
|
|
|
"<thead><tr>".
|
|
|
|
"<th class='left'>Title</th>".
|
|
|
|
"<th class='left'>Description</th>".
|
|
|
|
"</tr></thead>";
|
|
|
|
|
|
|
|
$n = 0;
|
|
|
|
foreach($pools as $pool) {
|
|
|
|
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
|
|
|
|
|
|
|
$pool_info .= "<tr class='$oe'>".
|
|
|
|
"<td class='left'>".html_escape($pool['title'])."</td>".
|
|
|
|
"<td class='left'>".html_escape($pool['description'])."</td>".
|
|
|
|
"</tr>";
|
|
|
|
|
|
|
|
// this will make disasters if more than one pool comes in the parameter
|
|
|
|
if($pool['public'] == "Y" || $user->is_admin()) {// IF THE POOL IS PUBLIC OR IS ADMIN SHOW EDIT PANEL
|
|
|
|
if(!$user->is_anonymous()) {// IF THE USER IS REGISTERED AND LOGGED IN SHOW EDIT PANEL
|
2009-12-30 07:07:10 +00:00
|
|
|
$this->sidebar_options($page, $pool, $check_all);
|
2009-12-26 00:31:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$pool_info .= "</tbody></table>";
|
|
|
|
$page->add_block(new Block($heading, $pool_info, "main", 10));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE POOL WITH TITLE DESCRIPTION AND IMAGES WITH PAGINATION
|
|
|
|
*/
|
|
|
|
public function view_pool($pools, $images, $pageNumber, $totalPages) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $user, $page;
|
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$this->display_top($pools, "Viewing Pool");
|
2009-12-24 07:36:09 +00:00
|
|
|
|
|
|
|
$pool_images = '';
|
2009-12-30 07:07:10 +00:00
|
|
|
foreach($images as $image) {
|
2009-12-24 07:36:09 +00:00
|
|
|
$thumb_html = $this->build_thumb_html($image);
|
|
|
|
$pool_images .= '<span class="thumb">'.
|
2009-12-26 00:31:02 +00:00
|
|
|
'<a href="$image_link">'.$thumb_html.'</a>'.
|
|
|
|
'</span>';
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->add_block(new Block("Viewing Posts", $pool_images, "main", 30));
|
2009-12-30 07:07:10 +00:00
|
|
|
$this->display_paginator($page, "pool/view/".$pools[0]['id'], null, $pageNumber, $totalPages);
|
2009-12-26 00:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE POOL OPTIONS ON SIDEBAR BUT WE HIDE REMOVE OPTION IF THE USER IS NOT THE OWNER OR ADMIN
|
|
|
|
*/
|
2009-12-30 07:07:10 +00:00
|
|
|
public function sidebar_options(Page $page, $pool, $check_all) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $user;
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$editor = " <form action='".make_link("pool/import")."' method='POST'>
|
2009-12-26 00:31:02 +00:00
|
|
|
<input type='text' name='pool_tag' id='edit' value='Please enter a tag' onclick='this.value=\"\";'/>
|
|
|
|
<input type='submit' name='edit' id='edit' value='Import'/>
|
|
|
|
<input type='hidden' name='pool_id' value='".$pool['id']."'>
|
|
|
|
</form>
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
<form method='GET' action='".make_link("pool/edit/".$pool['id'])."'>
|
2009-12-26 00:31:02 +00:00
|
|
|
<input type='submit' name='edit' id='edit' value='Edit Pool'/>
|
|
|
|
</form>
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
<form method='GET' action='".make_link("pool/order/".$pool['id'])."'>
|
2009-12-26 00:31:02 +00:00
|
|
|
<input type='submit' name='edit' id='edit' value='Order Pool'/>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
if($user->id == $pool['user_id'] || $user->is_admin()){
|
|
|
|
$editor .= "
|
2009-12-26 00:31:02 +00:00
|
|
|
<script type='text/javascript'>
|
|
|
|
function confirm_action() {
|
|
|
|
return confirm('Are you sure that you want to delete this pool?');
|
|
|
|
}
|
2009-12-30 07:07:10 +00:00
|
|
|
</script>
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
<form action='".make_link("pool/nuke")."' method='POST'>
|
2009-12-26 00:31:02 +00:00
|
|
|
<input type='submit' name='delete' id='delete' value='Delete Pool' onclick='return confirm_action()' />
|
|
|
|
<input type='hidden' name='pool_id' value='".$pool['id']."'>
|
|
|
|
</form>
|
|
|
|
";
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
2009-12-30 07:07:10 +00:00
|
|
|
|
|
|
|
if($check_all) {
|
|
|
|
$editor .= "
|
|
|
|
<script language='JavaScript' type='text/javascript'>
|
|
|
|
function setAll(value) {
|
|
|
|
var a=new Array();
|
|
|
|
a=document.getElementsByName('check[]');
|
|
|
|
var p=0;
|
|
|
|
for(i=0;i<a.length;i++){
|
|
|
|
a[i].checked = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<br><input type='button' name='CheckAll' value='Check All' onClick='setAll(true)'>
|
|
|
|
<input type='button' name='UnCheckAll' value='Uncheck All' onClick='setAll(false)'>
|
|
|
|
";
|
|
|
|
}
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->add_block(new Block("Manage Pool", $editor, "left", 10));
|
|
|
|
}
|
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* HERE WE DISPLAY THE RESULT OF THE SEARCH ON IMPORT
|
|
|
|
*/
|
|
|
|
public function pool_result(Page $page, $images, $pool_id) {
|
2009-12-24 07:36:09 +00:00
|
|
|
$pool_images = "
|
2009-12-26 00:31:02 +00:00
|
|
|
<script language='JavaScript' type='text/javascript'>
|
|
|
|
function setAll(value) {
|
|
|
|
var a=new Array();
|
|
|
|
a=document.getElementsByName('check[]');
|
|
|
|
var p=0;
|
|
|
|
for(i=0;i<a.length;i++) {
|
|
|
|
a[i].checked = value;
|
|
|
|
}
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
function confirm_action() {
|
|
|
|
return confirm('Are you sure you want to add selected posts to this pool?');
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
</script>
|
2009-12-24 07:36:09 +00:00
|
|
|
";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$pool_images .= "<form action='".make_link("pool/add_posts")."' method='POST' name='checks'>";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
foreach($images as $image) {
|
2009-12-26 00:31:02 +00:00
|
|
|
$thumb_html = $this->build_thumb_html($image);
|
|
|
|
|
|
|
|
$pool_images .= '<span class="thumb">'.
|
|
|
|
'<a href="$image_link">'.$thumb_html.'</a>'.
|
|
|
|
'<br>'.
|
|
|
|
'<input name="check[]" type="checkbox" value="'.$image->id.'" />'.
|
|
|
|
'</span>';
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
|
|
|
$pool_images .= "<br>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<input type='submit' name='edit' id='edit' value='Add Selected' onclick='return confirm_action()'/>".
|
|
|
|
"<input type='hidden' name='pool_id' value='".$pool_id."'>".
|
|
|
|
"</form>";
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->add_block(new Block("Import", $pool_images, "main", 10));
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
$editor = "
|
|
|
|
<input type='button' name='CheckAll' value='Check All' onClick='setAll(true)'>
|
|
|
|
<input type='button' name='UnCheckAll' value='Uncheck All' onClick='setAll(false)'>
|
|
|
|
";
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->add_block(new Block("Manage Pool", $editor, "left", 10));
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE POOL ORDERER
|
|
|
|
* WE LIST ALL IMAGES ON POOL WITHOUT PAGINATION AND WITH A TEXT INPUT TO SET A NUMBER AND CHANGE THE ORDER
|
|
|
|
*/
|
|
|
|
public function edit_order(Page $page, $pools, $images) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $user;
|
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$this->display_top($pools, "Sorting Pool");
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
$pool_images = "<form action='".make_link("pool/order")."' method='POST' name='checks'>";
|
2009-12-24 07:36:09 +00:00
|
|
|
$n = 0;
|
|
|
|
foreach($images as $pair) {
|
|
|
|
$image = $pair[0];
|
|
|
|
$thumb_html = $this->build_thumb_html($image);
|
|
|
|
$pool_images .= '<span class="thumb">'.
|
2009-12-26 00:31:02 +00:00
|
|
|
'<a href="$image_link">'.$thumb_html.'</a>'.
|
|
|
|
'<br><input name="imgs['.$n.'][]" type="text" style="max-width:50px;" value="'.$image->image_order.'" />'.
|
|
|
|
'<input name="imgs['.$n.'][]" type="hidden" value="'.$image->id.'" />'.
|
|
|
|
'</span>';
|
|
|
|
$n++;
|
2009-12-24 07:36:09 +00:00
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
$pool_images .= "<br>".
|
|
|
|
"<input type='submit' name='edit' id='edit' value='Order'/>".
|
2009-12-30 07:07:10 +00:00
|
|
|
"<input type='hidden' name='pool_id' value='".$pools[0]['id']."'>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"</form>";
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->add_block(new Block("Sorting Posts", $pool_images, "main", 30));
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE POOL EDITOR
|
2009-12-30 07:07:10 +00:00
|
|
|
* WE LIST ALL IMAGES ON POOL WITHOUT PAGINATION AND WITH
|
|
|
|
* A CHECKBOX TO SELECT WHICH IMAGE WE WANT TO REMOVE
|
2009-12-26 00:31:02 +00:00
|
|
|
*/
|
|
|
|
public function edit_pool(Page $page, $pools, $images) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $user;
|
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
$this->display_top($pools, "Editing Pool", true);
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$pool_images = "
|
|
|
|
";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-30 07:07:10 +00:00
|
|
|
$pool_images = "<form action='".make_link("pool/remove_posts")."' method='POST' name='checks'>";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
foreach($images as $pair) {
|
|
|
|
$image = $pair[0];
|
|
|
|
|
|
|
|
$thumb_html = $this->build_thumb_html($image);
|
|
|
|
|
|
|
|
$pool_images .= '<span class="thumb">'.
|
2009-12-26 00:31:02 +00:00
|
|
|
'<a href="$image_link">'.$thumb_html.'</a>'.
|
|
|
|
'<br><input name="check[]" type="checkbox" value="'.$image->id.'" />'.
|
|
|
|
'</span>';
|
|
|
|
}
|
2009-12-24 07:36:09 +00:00
|
|
|
|
2009-12-26 00:31:02 +00:00
|
|
|
$pool_images .= "<br>".
|
|
|
|
"<input type='submit' name='edit' id='edit' value='Remove Selected'/>".
|
2009-12-26 00:56:53 +00:00
|
|
|
"<input type='hidden' name='pool_id' value='".$pools[0]['id']."'>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"</form>";
|
2009-12-24 07:36:09 +00:00
|
|
|
|
|
|
|
$page->add_block(new Block("Editing Posts", $pool_images, "main", 30));
|
2009-12-26 00:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE HISTORY LIST
|
|
|
|
*/
|
|
|
|
public function show_history($histories, $pageNumber, $totalPages) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $page;
|
|
|
|
$html = "<table id='poolsList' class='zebra'>".
|
|
|
|
"<thead><tr>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<th>Pool</th>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<th>Post Count</th>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<th>Changes</th>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<th>Updater</th>".
|
|
|
|
"<th>Date</th>".
|
|
|
|
"<th>Action</th>".
|
|
|
|
"</tr></thead>";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$n = 0;
|
2009-12-26 00:31:02 +00:00
|
|
|
foreach($histories as $history) {
|
|
|
|
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
|
|
|
|
|
|
|
$pool_link = "<a href='".make_link("pool/view/".$history['pool_id'])."'>".html_escape($history['title'])."</a>";
|
|
|
|
$user_link = "<a href='".make_link("user/".url_escape($history['user_name']))."'>".html_escape($history['user_name'])."</a>";
|
|
|
|
$revert_link = "<a href='".make_link("pool/revert/".$history['id'])."'>Revert</a>";
|
|
|
|
|
|
|
|
if ($history['action'] == 1) {
|
|
|
|
$prefix = "+";
|
|
|
|
} elseif ($history['action'] == 0) {
|
|
|
|
$prefix = "-";
|
|
|
|
}
|
|
|
|
|
|
|
|
$images = trim($history['images']);
|
|
|
|
$images = explode(" ", $images);
|
|
|
|
|
|
|
|
$image_link = "";
|
|
|
|
foreach ($images as $image) {
|
|
|
|
$image_link .= "<a href='".make_link("post/view/".$image)."'>".$prefix.$image." </a>";
|
|
|
|
}
|
|
|
|
|
|
|
|
$html .= "<tr class='$oe'>".
|
|
|
|
"<td class='left'>".$pool_link."</td>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<td>".$history['count']."</td>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<td>".$image_link."</td>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<td>".$user_link."</td>".
|
2009-12-26 00:31:02 +00:00
|
|
|
"<td>".$history['date']."</td>".
|
2009-12-24 07:36:09 +00:00
|
|
|
"<td>".$revert_link."</td>".
|
|
|
|
"</tr>";
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$html .= "</tbody></table>";
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->set_title("Recent Changes");
|
|
|
|
$page->set_heading("Recent Changes");
|
|
|
|
$page->add_block(new Block("Recent Changes", $html, "main", 10));
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$this->display_paginator($page, "pool/updated", null, $pageNumber, $totalPages);
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
|
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
/*
|
2009-12-26 00:31:02 +00:00
|
|
|
* HERE WE DISPLAY THE ERROR
|
|
|
|
*/
|
|
|
|
public function display_error($errMessage) {
|
2009-12-24 07:36:09 +00:00
|
|
|
global $page;
|
2009-12-26 00:31:02 +00:00
|
|
|
|
2009-12-24 07:36:09 +00:00
|
|
|
$page->set_title("Error");
|
|
|
|
$page->set_heading("Error");
|
|
|
|
$page->add_block(new Block("Error", $errMessage, "main", 10));
|
|
|
|
}
|
|
|
|
}
|
2009-12-26 00:31:02 +00:00
|
|
|
?>
|