mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* check if plugin exist before uninstalling
* fixed some bug when you uninstall and then try to install again on the same page * moved some characters.frags code to twig template
This commit is contained in:
parent
005356ebb3
commit
6c3439acf9
@ -40,7 +40,12 @@ function deleteDirectory($dir) {
|
||||
if(isset($_REQUEST['uninstall'])){
|
||||
$uninstall = $_REQUEST['uninstall'];
|
||||
|
||||
$string = file_get_contents(BASE . 'plugins/' . $uninstall . '.json');
|
||||
$filename = BASE . 'plugins/' . $uninstall . '.json';
|
||||
if(!file_exists($filename)) {
|
||||
error('Plugin ' . $uninstall . ' does not exist.');
|
||||
}
|
||||
else {
|
||||
$string = file_get_contents($filename);
|
||||
$plugin_info = json_decode($string, true);
|
||||
if($plugin_info == false) {
|
||||
warning('Cannot load plugin info ' . $uninstall . '.json');
|
||||
@ -62,6 +67,7 @@ if(isset($_REQUEST['uninstall'])){
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(isset($_FILES["plugin"]["name"]))
|
||||
{
|
||||
$file = $_FILES["plugin"];
|
||||
|
@ -335,8 +335,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
foreach($player_frags as $frag)
|
||||
{
|
||||
$description = 'Fragged <a href="' . getPlayerLink($frag[name], false) . '">' . $frag[name] . '</a> at level ' . $frag[level];
|
||||
$description .= '. ('.(($frag['unjustified'] == 0) ? '<font size="1" color="green">Justified</font>' : '<font size="1" color="red">Unjustified</font>').')';
|
||||
$frags[] = array('time' => $frag['date'], 'description' => $description);
|
||||
$frags[] = array('time' => $frag['date'], 'description' => $description, 'unjustified' => $frag['unjustified'] != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
||||
<input type="hidden" name="upload_plugin" />
|
||||
<table cellspacing="3" border="0">
|
||||
<tr>
|
||||
|
@ -242,7 +242,7 @@
|
||||
{% for frag in frags %}
|
||||
<tr bgcolor="'{{ getStyle(i) }}">
|
||||
<td width="20%" align="center">{{ frag.time|date("j M Y, H:i") }}</td>
|
||||
<td>{{ frag.description }}</td>
|
||||
<td>{{ frag.description }}({% if frag.unjustified %}<font size="1" color="red">Unjustified</font>{% else %}<font size="1" color="green">Justified</font>{% endif %})</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
Loading…
x
Reference in New Issue
Block a user