-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmigrate.php
More file actions
executable file
·537 lines (518 loc) · 21.1 KB
/
migrate.php
File metadata and controls
executable file
·537 lines (518 loc) · 21.1 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
<?php
$migrate_ver = '0.4';
/*
Plugin Name: Migrate site
Description: Migrate site to another domain
Version: 0.4
Author: Andrejus Semionovas
Author URI: http://pigios-svetaines.eu/
*/
i18n_merge('migrate') || i18n_merge('migrate','en_US');
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
global $SITEURL, $migrate_ver;
# register plugin
register_plugin(
$thisfile, //Plugin id
'Migrate site ', //Plugin name
$migrate_ver, //Plugin version
'Andrejus Semionovas', //Plugin author
'http://pigios-svetaines.eu', //author website
'Migrate site to another domain', //Plugin description
'backups', //page type - on which admin tab to display
'migrate_settings' //main function (administration)
);
add_action('backups-sidebar','createSideMenu',array($thisfile,'Migrate site'));
function migrate_settings(){ ?>
<style>
fieldset {
border-radius: 6px;
}
.inner-divs {
clear: both;
padding: 10px 20px;
}
#maincontent .migrate_input {
float: right;
color: #333;
border: 1px solid #AAA;
padding: 5px;
font-family: Arial,Helvetica Neue,Helvetica,sans-serif;
font-size: 12px;
border-radius: 2px;
width: 60%;
margin-left: 10px;
}
.container.inner {
margin: 10px;
}
.container .left, .container .right {
float: left;
}
.container .left, .container .right {
width: 50%;
}
#all_arch label, .inner label {
display: inline-block;
margin-left: 6px;
cursor: pointer;
}
.change-button {
margin: 20px;
line-height: 14px !important;
background-color: #182227;
color: #CCC;
font-weight: bold;
text-decoration: none;
text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
transition: all 0.1s ease-in-out 0s;
font-size: 10px;
text-transform: uppercase;
display: block;
padding: 3px 10px;
border-radius: 3px;
background-repeat: no-repeat;
background-position: 94% center;
cursor: pointer;
border: medium none;
}
.change-button:hover {
background-color: #CF3805;
color: #FFF;
font-weight: bold;
text-decoration: none;
line-height: 14px !important;
text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}
#all_arch {
padding-left: 20px;
}
#all_arch span {
padding-left: 8px;
}
</style>
<?php
global $content, $SITEURL, $migrate_ver;
if(isset($_POST['do_replace']) && $_POST['do_replace']) {
if(isset($_POST['xml_replace']) && $_POST['xml_replace'] == 0) {
xml_replace($_POST['exist_name'], $_POST['new_name'], 0);
}
if(isset($_POST['xml_replace']) && $_POST['xml_replace'] == 1) {
if(isset($_POST['all_arch']) && $_POST['all_arch'] == 1) $all_arch = true;
else $all_arch = false;
xml_replace($_POST['exist_name'], $_POST['new_name'], 1, $all_arch);
unset($_POST['xml_replace']);
}
unset($_POST['xml_replace']);
unset($_POST['do_replace']);
}
if(isset($_POST['file_delete']) && $_POST['file_delete']) {
unlink('../plugins/migrate/arch/'.$_POST['file_delete']);
unset($_POST['file_delete']);
}
?>
<h3 class="floated" style="float:left;margin-bottom: 20px;"><?php i18n('migrate/TITLE'); ?><span style="margin-left: 16px;">ver. <?php echo $migrate_ver; ?></span></h3>
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post" class="migrate" name="migrate">
<fieldset class="container widesec">
<div class="inner-divs">
<span class="input-span"><?php i18n('migrate/EXIST_NAME'); ?></span>
<input type="text" name="exist_name" class="migrate_input" value="<?php echo $SITEURL; ?>"/>
</div>
<div class="inner-divs">
<span class="input-span"><?php i18n('migrate/NEW_NAME'); ?></span>
<input type="text" name="new_name" class="migrate_input" value=""/>
</div>
<fieldset class="container inner">
<div class="left">
<label><input type="radio" id="xml_replace" name="xml_replace" value=0 onclick="checkbutton()" /><label for="xml_replace"><?php i18n('migrate/REPLACE'); ?></label>
</div>
<div class="right">
<label><input type="radio" id="xml_archive" name="xml_replace" value=1 checked onclick="checkbutton()" /><label for="xml_archive"><?php i18n('migrate/ARCHIVE'); ?></label>
</div>
</fieldset>
<div class="widesec" id="all_arch">
<input type="checkbox" name="all_arch" id="allfile" value=1 /><label for="allfile"><?php i18n('migrate/ALL_INCLUDE'); ?></label>
</div>
<input type="submit" name="do_replace" class="change-button" value="<?php i18n('migrate/SUBMIT'); ?>" onclick="return checkform()"/>
</fieldset>
</form>
<script type="text/javascript">
function checkbutton() {
if (document.getElementById("xml_archive").checked) {
document.getElementById('all_arch').style.visibility = "visible";
}
if (document.getElementById("xml_replace").checked) {
document.getElementById('all_arch').style.visibility = "hidden";
}
}
function checkform() {
if(document.migrate.new_name.value == "" || document.migrate.exist_name.value == document.migrate.new_name.value) {
if(document.migrate.new_name.value == "") {
var empty_field='<?php i18n('migrate/NOT_NEW'); ?>';
alert(empty_field);
return false;
}
if(document.migrate.exist_name.value == document.migrate.new_name.value) {
var ident_field='<?php i18n('migrate/IDENTICAL'); ?>';
alert(ident_field);
return false;
}
} else {
var lastnChar = document.migrate.new_name.value.substr(document.migrate.new_name.value.length - 1);
var lasteChar = document.migrate.exist_name.value.substr(document.migrate.exist_name.value.length - 1);
var httpnChar = document.migrate.new_name.value.substr(0, 4);
var httpeChar = document.migrate.exist_name.value.substr(0, 4);
if(lastnChar=="/" && lasteChar!="/" || lastnChar!="/" && lasteChar=="/") {
alert(lastnChar+" Backslash not indent "+lasteChar);
return false;
}
if(httpnChar=="http" && httpeChar!="http" || httpnChar!="http" && httpeChar=="http") {
alert(httpnChar+" HTTP not indent "+httpeChar);
return false;
}
document.migrate.submit();
return true;
}
}
jQuery(function(){
setTimeout(function() {
jQuery(".fancy-message").hide('slow');
}, 20000);
});
</script>
<?php
$dir_arch = GSPLUGINPATH.'migrate/arch';
$arch_handle = false;
if (is_dir($dir_arch)) {
if ($dh = opendir($dir_arch)) {
while (($file = readdir($dh)) !== false) {
if($file == "." || $file == ".." || is_dir($dir_arch.'/'.$file) || $file == ".htaccess") { continue; }
else {
$arch_handle = true;
}
}
}
}
if($arch_handle) {
?>
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post" class="zipfiles" name="zipfiles">
<fieldset class="container widesec">
<legend style="padding: 0px 6px 0px 6px;margin: 6px;"><?php i18n('migrate/FOR_DOWNLOAD'); ?></legend><?php
$dh = opendir($dir_arch);
while (($file = readdir($dh)) !== false) {
if($file == "." || $file == ".." || is_dir($dir_arch.'/'.$file) || $file == ".htaccess") { continue; }
else { ?>
<div class="inner">
<div style="width: 70%;float: left;">
<a href="<?php echo $SITEURL.'plugins/migrate/arch/'.$file; ?>" target="_blank"><?php echo $file; ?></a>
</div>
<div style="float: left;"><?php echo round(filesize('../plugins/migrate/arch/'.$file) * .0009765625, 3); ?> Kb</div>
<div style="width: 10%;float: right;text-align: right;" style="text-align: right;">
<button class="filedelete" name="file_delete" value="<?php echo $file; ?>" style="width: 20px;height: 20px; margin-right: 20px; background:url(<?php echo $SITEURL.'plugins/migrate/images/deletef.png' ?>) red center no-repeat;cursor: pointer;border: 1px solid #F00;border-radius: 4px;" title="<?php i18n('migrate/DEL_FILE'); ?>"></button>
</div>
</div><?php
}
} ?>
</fieldset>
</form>
<?php
}
}
function replaceXMLdata($xml, $element, $repl_string){
//* Handle empty Taggs for storage *//
foreach($xml->children() as $child) {
$var_empt = $child->getName();
$var_emp = $child;
if(!strlen($var_emp)>0) {
$xml->$var_empt = '';
}
}
//* Replace old node data with new one *//
$new_child = $xml->addChild($element);
$domReplace = dom_import_simplexml($new_child);
$no = $domReplace->ownerDocument;
$domReplace->appendChild($no->createCDATASection($repl_string));
$domToChange = dom_import_simplexml($xml->$element);
$nodeImport = $domToChange->ownerDocument->importNode($domReplace, TRUE);
$domToChange->parentNode->replaceChild($nodeImport, $domToChange);
return $xml;
}
function xml_replace($exist_name, $new_name, $mode=1, $alls=false) {
$dir = GSROOTPATH.'data/pages';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$total = 0;
$spec_total = 0;
$files_change = 0;
$no_modified = 0;
$spec_count = 0;
while (($file = readdir($dh)) !== false) {
if($file == "." || $file == ".." || is_dir($dir.'/'.$file) || $file == ".htaccess")
{ continue; }
else {
$ext = substr($file, strrpos($file, '.') + 1);
if(in_array($ext, array("xml","XML"))) {
$file_xml = simplexml_load_file(GSROOTPATH.'data/pages/'.$file);
if(isset($file_xml->special)) { //Special fields replacing
foreach ($file_xml->children() as $child) {
$node_name = $child->getName();
if($node_name == "content") continue;
$spec_content = $file_xml->$node_name;
if (strpos($spec_content, $exist_name) !== false) {
$spec_nr = str_ireplace($exist_name, $new_name, $spec_content);
$file_xml->$node_name = $spec_nr;
$spec_count++;
}
}
}
$file_content = $file_xml->content;
$str_nr = str_ireplace($exist_name, $new_name, $file_content, $count);
if($count>0 || $alls == 1 || $spec_count>0) {
if($count>0) {
$total += $count;
$files_change = $files_change + 1;
} elseif($spec_count>0) {
$spec_total += $spec_count;
$files_change = $files_change + 1;
}
else { $no_modified = $no_modified + 1; }
if(!is_dir(GSPLUGINPATH.'migrate/mods')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/mods. Line: '.__LINE__);
return false;
}
}
$file_xml = replaceXMLdata($file_xml, 'content', $str_nr);
if($mode == 1) XMLsave($file_xml, GSPLUGINPATH.'migrate/mods/'.$file);
if($mode == 0) XMLsave($file_xml, GSROOTPATH.'data/pages/'.$file);
}
}
}
}
closedir($dh);
//***** News Manager support *****//
$news = 0;
$img_count = 0;
$dirm = GSROOTPATH.'data/posts';
if (is_dir($dirm)) {
if ($dhm = opendir($dirm)) {
while (($file = readdir($dhm)) !== false) {
if($file == "." || $file == ".." || is_dir($dir.'/'.$file) || $file == ".htaccess") {
continue;
} else {
$ext = substr($file, strrpos($file, '.') + 1);
if(in_array($ext, array("xml","XML"))) {
$file_xml = simplexml_load_file($dirm.'/'.$file);
if(isset($file_xml->image)) {
foreach ($file_xml->children() as $child) {
$node_name = $child->getName();
if($node_name == "image") {
$img_url = $file_xml->$node_name;
if (strpos($img_url, $exist_name) !== false) {
$img_nr = str_ireplace($exist_name, $new_name, $img_url);
$file_xml->$node_name = $img_nr;
$img_count++;
}
}
}
}
if(isset($file_xml->content)) {
$file_content = $file_xml->content;
$str_nr = str_ireplace($exist_name, $new_name, $file_content, $img_count);
if($img_count>0 || $alls == 1) {
if($img_count>0) {
$news += $img_count;
$files_change = $files_change + 1;
} else { $no_modified = $no_modified + 1; }
if(!is_dir(GSPLUGINPATH.'migrate/mods/data')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods/data', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/mods/data. Line: '.__LINE__);
return false;
}
}
if(!is_dir(GSPLUGINPATH.'migrate/mods/data/posts')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods/data/posts', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/mods/data/posts. Line: '.__LINE__);
return false;
}
}
$file_xml = replaceXMLdata($file_xml, 'content', $str_nr);
if($mode == 1) {
if(!is_dir(GSPLUGINPATH.'migrate/mods/data')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods/data', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/mods/data. Line: '.__LINE__);
return false;
}
}
if(!is_dir(GSPLUGINPATH.'migrate/mods/data/posts')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods/data/posts', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/mods/data/posts. Line: '.__LINE__);
return false;
}
}
XMLsave($file_xml, GSPLUGINPATH.'migrate/mods/data/posts/'.$file);
}
if($mode == 0) XMLsave($file_xml, GSROOTPATH.'data/posts/'.$file);
}
}
}
}
}
closedir($dhm);
}
}
if(!is_dir(GSPLUGINPATH.'migrate/mods')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/mods', 0777, true) ) {
die('Failed to create folder: '.SPLUGINPATH.'migrate/mods. Line: '.__LINE__);
return false;
}
}
//* Changes for Website XML file *//
$file_xml = simplexml_load_file(GSROOTPATH.'data/other/website.xml');
$file_content = $file_xml->SITEURL;
$str_nr = str_ireplace($exist_name, $new_name, $file_content, $countw);
if($countw>0) {
$file_xml = replaceXMLdata($file_xml, 'SITEURL', $str_nr);
if($mode == 1) $file_xml->saveXML(GSPLUGINPATH.'migrate/mods/website.xml');
if($mode == 0) $file_xml->saveXML(GSROOTPATH.'data/other/website.xml');
$total += $countw;
$files_change = $files_change + 1;
}
//* Changes for Random Content XML file *//
if(file_exists(GSDATAOTHERPATH . 'random_content.xml')) {
$category_file = getXML(GSDATAOTHERPATH . 'random_content.xml');
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
foreach($category_file->category as $category) {
$c_atts= $category->attributes();
$c_child = $xml->addChild('category');
$c_child->addAttribute('name', $c_atts['name']);
$c_child->addAttribute('limit', $c_atts['limit']);
foreach($category->content as $content) {
$replace = str_ireplace($exist_name, $new_name, $content, $countr);
$atts= $content->attributes();
$child = $c_child->addChild('content');
$child->addAttribute('title', $atts['title']);
$child->addCData($replace);
}
}
if($countr>0) {
if($mode == 1) XMLsave($xml, GSPLUGINPATH.'migrate/mods/random_content.xml');
if($mode == 0) XMLsave($xml, GSDATAOTHERPATH . 'random_content.xml');
$total += $countr;
$files_change = $files_change + 1;
}
}
if($total > 0 && $mode == 1) {
if(!is_dir(GSPLUGINPATH.'migrate/arch')) {
if ( ! @mkdir(GSPLUGINPATH.'migrate/arch', 0777, true) ) {
die('Failed to create folder: '.GSPLUGINPATH.'migrate/arch. Line: '.__LINE__);
return false;
}
$myfile = fopen(GSPLUGINPATH.'migrate/arch/'.'.htaccess', 'w') or die('Unable to open file!');
fwrite($myfile, 'Allow from All');
fclose($myfile);
}
$timestamp = gmdate('Y-m-d-Hi');
$zipcreated = true;
set_time_limit (0);
ini_set("memory_limit","800M");
$new_domain = str_replace(array("http://", "https://", "/", ".", ":"), array("","","_","_","_"), $new_name);
$zip_path = GSPLUGINPATH.'migrate/arch/'.$new_domain.'_'.$timestamp .'.zip';
$sourcePath = str_replace('/', DIRECTORY_SEPARATOR, GSPLUGINPATH.'migrate/mods/');
if (!class_exists ( 'ZipArchive' , false)) {
include('inc/ZipArchive.php');
}
if (class_exists ( 'ZipArchive' , false)) {
$zip = new ZipArchive();
$result = $zip->open($zip_path, ZipArchive::CREATE);
if ($result === TRUE) {
if(is_readable(GSPLUGINPATH.'migrate/mods')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods') as $fileInfo) {
if(!$fileInfo->isDot() && !$fileInfo->isDir()) {
if($fileInfo->getFilename() != 'website.xml' && $fileInfo->getFilename() != 'random_content.xml') {
if (($zip->addFile ($fileInfo->getPathname(), "data/pages/".$fileInfo->getFilename())) === TRUE) {
$theoreticaly_added = TRUE;
}
}
if($fileInfo->getFilename() == 'website.xml' || $fileInfo->getFilename() == 'random_content.xml') {
if (($zip->addFile ($fileInfo->getPathname(), "data/other/".$fileInfo->getFilename())) === TRUE) {
$theoreticaly_added = TRUE;
}
}
}
}
}
if(is_readable(GSPLUGINPATH.'migrate/mods/data/other/news_manager')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods/data/other/news_manager') as $fileInfo) {
if(!$fileInfo->isDot() && !$fileInfo->isDir()) {
if (($zip->addFile ($fileInfo->getPathname(), "data/other/news_manager/".$fileInfo->getFilename())) === TRUE) {
$theoreticaly_added = TRUE;
}
}
}
}
if(is_readable(GSPLUGINPATH.'migrate/mods/data/posts')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods/data/posts') as $fileInfo) {
if(!$fileInfo->isDot() && !$fileInfo->isDir()) {
if (($zip->addFile ($fileInfo->getPathname(), "data/posts/".$fileInfo->getFilename())) === TRUE) {
$theoreticaly_added = TRUE;
}
}
}
}
} else { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #DFF0D8; color: #3C8C8F;"><p><?php i18n('migrate/ZIP_NOT_OPEN'); ?></p></div><?php
}
$status = $zip->close();
if(!$status) { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #DFF0D8; color: #3C8C8F;"><p><?php i18n('migrate/ZIP_NOT_CLOSE'); ?></p></div><?php
}
}
else { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #DFF0D8; color: #3C8C8F;"><p><?php i18n('migrate/ZIP_NOT'); ?></p></div><?php
}
if (is_readable(GSPLUGINPATH.'migrate/mods/data/other/news_manager')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods/data/other/news_manager') as $fileInfo) {
if(!$fileInfo->isDot()) {
unlink($fileInfo->getPathname());
}
}
rmdir(GSPLUGINPATH.'migrate/mods/data/other/news_manager');
}
if (is_readable(GSPLUGINPATH.'migrate/mods/data/posts')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods/data/posts') as $fileInfo) {
if(!$fileInfo->isDot()) {
unlink($fileInfo->getPathname());
}
}
rmdir(GSPLUGINPATH.'migrate/mods/data/posts');
}
if (is_readable(GSPLUGINPATH.'migrate/mods/data/other/')) {
rmdir(GSPLUGINPATH.'migrate/mods/data/other');
}
if (is_readable(GSPLUGINPATH.'migrate/mods')) {
foreach (new DirectoryIterator(GSPLUGINPATH.'migrate/mods') as $fileInfo) {
if(!$fileInfo->isDot() && !$fileInfo->isDir()) {
unlink($fileInfo->getPathname());
}
}
}
if (is_readable(GSPLUGINPATH.'migrate/mods/data')) {
rmdir(GSPLUGINPATH.'migrate/mods/data');
}
if($status && $theoreticaly_added) { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #DFF0D8; color: #3C8C8F;"><p><?php i18n('migrate/ARCH_FILE'); i18n('migrate/ALL_REPLACE'); echo $total; i18n('migrate/ALL_FILES'); echo $files_change; (isset($spec_total) && !empty($spec_total)?i18n('migrate/ALL_SPEC_ITEMS'):''); echo (isset($spec_total) && !empty($spec_total)?$spec_total:''); echo ((isset($news) && $news>0)?i18n('migrate/ALL_NM_ITEMS'):''); echo ((isset($news) && $news>0)?$news:''); (isset($no_modified) && !empty($no_modified) && $no_modified!=$total?i18n('migrate/TOTAL_FILES'):''); echo (isset($no_modified) && !empty($no_modified) && $no_modified!=$total?$no_modified:''); ?></p></div><?php
}
}
if($mode == 0) { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #DFF0D8; color: #3C8C8F;"><p><?php i18n('migrate/REPL_FILE'); ?><?php i18n('migrate/ALL_REPLACE'); echo $total; i18n('migrate/ALL_FILES'); echo $files_change; (isset($spec_total) && !empty($spec_total)?i18n('migrate/ALL_SPEC_ITEMS'):''); echo (isset($spec_total) && !empty($spec_total)?$spec_total:''); echo (isset($news) && $news>0?i18n('migrate/ALL_NM_ITEMS'):''); echo (isset($news) && $news>0?$news:''); ?></p></div><?php
}
if (is_readable(GSDATAOTHERPATH . 'news_manager/posts.xml')) @unlink(GSDATAOTHERPATH . 'news_manager/posts.xml');
} else { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #F2DEDE; color: #A94442;"><p><?php i18n('migrate/NOT_DIR_ACCESS'); echo $dir; ?></p></div><?php
}
} else { ?>
<div class="fancy-message" style="border: 1px solid; padding: 20px 10px 10px 10px; border-radius: 4px; margin-bottom: 20px; background: #F2DEDE; color: #A94442;"><p><?php i18n('migrate/NOT_DIR_EXIST'); echo $dir; ?></p></div><?php
}
}
?>