• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision4a9c63fe2f063ee123ec36a86d7c2cfbcaf43301 (tree)
Time2008-02-25 08:04:22
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

ver 0.5.9.2

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@613 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/extra/compress.php
@@ -0,0 +1,53 @@
1+<html><body><?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+$strRel = '../../../../';
8+include($strRel . 'config.php');
9+
10+if (!($member->isLoggedIn() && $member->isAdmin())) exit('Not logged in');
11+if (!$manager->checkTicket()) exit('Invalid ticket');
12+
13+error_reporting (E_ERROR | E_WARNING | E_PARSE);
14+
15+//$files=listup_files('../');
16+$files=listup_files('../editor');
17+
18+if (!($fHandle=fopen('compress.dat','x'))) exit; //Overwrite prohibited.
19+$list='';
20+$fpoint=0;
21+
22+foreach ($files as $value) {
23+ ob_start();
24+ $list.=readfile($value).'|'.$value."\n";// The data at each line is: "filesize|filename"
25+ $data=ob_get_contents();
26+ ob_end_clean();
27+ fwrite($fHandle,$data);
28+ echo "$value<br />\n";
29+}
30+fclose($fHandle);
31+
32+if (!($fHandle=fopen('compress.lst','x'))) exit; //Overwrite prohibited.
33+fwrite($fHandle,$list);
34+fclose($fHandle);
35+
36+function listup_files($dir){
37+ $dir=str_replace('\\','/',$dir);// Windows support.
38+ $dir=preg_replace('/[\/]$/','',$dir).'/';
39+ $files=array();
40+ if (!is_dir($dir)) return $files;
41+ $d = dir($dir);
42+ while (false !== ($entry = $d->read())) {
43+ if ($entry=='.'||$entry=='..') continue;// Ignore this and parent directory.
44+ if (is_dir($dir.$entry)) {// The case of directory
45+ foreach(listup_files($dir.$entry) as $value) $files[]=$value;
46+ continue;
47+ }
48+ $files[]=$dir.$entry;
49+ }
50+ $d->close();
51+ return $files;
52+}
53+?>All Done!</body></html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/extra/expand.php
@@ -0,0 +1,44 @@
1+<html><body><?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+$strRel = '../../../../';
8+include($strRel . 'config.php');
9+
10+if (!($member->isLoggedIn() && $member->isAdmin())) exit('Not logged in');
11+if (!$manager->checkTicket()) exit('Invalid ticket');
12+
13+error_reporting (E_ERROR | E_WARNING | E_PARSE);
14+
15+if (!file_exists('compress.lst')) exit('compress.lst not found');
16+if (!($fHandle=fopen('compress.dat','r'))) exit;
17+
18+foreach(file('compress.lst') as $value) {
19+ list($filesize,$filename)=explode('|',$value);// The data contains "filesize|filename".
20+ $filesize=(int)$filesize;
21+ $filename=trim($filename);
22+ echo "($filesize)$filename<br />\n";
23+ $data=fread($fHandle,$filesize);
24+ mkdirex(dirname($filename));
25+ if (!($fHandle2=fopen($filename,'w'))) continue;// Overwrite allowed.
26+ fwrite($fHandle2,$data);
27+ fclose($fHandle2);
28+}
29+
30+function mkdirex($dir,$mod='777'){
31+ $dir=str_replace('\\','/',$dir);
32+ if (substr($dir,0,1)=='/') $temp='/';
33+ else $temp='';
34+ eval('$i=0'.$mod.';');
35+ foreach(explode('/',$dir) as $value) {
36+ if (!$value) continue;
37+ $temp.=$value.'/';
38+ if (!file_exists($temp)) {
39+ @mkdir($temp);
40+ @chmod($temp,$i);
41+ }
42+ }
43+}
44+?>All Done!</body></html>
\ No newline at end of file
--- /dev/null
+++ b/trunk/NP_MitasNom/mitasnom/extra/index.php
@@ -0,0 +1,16 @@
1+<html><body><?php
2+/*
3+ * NP_MitasNom
4+ * Written by Katsumi
5+ * This library is GPL
6+ */
7+$strRel = '../../../../';
8+include($strRel . 'config.php');
9+
10+if (!($member->isLoggedIn() && $member->isAdmin())) exit('Not logged in');
11+
12+echo '<a href="'.$manager->addTicketToUrl('expand.php').'">Expand</a><p/>';
13+
14+if (!file_exists('compress.lst')) echo '<a href="'.$manager->addTicketToUrl('compress.php').'">Compress</a><p/>';
15+
16+?></body></html>
\ No newline at end of file
Show on old repository browser