-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathviewarchives.php
More file actions
96 lines (86 loc) · 3.91 KB
/
Copy pathviewarchives.php
File metadata and controls
96 lines (86 loc) · 3.91 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
// $Id: viewarchives.php, see below
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
// Créé par Niluge_Kiwi
// v 0.23 2007/10/12 22:38:22
// ======================================================================== //
//
// www.lmdmf.net
//
// kiwiiii@gmail.com
//
// ======================================================================== //
//
include "./header.php";
include XOOPS_ROOT_PATH.'/header.php';
$from = !empty($_GET['from']) ? intval($_GET['from']) : 0;
$to = isset($_GET['to']) ? intval($_GET['to']) : 0;
$purge_folder = rtrim (ltrim(getmoduleoptionNK('purge_folder'), '/'), '/');
$rep = empty($purge_folder) ? XOOPS_ROOT_PATH.'/modules/aChat/logs' : XOOPS_ROOT_PATH.'/'.$purge_folder;
function archives_home($rep)
{
echo '<div style="text-align:center;">
<h1>'._MD_ACHAT_TITLE.'</h2>
<h3>'._MD_ACHAT_TITLE_ARCHIVES.'</h3>
</div><br />';
$rep = opendir($rep);
$AuMoinsUnLog = false;
echo '<ul>';
while ($file = readdir($rep)){
if($file != '..' && $file !='.' && $file !=''){
if (!is_dir($file) && preg_match('/aChat_logs\_\-\_([0-9]*)\_to\_([0-9]*)\.html/',$file, $results)){
$AuMoinsUnLog = true;
echo '<li><a href="'.XOOPS_URL.'/modules/aChat/viewarchives.php?from='.$results[1].'&to='.$results[2].'">'._MD_ACHAT_MESSAGES .' '. _MD_ACHAT_ARCHIVE_FROM .' '.formatTimestamp($results[1]).' '. _MD_ACHAT_ARCHIVE_TO .' '.formatTimestamp($results[2]).'</a></li>';
}
}
}
if(!$AuMoinsUnLog) {
echo '<li>'._MD_ACHAT_ARCHIVE_NO.'</li>';
}
echo '<ul>';
}
function archive_read($from, $to, $rep)
{
$file = 'aChat_logs_-_'. $from .'_to_'. $to .'.html';
$filename = $rep.'/'.$file;
echo '<a href="'.XOOPS_URL.'/modules/aChat/viewarchives.php">'. _MD_ACHAT_ARCHIVE_RETURN . '</a><hr /><br />';
if(file_exists($filename)) {
include($filename);
} else {
echo _MD_ACHAT_ARCHIVE_NOARCHIVESELECTED;
}
echo '<br /><hr /><a href="'.XOOPS_URL.'/modules/aChat/viewarchives.php">'. _MD_ACHAT_ARCHIVE_RETURN . '</a>';
}
switch($from) {
case 0 :
archives_home($rep);
break;
default :
archive_read($from, $to, $rep);
break;
}
include(XOOPS_ROOT_PATH."/footer.php");
?>