zoukankan      html  css  js  c++  java
  • 发布站点到远程FTP根目录

    第一步:修改 phpcms/modules/admin/templates/site_add.tpl.php 找到

    <legend><?php echo L('release_point_configuration')?></legend>

    大约在64行的位置
    将他下面的整个table 替换成如下代码

    <table width="100%" class="table_form">
    <tr>
    <th width="80" valign="top"><?php echo L('release_point')?>:</th>
    <td> <select name="release_point[]" size="3" id="release_point" multiple title="<?php echo L('ctrl_more_selected')?>" onchange="if($(this).val() > 0){$('#ftp_top').show();}else{$('#ftp_top').hide();}">
    <option value='' selected><?php echo L('not_use_the_publishers_some')?></option>
    <?php if(is_array($release_point_list) && !empty($release_point_list)): foreach($release_point_list as $v):?>
    <option value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
    <?php endforeach;endif;?>
    </select> </td>
    
    </tr>
    <tr id="ftp_top" style="display:none" >
    <th width="120" valign="top">发布到FTP根目录:</th>
    <td><input type="radio" name="setting[ftp_top]" value="1" /> 是 <input type="radio" name="setting[ftp_top]" value="0" checked /> 否 <br />注:如果选择是 那么远程FTP将不会包含站点目录,适用于不能子目录绑定的FTP!!</td>
    </tr>
    
    </table>

    二步 :修改 phpcms/modules/admin/templates/site_edit.tpl.php 找到

    <legend><?php echo L('release_point_configuration')?></legend>
    <table width="100%" class="table_form">
    <tr>
    <th width="80" valign="top"><?php echo L('release_point')?>:</th>
    <td> <select name="release_point[]" size="3" id="release_point" multiple title="<?php echo L('ctrl_more_selected')?>" onchange="if($(this).val() > 0){$('#ftp_top').show();}else{$('#ftp_top').hide();}">
    <option value='' <?php if(!$data['release_point']) echo 'selected';?>><?php echo L('not_use_the_publishers_some')?></option>
    <?php if(is_array($release_point_list) && !empty($release_point_list)): foreach($release_point_list as $v):?>
    <option value="<?php echo $v['id']?>"<?php if(in_array($v['id'], explode(',',$data['release_point']))){echo ' selected';}?>><?php echo $v['name']?></option>
    <?php endforeach;endif;?>
    </select></td>
    </tr>
    <tr id="ftp_top" <?php echo $data['release_point'] ? '' : 'style="display:none"'?> >
    <th width="120" valign="top">发布到FTP根目录:</th>
    <td><input type="radio" name="setting[ftp_top]" value="1" <?php echo $setting['ftp_top'] ? 'checked' : '';?> /> 是 <input type="radio" name="setting[ftp_top]" value="0" <?php echo $setting['ftp_top'] ? '' : 'checked';?> /> 否 <br />注:如果选择是 那么远程FTP将不会包含站点目录,适用于不能子目录绑定的FTP!!</td>
    </tr>
    
    </table>

    第三步: 修改  phpcms/modules/release/index.php

    foreach ($data as $v) {

    将整个foreach循环改成如下

     
    if(strpos($this->site['setting'], "'ftp_top' => '1'"))$ftp_top = pc_base::load_config('system','html_root');
       foreach ($data as $v) {
        $status = -1;
        $n_path = isset($ftp_top) ? preg_replace(array('|^'.$ftp_top.'/'.$this->site['dirname'].'/|iUs', '|^/'.$this->site['dirname'].'/|iUs'), '', $v['path']) : $v['path'];
        switch ($v['type']) {
         case 'del':
          if ($ftps->f_delete($release_point['path'].$n_path)) {
           $status = 1;
          }
          break;
         case 'add':
         case 'edit':
          if ($ftps->put($release_point['path'].$n_path, PHPCMS_PATH.$v['path'])) {
           $status = 1;
          }
          break;
        }
        $queue->update(array('status'.($id+1)=>$status, 'times'=>SYS_TIME), array('id'=>$v['id']));
       }
  • 相关阅读:
    mininet 多径传输网络仿真
    mininet 多径仿真双路由双网卡
    mininet仿真星型拓扑
    mininet 三个路由器两个终端的仿真
    mininet 两个路由器两个终端仿真
    mininet 仿真一个路由器两个终端
    mininet 两个交换机两个终端的仿真
    mininet 一个交换机两个终端的仿真
    ps命令
    df命令
  • 原文地址:https://www.cnblogs.com/wangchuang/p/3201554.html
Copyright © 2011-2022 走看看