forked from Pluxopolis/plxMySearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
executable file
·39 lines (35 loc) · 1.21 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php if(!defined('PLX_ROOT')) exit; ?>
<?php
$filename = PLX_ROOT.PLX_CONFIG_PATH.'plugins/plxMySearch.data.php';
if(isset($_GET['action']) AND $_GET['action']=='resetsearchstats') {
if(isset($_GET['key']) AND $_GET['key']==$plxAdmin->aConf['clef']) {
if(file_exists($filename))
unlink($filename);
}
header('Location: plugin.php?p=plxMySearch');
exit;
}
$data=array();
if($fileexists=file_exists($filename)) {
$data = explode("\n", file_get_contents($filename));
}
?>
<?php
echo '<p class="in-action-bar">'.$plxPlugin->getLang('L_DATA_LIST').'</p>';
if(sizeof($data)>0) {
$array = array_count_values($data);
arsort($array);
echo "<table>";
echo '<thead><tr><th>'.$plxPlugin->getLang('L_TABLE_WORD').'</th><th>'.$plxPlugin->getLang('L_TABLE_WORD_COUNT').'</th></tr></thead>';
echo '<tbody>';
foreach($array as $key=>$value) {
echo '<tr><td>'.$key.'</td><td>'.$value.'</td></tr>';
}
echo '</tbody>';
echo "</table>";
} else {
echo '<p>'.$plxPlugin->getLang('L_NO_DATA').'.</p>';
}
if($fileexists)
echo '<p><a href="plugin.php?p=plxMySearch&action=resetsearchstats&key='.$plxAdmin->aConf['clef'].'">'.$plxPlugin->getLang('L_RESET_STATS').'</a></p>';
?>