BVB Source Codes

Shandong kernel enterprise stand the source code Show module_make.php Source code

Return Download Shandong kernel enterprise stand the source code: download module_make.php Source code - Download Shandong kernel enterprise stand the source code Source code - Type:.php
  1. <?php
  2. @set_time_limit(0);
  3. require_once(dirname(__FILE__)."/config.php");
  4. require_once(dirname(__FILE__)."/../include/dedemodule.class.php");
  5. CheckPurview('sys_module');
  6. if(empty($action)) $action = '';
  7.  
  8. if($action=='')
  9. {
  10.         $modules = array();
  11.         require_once(dirname(__FILE__)."/templets/module_make.htm");
  12.         exit();
  13. }
  14. /*---------
  15. //获得Hash码
  16. function GetHash()
  17. ----------*/
  18. else if($action=='gethash')
  19. {
  20.         echo md5($modulname.$email);
  21.         exit();
  22. }
  23. /*-------------
  24. //生成项目
  25. function Makemodule()
  26. --------------*/
  27. else if($action=='make')
  28. {
  29.         $filelist = str_replace("\r","\n",trim($filelist));
  30.         $filelist = trim(ereg_replace("[\n]{1,}","\n",$filelist));
  31.         if($filelist==''){
  32.                 ShowMsg("对不起,你没有指定模块的文件列表,因此不能创建项目!","-1");
  33.                 exit();
  34.         }
  35.  
  36.         //去除转义
  37.         foreach($_POST as $k=>$v) $$k = stripslashes($v);
  38.  
  39.         if(!isset($autosetup)) $autosetup = 0;
  40.         if(!isset($autodel)) $autodel = 0;
  41.         $mdir = DEDEROOT.'/data/module';
  42.         $hashcode = md5($modulname.$email);
  43.         $moduleFilename = $mdir.'/'.$hashcode.'.xml';
  44.         $menustring = base64_encode($menustring);
  45.         $dm = new DedeModule($mdir);
  46.  
  47.         if($dm->HasModule($hashcode))
  48.         {
  49.                 $dm->Clear();
  50.                 ShowMsg("对不起,你指定同名模块已经存在,因此不能创建项目!<br>如果你要更新这个模块,请先删除:module/{$hashcode}.xml","-1");
  51.                 exit();
  52.         }
  53.  
  54.         $readmef = $setupf = $uninstallf = '';
  55.  
  56.         if(empty($readmetxt))
  57.         {
  58.                 move_uploaded_file($readme,$mdir."/{$hashcode}-r.html") or die("你没填写说明或上传说明文件!");
  59.                 $readmef = $dm->GetEncodeFile($mdir."/{$hashcode}-r.html",true);
  60.         }
  61.         else
  62.         {
  63.                 $readmetxt = "<p style='line-height:150%'>".$readmetxt;
  64.                 $readmetxt = ereg_replace("[\r\n]{1,}","<br />\r\n",$readmetxt);
  65.                 $readmetxt .= "</p>";
  66.                 $readmef = base64_encode(trim($readmetxt));
  67.         }
  68.        
  69.         if($autosetup==0)
  70.         {
  71.           move_uploaded_file($setup,$mdir."/{$hashcode}-s.php") or die("你没上传,或系统无法把setup文件移动到 module 目录!");
  72.           $setupf = $dm->GetEncodeFile($mdir."/{$hashcode}-s.php",true);
  73.         }
  74.  
  75.   if($autodel==0)
  76.         {
  77.           move_uploaded_file($uninstall,$mdir."/{$hashcode}-u.php") or die("你没上传,或系统无法把uninstall文件移动到 module 目录!");
  78.           $uninstallf = $dm->GetEncodeFile($mdir."/{$hashcode}-u.php",true);
  79.         }
  80.  
  81.         if(trim($setupsql40)=='') $setupsql40 = '';
  82.         else $setupsql40 = base64_encode(trim($setupsql40));
  83.  
  84.         //if(trim($setupsql41)=='') $setupsql41 = '';
  85.         //else $setupsql41 = base64_encode(trim($setupsql41));
  86.  
  87.         if(trim($delsql)=='') $delsql = '';
  88.         else $delsql = base64_encode(trim($delsql));
  89.  
  90.         $modulinfo = "<module>
  91. <baseinfo>
  92. name={$modulname}
  93. team={$team}
  94. time={$mtime}
  95. email={$email}
  96. url={$url}
  97. hash={$hashcode}
  98. indexname={$indexname}
  99. indexurl={$indexurl}
  100. ismember={$ismember}
  101. autosetup={$autosetup}
  102. autodel={$autodel}
  103. lang={$lang}
  104. moduletype={$moduletype}
  105. </baseinfo>
  106. <systemfile>
  107. <menustring>
  108. $menustring
  109. </menustring>
  110. <readme>
  111. {$readmef}
  112. </readme>
  113. <setupsql40>
  114. $setupsql40
  115. </setupsql40>
  116. <delsql>
  117. $delsql
  118. </delsql>
  119. <setup>
  120. {$setupf}
  121. </setup>
  122. <uninstall>
  123. {$uninstallf}
  124. </uninstall>
  125. <oldfilelist>
  126. $filelist
  127. </oldfilelist>
  128. </systemfile>
  129. ";
  130.  
  131. $filelists = explode("\n",$filelist);
  132. foreach($filelists as $v)
  133. {
  134.   $v = trim($v);
  135.   if(!empty($v)) $dm->MakeEncodeFileTest(dirname(__FILE__),$v);
  136. }
  137. //测试无误后编译安装包
  138. $fp = fopen($moduleFilename,'w');
  139. fwrite($fp,$modulinfo);
  140. fwrite($fp,"<modulefiles>\r\n");
  141. foreach($filelists as $v)
  142. {
  143.   $v = trim($v);
  144.   if(!empty($v)) $dm->MakeEncodeFile(dirname(__FILE__),$v,$fp);
  145. }
  146. fwrite($fp,"</modulefiles>\r\n");
  147. fwrite($fp,"</module>\r\n");
  148. fclose($fp);
  149. ShowMsg("成功对一个新模块进行编译!","module_main.php");
  150. exit();
  151. }/*-------------
  152. //修改项目
  153. function editModule()
  154. --------------*/
  155. else if($action=='edit')
  156. {
  157.         $filelist = str_replace("\r","\n",trim($filelist));
  158.         $filelist = trim(ereg_replace("[\n]{1,}","\n",$filelist));
  159.         if($filelist==""){
  160.                 ShowMsg("对不起,你没有指定模块的文件列表,因此不能创建项目!","-1");
  161.                 exit();
  162.         }
  163.  
  164.         //已经去除转义
  165.         foreach($_POST as $k=>$v) $$k = stripslashes($v);
  166.         if(!isset($autosetup)) $autosetup = 0;
  167.         if(!isset($autodel)) $autodel = 0;
  168.         $mdir = DEDEROOT.'/data/module';
  169.         $hashcode = $hash;
  170.         $moduleFilename = $mdir.'/'.$hashcode.'.xml';
  171.         $modulname = str_replace('=','',$modulname);
  172.         $email = str_replace('=','',$email);
  173.         $team = str_replace('=','',$team);
  174.         $indexurl = str_replace('=','',$indexurl);
  175.         $menustring = base64_encode($menustring);
  176.  
  177.         $dm = new DedeModule($mdir);
  178.  
  179.   $readmef = base64_encode($readmetxt);
  180.  
  181.   $setupf = $uninstallf = '';
  182.   //编译setup文件
  183.   if(is_uploaded_file($setup)) {
  184.           move_uploaded_file($setup,$mdir."/{$hashcode}-s.php") or die("你没上传,或系统无法把setup文件移动到 module 目录!");
  185.           $setupf = $dm->GetEncodeFile($mdir."/{$hashcode}-s.php",true);
  186.         }
  187.         else {
  188.                 if($autosetup==0) $setupf = base64_encode($dm->GetSystemFile($hashcode,'setup'));
  189.         }
  190.  
  191.          //编译uninstall文件
  192.         if(is_uploaded_file($uninstall)) {
  193.                 move_uploaded_file($uninstall,$mdir."/{$hashcode}-u.php") or die("你没上传,或系统无法把uninstall文件移动到 module 目录!");
  194.     $uninstallf = $dm->GetEncodeFile($mdir."/{$hashcode}-u.php",true);
  195.   }
  196.   else {
  197.         if($autodel==0) $uninstallf = base64_encode($dm->GetSystemFile($hashcode,'uninstall'));
  198.   }
  199.  
  200.         if(trim($setupsql40)=='') $setupsql40 = '';
  201.         else $setupsql40 = base64_encode(trim($setupsql40));
  202.  
  203.         //if(trim($setupsql41)=='') $setupsql41 = '';
  204.         //else $setupsql41 = base64_encode(trim($setupsql41));
  205.  
  206.         if(trim($delsql)=='') $delsql = '';
  207.         else $delsql = base64_encode(trim($delsql));
  208.  
  209.         $modulinfo = "<module>
  210. <baseinfo>
  211. name={$modulname}
  212. team={$team}
  213. time={$mtime}
  214. email={$email}
  215. url={$url}
  216. hash={$hashcode}
  217. indexname={$indexname}
  218. indexurl={$indexurl}
  219. ismember={$ismember}
  220. autosetup={$autosetup}
  221. autodel={$autodel}
  222. lang={$lang}
  223. moduletype={$moduletype}
  224. </baseinfo>
  225. <systemfile>
  226. <menustring>
  227. $menustring
  228. </menustring>
  229. <readme>
  230. {$readmef}
  231. </readme>
  232. <setupsql40>
  233. $setupsql40
  234. </setupsql40>
  235. <delsql>
  236. $delsql
  237. </delsql>
  238. <setup>
  239. {$setupf}
  240. </setup>
  241. <uninstall>
  242. {$uninstallf}
  243. </uninstall>
  244. <oldfilelist>
  245. $filelist
  246. </oldfilelist>
  247. </systemfile>
  248. ";
  249.  
  250. if($rebuild=='yes')
  251. {
  252.         $filelists = explode("\n",$filelist);
  253.         foreach($filelists as $v)
  254.         {
  255.         $v = trim($v);
  256.         if(!empty($v)) $dm->MakeEncodeFileTest(dirname(__FILE__),$v);
  257.         }
  258.         //测试无误后编译安装包
  259.         $fp = fopen($moduleFilename,'w');
  260.         fwrite($fp,$modulinfo."\r\n");
  261.         fwrite($fp,"<modulefiles>\r\n");
  262.         foreach($filelists as $v)
  263.         {
  264.         $v = trim($v);
  265.         if(!empty($v)) $dm->MakeEncodeFile(dirname(__FILE__),$v,$fp);
  266.         }
  267.         fwrite($fp,"</modulefiles>\r\n");
  268.         fwrite($fp,"</module>\r\n");
  269.         fclose($fp);
  270. }
  271. else
  272. {
  273.         $fxml = $dm->GetFileXml($hashcode);
  274.         $fp = fopen($moduleFilename,'w');
  275.         fwrite($fp,$modulinfo."\r\n");
  276.         fwrite($fp,$fxml);
  277.         fclose($fp);
  278. }
  279. ShowMsg("成功对模块重新编译!","module_main.php");
  280. exit();
  281. }
  282.  
  283. //ClearAllLink();
  284. ?>
downloadmodule_make.php Source code - Download Shandong kernel enterprise stand the source code Source code
Related Source Codes/Software:
Dede V2.2 dance music program - This system is based on DEDE5.7 sp1 production dan... 2016-11-11
Search engine v1.0 eight grams of novels - This program consists of WEB side and collection p... 2016-11-11
A thief free Jacky novel CMS, support for multiple station collection, support pseudo original SEO - A thief free Jacky novel CMS, support for multiple... 2016-11-11
Kunlun lubricating oil companies stand the source code - Just testing, free, source code is very beautiful ... 2016-11-11
Imitation of Chinese stationmaster net source dreams to 5.7 sp1 source code - Exactly the same and the Director of China network... 2016-11-11
Newscoop CMS v4.0.4 multilingual version - Newscoop is a content management system is mainly ... 2016-11-11
Ku978 navigator free send you department (with acquisition module) - Is I purchase the commercial version of this progr... 2016-11-11
Think of concise message this v1.1 - Wisdom of concise message this V1.1 main functions... 2016-11-11
nvidia-docker - Build and run Docker containers leveraging NVIDIA ... 2017-04-08
quickstart - Angular 2 QuickStart - source from the documentati... 2017-04-08
jQuery-Autocomplete - Ajax Autocomplete for jQuery allows you to easily ... 2017-04-08
Android-Best-Practices - Android best practice examples 2017-04-08
Bootstrap-Admin-Template - Metis - Free Bootstrap Admin Dashboard Template ... 2017-04-08
CocoaSPDY - SPDY for iOS and OS X 2017-04-08
parse-dashboard - A dashboard for managing your Parse apps that aren... 2017-04-08
HoloEverywhere - NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE. 2017-04-08
side-comments - [UNMAINTAINED] An interface component to give your... 2017-04-08
SVG-Morpheus - JavaScript library enabling SVG icons to morph fro... 2017-04-08

 Back to top