BVB Source Codes

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

Return Download Shandong kernel enterprise stand the source code: download catalog_add.php Source code - Download Shandong kernel enterprise stand the source code Source code - Type:.php
  1. <?php
  2. require_once(dirname(__FILE__)."/config.php");
  3. require_once(DEDEINC."/typelink.class.php");
  4.  
  5. if(empty($listtype))
  6. {
  7.         $listtype='';
  8. }
  9. if(empty($dopost))
  10. {
  11.         $dopost = '';
  12. }
  13. if(empty($upinyin))
  14. {
  15.         $upinyin = 0;
  16. }
  17. if(empty($channelid))
  18. {
  19.         $channelid = 1;
  20. }
  21. if(isset($channeltype))
  22. {
  23.         $channelid = $channeltype;
  24. }
  25. $id = empty($id) ? 0 :intval($id);
  26. $reid = empty($reid) ? 0 :intval($reid);
  27. $nid = 'article';
  28.  
  29. if($id==0 && $reid==0)
  30. {
  31.         CheckPurview('t_New');
  32. }
  33. else
  34. {
  35.         $checkID = empty($id) ? $reid : $id;
  36.         CheckPurview('t_AccNew');
  37.         CheckCatalog($checkID, '你无权在本栏目下创建子类!');
  38. }
  39.  
  40. if(empty($myrow))
  41. {
  42.         $myrow = array();
  43. }
  44. $dsql->SetQuery("select id,typename,nid from `#@__channeltype` where id<>-1 And isshow=1 order by id");
  45. $dsql->Execute();
  46. while($row=$dsql->GetObject())
  47. {
  48.         $channelArray[$row->id]['typename'] = $row->typename;
  49.         $channelArray[$row->id]['nid'] = $row->nid;
  50.         if($row->id==$channelid)
  51.         {
  52.                 $nid = $row->nid;
  53.         }
  54. }
  55. if($dopost=='quick')
  56. {
  57.         include DedeInclude('templets/catalog_add_quick.htm');
  58.         exit();
  59. }
  60. /*---------------------
  61. function action_savequick(){ }
  62. ---------------------*/
  63. else if($dopost=='savequick')
  64. {
  65.         $tempindex = "{style}/index_{$nid}.htm";
  66.         $templist = "{style}/list_{$nid}.htm";
  67.         $temparticle = "{style}/article_{$nid}.htm";
  68.         $queryTemplate = "insert into `#@__arctype`(reid,topid,sortrank,typename,typedir,isdefault,defaultname,issend,channeltype,
  69.    tempindex,templist,temparticle,modname,namerule,namerule2,ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`cross`,`crossid`,`content`,`smalltypes`)
  70.    Values('~reid~','~topid~','~rank~','~typename~','~typedir~','$isdefault','$defaultname','$issend','$channeltype',
  71.    '$tempindex','$templist','$temparticle','default','$namerule','$namerule2','0','0','','','~typename~','0','','','0','0','0','','')";
  72.         foreach($_POST as $k=>$v)
  73.         {
  74.                 if(ereg('^posttype',$k))
  75.                 {
  76.                         $k = str_replace('posttype','',$k);
  77.                 }
  78.                 else
  79.                 {
  80.                         continue;
  81.                 }
  82.                 $rank = ${'rank'.$k};
  83.                 $toptypename = trim(${'toptype'.$k});
  84.                 $sontype = trim(${'sontype'.$k});
  85.                 $toptypedir = GetPinyin(stripslashes($toptypename));
  86.                 $toptypedir = $referpath=='parent' ? $nextdir.'/'.$toptypedir : '/'.$toptypedir;
  87.                 if(empty($toptypename))
  88.                 {
  89.                         continue;
  90.                 }
  91.                 $sql = str_replace('~reid~','0',$queryTemplate);
  92.                 $sql = str_replace('~topid~','0',$sql);
  93.                 $sql = str_replace('~rank~',$rank,$sql);
  94.                 $sql = str_replace('~typename~',$toptypename,$sql);
  95.                 $sql = str_replace('~typedir~',$toptypedir,$sql);
  96.                 $dsql->ExecuteNoneQuery($sql);
  97.                 $tid = $dsql->GetLastID();
  98.                 if($tid>0 && $sontype!='')
  99.                 {
  100.                         $sontypes = explode(',',$sontype);
  101.                         foreach($sontypes as $k=>$v)
  102.                         {
  103.                                 $v = trim($v);
  104.                                 if($v=='')
  105.                                 {
  106.                                         continue;
  107.                                 }
  108.                                 $typedir = $toptypedir.'/'.GetPinyin(stripslashes($v));
  109.                                 $sql = str_replace('~reid~',$tid,$queryTemplate);
  110.                                 $sql = str_replace('~topid~',$tid,$sql);
  111.                                 $sql = str_replace('~rank~',$k,$sql);
  112.                                 $sql = str_replace('~typename~',$v,$sql);
  113.                                 $sql = str_replace('~typedir~',$typedir,$sql);
  114.                                 $dsql->ExecuteNoneQuery($sql);
  115.                         }
  116.                 }
  117.         }
  118.         UpDateCatCache();
  119.         ShowMsg('成功增加指定栏目!','catalog_main.php');
  120.         exit();
  121. }
  122. /*---------------------
  123. function action_save(){ }
  124. ---------------------*/
  125. else if($dopost=='save')
  126. {
  127.         $smalltypes = '';
  128.         if(empty($smalltype)) $smalltype = '';
  129.         if(is_array($smalltype)) $smalltypes = join(',',$smalltype);
  130.        
  131.         if(!isset($sitepath)) $sitepath = '';
  132.        
  133.         if($topid==0 && $reid>0) $topid = $reid;
  134.        
  135.         if($ispart!=0) $cross = 0;
  136.        
  137.         $description = Html2Text($description,1);
  138.         $keywords = Html2Text($keywords,1);
  139.        
  140.         if($ispart != 2 )
  141.         {
  142.                 //栏目的参照目录
  143.                 if($referpath=='cmspath') $nextdir = '{cmspath}';
  144.                 if($referpath=='basepath') $nextdir = '';
  145.                 //用拼音命名
  146.                 if($upinyin==1 || $typedir=='')
  147.                 {
  148.                         $typedir = GetPinyin(stripslashes($typename));
  149.                 }
  150.                 $typedir = $nextdir.'/'.$typedir;
  151.                 $typedir = ereg_replace("/{1,}", "/", $typedir);
  152.         }
  153.  
  154.         //开启多站点时的设置(仅针对顶级栏目)
  155.         if($reid==0 && $moresite==1)
  156.         {
  157.                 $sitepath = $typedir;
  158.  
  159.                 //检测二级网址
  160.                 if($siteurl!='')
  161.                 {
  162.                         $siteurl = ereg_replace("/$","",$siteurl);
  163.                         if(!eregi("http://",$siteurl))
  164.                         {
  165.                                 ShowMsg("你绑定的二级域名无效,请用(http://host)的形式!","-1");
  166.                                 exit();
  167.                         }
  168.                         if(eregi($cfg_basehost,$siteurl))
  169.                         {
  170.                                 ShowMsg("你绑定的二级域名与当前站点是同一个域,不需要绑定!","-1");
  171.                                 exit();
  172.                         }
  173.                 }
  174.         }
  175.  
  176.         //创建目录
  177.         if($ispart != 2)
  178.         {
  179.                 $true_typedir = str_replace("{cmspath}",$cfg_cmspath,$typedir);
  180.                 $true_typedir = ereg_replace("/{1,}","/",$true_typedir);
  181.                 if(!CreateDir($true_typedir))
  182.                 {
  183.                         ShowMsg("创建目录 {$true_typedir} 失败,请检查你的路径是否存在问题!","-1");
  184.                         exit();
  185.                 }
  186.         }
  187.        
  188.         $in_query = "insert into `#@__arctype`(reid,topid,sortrank,typename,typedir,isdefault,defaultname,issend,channeltype,
  189.    tempindex,templist,temparticle,modname,namerule,namerule2,
  190.    ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`cross`,`crossid`,`content`,`smalltypes`)
  191.    Values('$reid','$topid','$sortrank','$typename','$typedir','$isdefault','$defaultname','$issend','$channeltype',
  192.    '$tempindex','$templist','$temparticle','default','$namerule','$namerule2',
  193.    '$ispart','$corank','$description','$keywords','$seotitle','$moresite','$siteurl','$sitepath','$ishidden','$cross','$crossid','$content','$smalltypes')";
  194.  
  195.         if(!$dsql->ExecuteNoneQuery($in_query))
  196.         {
  197.                 ShowMsg("保存目录数据时失败,请检查你的输入资料是否存在问题!","-1");
  198.                 exit();
  199.         }
  200.         UpDateCatCache();
  201.         if($reid>0)
  202.         {
  203.                 PutCookie('lastCid',GetTopid($reid),3600*24,'/');
  204.         }
  205.         ShowMsg("成功创建一个分类!","catalog_main.php");
  206.         exit();
  207.  
  208. }//End dopost==save
  209.  
  210.  
  211. //获取从父目录继承的默认参数
  212. if($dopost=='')
  213. {
  214.         $channelid = 1;
  215.         $issend = 1;
  216.         $corank = 0;
  217.         $reid = 0;
  218.         $topid = 0;
  219.         $typedir = '';
  220.         $moresite = 0;
  221.         if($id>0)
  222.         {
  223.                 $myrow = $dsql->GetOne(" Select tp.*,ch.typename as ctypename From `#@__arctype` tp left join `#@__channeltype` ch on ch.id=tp.channeltype where tp.id=$id ");
  224.                 $channelid = $myrow['channeltype'];
  225.                 $issennd = $myrow['issend'];
  226.                 $corank = $myrow['corank'];
  227.                 $topid = $myrow['topid'];
  228.                 $typedir = $myrow['typedir'];
  229.         }
  230.  
  231.         //父栏目是否为二级站点
  232.         $moresite = empty($myrow['moresite']) ? 0 : $myrow['moresite'];
  233. }
  234.  
  235. include DedeInclude('templets/catalog_add.htm');
  236.  
  237. ?>
downloadcatalog_add.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