Add option to delete MGR posters

This commit is contained in:
DariusIII
2017-01-09 12:00:41 +01:00
parent 13225a2f84
commit 8e1c7397fd
3 changed files with 40 additions and 0 deletions
+16
View File
@@ -318,6 +318,8 @@ class ReleasesMultiGroup
}
/**
* Add multi group posters to database
*
* @param $poster
*/
public function addPoster($poster)
@@ -326,6 +328,8 @@ class ReleasesMultiGroup
}
/**
* Update multi group poster
*
* @param $id
* @param $poster
*/
@@ -335,6 +339,18 @@ class ReleasesMultiGroup
}
/**
* Delete multi group posters from database
*
* @param $id
*/
public function deletePoster($id)
{
$this->pdo->queryExec(sprintf('DELETE * FROM mgr_posters WHERE id = %d', $id));
}
/**
* Fetch all multi group posters from database
*
* @return array|bool
*/
public function getAllPosters()
+19
View File
@@ -0,0 +1,19 @@
<?php
require_once './config.php';
use nntmux\ReleasesMultiGroup;
$page = new AdminPage();
if (isset($_GET['id']))
{
$forum = new ReleasesMultiGroup();
$forum->deletePoster($_GET['id']);
}
if (isset($_GET['from']))
$referrer = $_GET['from'];
else
$referrer = $_SERVER['HTTP_REFERER'];
header("Location: " . $referrer);
@@ -13,6 +13,11 @@
<td>
<a href="{$smarty.const.WWW_TOP}/posters-edit.php?id={$poster.id}&poster={$poster.poster}">{$poster.poster}</a>
</td>
<td>
<a class="confirm_action btn btn-sm btn-danger"
href="{$smarty.const.WWW_TOP}/admin/poster_delete?id={$poster.id} from={$smarty.server.REQUEST_URI|escape:"url"}"
title="Delete Topic">Delete Topic</a>
</td>
</tr>
{/foreach}
</table>