自拍亚洲一区欧美另类,亚洲成人影院,亚洲午夜久久久久妓女影院,最近中文字幕高清中文字幕无,亚洲熟妇av一区二区三区漫画

互聯(lián)網(wǎng)知識(shí)

精準(zhǔn)傳達(dá) ? 價(jià)值共享

洞悉互聯(lián)網(wǎng)前沿資訊,探尋網(wǎng)站營(yíng)銷規(guī)律

織夢(mèng)網(wǎng)站后臺(tái)增加復(fù)制文章文檔的功能

作者:狐靈科技 | 2019-06-22 22:24 |點(diǎn)擊:

起因:

因?yàn)楹`的客戶 在我們公司做了一個(gè)中文網(wǎng)站 突然突然想在增加一個(gè)外貿(mào)站 而且是以二級(jí)目錄/en 的形式

客戶的產(chǎn)品有幾千個(gè) 非常之多  每篇文章發(fā)布起來是非常麻煩的  所以導(dǎo)致我們想增加文章復(fù)制功能 只把標(biāo)題改下 提高效率

下面說織夢(mèng)網(wǎng)站后臺(tái)增加復(fù)制文檔的功能的詳細(xì)說明 另“附上修改的文件打包


效果圖如下:

復(fù)制文檔功能截圖

Dedecms織夢(mèng)后臺(tái)增加復(fù)制文檔
的功能步驟如下

一、打開templets下的content_list.htm 找到

<a href="javascript:;" onClick="moveArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>)" class="coolbg">&nbsp;移動(dòng)&nbsp;</a>

在這一行的下方添加:

<a href="javascript:;" onClick="copyArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>);" class="coolbg">&nbsp;復(fù)制&nbsp;</a>

 

二、打開dede/js/list.js 找到


function moveArc(e, obj, cid)

在它的上方添加這個(gè)函數(shù)
 

  1. function copyArc(e, obj, cid){
        var qstr=getCheckboxItem();
        if(qstr=='')
        {
            alert('必須選擇一個(gè)或多個(gè)文檔!');
            return;
        }
        LoadQuickDiv(e, 'archives_do.php?dopost=copyArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'copyArchives', '450px', '180px');
        ChangeFullDiv('show');
    }
     


 

三、打開 dede/archives_do.php 找到

else if($dopost=='return')



在它的上方添加如下代碼:


  1. elseif ($dopost == 'copyArchives') {
        CheckPurview('sys_ArcBatch');
        if (empty($totype)) {
            require_once(DEDEINC . '/typelink.class.php');
            if (!empty($aid) && empty($qstr)) $qstr = $aid;
     
            AjaxHead();
            $channelid = empty($channelid) ? 0 : $channelid;
            $tl = new TypeLink($aid);
            $typeOptions = $tl->GetOptionArray(0, $admin_catalogs, $channelid);
            $typeOptions = "<select name='totype' style='width:90%'>
            <option value='0'>請(qǐng)選擇復(fù)制到的位置...</option>
            $typeOptions
            </select>";
     
            //輸出AJAX可移動(dòng)窗體
            $divname = 'copyArchives';
            echo "<div class='title' onmousemove="DropMoveHand('{$divname}', 225);" onmousedown="DropStartHand();" onmouseup="DropStopHand();"> ";
            echo "    <div class='titLeft'>復(fù)制文檔</div> ";
            echo "    <div class='titRight'><img src='images/ico-close.gif' style='cursor:pointer;' onclick='HideObj("{$divname}");ChangeFullDiv("hide");' 關(guān)閉' title='關(guān)閉' /></div> ";
            echo "</div> ";
            echo "<form name='quickeditform' action='archives_do.php' method='post'> ";
            echo "<input type='hidden' name='dopost' value='{$dopost}' /> ";
            echo "<input type='hidden' name='qstr' value='{$qstr}' /> ";
            echo "<table width='100%' style='margin-top:6px;z-index:9000;'> ";
            ?>
            <tr height='28'>
                <td width="80" class='bline'> 目標(biāo)欄目:</td>
                <td class='bline'>
                    <?php echo $typeOptions; ?>
                </td>
            </tr>
            <tr height='32'>
                <td width="80" class='bline'> 文檔ID:</td>
                <td class='bline'>
                    <input type='text' name='tmpids' value="<?php echo $qstr; ?>" style='width:310px;overflow:hidden;'/>
                    <br/>
                    復(fù)制到的目標(biāo)欄目必須和選定的文檔頻道類型一致,否則程序會(huì)自動(dòng)勿略不符合的文檔。
                </td>
            </tr>
            <tr height='32'>
                <td colspan='2' align='center' style='padding-top:12px'>
                    <input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" class="np"
                           border="0" style="cursor:pointer"/>
                      
                    <img src="images/button_back.gif" width="60" height="22" border="0"
                         onclick='HideObj("<?php echo $divname; ?>");ChangeFullDiv("hide");' style="cursor:pointer"/>
                </td>
                </td>
            </tr>
            </table>
            </form>
            <?php
            //AJAX窗體結(jié)束
        } else {
            $totype = preg_replace("#[^0-9]#", '', $totype);
            $typeInfos = $dsql->GetOne("SELECT tp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystem FROM `dede_arctype` tp LEFT JOIN `dede_channeltype` ch on ch.id=tp.channeltype WHERE tp.id='$totype' ");
            $idtype = "id";
            if (!is_array($typeInfos)) {
                ShowMsg('參數(shù)錯(cuò)誤!', '-1');
                exit();
            }
            if ($typeInfos['ispart'] != 0) {
                ShowMsg('文檔保存的欄目必須為最終列表欄目!', '-1');
                exit();
            }
            if (empty($typeInfos['addtable'])) {
                $typeInfos['maintable'] = '`dede_archives`';
            }
            //增加單表模型判斷
            if ($typeInfos['issystem'] == -1) {
                $typeInfos['maintable'] = $typeInfos['addtable'];
                $idtype = "aid";
            }
            $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr));
            $arc = '';
            $j = 0;
            $okids = array();
            $dsql->SetQuery("SELECT {$idtype},typeid FROM `{$typeInfos['maintable']}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos['channeltype']}' ");
            $dsql->Execute();
            while ($row = $dsql->GetArray()) {
                if ($row['typeid'] != $totype) {
                    
                    $dsql->ExecuteNoneQuery("insert into `dede_arctiny` (typeid,typeid2,arcrank,channel,senddate,sortrank,mid) select typeid,typeid2,arcrank,channel,senddate,sortrank,mid from `dede_arctiny` where id='{$row[$idtype]}'");
                    
                    $xid = $dsql->GetLastID();
                    
                    $dsql->ExecuteNoneQuery("insert into `{$typeInfos['maintable']}`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weight) select case when id>'0' then '$xid'  else '' end, case when typeid>'0' then '$totype'  else '' end,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords ,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weight from `{$typeInfos['maintable']}` WHERE id='{$row[$idtype]}' ");
                    
                    $dsql->ExecuteNoneQuery("insert into `{$typeInfos['addtable']}`(aid,typeid,body,redirecturl,templet,userip) select case when aid>'0' then '$xid'  else '' end,$totype,body,redirecturl,templet,userip from `{$typeInfos['addtable']}` WHERE aid='{$row[$idtype]}' ");
                    
                    $okids[] = $row[$idtype];
                    $j++;
                }
            }
     
            
        UpDateCatCache();
        $sql = " TRUNCATE TABLE `dede_arctiny`";
        $dsql->ExecuteNoneQuery($sql);
        
        //導(dǎo)入普通模型微數(shù)據(jù)
        $sql = "INSERT INTO `dede_arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)  
                SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `dede_archives` ";
        $dsql->ExecuteNoneQuery($sql);
        
        //導(dǎo)入單表模型微數(shù)據(jù)
        $dsql->SetQuery("SELECT id,addtable FROM `dede_channeltype` WHERE id < -1 ");
        $dsql->Execute();
        $doarray = array();
        while($row = $dsql->GetArray())
        {
            $tb = str_replace('dede_', $cfg_dbprefix, $row['addtable']);
            if(empty($tb) || isset($doarray[$tb]) )
            {
                continue;
            }
            else
            {
                $sql = "INSERT INTO `dede_arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid)  
                        SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb` ";
                $rs = $dsql->executenonequery($sql);
                $doarray[$tb]  = 1;
            }
        }
            //更新HTML
            foreach ($okids as $aid) {
                $arc = new Archives($aid);
                $arc->MakeHtml();
            }
            ShowMsg("成功復(fù)制 $j 個(gè)文檔!", $ENV_GOBACK_URL);
            exit();
        }
     


然后就完成了織夢(mèng) 增加復(fù)制文章的方法


如果提示成功復(fù)制0個(gè)文檔 說明你復(fù)制錯(cuò)了 不能同欄目之間復(fù)制 


另外注意的是 完成了以上操作 只能文檔復(fù)制 不能圖集  想要圖集復(fù)制 找到這個(gè)文件 
dede/ templets/ content_i_list.htm 

找到 

  1. <a href="javascript:;" onClick="moveArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>)" class="coolbg">&nbsp;移動(dòng)&nbsp;</a>

在他的下面復(fù)制
 
  1. <a href="javascript:;" onClick="copyArc(event,this,<?php echo (empty($channelid) ? 0 : $channelid); ?>);" class="coolbg">&nbsp;復(fù)制&nbsp;</a>

完成

圖集只能復(fù)制文章內(nèi)容 不能復(fù)制圖集圖片

如果嫌麻煩或者擔(dān)心改錯(cuò) 可以下載懶人包進(jìn)行替換

 點(diǎn)擊圖標(biāo)下載(注意更改dede默認(rèn)目錄)



如沒特殊注明,文章均為狐靈科技原創(chuàng),轉(zhuǎn)載請(qǐng)注明?? "織夢(mèng)網(wǎng)站后臺(tái)增加復(fù)制文章文檔的功能
多一份免費(fèi)策劃方案,總有益處。

請(qǐng)直接添加技術(shù)總監(jiān)微信聯(lián)系咨詢

網(wǎng)站設(shè)計(jì) 品牌營(yíng)銷

多一份參考,總有益處

聯(lián)系狐靈科技,免費(fèi)獲得專屬《策劃方案》及報(bào)價(jià)

咨詢相關(guān)問題或預(yù)約面談,可以通過以下方式與我們聯(lián)系

業(yè)務(wù)熱線:15082661954 / 大客戶專線:15523356218