当前位置: 首页>>代码示例>>PHP>>正文


PHP CreateDir函数代码示例

本文整理汇总了PHP中CreateDir函数的典型用法代码示例。如果您正苦于以下问题:PHP CreateDir函数的具体用法?PHP CreateDir怎么用?PHP CreateDir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CreateDir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: xstart

function xstart()
{
    $unix = new unix();
    $sock = new sockets();
    build_progress("{starting} {creating_new_cache}", 15);
    $Config = unserialize($sock->GET_INFO("NewCacheCenterWizard"));
    if (isset($Config["SaveHD"])) {
        CreateHD();
        return;
    }
    if (isset($Config["SaveDir"])) {
        CreateDir();
        return;
    }
}
开发者ID:articatech,项目名称:artica,代码行数:15,代码来源:exec.squid.cache.wizard.php

示例2: wpdm_pro_Install

function wpdm_pro_Install()
{
    global $wpdb;
    delete_option('wpdm_latest');
    $sqls[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ahm_download_stats` (\n              `id` int(11) NOT NULL AUTO_INCREMENT,\n              `pid` int(11) NOT NULL,\n              `uid` int(11) NOT NULL,\n              `oid` varchar(100) NOT NULL,\n              `year` int(4) NOT NULL,\n              `month` int(2) NOT NULL,\n              `day` int(2) NOT NULL,\n              `timestamp` int(11) NOT NULL,\n              `ip` varchar(20) NOT NULL,\n              PRIMARY KEY (`id`)\n            )";
    $sqls[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ahm_emails` (\n              `id` int(11) NOT NULL AUTO_INCREMENT,\n              `email` varchar(255) NOT NULL,\n              `pid` int(11) NOT NULL,\n              `date` int(11) NOT NULL,\n              `custom_data` text NOT NULL,\n              `request_status` INT( 1 ) NOT NULL,\n              PRIMARY KEY (`id`)\n            )";
    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    foreach ($sqls as $sql) {
        $wpdb->query($sql);
        //dbDelta($sql);
    }
    if (get_option('_wpdm_etpl') == '') {
        update_option('_wpdm_etpl', array('title' => 'Your download link', 'body' => file_get_contents(dirname(__FILE__) . '/templates/wpdm-email-lock-template.html')));
    }
    wpdm_common_actions();
    flush_rewrite_rules();
    CreateDir();
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:18,代码来源:download-manager.php

示例3: GetFileNewName

function GetFileNewName($aid, $typeid, $timetag, $title, $ismake = 0, $rank = 0, $namerule = '', $typedir = '', $money = 0, $filename = '')
{
    global $cfg_arc_dirname;
    $articlename = GetFileName($aid, $typeid, $timetag, $title, $ismake, $rank, $namerule, $typedir, $money, $filename);
    if (ereg("\\?", $articlename)) {
        return $articlename;
    }
    if ($cfg_arc_dirname == 'Y' && ereg("/\$", $articlename)) {
        $articlename = $articlename . "index.html";
    }
    $slen = strlen($articlename) - 1;
    for ($i = $slen; $i >= 0; $i--) {
        if ($articlename[$i] == '/') {
            $subpos = $i;
            break;
        }
    }
    $okdir = substr($articlename, 0, $subpos);
    CreateDir($okdir);
    return $articlename;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:21,代码来源:channelunit.func.php

示例4: YandexTTS

/**
 * YandexTTS
 * @param mixed $message Message
 * @param mixed $lang    Language (default 'ru-RU')
 * @return int|string
 */
function YandexTTS($message, $lang = 'ru-RU')
{
    $filename = md5($message) . '_ya.mp3';
    $cachedVoiceDir = ROOT . 'cached/voice';
    $cachedFileName = $cachedVoiceDir . '/' . $filename;
    $base_url = 'https://tts.voicetech.yandex.net/generate?';
    if (file_exists($cachedFileName)) {
        @touch($cachedFileName);
        return $cachedFileName;
    }
    $qs = http_build_query(array('format' => 'mp3', 'lang' => $lang, 'speaker' => 'omazh', 'key' => SETTINGS_YANDEX_TTS_KEY, 'text' => $message));
    try {
        $contents = file_get_contents($base_url . $qs);
    } catch (Exception $e) {
        registerError('yandextts', get_class($e) . ', ' . $e->getMessage());
    }
    if (isset($contents)) {
        CreateDir($cachedVoiceDir);
        SaveFile($cachedFileName, $contents);
        return $cachedFileName;
    }
    return 0;
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:29,代码来源:tts.class.php

示例5: str_replace

    exit;
}
if ($action == '') {
    echo "本程序将检测下列目录是否存在,或者是否具有写入的权限,并尝试创建或更改:<br>";
    echo "(如果你的主机使用的是windows系统,你无需进行此操作)<br>";
    echo "'/include' 目录和 '当前目录/templets' 文件夹请你在FTP中手工更改权限为可写入(0777)<br>";
    echo "<pre>" . str_replace('|', '', $needDir) . "</pre>";
    echo "</td></tr>\r\n<tr><td bgcolor='#F9FCEF' height='32px' style='padding-left:20px'>\r\n<a href='testenv.php?action=ok' class='np coolbg'>&lt;&lt;开始检测&gt;&gt;</a> &nbsp; <a href='index_body.php' class='np coolbg'>&lt;&lt;返回主页&gt;&gt;</a>";
} else {
    $needDirs = explode('|', $needDir);
    $needDir = '';
    foreach ($needDirs as $needDir) {
        $needDir = trim($needDir);
        $needDir = str_replace("\\", "/", $needDir);
        $needDir = ereg_replace("/{1,}", "/", $needDir);
        if (CreateDir($needDir)) {
            echo "成功更改或创建:{$needDir} <br>";
        } else {
            echo "更改或创建目录:{$needDir} <font color='red'>失败!</font> <br>";
        }
    }
    echo "<br>如果发现更改或创建错误的项目,请<a href='testenv.php?action=ok&play=" . time() . "'><u>重试</u></a>或手动登陆到FTP更改相关目录的权限为777或666<br>";
    echo "</td></tr>\r\n<tr><td bgcolor='#F9FCEF' height='32px' style='padding-left:20px'>\r\n<a href='index_body.php' class='np coolbg'>&lt;&lt;返回主页&gt;&gt;</a>";
    CloseFtp();
}
?>
</td>
</tr>
</table>
</body>
</html>
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:testenv.php

示例6: DisplayPartTemplets

 /**
  *  显示单独模板页面
  *
  * @access    public
  * @param     string
  * @return    string
  */
 function DisplayPartTemplets()
 {
     $this->PartView = new PartView($this->TypeID, false);
     $this->PartView->SetTypeLink($this->TypeLink);
     $nmfa = 0;
     $tmpdir = $GLOBALS['cfg_basedir'] . $GLOBALS['cfg_templets_dir'];
     if ($this->Fields['ispart'] == 1) {
         //封面模板
         $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']);
         $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
         $tempfile = $tmpdir . "/" . $tempfile;
         if (!file_exists($tempfile)) {
             $tempfile = $tmpdir . "/" . $GLOBALS['cfg_df_style'] . "/index_default.htm";
         }
         $this->PartView->SetTemplet($tempfile);
     } else {
         if ($this->Fields['ispart'] == 2) {
             //跳转网址
             $gotourl = $this->Fields['typedir'];
             header("Location:{$gotourl}");
             exit;
         }
     }
     CreateDir(MfTypedir($this->Fields['typedir']));
     $makeUrl = $this->GetMakeFileRule($this->Fields['id'], "index", MfTypedir($this->Fields['typedir']), $this->Fields['defaultname'], $this->Fields['namerule2']);
     $makeFile = $this->GetTruePath() . $makeUrl;
     if ($nmfa == 0) {
         $this->PartView->Display();
     } else {
         if (!file_exists($makeFile)) {
             $this->PartView->Display();
         } else {
             include $makeFile;
         }
     }
 }
开发者ID:cwcw,项目名称:cms,代码行数:43,代码来源:arc.listview.class.php

示例7: MakeHtml

 /**
  *  开始创建列表
  *
  * @access    public
  * @param     int  $isremote  是否远程
  * @return    string
  */
 function MakeHtml($isremote = 0)
 {
     global $cfg_remote_site;
     //初步给固定值的标记赋值
     $this->ParseTempletsFirst();
     $totalpage = ceil($this->TotalResult / $this->PageSize);
     if ($totalpage == 0) {
         $totalpage = 1;
     }
     CreateDir($GLOBALS['cfg_special']);
     $murl = "";
     for ($this->PageNo = 1; $this->PageNo <= $totalpage; $this->PageNo++) {
         foreach ($this->dtp->CTags as $tagid => $ctag) {
             if ($ctag->GetName() == "list") {
                 $limitstart = ($this->PageNo - 1) * $this->PageSize;
                 $row = $this->PageSize;
                 if (trim($ctag->GetInnerText()) == "") {
                     $InnerText = GetSysTemplets("spec_list.htm");
                 } else {
                     $InnerText = trim($ctag->GetInnerText());
                 }
                 $this->dtp->Assign($tagid, $this->GetArcList($limitstart, $row, $ctag->GetAtt("col"), $ctag->GetAtt("titlelen"), $ctag->GetAtt("infolen"), $ctag->GetAtt("imgwidth"), $ctag->GetAtt("imgheight"), "spec", $ctag->GetAtt("orderby"), $InnerText, $ctag->GetAtt("tablewidth")));
             } else {
                 if ($ctag->GetName() == "pagelist") {
                     $list_len = trim($ctag->GetAtt("listsize"));
                     if ($list_len == "") {
                         $list_len = 3;
                     }
                     $this->dtp->Assign($tagid, $this->GetPageListST($list_len));
                 }
             }
         }
         //End foreach
         $makeFile = $GLOBALS['cfg_special'] . "/spec_" . $this->PageNo . $GLOBALS['art_shortname'];
         $murl = $makeFile;
         $makeFile = $GLOBALS['cfg_basedir'] . $makeFile;
         $this->dtp->SaveTo($makeFile);
         //如果启用远程站点则上传
         if ($cfg_remote_site == 'Y' && $isremote == 1) {
             //分析远程文件路径
             $remotefile = str_replace(DEDEROOT, '', $makeFile);
             $localfile = '..' . $remotefile;
             $remotedir = preg_replace('/[^\\/]*\\.html/', '', $remotefile);
             //不相等则说明已经切换目录则可以创建镜像
             $this->ftp->rmkdir($remotedir);
             $this->ftp->upload($localfile, $remotefile, 'acii');
         }
         echo "成功创建:{$murl}<br/>";
     }
     copy($GLOBALS['cfg_basedir'] . $GLOBALS['cfg_special'] . "/spec_1" . $GLOBALS['art_shortname'], $GLOBALS['cfg_basedir'] . $GLOBALS['cfg_special'] . "/index.html");
     $murl = $GLOBALS['cfg_special'] . "/index.html";
     return $murl;
 }
开发者ID:iabing,项目名称:mzzyc,代码行数:60,代码来源:arc.specview.class.php

示例8: GetMakeFileRule

 function GetMakeFileRule()
 {
     $okfile = '';
     $namerule = $this->FLInfos['namerule'];
     $listdir = $this->FLInfos['listdir'];
     $listdir = str_replace('{cmspath}', $GLOBALS['cfg_cmspath'], $listdir);
     $okfile = str_replace('{listid}', $this->FLInfos['aid'], $namerule);
     $okfile = str_replace('{listdir}', $listdir, $okfile);
     $okfile = str_replace("\\", "/", $okfile);
     $mdir = ereg_replace("/([^/]*)\$", "", $okfile);
     if (!ereg("/", $mdir) && ereg("\\.", $mdir)) {
         return $okfile;
     } else {
         CreateDir($mdir, '', '');
         return $okfile;
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:17,代码来源:arc.freelist.class.php

示例9: DisplayPartTemplets

 	function DisplayPartTemplets()
 	{
 		$nmfa = 0;
 		$tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
 		if($this->Fields['ispart']==1){
 			$tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
 		  $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
 			$tempfile = $tmpdir."/".$tempfile;
 			if(!file_exists($tempfile)){
 	  	  $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_article.htm";
 	    }
 			$this->PartView->SetTemplet($tempfile);
 		}else if($this->Fields['ispart']==2){
 			$tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempone']);
 		  $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
 			if(is_file($tmpdir."/".$tempfile)) $this->PartView->SetTemplet($tmpdir."/".$tempfile);
 			else{ $this->PartView->SetTemplet("这是没有使用模板的单独页!","string"); $nmfa = 1; }
 		}
	  CreateDir($this->Fields['typedir']);
 		$makeUrl = $this->GetMakeFileRule($this->Fields['ID'],"index",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
 		$makeFile = $this->GetTruePath().$makeUrl;
	  if($nmfa==0) $this->PartView->Display();
 		else{
 			if(!file_exists($makeFile)) $this->PartView->Display();
 			else include($makeFile);
 		}
	  $this->Close();
 	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:28,代码来源:inc_arclist_view.php

示例10: UploadOneImage

function UploadOneImage($upname,$handurl='',$ddisremote=1,$ntitle='')
{
	
	global $cuserLogin,$cfg_basedir,$cfg_image_dir,$dsql,$title;
	if($ntitle!='') $title = $ntitle; 
	$ntime = time();
	$filename = '';
	$isrm_up = false;
	$handurl = trim($handurl);
	//如果用户自行上传了图片
	if(!empty($_FILES[$upname]['tmp_name']) && is_uploaded_file($_FILES[$upname]['tmp_name']))
  {
      $istype = 0;
      $sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png");
      $_FILES[$upname]['type'] = strtolower(trim($_FILES[$upname]['type']));
      if(!in_array($_FILES[$upname]['type'],$sparr)){
		     ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG格式的其中一种!","-1");
		     exit();
	    }
      
      
      if(!empty($handurl) && !eregi("^http://",$handurl) && file_exists($cfg_basedir.$handurl) ){
	    	 if(!is_object($dsql)) $dsql = new DedeSql();
         $dsql->ExecuteNoneQuery("Delete From #@__uploads where url like '$handurl' ");
	    	 $fullUrl = eregi_replace("\.([a-z]*)$","",$handurl);
	    }else{
	    	 $savepath = $cfg_image_dir."/".strftime("%Y-%m",$ntime);
         CreateDir($savepath);
         $fullUrl = $savepath."/".strftime("%d",$ntime).dd2char(strftime("%H%M%S",$ntime).'0'.$cuserLogin->getUserID().'0'.mt_rand(1000,9999));
	    }
      
      if(strtolower($_FILES[$upname]['type'])=="image/gif") $fullUrl = $fullUrl.".gif";
      else if(strtolower($_FILES[$upname]['type'])=="image/png") $fullUrl = $fullUrl.".png";
      else $fullUrl = $fullUrl.".jpg";
      
      //保存
      @move_uploaded_file($_FILES[$upname]['tmp_name'],$cfg_basedir.$fullUrl);
	    $filename = $fullUrl;

	    //水印
	    @WaterImg($imgfile,'up');
	    $isrm_up = true;
	    
  }
  //远程或选择本地图片
  else{
	    if($handurl=='') return '';
	    //远程图片并要求本地化
	    if($isremote==1 && eregi("^http://",$handurl)){
	  	   $ddinfos = GetRemoteImage($handurl,$cuserLogin->getUserID());
	  	   if(!is_array($ddinfos)) $litpic = "";
	  	   else $filename = $ddinfos[0];
	  	   $isrm_up = true;
	    //本地图片或远程不要求本地化
	    }else{
	    	$filename = $handurl;
	    }
  }
  $imgfile = $cfg_basedir.$filename;
  if(is_file($imgfile) && $isrm_up && $filename!=''){
		$info = "";
		$imginfos = GetImageSize($imgfile,$info);
		//把新上传的图片信息保存到媒体文档管理档案中
		$inquery = "
        INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid) 
        VALUES ('$title','$filename','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','".$cuserLogin->getUserID()."','0');
    ";
     $dsql = new DedeSql(false);
     $dsql->ExecuteNoneQuery($inquery);
	}
  return $filename;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:72,代码来源:inc_archives_functions.php

示例11: MakeHtml

 	function MakeHtml($startpage=1,$makepagesize=0)
 	{
 		if(empty($startpage)) $startpage = 1;

 		$this->CountRecord();
 		
 		//初步给固定值的标记赋值
 		$this->ParseTempletsFirst();

 		CreateDir('/digg','','');

 		$murl = "";

 		if($makepagesize>0) $endpage = $startpage+$makepagesize;
 		else $endpage = ($this->TotalPage+1);

 		if($endpage>($this->TotalPage+1)) $endpage = $this->TotalPage;

 		//循环更新HTML
 		for($this->PageNo=$startpage;$this->PageNo<$endpage;$this->PageNo++)
 		{
 		  $this->ParseDMFields($this->PageNo,1);
 	    $makeFile = $this->NameRule;
 	    $makeFile = str_replace("{page}",$this->PageNo,$makeFile);
 	    $murl = $makeFile;
 	    $makeFile = $this->GetTruePath().$makeFile;
 	    $makeFile = ereg_replace("/{1,}","/",$makeFile);
 	    $murl = $this->GetTrueUrl($murl);
 	    $this->dtp->SaveTo($makeFile);
 	    echo "成功创建:<a href='$murl' target='_blank'>$murl</a><br/>";
 	  }
 	  
 		$this->Close();
 		
 		return $murl;
 	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:36,代码来源:inc_digglist_view.php

示例12: GetUpImage

function GetUpImage($litpic,$isdd=false,$exitErr=false,$iw=0,$ih=0,$iname='')
{
	global $cfg_ml,$cfg_ddimg_width,$cfg_ddimg_height;
	global $cfg_basedir,$cfg_user_dir,$title,$cfg_mb_upload_size,$cfg_photo_typenames;
	if($iw==0) $iw = $cfg_ddimg_width;
	if($ih==0) $ih = $cfg_ddimg_height;
	$ntime = $nowtme = mytime();
	if(!isset($_FILES[$litpic])) return "";
	if(is_uploaded_file($_FILES[$litpic]['tmp_name']))
	{
      //超过限定大小的文件不给上传
      if($_FILES[$litpic]['size'] > $cfg_mb_upload_size*1024){
      	@unlink($_FILES[$litpic]['tmp_name']);
      	return "";
      }
      $sparr = $cfg_photo_typenames;
      $_FILES[$litpic]['type'] = strtolower(trim($_FILES[$litpic]['type']));
      if(!in_array($_FILES[$litpic]['type'],$sparr)){
		    if($exitErr){
		    	ShowMsg("上传的缩略图片格式错误,请使用JPEG、GIF、PNG格式的其中一种!","-1");
		      exit();
		    }else{ return ""; }
	    }

      $savepath = $cfg_user_dir."/".$cfg_ml->M_ID;
      CreateDir($savepath);

      if($iname=='') $itname = dd2char($cfg_ml->M_ID."0".strftime("%y%m%d%H%M%S",$nowtme)."0".mt_rand(1000,9999)).'-lit';
      else $itname = $iname;

      $fullUrl = $savepath."/".$itname;

      //强制检测文件类型
      if($iname==''){
          if(strtolower($_FILES[$litpic]['type'])=="image/gif") $fullUrl = $fullUrl.".gif";
          else if(strtolower($_FILES[$litpic]['type'])=="image/png") $fullUrl = $fullUrl.".png";
          else $fullUrl = $fullUrl.".jpg";
      }else{
      	  $fullUrl = $fullUrl.'.jpg';
      }

      @move_uploaded_file($_FILES[$litpic]['tmp_name'],$cfg_basedir.$fullUrl);
	    $litpic = $fullUrl;

	    if($isdd) @ImageResize($cfg_basedir.$fullUrl,$iw,$ih);
	    else @WaterImg($cfg_basedir.$fullUrl,'up');

	    //保存用户上传的记录到数据库
	    if($title==''){
	    	if($isdd) $title = '用户上传的图片';
	    	else $title = '用户上传的略略图';
	    }
	    $info = "";
	    $datas[0] = 0;
	    $datas[1] = 0;
	    $datas = GetImageSize($cfg_basedir.$fullUrl,$info);
	    $addinfos[0] = $datas[0];
	    $addinfos[1] = $datas[1];
	    $addinfos[2] = filesize($cfg_basedir.$fullUrl);
	    SaveUploadInfo($title,$fullUrl,1,$addinfos);

	    return $litpic;
  }else{
  	 return "";
  }
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:66,代码来源:inc_archives_functions.php

示例13: SaveToHtml

 /**
  *  保存结果为文件
  *
  * @access    public
  * @param     string  $filename  文件名
  * @param     string  $isremote  是否远程
  * @return    string
  */
 function SaveToHtml($filename, $isremote = 0)
 {
     global $cfg_remote_site;
     //如果启用远程发布则需要进行判断
     if ($this->actype == "download") {
         if (substr_count($this->TypeLink->TypeInfos['typedir'], "/") > 1) {
             $a = "/html/download" . str_replace(strrchr($this->TypeLink->TypeInfos['typedir'], "/"), "", $this->TypeLink->TypeInfos['typedir']);
             CreateDir($a);
         }
     }
     if ($this->TypeLink->TypeInfos['reid'] == 45) {
         if (substr_count($this->TypeLink->TypeInfos['typedir'], "/") > 1) {
             $a = "/html" . str_replace(strrchr($this->TypeLink->TypeInfos['typedir'], "/"), "", $this->TypeLink->TypeInfos['typedir']);
             CreateDir($a);
         }
     }
     if ($cfg_remote_site == 'Y' && $isremote == 1) {
         //分析远程文件路径
         $remotefile = str_replace(DEDEROOT, '', $filename);
         $localfile = '..' . $remotefile;
         //创建远程文件夹
         $remotedir = preg_replace('/[^\\/]*\\.js/', '', $remotefile);
         $this->ftp->rmkdir($remotedir);
         $this->ftp->upload($localfile, $remotefile, 'ascii');
     }
     $this->dtp->SaveTo($filename);
 }
开发者ID:soonfine,项目名称:leread,代码行数:35,代码来源:arc.partview.class.php

示例14: CachePutContents

/**
 * 储存
 * @param $body
 * @param $path
 */
function CachePutContents($body, $path)
{
    CreateDir(dirname($path));
    $handle = fopen($path, 'w');
    fwrite($handle, $body);
    fclose($handle);
}
开发者ID:baiyunping333,项目名称:seo-marketing,代码行数:12,代码来源:function.php

示例15: wpdm_pro_Install

function wpdm_pro_Install()
{
    global $wpdb;
    delete_option('wpdm_latest');
    /*
    $sqls[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ahm_files` (
            `id` int(11) NOT NULL AUTO_INCREMENT,
            `title` varchar(255) NOT NULL,
            `description` text NOT NULL,
            `link_label` varchar(255) NOT NULL,
            `password` text NOT NULL,
            `quota` int(11) NOT NULL,
            `show_quota` tinyint(11) NOT NULL,
            `show_counter` tinyint(1) NOT NULL,
            `access` text NOT NULL,
            `template` varchar(100) NOT NULL,
            `category` text NOT NULL,
            `icon` varchar(255) NOT NULL,
            `preview` varchar(255) NOT NULL,
            `files` text NOT NULL,
            `sourceurl` text NOT NULL,
            `download_count` int(11) NOT NULL,
            `page_template` varchar(255) NOT NULL,
            `url_key` varchar(255) NOT NULL,
            `uid` INT NOT NULL,
            `create_date` INT NOT NULL,
            `update_date` INT NOT NULL,
            PRIMARY KEY (`id`)
          ) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    */
    $sqls[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ahm_download_stats` (\n              `id` int(11) NOT NULL AUTO_INCREMENT,\n              `pid` int(11) NOT NULL,\n              `uid` int(11) NOT NULL,\n              `oid` varchar(100) NOT NULL,\n              `year` int(4) NOT NULL,\n              `month` int(2) NOT NULL,\n              `day` int(2) NOT NULL,\n              `timestamp` int(11) NOT NULL,\n              `ip` varchar(20) NOT NULL,\n              PRIMARY KEY (`id`)\n            ) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    /*
    $sqls[] = "CREATE TABLE `{$wpdb->prefix}ahm_filemeta` (
           `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
           `pid` INT NOT NULL ,
           `name` VARCHAR( 80 ) NOT NULL ,
           `value` TEXT NOT NULL,
           `uniq` BOOLEAN NOT NULL DEFAULT '0'
          ) ENGINE = MyISAM  DEFAULT CHARSET=utf8";
    */
    $sqls[] = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ahm_emails` (\n              `id` int(11) NOT NULL AUTO_INCREMENT,\n              `email` varchar(255) NOT NULL,\n              `pid` int(11) NOT NULL,\n              `date` int(11) NOT NULL,\n              `custom_data` text NOT NULL,\n              `request_status` INT( 1 ) NOT NULL,\n              PRIMARY KEY (`id`)\n            )";
    /* $sqls[] = "CREATE TABLE  IF NOT EXISTS `{$wpdb->prefix}ahm_categories` (
       `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
       `title` VARCHAR( 255 ) NOT NULL ,
       `desc` TEXT NOT NULL ,
       `url_key` VARCHAR( 255 ) NOT NULL ,
       `pcount` INT NOT NULL ,
       `image` VARCHAR( 255 ) NOT NULL ,
       `parent` INT NOT NULL ,
       UNIQUE (
       `url_key`
       )
       )";*/
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_files` ADD `uid` INT NOT NULL";
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_files` ADD `create_date` INT NOT NULL";
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_files` ADD `update_date` INT NOT NULL";
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_files` ADD `url_key` varchar(255) NOT NULL";
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_emails` ADD `custom_data` TEXT NOT NULL ";
    //$sqls[] = "ALTER TABLE `{$wpdb->prefix}ahm_emails` ADD `request_status` INT( 1 ) NOT NULL ";
    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    foreach ($sqls as $sql) {
        $wpdb->query($sql);
        //dbDelta($sql);
    }
    if (get_option('_wpdm_etpl') == '') {
        update_option('_wpdm_etpl', array('title' => 'Your download link', 'body' => file_get_contents(dirname(__FILE__) . '/templates/wpdm-email-lock-template.html')));
    }
    wpdm_common_actions();
    flush_rewrite_rules();
    CreateDir();
}
开发者ID:jimrucinski,项目名称:Vine,代码行数:71,代码来源:download-manager.php


注:本文中的CreateDir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。