//保存到附加表
$cts = $dsql->GetOne("SELECT addtable FROM `js_channeltype` WHERE id='$channelid' ");
在其上边加入
//软件链接列表
$urls = '';
//本地链接处理
$softurl1 = stripslashes($softurl1);
$nsoftsize = '';
if($softurl1 != '')
{
$urls .= "{dede:link islocal='1' text='{$servermsg1}'} $softurl1 {/dede:link}\r\n";
}
//其它链接处理
for($i=2; $i<=30; $i++)
{
if(!(${'softurl'.$i}))
{
$forconfig = (${'forconfig'.$i}) ? FALSE : TRUE;
if($forconfig)
{
if(empty(${'need'.$i})) continue;
$serverUrl = stripslashes(${'softurlfirst'.$i});
$serverUrl = preg_replace("#\/$#", "", $serverUrl);
$softurl = stripslashes(${'softurl'.$i});
if( cn_substr($softurl, 1) != '/' ) $softurl = '/'.$softurl;
$softurl = $serverUrl.$softurl;
}
else
{
$softurl = stripslashes(${'softurl'.$i});
}
$servermsg = str_replace("'", "", stripslashes(${'servermsg'.$i}));
if($servermsg=='') $servermsg = '下载地址'.$i;
if($softurl != '')
{
$urls .= "{dede:link text='$servermsg'} $softurl {/dede:link}\r\n";
}
}
}
$urls = addslashes($urls);
这段大概在203行左右,主要作用是处理下载地址。然后再找到
$query = "INSERT INTO `{$addtable}`(aid,typeid,redirecturl,templet,userip,body{$inadd_f}) Values('$arcID','$typeid','$redirecturl','$templet','$useip','$body'{$inadd_v})";
替换为
$query = "INSERT INTO `{$addtable}`(aid,typeid,redirecturl,templet,userip,body,softlinks,needmoney,daccess{$inadd_f}) Values('$arcID','$typeid','$redirecturl','$templet','$useip','$body','$urls','$needmoney','$daccess'{$inadd_v})";
article_add.php修改完毕,添加一下文章,把下载地址,金币,会员组都写进去,看看数据库是不是有这条记录了^ ^。
6、打开article_edit.php,找到
$channelid = $arcRow['channel'];
在其上边加入
$newRowStart = 1;
$nForm = '';
$daccess = $addRow['daccess'];
$needmoney = $addRow['needmoney'];
if($addRow['softlinks'] != '')
{
$dtp = new DedeTagParse();
$dtp->LoadSource($addRow['softlinks']);
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $ctag)
{
if($ctag->GetName()=='link')
{
$islocal = $ctag->GetAtt('islocal');
if($islocal != 1) $needmsg = "<input type='checkbox' name='del{$newRowStart}' value='1' />删除";
else $needmsg = '<input name="sel1" type="button" id="sel1" value="选取" onClick="SelectSoft(\'form1.softurl'.$newRowStart.'\')" />';
$nForm .= "<div style='line-height:36px'>软件地址{$newRowStart}:<input type='text' name='softurl{$newRowStart}' style='width:280px' value='".trim($ctag->GetInnerText())."' />
服务器名称:<input type='text' name='servermsg{$newRowStart}' value='".$ctag->GetAtt("text")."' style='width:150px' />
<input type='hidden' name='islocal{$newRowStart}' value='{$islocal}' />
$needmsg
</div>\r\n";
$newRowStart++;
}
}
}
$dtp->Clear();
}
找到
$cts = $dsql->GetOne("SELECT addtable FROM `js_channeltype` WHERE id='$channelid' ");
在其上边加入以下代码:
//软件链接列表
$urls = '';
for($i=1; $i<=30; $i++)
{
if(!empty(${'softurl'.$i}))
{
$islocal = empty(${'islocal'.$i}) ? '' : 1;
$isneed = empty(${'del'.$i}) ? true : false;
$servermsg = str_replace("'",'',stripslashes(${'servermsg'.$i}));
$softurl = stripslashes(${'softurl'.$i});
if($servermsg=='')
{
$servermsg = '下载地址'.$i;
}
if($softurl != '')
{