code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_js');
$aid = ereg_replace("[^0-9]","",$aid);
$db = new DedeSql(false);
$row = $db->GetOne("Select * From #@__plus where aid='$aid'");
require_once(dirname(__FILE__)."/templets/plus_js.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/plus_js.php | PHP | asf20 | 291 |
<?php
require(dirname(__FILE__)."/config.php");
require(DEDEADMIN."/../include/pub_oxwindow.php");
require(DEDEADMIN."/file_class.php");
CheckPurview('plus_文件管理器');
$activepath = str_replace("..","",$activepath);
$activepath = ereg_replace("^/{1,}","/",$activepath);
if($activepath == "/") $activepath = "";
if($activepath == "") $inpath = $cfg_basedir;
else $inpath = $cfg_basedir.$activepath;
//文件管理器交互与逻辑控制文件
$fmm = new FileManagement();
$fmm->Init();
/*---------------
function __rename();
----------------*/
if($fmdo=="rename")
{
$fmm->RenameFile($oldfilename,$newfilename);
}
//新建目录
/*---------------
function __newdir();
----------------*/
else if($fmdo=="newdir")
{
$fmm->NewDir($newpath);
}
//移动文件
/*---------------
function __move();
----------------*/
else if($fmdo=="move")
{
$fmm->MoveFile($filename,$newpath);
}
//删除文件
/*---------------
function __delfile();
----------------*/
else if($fmdo=="del")
{
$fmm->DeleteFile($filename);
}
//文件编辑
/*---------------
function __saveEdit();
----------------*/
else if($fmdo=="edit")
{
$filename = str_replace("..","",$filename);
$file = "$cfg_basedir$activepath/$filename";
$str = eregi_replace("< textarea","<textarea",$str);
$str = eregi_replace("< /textarea","</textarea",$str);
$str = eregi_replace("< form","<form",$str);
$str = eregi_replace("< /form","</form",$str);
$str = stripslashes($str);
$fp = fopen($file,"w");
fputs($fp,$str);
fclose($fp);
if(empty($backurl)) ShowMsg("成功保存一个文件!","file_manage_main.php?activepath=$activepath");
else ShowMsg("成功保存文件!",$backurl);
exit();
}
//文件编辑,可视化模式
/*---------------
function __saveEditView();
----------------*/
else if($fmdo=="editview")
{
$filename = str_replace("..","",$filename);
$file = "$cfg_basedir$activepath/$filename";
$str = eregi_replace('"','\\"',$str);
$str = stripslashes($str);
$fp = fopen($file,"w");
fputs($fp,$str);
fclose($fp);
if(empty($backurl)) $backurl = "file_manage_main.php?activepath=$activepath";
ShowMsg("成功保存文件!",$backurl);
exit();
}
//文件上传
/*---------------
function __upload();
----------------*/
else if($fmdo=="upload")
{
$j=0;
for($i=1;$i<=50;$i++)
{
$upfile = "upfile".$i;
$upfile_name = "upfile".$i."_name";
if(!isset(${$upfile}) || !isset(${$upfile_name})) continue;
$upfile = ${$upfile};
$upfile_name = ${$upfile_name};
if(is_uploaded_file($upfile))
{
if(!file_exists($cfg_basedir.$activepath."/".$upfile_name)){
move_uploaded_file($upfile,$cfg_basedir.$activepath."/".$upfile_name);
}
@unlink($upfile);
$j++;
}
}
ShowMsg("成功上传 $j 个文件到: $activepath","file_manage_main.php?activepath=$activepath");
exit();
}
//空间检查
else if($fmdo=="space")
{
if($activepath=="") $ecpath = "所有目录";
else $ecpath = $activepath;
$titleinfo = "目录 <a href='file_manage_main.php?activepath=$activepath'><b><u>$ecpath</u></b></a> 空间使用状况:<br/>";
$wintitle = "文件管理";
$wecome_info = "文件管理::空间大小检查 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>";
$activepath=$cfg_basedir.$activepath;
$space=new SpaceUse;
$space->checksize($activepath);
$total=$space->totalsize;
$totalkb=$space->setkb($total);
$totalmb=$space->setmb($total);
$win = new OxWindow();
$win->Init("","js/blank.js","POST");
$win->AddTitle($titleinfo);
$win->AddMsgItem(" $totalmb M<br/> $totalkb KB<br/> $total 字节");
$winform = $win->GetWindow("");
$win->Display();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/file_manage_control.php | PHP | asf20 | 3,825 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('spec_List');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
require_once(dirname(__FILE__)."/inc/inc_list_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
if(!isset($cid)) $cid = 0;
if(!isset($keyword)) $keyword = "";
if(!isset($channelid)) $channelid = 0;
if(!isset($arcrank)) $arcrank = "";
$typeid = $cid;
if($cuserLogin->getUserRank()<5) $arcrank = -1;
$tl = new TypeLink($cid);
$seltypeids = 0;
if(!empty($cid)){
$seltypeids = $tl->dsql->GetOne("Select ID,typename,channeltype From #@__arctype where ID='$cid' ");
}
$opall=1;
if(is_array($seltypeids)){
$optionarr = GetTypeidSel('form3','cid','selbt1',0,$seltypeids['ID'],$seltypeids['typename']);
}else{
$optionarr = GetTypeidSel('form3','cid','selbt1',0,0,'请选择...');
}
$whereSql = " where arcs.channel = -1 ";
if($keyword!=""){
$whereSql .= " And (arcs.title like '%$keyword%' Or arcs.writer like '%$keyword%' Or arcs.source like '%$keyword%') ";
}
if($typeid!=0){
$tlinkSql = $tl->GetSunID($typeid,"arcs",0);
$whereSql .= " And $tlinkSql ";
}
if($arcrank!=""){
$whereSql .= " And arcs.arcrank=$arcrank ";
$CheckUserSend = "<input type='button' onClick=\"location='content_s_list.php?cid=".$cid."';\" value='所有专题' class='inputbut' />";
}
else
{
$CheckUserSend = "<input type='button' onClick=\"location='content_s_list.php?cid=".$cid."&arcrank=-1';\" value='待审核专题' class='inputbut' />";
}
$tl->Close();
$query = "
select arcs.ID,arcs.typeid,arcs.senddate,arcs.iscommend,arcs.ismake,arcs.channel,arcs.arcrank,arcs.click,arcs.title,arcs.color,arcs.litpic,arcs.pubdate,arcs.adminID,arcs.memberID,`#@__arctype`.typename,`#@__channeltype`.typename as channelname
from `#@__archivesspec` arcs
left join `#@__arctype` on #@__arctype.ID=arcs.typeid
left join `#@__channeltype` on #@__channeltype.ID=arcs.channel
$whereSql
order by arcs.ID desc
";
$dlist = new DataList();
$dlist->pageSize = 20;
$dlist->SetParameter("dopost","listArchives");
$dlist->SetParameter("keyword",$keyword);
$dlist->SetParameter("cid",$cid);
$dlist->SetParameter("arcrank",$arcrank);
$dlist->SetParameter("channelid",$channelid);
$dlist->SetSource($query);
include(dirname(__FILE__)."/templets/content_s_list.htm");
$dlist->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/content_s_list.php | PHP | asf20 | 2,470 |
<?php
$__ONLYDB = true;
$__ONLYCONFIG = true;
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/pub_charset.php");
AjaxHead();
$myhtml = UnicodeUrl2Gbk(stripslashes($myhtml));
echo "<div class='coolbg4' style='width:380px'>[<a href='#' onclick='javascript:HideObj(\"_myhtml\")'>关闭</a>]</div>\r\n";
preg_match_all("/(src|SRC)=[\"|'| ]{0,}(http:\/\/(.*)\.(gif|jpg|jpeg|png))/isU",$body,$img_array);
$img_array = array_unique($img_array[2]);
echo "捕获的图片:";
print_r($img_array);
echo "<span class='coolbg5'> </span>\r\n";
?> | zyyhong | trunk/jiaju001/news/lic/album_testhtml.php | PHP | asf20 | 623 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_ArcBatch');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/inc/inc_batchup.php");
//typeid,startid,endid,seltime,starttime,endtime,action,newtypeid
//批量操作
//check del move makehtml
//获取ID条件
//------------------------
if(empty($startid)) $startid = 0;
if(empty($endid)) $endid = 0;
if(empty($seltime)) $seltime = 0;
//生成HTML操作由其它页面处理
if($action=="makehtml")
{
$jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid";
$jumpurl .= "&typeid=$typeid&pagesize=20&seltime=$seltime";
$jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime);
header("Location: $jumpurl");
exit();
}
$gwhere = " where arcrank=0 ";
if($startid >0 ) $gwhere .= " And ID>= $startid ";
if($endid > $startid) $gwhere .= " And ID<= $endid ";
$dsql = new DedeSql(false);
$idsql = "";
if($typeid!=0){
$GLOBALS['idArray'] = array();
$idArrary = TypeGetSunTypes($typeid,$dsql,0);
if(is_array($idArrary)){
foreach($idArrary as $tid){
if($idsql=="") $idsql .= " typeid=$tid ";
else $idsql .= " or typeid=$tid ";
}
$gwhere .= " And ( ".$idsql." ) ";
}
}
if($seltime==1){
$t1 = GetMkTime($starttime);
$t2 = GetMkTime($endtime);
$gwhere .= " And (senddate >= $t1 And senddate <= $t2) ";
}
//指量审核
if($action=='check')
{
if(empty($startid)||empty($endid)){
ShowMsg('该操作必须指定起始ID!','javascript:;');
exit();
}
$jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid";
$jumpurl .= "&typeid=$typeid&pagesize=20&seltime=$seltime";
$jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime);
$dsql->SetQuery("Select ID,arcrank From #@__archives $gwhere");
$dsql->Execute('c');
while($row = $dsql->GetObject('c')){
if($row->arcrank==-1) $dsql->ExecuteNoneQuery("Update #@__archives set arcrank=0 where ID='{$row->ID}'");
}
$dsql->Close();
ShowMsg("完成数据库的审核处理,准备更新HTML...",$jumpurl);
exit();
}
//批量删除
else if($action=='del')
{
if(empty($startid)||empty($endid)){
ShowMsg('该操作必须指定起始ID!','javascript:;');
exit();
}
$dsql->SetQuery("Select ID From #@__archives $gwhere");
$dsql->Execute('x');
$tdd = 0;
while($row = $dsql->GetObject('x')){ if(DelArc($row->ID)) $tdd++; }
$dsql->Close();
ShowMsg("成功删除 $tdd 条记录!","javascript:;");
exit();
}
//批量移动
else if($action=='move')
{
if(empty($typeid)){
ShowMsg('该操作必须指定栏目!','javascript:;');
exit();
}
$typeold = $dsql->GetOne("Select * From #@__arctype where ID='$typeid'; ");
$typenew = $dsql->GetOne("Select * From #@__arctype where ID='$newtypeid'; ");
if(!is_array($typenew)){
$dsql->Close();
ShowMsg("无法检测移动到的新栏目的信息,不能完成操作!","javascript:;");
exit();
}
if($typenew['ispart']!=0){
$dsql->Close();
ShowMsg("你不能把数据移动到非最终列表的栏目!","javascript:;");
exit();
}
if($typenew->channeltype!=$typeold->channeltype){
$dsql->Close();
ShowMsg("不能把数据移动到内容类型不同的栏目!","javascript:;");
exit();
}
$gwhere .= " And channel='".$typenew['channeltype']."'";
$dsql->SetQuery("Select ID From #@__archives $gwhere");
$dsql->Execute('m');
$tdd = 0;
while($row = $dsql->GetObject('m')){
$rs = $dsql->ExecuteNoneQuery("Update #@__archives set typeid='$newtypeid' where ID='{$row->ID}'");
if($rs) $tdd++;
DelArc($row->ID,true);
}
$dsql->Close();
if($tdd>0)
{
$jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid";
$jumpurl .= "&typeid=$newtypeid&pagesize=20&seltime=$seltime";
$jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime);
ShowMsg("成功移动 $tdd 条记录,准备重新生成HTML...",$jumpurl);
}
else ShowMsg("完成操作,没移动任何数据...","javascript:;");
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/content_batchup_do.php | PHP | asf20 | 4,200 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/templets/article_desction_main.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/article_description_main.php | PHP | asf20 | 149 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('co_AddNote');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
if(empty($action)) $action = "";
if(empty($exrule)) $exrule = "";
if($action=="select"){
require_once(dirname(__FILE__)."/templets/co_sel_exrule.htm");
ClearAllLink();
exit();
}
if($exrule==""){
ShowMsg("请先选择一个导入规则!","co_sel_exrule.php");
exit();
}
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
$dsql = new DedeSql(false);
if(empty($extype))
{
$row = $dsql->GetOne("Select * From #@__co_exrule where aid='$exrule'");
}else
{
$row = $dsql->GetOne("Select * From #@__co_exrule where channelid='$channelid'");
//如果不存在某频道的规则,系统自动生成一个规则
if(!is_array($row))
{
$cinfos = $dsql->GetOne("Select * From #@__channeltype where ID='$channelid'",MYSQL_ASSOC);
$maintable = ($cinfos['maintable']=='' ? '#@__archives' : $cinfos['maintable'] );
$addtable = $cinfos['addtable'];
$tablesinfo = ($addtable=='' ? $maintable : $maintable.','.$addtable);
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadString($cinfos['fieldset']);
$exRule = "
{dede:note
rulename='{$cinfos['typename']}模型'
etype='当前系统'
tablename='{$tablesinfo}'
autofield='ID'
synfield='aid'
channelid='{$cinfos['ID']}'
/}
{dede:field name='typeid' comment='栏目ID' intable='{$maintable}' source='value'}{tid}{/dede:field}
{dede:field name='arcrank' comment='文档权限' intable='{$maintable}' source='value'}{rank}{/dede:field}
{dede:field name='channel' comment='频道类型' intable='{$maintable}' source='value'}{cid}{/dede:field}
{dede:field name='typeid' comment='栏目ID' intable='{$addtable}' source='value'}{tid}{/dede:field}
{dede:field name='adminID' comment='管理员ID' intable='{$maintable}' source='value'}{admin}{/dede:field}
{dede:field name='sortrank' comment='排序级别' intable='{$maintable}' source='value'}{senddate}{/dede:field}
{dede:field name='senddate' comment='录入时间' intable='{$maintable}' source='value'}{senddate}{/dede:field}
{dede:field name='source' comment='来源' intable='{$maintable}' source='value'}{source}{/dede:field}
{dede:field name='pubdate' comment='发布时间' intable='{$maintable}' source='function'} @me = (@me=='' ? time() : GetMkTime(@me));{/dede:field}
{dede:field name='litpic' comment='缩略图' intable='{$maintable}' source='function'}@me = @litpic;{/dede:field}
{dede:field name='title' comment='标题' intable='{$maintable}' source='export'}{/dede:field}
{dede:field name='writer' comment='作者' intable='{$maintable}' source='export'}{/dede:field}
";
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $tagid=>$ctag)
{
$action = '';
if($ctag->GetAtt('notsend')==1) continue;
$ctype = $ctag->GetAtt('type');
if($ctype=='int'||$ctype=='float'){
$action = "@me = ((\$str = preg_replace(\"/[^0-9\.\-]/is\",\"\",@me))=='' ? '0' : \$str);";
}else if($ctype=='softlinks'){
$action = "@me = TurnLinkTag(@me);";
}else if($ctype=='img'){
$action = "@me = TurnImageTag(@me);";
}
$exRule .= "{dede:field name='".$ctag->GetName()."' comment='".$ctag->GetAtt('itemname')."' intable='".$addtable."' source='export'}{$action}{/dede:field}\r\n";
}
}
$row['ruleset'] = $exRule;
$exRule = addslashes($exRule);
$ntime = time();
$query = "
Insert Into `#@__co_exrule`(channelid,rulename,etype,dtime,ruleset)
Values('$channelid','{$cinfos['typename']}模型','当前系统','".time()."','$exRule')
";
$dsql->ExecuteNoneQuery($query);
$gerr = $dsql->GetError();
$row['aid'] = $exrule = $dsql->GetLastID();
if($row['aid']<1){
ClearAllLink();
ShowMsg("生成规则错误,无法进行操作!".$gerr,"javascript:;");
exit();
}
$row['channelid'] = $channelid;
$row['rulename'] = "{$cinfos['typename']}模型";
$row['etype'] = "当前系统";
$row['dtime'] = $ntime;
}
}
if(empty($exrule)) $exrule = $row['aid'];
if(empty($exrule)){
ClearAllLink();
ShowMsg("读取规则错误,无法继续操作!","javascript:;");
exit();
}
$ruleset = $row['ruleset'];
$dtp = new DedeTagParse();
$dtp->LoadString($ruleset);
$noteid = 0;
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $ctag){
if($ctag->GetName()=='field') $noteid++;
if($ctag->GetName()=='note') $noteinfos = $ctag;
}
}
else
{
ShowMsg("该规则不合法,无法进行生成采集配置!","-1");
$dsql->Close();
exit();
}
require_once(dirname(__FILE__)."/templets/co_add.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_add.php | PHP | asf20 | 4,763 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Group');
if(empty($dopost)) $dopost = "";
$dsql = new DedeSql(false);
require_once(dirname(__FILE__)."/templets/sys_group.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/sys_group.php | PHP | asf20 | 232 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
if(empty($dopost)) $dopost = "";
if(empty($fmdo)) $fmdo = "";
if(!isset($ENV_GOBACK_URL)) $ENV_GOBACK_URL = '';
/*----------------
function __DelMember()
删除会员
----------------*/
if($dopost=="delmember")
{
CheckPurview('member_Del');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__member where ID='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__memberstow where uid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_guestbook where mid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_arctype where memberid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_flink where mid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_cominfo where id='$ID'");
$dsql->ExecuteNoneQuery("update #@__archives set memberID='0' where memberID='$ID'");
$dsql->Close();
ShowMsg("成功删除一个会员!",$ENV_GOBACK_URL);
exit();
}
$wintitle = "会员管理-删除会员";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::删除会员";
$win = new OxWindow();
$win->Init("company_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("你确实要删除(ID:".$ID.")这个会员?");
$winform = $win->GetWindow("ok");
$win->Display();
}
/*-----------------------------
function __UpOperations()
业务状态更改为已付款状态
------------------------------*/
else if($dopost=="upoperations")
{
CheckPurview('member_Operations');
if($nid==''){
ShowMsg("没选定要更改的业务记录!","-1");
exit();
}
$nids = explode('`',$nid);
$wh = '';
foreach($nids as $n){
if($wh=='') $wh = " where aid='$n' ";
else $wh .= " Or aid='$n' ";
}
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member_operation set sta=1 $wh ");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改指定的业务记录!",$ENV_GOBACK_URL);
exit();
}
/*----------------------------
function __OkOperations()
业务状态更改改完成状态
-----------------------------*/
else if($dopost=="okoperations")
{
CheckPurview('member_Operations');
if($nid==''){
ShowMsg("没选定要更改的业务记录!","-1");
exit();
}
$nids = explode('`',$nid);
$wh = '';
foreach($nids as $n){
if($wh=='') $wh = " where aid='$n' ";
else $wh .= " Or aid='$n' ";
}
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member_operation set sta=2 $wh ");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改指定的业务记录!",$ENV_GOBACK_URL);
exit();
}
/*----------------
function __UpRank()
会员升级
----------------*/
else if($dopost=="uprank")
{
CheckPurview('member_Edit');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$membertype = ereg_replace("[^0-9]","",$membertype);
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member set membertype='$membertype',uptype='0' where ID='$ID'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功升级一个会员!",$ENV_GOBACK_URL);
exit();
}
$dsql = new DedeSql(false);
$MemberTypes = "";
$dsql->SetQuery("Select rank,membername From #@__arcrank where rank>0");
$dsql->Execute();
$MemberTypes[0] = "普通会员";
while($row = $dsql->GetObject()){
$MemberTypes[$row->rank] = $row->membername;
}
$dsql->Close();
$options = "<select name='membertype' style='width:100'>\r\n";
foreach($MemberTypes as $k=>$v)
{
if($k!=$uptype) $options .= "<option value='$k'>$v</option>\r\n";
else $options .= "<option value='$k' selected>$v</option>\r\n";
}
$options .= "</select>\r\n";
$wintitle = "会员管理-会员升级";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::会员升级";
$win = new OxWindow();
$win->Init("member_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("会员升级:");
$win->AddItem("会员目前的等级:",$MemberTypes[$mtype]);
$win->AddItem("会员申请的等级:",$MemberTypes[$uptype]);
$win->AddItem("开通等级:",$options);
$winform = $win->GetWindow("ok");
$win->Display();
}
/*----------------
function __Recommend()
推荐会员
----------------*/
else if($dopost=="recommend")
{
CheckPurview('member_Edit');
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
if($matt==0){
$dsql->ExecuteNoneQuery("update #@__member set matt=1 where ID='$ID'");
$dsql->Close();
ShowMsg("成功设置一个会员推荐!",$ENV_GOBACK_URL);
exit();
}else{
$dsql->ExecuteNoneQuery("update #@__member set matt=0 where ID='$ID'");
$dsql->Close();
ShowMsg("成功取消一个会员推荐!",$ENV_GOBACK_URL);
exit();
}
}
/*----------------
function __AddMoney()
会员充值
----------------*/
else if($dopost=="addmoney")
{
CheckPurview('member_Edit');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$money = ereg_replace("[^0-9]","",$money);
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member set money=money+$money where ID='$ID'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功给一个会员充值!",$ENV_GOBACK_URL);
exit();
}
if(empty($upmoney)) $upmoney = 500;
$wintitle = "会员管理-会员充值";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::会员充值";
$win = new OxWindow();
$win->Init("member_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("会员充值:");
$win->AddMsgItem("请输入充值点数:<input type='text' name='money' size='10' value='$upmoney'>",60);
$winform = $win->GetWindow("ok");
$win->Display();
}
/*----------------
function __EditUser()
更改会员
----------------*/
else if($dopost=="edituser")
{
CheckPurview('member_Edit');
$dsql = new DedeSql(false);
$uptime = GetMkTime($uptime);
$edpwd = '';
if($newpwd!=''){
$newpwd = GetEncodePwd($newpwd);
$edpwd = "pwd='$newpwd',";
}
$query = "update #@__member set
{$edpwd}
membertype = '$membertype',
uptime = '$uptime',
exptime = '$exptime',
money = '$money',
email = '$email',
uname = '$uname',
sex = '$sex',
mybb = '$mybb',
spacename = '$spacename',
news = '$news'
where ID='$ID' ";
$rs = $dsql->ExecuteNoneQuery($query);
$truename = filterscript(trim($truename));
$business = filterscript(trim($business));
$phone = intval($phone);
$fax = intval($fax);
$mobi = intval($mobi);
$comname = filterscript(trim($comname));
$regyear = intval($regyear);
$service = filterscript(trim($service));
$typeid1 = intval($typeid1);
$typeid2 = intval($typeid2);
$comaddr = filterscript(trim($comaddr));
$cominfo = filterscript(trim($cominfo));
$postid = intval($postid);
$website = filterscript(trim($website));
$culture = filterscript(trim($culture));
$sql = "update #@__member_cominfo set truename='$truename', business='$business',
phone='$phone', fax='$fax', mobi='$mobi', comname='$comname',
regyear='$regyear', service='$service', typeid1='$typeid1',
typeid2='$typeid2', comaddr='$comaddr', cominfo='$cominfo',
postid='$postid', website='$website', culture='$culture' where id='$ID'";
//echo $sql;
$row = $dsql->GetOne("select id from #@__member_cominfo where id='$ID'");
if(empty($row)){
$dsql->ExecuteNoneQuery("insert into #@__member_cominfo(id) values('$ID')");
}
$dsql->ExecuteNoneQuery($sql);
$dsql->Close();
ShowMsg("成功更改企业资料!",$ENV_GOBACK_URL);
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/company_do.php | PHP | asf20 | 8,041 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('temp_Other');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
if(empty($dopost)) $dopost = "";
//////////////////////////////////////////
if($dopost=="save")
{
$tagname = trim($tagname);
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select typeid From #@__mytag where typeid='$typeid' And tagname like '$tagname'");
if(is_array($row)){
$dsql->Close();
ShowMsg("在相同栏目下已经存在同名的标记!","-1");
exit();
}
$starttime = GetMkTime($starttime);
$endtime = GetMkTime($endtime);
$inQuery = "
Insert Into #@__mytag(typeid,tagname,timeset,starttime,endtime,normbody,expbody)
Values('$typeid','$tagname','$timeset','$starttime','$endtime','$normbody','$expbody');
";
$dsql->SetQuery($inQuery);
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功增加一个自定义标记!","mytag_main.php");
exit();
}
$startDay = time();
$endDay = AddDay($startDay,30);
$startDay = GetDateTimeMk($startDay);
$endDay = GetDateTimeMk($endDay);
require_once(dirname(__FILE__)."/templets/mytag_add.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/mytag_add.php | PHP | asf20 | 1,173 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Passport');
if(!function_exists('file_get_contents')){
ShowMsg("你的系统不支持函数:file_get_contents<br><br> 不能使用 Dede 通行证接口!","javascript:;");
exit();
}
if(empty($action)) $action = '';
if($action=='save'){
if(!$pp_type) $pp_type = 0;
else $pp_type = 1;
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__syspassport ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_isopen','cfg_pp_isopen'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_regurl','cfg_pp_regurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_loginurl','cfg_pp_loginurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_exiturl','cfg_pp_exiturl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_editsafeurl','cfg_pp_editsafeurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_name','cfg_pp_name'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_indexurl','cfg_pp_indexurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_type','cfg_pp_type'); ");
$dsql->Close();
$fp = fopen(dirname(__FILE__)."/../include/config_passport.php","w") or die("写入文件 ../include/config_passport.php 失败!");
fwrite($fp,'<'.'?php ');
fwrite($fp,"\r\n");
foreach($GLOBALS as $k=>$v){
if(ereg('^pp_',$k)){
$v = str_replace("'","`",stripslashes($v));
fwrite($fp,'$cfg_'.$k." = '".$v."';\r\n");
}
}
fwrite($fp,'?'.'>');
fclose($fp);
ShowMsg("成功更改通行证设置!","sys_passport.php");
exit();
}
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * From #@__syspassport ");
$dsql->Execute();
while($row = $dsql->GetArray()){ $$row['varname'] = $row['value']; }
require_once(dirname(__FILE__)."/templets/sys_passport.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/sys_passport.php | PHP | asf20 | 1,981 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('co_EditNote');
if($linkareas!=""&&$linkareae!="") $linkarea = $linkareas.'[var:区域]'.$linkareae;
else $linkarea = '';
if($sppages!="" && $sppagee!="") $sppage = $sppages.'[var:分页区域]'.$sppagee;
else $sppage = '';
$itemconfig = "
{!-- 节点基本信息 --}
{dede:item name=\\'$notename\\'
imgurl=\\'$imgurl\\' imgdir=\\'$imgdir\\' language=\\'$language\\'
isref=\\'$isref\\' refurl=\\'$refurl\\' exptime=\\'$exptime\\'
typeid=\\'$exrule\\' matchtype=\\'$matchtype\\'}
{/dede:item}
{!-- 采集列表获取规则 --}
{dede:list source=\\'$source\\' sourcetype=\\'list\\'
varstart=\\'$varstart\\' varend=\\'$varend\\'}
{dede:url value=\\'$sourceurl\\'}$sourceurls{/dede:url}
{dede:need}$need{/dede:need}
{dede:cannot}$cannot{/dede:cannot}
{dede:linkarea}$linkarea{/dede:linkarea}
{/dede:list}
{!-- 网页内容获取规则 --}
{dede:art}
{dede:sppage sptype=\\'$sptype\\'}$sppage{/dede:sppage}";
for($i=1;$i<=50;$i++)
{
if(!empty(${"field".$i}))
{
if(!isset($GLOBALS["value".$i])) $GLOBALS["value".$i] = "";
else $GLOBALS["value".$i] = trim($GLOBALS["value".$i]);
if(!isset($GLOBALS["match".$i])) $GLOBALS["match".$i] = "";
if(!isset($GLOBALS["comment".$i])) $GLOBALS["comment".$i] = "";
if(!isset($GLOBALS["isunit".$i])) $GLOBALS["isunit".$i] = "";
if(!isset($GLOBALS["isdown".$i])) $GLOBALS["isdown".$i] = "";
if(!isset($GLOBALS["trim".$i])) $GLOBALS["trim".$i] = "";
$trimstr = $GLOBALS["trim".$i];
$GLOBALS["comment".$i] = str_replace("'","",$GLOBALS["comment".$i]);
if($trimstr!=""&&!eregi("{dede:trim",$trimstr)){
$trimstr = " {dede:trim}$trimstr{/dede:trim}\r\n";
}
else{
$trimstr = str_replace("{dede:trim"," {dede:trim",$trimstr);
}
$matchstr = '';
if( !empty($GLOBALS["matchs".$i]) && !empty($GLOBALS["matche".$i]) ){
$matchstr = $GLOBALS["matchs".$i]."[var:内容]".$GLOBALS["matche".$i];
}
$itemconfig .= "
{dede:note field=\\'".${"field".$i}."\\' value=\\'".$GLOBALS["value".$i]."\\' comment=\\'".$GLOBALS["comment".$i]."\\'
isunit=\\'".$GLOBALS["isunit".$i]."\\' isdown=\\'".$GLOBALS["isdown".$i]."\\'}
{dede:match}".$matchstr."{/dede:match}
$trimstr
{dede:function}".$GLOBALS["function".$i]."{/dede:function}
{/dede:note}";
}
}
$itemconfig .= "
{/dede:art}
";
$inQuery = "
Update #@__conote set gathername='$notename',language='$language',arcsource='$arcsource',noteinfo='$itemconfig'
Where nid='$nid';
";
$dsql = new DedeSql(false);
if($dsql->ExecuteNoneQuery($inQuery))
{
$dsql->Close();
ShowMsg("成功更改一个节点!","co_main.php");
exit();
}
else
{
$gerr = $dsql->GetError();
$dsql->Close();
header("Content-Type: text/html; charset={$cfg_ver_lang}");
echo "SQL语句:<xmp>$inQuery</xmp>";
echo "<hr>错误提示:".$gerr."<hr>";
$dsql->Close();
ShowMsg("更改节点失败,请检查原因!","javascript:;");
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_edit_action.php | PHP | asf20 | 3,075 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_sitemap.php");
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
if(empty($dopost))
{
ShowMsg("参数错误!","-1");
exit();
}
$sm = new SiteMap();
$maplist = $sm->GetSiteMap($dopost);
$sm->Close();
if($dopost=="site")
{
$murl = $cfg_plus_dir."/sitemap.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
else
{
$murl = $cfg_plus_dir."/rssmap.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/rssmap.htm";
}
$dtp = new DedeTagParse();
$dtp->LoadTemplet($tmpfile);
$dtp->SaveTo($cfg_basedir.$murl);
$dtp->Clear();
header("Content-Type: text/html; charset={$cfg_ver_lang}");
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n";
echo "<a href='$murl' target='_blank'>成功更新文件: $murl 浏览...</a>";
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/makehtml_map.php | PHP | asf20 | 942 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($isrm)) $isrm = 0;
if(!isset($ddisfirst)) $ddisfirst = 0;
if(!isset($ddisremote)) $ddisremote = 0;
$zipfile = (empty($zipfile) ? '' : $zipfile);
$formzip = (empty($formzip) ? 0 : $formzip);
$delzip = (empty($delzip) ? 0 : $delzip);
$formhtml = (empty($formhtml) ? 0 : $formhtml);
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_New')) {
CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
if($typeid2!=0) CheckCatalog($typeid2,"对不起,你没有操作栏目 {$typeid2} 的权限!");
}
$title = trim($title);
if(empty($title)){
ShowMsg("请输入标题","-1");
exit();
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$shorttitle = (empty($shorttitle) ? '' : cn_substr($shorttitle,36));
$color = cn_substr($color,10);
$writer = "";
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
$litpic = GetDDImage('litpic',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$imgurls = "{dede:pagestyle maxwidth='$maxwidth' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n";
$hasone = false;
//处理并保存所指定的图片从
//网上复制
//------------------------------
if($formhtml==1)
{
$imagebody = stripslashes($imagebody);
$imgurls .= GetCurContentAlbum($imagebody,$copysource,$litpicname);
if($ddisfirst==1 && $litpic=="" && !empty($litpicname))
{
$litpic = $litpicname;
$hasone = true;
}
}
//ZIP中解压
//------------------------------
else if($formzip==1)
{
include_once(DEDEADMIN."/../include/zip.lib.php");
include_once(DEDEADMIN."/file_class.php");
$zipfile = $cfg_basedir.str_replace($cfg_mainsite,'',$zipfile);
$tmpzipdir = DEDEADMIN.'/module/ziptmp/'.cn_substr(md5(ExecTime()),16);
$ntime = time();
if(file_exists($zipfile))
{
@mkdir($tmpzipdir,$GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir,$GLOBALS['cfg_dir_purview']);
$z = new zip();
$z->ExtractAll($zipfile,$tmpzipdir);
$fm = new FileManagement();
$imgs = array();
$fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);
$i = 0;
foreach($imgs as $imgold)
{
$i++;
$savepath = $cfg_image_dir."/".strftime("%Y-%m",$ntime);
CreateDir($savepath);
$iurl = $savepath."/".strftime("%d",$ntime).dd2char(strftime("%H%M%S",$ntime).'-'.$adminID."-{$i}".mt_rand(1000,9999));
$iurl = $iurl.substr($imgold,-4,4);
$imgfile = $cfg_basedir.$iurl;
copy($imgold,$imgfile);
unlink($imgold);
if(is_file($imgfile))
{
$litpicname = GetImageMapDD($iurl,$ddmaxwidth);
$info = '';
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
//把图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminID','0');
";
$dsql->ExecuteNoneQuery($inquery);
if(!$hasone && $ddisfirst==1
&& $litpic=="" && !empty($litpicname))
{
if( file_exists($cfg_basedir.$litpicname) )
{
$litpic = $litpicname;
$hasone = true;
}
}
}
}
if($delzip==1) $fm->RmDirFiles($tmpzipdir);
}
}
//正常上传或指定网址
//------------------------------
else {
for($i=1;$i<=120;$i++)
{
if(isset(${'imgurl'.$i})||(isset($_FILES['imgfile'.$i]['tmp_name']) && is_uploaded_file($_FILES['imgfile'.$i]['tmp_name'])))
{
$iinfo = str_replace("'","`",stripslashes(${'imgmsg'.$i}));
//非上传图片
if(!is_uploaded_file($_FILES['imgfile'.$i]['tmp_name']))
{
$iurl = stripslashes(${'imgurl'.$i});
if(trim($iurl)=="") continue;
$iurl = trim(str_replace($cfg_basehost,"",$iurl));
if((eregi("^http://",$iurl) && !eregi($cfg_basehost,$iurl)) && $cfg_isUrlOpen)
//远程图片
{
$reimgs = "";
if($cfg_isUrlOpen && $isrm==1)
{
$reimgs = GetRemoteImage($iurl,$adminID);
if(is_array($reimgs)){
$litpicname = GetImageMapDD($reimgs[0],$ddmaxwidth);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$reimgs[1]."' height='".$reimgs[2]."'} ".$reimgs[0]." {/dede:img}\r\n";
}else{
echo "下载:".$iurl." 失败,可能图片有反采集功能或http头不正确!<br />\r\n";
}
}else{
$imgurls .= "{dede:img text='$iinfo' width='' height=''} ".$iurl." {/dede:img}\r\n";
}
//站内图片
}else if($iurl!=""){
$imgfile = $cfg_basedir.$iurl;
if(is_file($imgfile)){
$litpicname = GetImageMapDD($iurl,$ddmaxwidth);
$info = "";
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
}
}
//直接上传的图片
}else
{
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png","image/x-png","image/wbmp");
if(!in_array($_FILES['imgfile'.$i]['type'],$sparr)){
continue;
}
$uptime = time();
$imgPath = $cfg_image_dir."/".strftime("%y%m%d",$uptime);
MkdirAll($cfg_basedir.$imgPath,$GLOBALS['cfg_dir_purview']);
CloseFtp();
$filename = $imgPath."/".dd2char($cuserLogin->getUserID().strftime("%H%M%S",$uptime).mt_rand(1000,9999))."-{$i}";
$fs = explode(".",$_FILES['imgfile'.$i]['name']);
$filename = $filename.".".$fs[count($fs)-1];
@move_uploaded_file($_FILES['imgfile'.$i]['tmp_name'],$cfg_basedir.$filename);
//缩图
$litpicname = GetImageMapDD($filename,$ddmaxwidth);
//水印
$imgfile = $cfg_basedir.$filename;
@WaterImg($imgfile,'up');
if(is_file($imgfile)){
$iurl = $filename;
$info = "";
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
//把新上传的图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('$title".$i."','$filename','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','$adminID','0');
";
$dsql->ExecuteNoneQuery($inquery);
}
}
if(!$hasone && $ddisfirst==1 && $litpic=="" && !empty($litpicname))
{
if( file_exists($cfg_basedir.$litpicname) )
{
$litpic = $litpicname;
$hasone = true;
}
}
}//含有图片的条件
}//循环结束
}
$imgurls = addslashes($imgurls);
//写入数据库
//-----------------------------------
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//加入主档案表
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(ID,typeid,typeid2,sortrank,iscommend,ismake,channel,arcrank,click,money,
title,shorttitle,color,writer,source,litpic,pubdate,senddate,arcatt,adminID,memberID,description,keywords,likeid)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid','$arcrank','0','$money',
'$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$arcatt','$adminID','0',
'$description','$keywords','$likeid');
";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
//加入附加表
//----------------------------------
$query = "
INSERT INTO `{$cts['addtable']}`(aid,typeid,pagestyle,maxwidth,imgurls,row,col,isrm,ddmaxwidth{$inadd_f})
Values('$arcID','$typeid','$pagestyle','$maxwidth','$imgurls','$row','$col','$isrm','$ddmaxwidth'{$inadd_v});
";
if(!$dsql->ExecuteNoneQuery($query))
{
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From `{$cts['maintable']}` where ID='$arcID'");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID'");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../album_add.php?cid=$typeid'><u>继续发布图片</u></a>
<a href='../archives_do.php?aid=".$arcID."&dopost=editArchives'><u>更改图集</u></a>
<a href='$artUrl' target='_blank'><u>预览文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布图片管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布一个图集!";
$wecome_info = "文章管理::发布图集";
$win = new OxWindow();
$win->AddTitle("成功发布一个图集:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/album_add_action.php | PHP | asf20 | 12,295 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($isrm)) $isrm = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
//处理并保存所指定的图片
//------------------------------
$imgurls = "{dede:pagestyle maxwidth='$maxwidth' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n";
if($formhtml==1)
{
$imagebody = stripslashes($imagebody);
$imgurls .= GetCurContentAlbum($imagebody,$copysource,$litpicname);
if($ddisfirst==1 && $litpic=="" && !empty($litpicname))
{
$litpic = $litpicname;
$hasone = true;
}
}
for($i=1;$i<=120;$i++)
{
if(isset(${'imgurl'.$i})||(isset($_FILES['imgfile'.$i]['tmp_name']) && is_uploaded_file($_FILES['imgfile'.$i]['tmp_name'])))
{
$iinfo = str_replace("'","`",stripslashes(${'imgmsg'.$i}));
//非上传图片
if(!is_uploaded_file($_FILES['imgfile'.$i]['tmp_name']))
{
$iurl = stripslashes(${'imgurl'.$i});
$ioldurl = @stripslashes(${'imgurlold'.$i});
$ioldddimg = @stripslashes(${'oldddimg'.$i});
if(trim($iurl)=="") continue;
$iurl = trim(str_replace($cfg_basehost,"",$iurl));
if((eregi("^http://",$iurl) && !eregi($cfg_basehost,$iurl)) && $cfg_isUrlOpen)
//远程图片
{
$reimgs = "";
if($cfg_isUrlOpen && $isrm==1)
{
$reimgs = GetRemoteImage($iurl,$adminID);
if(is_array($reimgs)){
$litpicname = GetImageMapDD($reimgs[0],$ddmaxwidth);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$reimgs[1]."' height='".$reimgs[2]."'} ".$reimgs[0]." {/dede:img}\r\n";
}else{
echo "下载:".$iurl." 失败,可能图片有反采集功能或http头不正确!<br />\r\n";
}
}else{
$imgurls .= "{dede:img text='$iinfo' width='' height=''} ".$iurl." {/dede:img}\r\n";
}
//站内图片
}else if($iurl!="")
{
$imgfile = $cfg_basedir.$iurl;
if(is_file($imgfile))
{
if($ioldurl!=$iurl)
{
if(file_exists($cfg_basedir.$ioldddimg)) @unlink($cfg_basedir.$ioldddimg);
$litpicname = GetImageMapDD($iurl,$ddmaxwidth);
}
else
{
$litpicname = $ioldddimg;
}
$info = "";
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
}
}
//直接上传的图片
}else
{
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png","image/x-png","image/wbmp");
if(!in_array($_FILES['imgfile'.$i]['type'],$sparr)){
continue;
}
$uptime = time();
$imgPath = $cfg_image_dir."/".strftime("%y%m%d",$uptime);
MkdirAll($cfg_basedir.$imgPath,$GLOBALS['cfg_dir_purview']);
CloseFtp();
$filename = $imgPath."/".dd2char($cuserLogin->getUserID().strftime("%H%M%S",$uptime).mt_rand(1000,9999))."-{$i}";
$fs = explode(".",$_FILES['imgfile'.$i]['name']);
$filename = $filename.".".$fs[count($fs)-1];
@move_uploaded_file($_FILES['imgfile'.$i]['tmp_name'],$cfg_basedir.$filename);
//缩图
$litpicname = GetImageMapDD($filename,$ddmaxwidth);
//水印
$imgfile = $cfg_basedir.$filename;
@WaterImg($imgfile,'up');
if(is_file($imgfile))
{
$iurl = $filename;
$info = "";
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
//把新上传的图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('$title".$i."','$filename','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','$adminID','0');
";
$dsql->ExecuteNoneQuery($inquery);
}
}
}//含有图片的条件
}//循环结束
if($formhtml==1)
{
$imagebody = stripslashes($imagebody);
$imgurls .= GetCurContentAlbum($imagebody,$copysource,$litpicname);
if($ddisfirst==1 && $litpic=="" && !empty($litpicname))
{
$litpic = $litpicname;
$hasone = true;
}
}
if($formzip==1)
{
include_once(DEDEADMIN."/../include/zip.lib.php");
include_once(DEDEADMIN."/file_class.php");
$zipfile = $cfg_basedir.str_replace($cfg_mainsite,'',$zipfile);
$tmpzipdir = DEDEADMIN.'/module/ziptmp/'.cn_substr(md5(ExecTime()),16);
$ntime = time();
if(file_exists($zipfile))
{
@mkdir($tmpzipdir,$GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir,$GLOBALS['cfg_dir_purview']);
$z = new zip();
$z->ExtractAll($zipfile,$tmpzipdir);
$fm = new FileManagement();
$imgs = array();
$fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);
$i = 0;
foreach($imgs as $imgold)
{
$i++;
$savepath = $cfg_image_dir."/".strftime("%Y-%m",$ntime);
CreateDir($savepath);
$iurl = $savepath."/".strftime("%d",$ntime).dd2char(strftime("%H%M%S",$ntime).'-'.$adminID."-{$i}".mt_rand(1000,9999));
$iurl = $iurl.substr($imgold,-4,4);
$imgfile = $cfg_basedir.$iurl;
copy($imgold,$imgfile);
unlink($imgold);
if(is_file($imgfile))
{
$litpicname = GetImageMapDD($iurl,$ddmaxwidth);
$info = '';
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
//把图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminID','0');
";
$dsql->ExecuteNoneQuery($inquery);
if(!$hasone && $ddisfirst==1
&& $litpic=="" && !empty($litpicname))
{
if( file_exists($cfg_basedir.$litpicname) )
{
$litpic = $litpicname;
$hasone = true;
}
}
}
}
if($delzip==1) $fm->RmDirFiles($tmpzipdir);
}
}
$imgurls = addslashes($imgurls);
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$cts['maintable']}` set
typeid='$typeid',
typeid2='$typeid2',
redirecturl='$redirecturl',
sortrank='$sortrank',
iscommend='$iscommend',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
source='$source',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
shorttitle='$shorttitle',
arcatt='$arcatt',
likeid='$likeid'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
//更新附加表
//----------------------------------
$addQuery = "
Update `{$cts['addtable']}`
set typeid='$typeid',pagestyle='$pagestyle',maxwidth = '$maxwidth',
imgurls='$imgurls',row='$row',col='$col',isrm='$isrm'{$inadd_f}
where aid='$ID';";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//生成HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
MakeArt($ID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../album_add.php?cid=$typeid'><u>继续发布图片</u></a>
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives'><u>查看更改</u></a>
<a href='$artUrl' target='_blank'><u>预览文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理已发布图片</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功更改图集!";
$wecome_info = "文章管理::更改图集";
$win = new OxWindow();
$win->AddTitle("成功更改一个图集:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/album_edit_action.php | PHP | asf20 | 11,686 |
<?php
require_once(dirname(__FILE__)."/../config.php");
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!TestPurview('spec_New')) {
ShowMsg("对不起,你没有操作栏目 {$typeid} 的文档权限!");
exit();
}
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isbold)) $isbold = 0;
$channelid = -1;
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('litpic',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//加入主档案表
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(
ID,typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,templet)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$templet');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表`{$cts['maintable']}`时出错,请检查!".$gerr,"javascript:;");
exit();
}
//专题节点列表
//--------------------------------
$arcids = "";
$notelist = "";
for($i=1;$i<=$cfg_specnote;$i++)
{
if(!empty(${'notename'.$i}))
{
$notename = str_replace("'","",trim(${'notename'.$i}));
$arcid = trim(${'arcid'.$i});
$col = trim(${'col'.$i});
$imgwidth = trim(${'imgwidth'.$i});
$imgheight = trim(${'imgheight'.$i});
$titlelen = trim(${'titlelen'.$i});
$infolen = trim(${'infolen'.$i});
$listtmp = trim(${'listtmp'.$i});
$noteid = trim(${'noteid'.$i});
$isauto = trim(${'isauto'.$i});
$keywordsn = str_replace("'","",trim(${'keywords'.$i}));
$typeidn = trim(${'typeid'.$i});
if(!empty(${'rownum'.$i})) $rownum = trim(${'rownum'.$i});
else $rownum = 0;
$arcid = ereg_replace("[^0-9,]","",$arcid);
$ids = explode(",",$arcid);
$okids = "";
if(is_array($ids)){
foreach($ids as $mid)
{
$mid = trim($mid);
if($mid=="") continue;
if(!isset($arcids[$mid])){
if($okids=="") $okids .= $mid;
else $okids .= ",".$mid;
$arcids[$mid] = 1;
}
}}
$notelist .= "{dede:specnote imgheight=\\'$imgheight\\' imgwidth=\\'$imgwidth\\'
infolen=\\'$infolen\\' titlelen=\\'$titlelen\\' col=\\'$col\\' idlist=\\'$okids\\'
name=\\'$notename\\' noteid=\\'$noteid\\' isauto=\'$isauto\' rownum=\\'$rownum\\'
keywords=\\'$keywordsn\\' typeid=\\'$typeidn\\'}
$listtmp
{/dede:specnote}\r\n";
}
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
//加入附加表
//----------------------------------
$inQuery = "INSERT INTO `{$cts['addtable']}`(aid,typeid,note{$inadd_f}) VALUES ('$arcID','$typeid','$notelist'{$inadd_v});";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From {$cts['maintable']} where ID='$arcID'");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID'");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, 0);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../spec_add.php?cid=$typeid'><u>创建新专题</u></a>
<a href='$artUrl' target='_blank'><u>查看专题</u></a>
<a href='../content_s_list.php'><u>已发布专题管理</u></a>
";
$wintitle = "成功创建专题!";
$wecome_info = "文章管理::发布专题";
$win = new OxWindow();
$win->AddTitle("成功创建专题:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/spec_add_action.php | PHP | asf20 | 6,077 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_Edit');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if( empty($chapterid)
|| (!empty($addchapter) && !empty($chapternew)) )
{
if(empty($chapternew))
{
ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!","-1");
exit();
}
$dsql = new DedeSql();
$row = $dsql->GetOne("Select * From #@__story_chapter where bookid='$bookid' order by chapnum desc");
if(is_array($row)) $nchapnum = $row['chapnum']+1;
else $nchapnum = 1;
$query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`memberid`,`chaptername`,`bookname`)
VALUES ('$bookid', '$catid', '$nchapnum', '0', '$chapternew','$bookname');";
$rs = $dsql->ExecuteNoneQuery($query);
if($rs){
$chapterid = $dsql->GetLastID();
}
else
{
ShowMsg("增加章节失败,请检查原因!","-1");
exit();
}
}else
{
$dsql = new DedeSql();
}
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if(empty($bcatid)) $bcatid = 0;
if(empty($booktype)) $booktype = 0;
$addtime = time();
//处理上传的缩略图
if(!isset($isremote)) $isremote = 0;
$bigpic = UploadOneImage('imgfile',$imgurl,$isremote);
$adminID = $cuserLogin->getUserID();
//----------------------------------
$inQuery = "
Update `#@__story_content` set `title`='$title',`bookname`='$bookname',
`chapterid`='$chapterid',`sortid`='$sortid',`bigpic`='$bigpic'
where id='$cid'
";
if(!$dsql->ExecuteNoneQuery($inQuery)){
ShowMsg("把数据保存到数据库时出错,请检查!".str_repolace("'","`",$dsql->GetError().$inQuery),"-1");
$dsql->Close();
exit();
}
$arcID = $cid;
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true,true);
if($artcontentUrl=="") $artcontentUrl = $cfg_book_url."/show-photo.php?id=$arcID&bookid=$bookid&chapterid=$chapterid";
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_photo_edit.php?c={$cid}'><u>继续修改</u></a>
<a href='$artUrl' target='_blank'><u>预览漫画</u></a>
<a href='$artcontentUrl' target='_blank'><u>预览内容</u></a>
<a href='../story_list_content.php?bookid={$bookid}'><u>管理所有内容</u></a>
<a href='../story_books.php'><u>管理所有图书</u></a>
";
$wintitle = "成功修改内容!";
$wecome_info = "连载管理::修改漫画内容";
$win = new OxWindow();
$win->AddTitle("成功发布漫画:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_edit_photo_action.php | PHP | asf20 | 3,160 |
<?php
require_once(dirname(__FILE__)."/../config.php");
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($ispic)) $ispic = 0;
if(!isset($isbold)) $isbold = 0;
if( empty($channelid)||empty($ID) ){
ShowMsg("文档为非指定的类型,请检查你增加内容时是否合法!","-1");
exit();
}
if(!TestPurview('spec_Edit')) {
ShowMsg("对不起,你没有操作栏目 {$typeid} 的文档权限!");
exit();
}
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,50))." ";
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
//更改主档案表
//----------------------------------
$inQuery = "
update `{$cts['maintable']}` set
typeid='$typeid',
sortrank='$sortrank',
iscommend='$iscommend',
ismake='$ismake',
title='$title',
color='$color',
source='$source',
writer='$writer',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
shorttitle='$shorttitle',
arcatt='$arcatt',
templet='$templet'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//专题节点列表
//--------------------------------
$arcids = "";
$notelist = "";
for($i=1;$i<=$cfg_specnote;$i++)
{
if(!empty(${'notename'.$i}))
{
$notename = str_replace("'","",trim(${'notename'.$i}));
$arcid = trim(${'arcid'.$i});
$col = trim(${'col'.$i});
$imgwidth = trim(${'imgwidth'.$i});
$imgheight = trim(${'imgheight'.$i});
$titlelen = trim(${'titlelen'.$i});
$infolen = trim(${'infolen'.$i});
$listtmp = trim(${'listtmp'.$i});
if(isset(${'noteid'.$i})) $noteid = trim(${'noteid'.$i});
else $noteid = $i;
if(isset(${'isauto'.$i})) $isauto = trim(${'isauto'.$i});
else $isauto = 0;
if(isset(${'keywords'.$i})) $keywordsn = str_replace("'","",trim(${'keywords'.$i}));
else $keywordsn = "";
if(!empty(${'typeid'.$i})) $typeidn = trim(${'typeid'.$i});
else $typeidn = 0;
if(!empty(${'rownum'.$i})) $rownum = trim(${'rownum'.$i});
else $rownum = 0;
$arcid = ereg_replace("[^0-9,]","",$arcid);
$ids = explode(",",$arcid);
$okids = "";
if(is_array($ids)){
foreach($ids as $mid)
{
$mid = trim($mid);
if($mid=="") continue;
if(!isset($arcids[$mid])){
if($okids=="") $okids .= $mid;
else $okids .= ",".$mid;
$arcids[$mid] = 1;
}
}}
$notelist .= "{dede:specnote imgheight=\\'$imgheight\\' imgwidth=\\'$imgwidth\\'
infolen=\\'$infolen\\' titlelen=\\'$titlelen\\' col=\\'$col\\' idlist=\\'$okids\\'
name=\\'$notename\\' noteid=\\'$noteid\\' isauto=\'$isauto\' rownum=\\'$rownum\\'
keywords=\\'$keywordsn\\' typeid=\\'$typeidn\\'}
$listtmp
{/dede:specnote}\r\n";
}
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
//更新附加表
//----------------------------------
$addQuery = "update `{$cts['addtable']}` set typeid ='$typeid',note='$notelist'{$inadd_f} where aid='$ID';";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//生成HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
MakeArt($ID,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../soft_add.php?cid=$typeid'><u>发布新专题</u></a>
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives'><u>继续修改</u></a>
<a href='$artUrl' target='_blank'><u>预览专题</u></a>
<a href='../content_s_list.php'><u>已发布专题管理</u></a>
";
$wintitle = "成功更改一个专题!";
$wecome_info = "专题管理::更改专题";
$win = new OxWindow();
$win->AddTitle("成功更改专题!");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/spec_edit_action.php | PHP | asf20 | 6,128 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if(!isset($remote)) $remote = 0;
if(!isset($autolitpic)) $autolitpic = 0;
if(!isset($smalltypeid)) $smalltypeid = 0;
if(!isset($sectorchange)){
$sectorid = $oldsectorid;
$sectorid2 = $oldsectorid2;
}
if(!isset($areachange)){
$areaid = $oldareaid;
$areaid2 = $oldareaid2;
}
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
$endtime = $senddate + 3600 * 24 * $endtime;
$title = cn_substr($title,80);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$body = stripslashes($body);
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = trim(preg_replace("/#p#|#e#/","",$description));
$description = addslashes($description);
}
//把内容中远程的图片资源本地化
//------------------------------------
if($cfg_isUrlOpen && $remote==1){
$body = GetCurContent($body);
}
//自动获取关键字
//----------------------------------
if($autokey==1){
require_once(DEDEADMIN."/../include/pub_splitword_www.php");
$keywords = "";
$sp = new SplitWord();
$titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title))));
$allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200)));
if(is_array($allindexs) && is_array($titleindexs)){
foreach($titleindexs as $k){
if(strlen($keywords)>=50) break;
else $keywords .= $k." ";
}
foreach($allindexs as $k){
if(strlen($keywords)>=50) break;
else if(!in_array($k,$titleindexs)) $keywords .= $k." ";
}
}
$sp->Clear();
unset($sp);
$keywords = preg_replace("/#p#|#e#/","",$keywords);
$keywords = addslashes($keywords);
}
//自动获取缩略图
if($autolitpic==1 && $litpic==''){
$litpic = GetDDImgFromBody($body);
}
$message = addslashes($body);
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$cts['maintable']}` set
typeid=$typeid,
smalltypeid=$smalltypeid,
areaid=$areaid,
areaid2=$areaid2,
sectorid=$sectorid,
sectorid2=$sectorid2,
sortrank=$sortrank,
pubdate=$pubdate,
endtime=$endtime,
title='$title',
iscommend='$iscommend',
keywords='$keywords',
litpic='$litpic',
description='$description',
arcatt='$arcatt'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
$addQuery = "Update `{$cts['addtable']}` set typeid='$typeid',
message='$message',contact='$contact',phone='$phone',
fax='$fax',email='$email',qq='$qq',msn='$msn',address='$address'{$inadd_f}
where aid='{$ID}' ";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//生成HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>0);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
MakeArt($ID,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives&channelid=-2'><u>查看更改</u></a>
<a href='$artUrl' target='_blank'><u>预览文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理信息</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功更改信息!";
$wecome_info = "文章管理::更改信息";
$win = new OxWindow();
$win->AddTitle("成功更改信息:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/action/info_edit_action.php | PHP | asf20 | 6,314 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if(!isset($remote)) $remote = 0;
if(!isset($dellink)) $dellink = 0;
if(!isset($autolitpic)) $autolitpic = 0;
if(!isset($autolitpic)) $autolitpic = 0;
if(!isset($smalltypeid)) $smalltypeid = 0;
if(!isset($areaid)) $areaid = 0;
if(!isset($areaid2)) $areaid2 = 0;
if(!isset($sectorid)) $sectorid = 0;
if(!isset($sectorid2)) $sectorid2 = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
//对保存的内容进行处理
//--------------------------------
$senddate = time();
$endtime = $senddate + 3600 * 24 * $endtime;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
$typeid2 = 0;
$iscommend = $iscommend + $isbold;
$title = cn_substr($title,80);
$adminID = $cuserLogin->userID;
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$body = stripslashes($body);
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = trim(preg_replace("/#p#|#e#/","",$description));
$description = addslashes($description);
}
//把内容中远程的图片资源本地化
//------------------------------------
if($cfg_isUrlOpen && $remote==1){
$body = GetCurContent($body);
}
//去除内容中的站外链接
//------------------------------------
if($dellink==1){
$body = str_replace($cfg_basehost,'#basehost#',$body);
$body = preg_replace("/(<a[ \t\r\n]{1,}href=[\"']{0,}http:\/\/[^\/]([^>]*)>)|(<\/a>)/isU","",$body);
$body = str_replace('#basehost#',$cfg_basehost,$body);
}
//自动获取关键字
//----------------------------------
if($autokey==1){
require_once(DEDEADMIN."/../include/pub_splitword_www.php");
$keywords = "";
$sp = new SplitWord();
$titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title))));
$allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200)));
if(is_array($allindexs) && is_array($titleindexs)){
foreach($titleindexs as $k){
if(strlen($keywords)>=50) break;
else $keywords .= $k." ";
}
foreach($allindexs as $k){
if(strlen($keywords)>=50) break;
else if(!in_array($k,$titleindexs)) $keywords .= $k." ";
}
}
$sp->Clear();
unset($sp);
$keywords = preg_replace("/#p#|#e#/","",$keywords);
$keywords = addslashes($keywords);
}
//自动获取缩略图
if($autolitpic==1 && $litpic==''){
$litpic = GetDDImgFromBody($body);
}
$message = addslashes($body);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//更新数据库的SQL语句
//----------------------------------
$inQuery = "insert into `{$cts['maintable']}`(`ID`,`typeid`, `smalltypeid`, `areaid`,
`areaid2`, `sectorid`,`sectorid2`, `endtime`, `typeid2`, sortrank,
iscommend, channel, arcrank, click, money, `title`, shorttitle, color,
writer, source, litpic, pubdate, senddate, arcatt, adminID,
memberID, description, keywords, templet, lastpost, postnum, redirecturl,
mtype, userip, locklikeid, likeid, digg, diggtime)
values('$arcID','$typeid', '$smalltypeid', '$areaid',
'$areaid2', '$sectorid', '$sectorid2', '$endtime', '$typeid2', '$sortrank',
'$iscommend', '$channelid', '0', '0', '0', '$title', '', '',
'', '', '$litpic', '$pubdate', '$senddate', '$arcatt', '$adminID',
'0', '$description', '$keywords', '', '0', '0', '',
'0', '$userip', '0', '', '0', '0');
";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$infoid = $arcID;
$inadd_f = '';
$inadd_v = '';
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
$sql = "insert into `{$cts['addtable']}`(aid, typeid, message, contact, phone, fax,email, qq, msn, address{$inadd_f})
values('$infoid', '$typeid', '$message', '$contact', '$phone', '$fax','$email', '$qq', '$msn', '$address'{$inadd_v});
";
if(!$dsql->ExecuteNoneQuery($sql)){
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From {$cts['maintable']} where ID='$arcID'");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID'");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>0);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,0);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../catalog_do.php?channelid=$channelid&cid=$typeid&dopost=addArchives'><u>继续发布</u></a>
<a target= '_blank' href='../archives_do.php?aid=".$infoid."&dopost=viewArchives&channelid=-2'><u>查看信息</u></a>
<a href='../archives_do.php?aid=".$infoid."&dopost=editArchives&channelid=-2'><u>更改信息</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理信息</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功更改信息!";
$wecome_info = "信息管理::更改信息";
$win = new OxWindow();
$win->AddTitle("成功更改信息:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/action/info_add_action.php | PHP | asf20 | 7,704 |
/*Powered by http://www.dedecms.com
Design & CSS By Pig.Z (QQ:7859301)*/
*{
padding:0px;
margin:0px;
font-family:宋体, Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
html{
padding-top:5px;
padding-bottom:5px;
padding-right:5px;
}
body{
font-family:宋体, Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
overflow-y:auto;
height:100%;
}
input{
border-width:1px;
border:1px solid #CCC;
padding:3px 0 3px 5px;
}
img{
border:0px;
}
a{
color:#000;
}
a:hover{
color:#F00;
text-decoration:none;
}
.bodytitle{
width:96%;
height:33px;
background:url(images/body_title_bg.gif) top left repeat-x;
margin-left:auto;
margin-right:auto;
margin-top:8px;
clear:both;
}
.bodytitleleft{
width:30px;
height:33px;
float:left;
background:url(images/body_title_left.gif) right bottom no-repeat;
}
.bodytitletxt{
height:27px;
float:left;
margin-top:6px;
line-height:27px;
font-size:14px;
font-weight:bold;
letter-spacing:2px;
padding-left:8px;
padding-right:8px;
background:#FFF url(images/body_title_right.gif) right bottom no-repeat;
}
.tbtitle{
height:27px;
margin:8px auto 0px auto;
line-height:27px;
letter-spacing:1px;
}
.tbtitle .tbtitletxt{
text-indent:20px;
}
.tblist{
background:#E2F5BC;
margin-left:auto;
margin-right:auto;
}
.tblist2{
margin-left:auto;
margin-right:auto;
border-left:1px solid #E2F5BC;
border-right:1px solid #E2F5BC;
border-bottom:1px solid #E2F5BC;
}
.tblist td{
background:#FFFFFF;
padding:6px;
}
.tblist td.tbsname{
background:#F9FFE6;
padding:6px;
}
.inputbut{
padding-left:3px;
padding-right:2px;
border:1px solid #999;
background:#FFF url(images/inputbut_bg.gif) left center repeat-x;
font-size:12px;
height:25px;
padding-top:5px;
letter-spacing:2px;
vertical-align:middle;
}
.trlbg td{
background:#FFFFCC;
}
.hg {
line-height: 20px;
}
.dlg {
border: 2px solid #007400;
background-color: #F0FAEB;
width:200px;
padding: 2px;
}
.data {
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-color: #E2F5BC;
border-bottom-color: #E2F5BC;
border-left-color: #E2F5BC;
}
| zyyhong | trunk/jiaju001/news/lic/action/css_body.css | CSS | asf20 | 2,322 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if(!isset($remote)) $remote = 0;
if(!isset($dellink)) $dellink = 0;
if(!isset($autolitpic)) $autolitpic = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_New')) {
CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
if($typeid2!=0) CheckCatalog($typeid2,"对不起,你没有操作栏目 {$typeid2} 的权限!");
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$uptime = $senddate = time();
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
$keywords = cn_substr($keywords,60);
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('litpic',$picname,$ddisremote);
$body = stripslashes($body);
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = trim(preg_replace("/#p#|#e#/","",$description));
$description = addslashes($description);
}
//把内容中远程的图片资源本地化
//------------------------------------
if($cfg_isUrlOpen && $remote==1){
$body = GetCurContent($body);
}
//去除内容中的站外链接
//------------------------------------
if($dellink==1){
$body = str_replace($cfg_basehost,'#basehost#',$body);
$body = preg_replace("/(<a[ \t\r\n]{1,}(.*)href=[\"']{0,}http:\/\/[^\/]([^>]*)>)|(<\/a>)/isU","",$body);
$body = str_replace('#basehost#',$cfg_basehost,$body);
}
//自动获取文章中的关键字
//----------------------------------
if($autokey==1){
require_once(DEDEADMIN."/../include/pub_splitword_www.php");
$keywords = "";
$sp = new SplitWord();
$titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title))));
$allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200)));
if(is_array($allindexs) && is_array($titleindexs)){
foreach($titleindexs as $k){
if(strlen($keywords)>=50) break;
else $keywords .= $k." ";
}
foreach($allindexs as $k){
if(strlen($keywords)>=50) break;
else if(!in_array($k,$titleindexs)) $keywords .= $k." ";
}
}
$sp->Clear();
unset($sp);
$keywords = preg_replace("/#p#|#e#/","",$keywords);
$keywords = addslashes($keywords);
}
//自动分页
$sptype = (empty($sptype) ? '' : $sptype);
if($sptype=="auto"){
$body = SpLongBody($body,$spsize*1024,"#p#分页标题#e#");
}
//自动获取缩略图
if($autolitpic==1 && $litpic==''){
$litpic = GetDDImgFromBody($body);
}
$body = addslashes($body);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//加入数据库的SQL语句
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(
ID,typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,templet,redirecturl,likeid)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$templet','$redirecturl','$likeid');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$query = "delete from #@__full_search where aid='$arcID' limit 1;";
$dsql->ExecuteNoneQuery($query);
$dsql->Close();
ShowMsg("把数据保存到数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
$dsql->SetQuery("INSERT INTO `{$cts['addtable']}`(aid,typeid,body{$inadd_f}) Values('$arcID','$typeid','$body'{$inadd_v})");
if(!$dsql->ExecuteNoneQuery()){
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From {$cts['maintable']} where ID='$arcID' limit 1");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID' limit 1");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../article_add.php?cid=$typeid'><u>继续发布文章</u></a>
<a href='$artUrl' target='_blank'><u>查看文章</u></a>
<a href='../archives_do.php?aid=".$arcID."&dopost=editArchives'><u>更改文章</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布文章管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布文章!";
$wecome_info = "文章管理::发布文章";
$win = new OxWindow();
$win->AddTitle("成功发布文章:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/article_add_action.php | PHP | asf20 | 7,583 |
<?php
@ob_start();
@set_time_limit(3600);
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('sys_description');
if(empty($startdd)) $startdd = 0;
if(empty($pagesize)) $pagesize = 100;
if(empty($totalnum)) $totalnum = 0;
if(empty($sid)) $sid = 0;
if(empty($eid)) $eid = 0;
if(empty($dojob)) $dojob = 'desc';
$table = ereg_replace("[^a-zA-Z_#@]","",$table);
$field = ereg_replace("[^a-zA-Z_\[\]]","",$field);
$channel = ereg_replace("[^0-9]","",$channel);
if($dsize>250) $dsize = 250;
header("Content-Type: text/html; charset={$cfg_ver_lang}");
$dsql = new DedeSql(false);
$tjnum = 0;
//--------------------------
//获取自动摘要
//--------------------------
if($dojob=='des'){
$channelinfo = $dsql->getone("select * from #@__channeltype where ID=$channel");
$maintable = $channelinfo['maintable'];
if(empty($totalnum)){
$addquery = "";
if($sid!=0) $addquery = " And ID>='$sid' ";
if($eid!=0) $addquery = " And ID<='$eid' ";
$tjQuery = "Select count(*) as dd From #@__full_search where channel='{$channel}' $addquery";
$row = $dsql->GetOne($tjQuery);
$totalnum = $row['dd'];
}
if($totalnum > 0){
$addquery = "";
if($sid!=0) $addquery = " And #@__archives.ID>='$sid' ";
if($eid!=0) $addquery = " And #@__archives.ID<='$eid' ";
$fquery = "
Select #@__archives.ID,#@__archives.title,#@__archives.description,{$table}.{$field}
From #@__archives left join {$table} on {$table}.aid=#@__archives.ID
where #@__archives.channel='{$channel}' $addquery limit $startdd,$pagesize ;
";
$dsql->SetQuery($fquery);
$dsql->Execute();
while($row=$dsql->GetArray())
{
$body = $row[$field];
$description = $row['description'];
if(strlen($description)>10 || $description=='-') continue;
$bodytext = preg_replace("/#p#|#e#|副标题|分页标题/isU","",Html2Text($body));
if(strlen($bodytext) < $msize) continue;
$des = trim(addslashes(cn_substr($bodytext,$dsize)));
if(strlen($des)<3) $des = "-";
$dsql->ExecuteNoneQuery("Update #@__archives set description='{$des}' where ID='{$row['ID']}';");
}
//返回进度信息
$startdd = $startdd + $pagesize;
if($totalnum > $startdd){
$tjlen = ceil( ($startdd/$totalnum) * 100 );
}else{
$tjlen=100;
$dsql->Close();
echo "完成所有任务!";
exit();
}
$dvlen = $tjlen * 2;
$tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>";
$tjsta .= "<br/>完成处理文档总数的:$tjlen %,继续执行任务...";
$nurl = "article_description_action.php?totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}";
$dsql->Close();
ShowMsg($tjsta,$nurl,0,500);
exit();
}else{
$dsql->Close();
echo "完成所有任务!";
exit();
}
}//获取自动摘要代码结束
//----------------------------
//更新自动分页
//----------------------------
if($dojob=='page'){
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
//统计记录总数
if($totalnum==0){
$addquery = " where ID>0 ";
if($sid!=0) $addquery = " And ID>='$sid' ";
if($eid!=0) $addquery = " And ID<='$eid' ";
$row = $dsql->GetOne("Select count(*) as dd From $table $addquery");
$totalnum = $row['dd'];
}
//获取记录,并分析
if($totalnum > $startdd+$pagesize) $limitSql = " limit $startdd,$pagesize";
else if(($totalnum-$startdd)>0) $limitSql = " limit $startdd,".($totalnum - $startdd);
else $limitSql = "";
$tjnum = $startdd;
if($limitSql!=""){
$addquery = " where ID>0 ";
if($sid!=0) $addquery = " And ID>='$sid' ";
if($eid!=0) $addquery = " And ID<='$eid' ";
$fquery = "Select aid,$field From $table $addquery $limitSql ;";
$dsql->SetQuery($fquery);
$dsql->Execute();
while($row=$dsql->GetArray())
{
$tjnum++;
$body = $row[$field];
$aid = $row['aid'];
if(strlen($body) < $msize) continue;
if(!preg_match("/#p#/iU",$body)){
$body = SpLongBody($body,$cfg_arcautosp_size*1024,"#p#分页标题#e#");
$body = addslashes($body);
$dsql->ExecuteNoneQuery("Update $table set $field='$body' where aid='$aid' ; ");
}
}
}//end if limit
//返回进度提示
if($totalnum>0) $tjlen = ceil( ($tjnum/$totalnum) * 100 );
else $tjlen=100;
$dvlen = $tjlen * 2;
$tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>";
$tjsta .= "<br/>完成处理文档总数的:$tjlen %,继续执行任务...";
if($tjnum < $totalnum)
{
$nurl = "article_description_action.php?totalnum=$totalnum&startdd=".($startdd+$pagesize)."&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}";
$dsql->Close();
ShowMsg($tjsta,$nurl,0,500);
exit();
}else{
$dsql->Close();
echo "完成所有任务!";
exit();
}
}//更新自动分页处理代码结束
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/article_description_action.php | PHP | asf20 | 5,394 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_New');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if($catid==0){
ShowMsg("请指定图书所属栏目!","-1");
exit();
}
$dsql = new DedeSql(false);
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
$pubdate = GetMkTime($pubdate);
$bookname = cn_substr($bookname,50);
if($keywords!="") $keywords = trim(cn_substr($keywords,60));
//处理上传的缩略图
$litpic = GetDDImage('litpic',$litpicname,0);
$adminID = $cuserLogin->getUserID();
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = addslashes($description);
}
//----------------------------------
$upQuery = "
Update `#@__story_books`
set catid='$catid',
bcatid='$bcatid',
iscommend='$iscommend',
click='$click',
freenum='$freenum',
bookname='$bookname',
author='$author',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
body='$body',
keywords='$keywords',
status='$status',
ischeck='$ischeck'
where id='$bookid' ";
if(!$dsql->ExecuteNoneQuery($upQuery)){
ShowMsg("更新数据库时出错,请检查!".$dsql->GetError(),"-1");
$dsql->Close();
exit();
}
$dsql->Close();
//生成HTML
//---------------------------------
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_edit.php?bookid={$bookid}'><u>继续修改</u></a>
<a href='../story_add.php?catid={$catid}'><u>发布新图书</u></a>
<a href='$artUrl' target='_blank'><u>预览图书</u></a>
<a href='../story_add_content.php?bookid={$bookid}'><u>增加图书内容</u></a>
<a href='../story_books.php'><u>管理图书</u></a>
";
$wintitle = "成功修改图书!";
$wecome_info = "连载管理::修改图书";
$win = new OxWindow();
$win->AddTitle("成功修改一本图书:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_edit_action.php | PHP | asf20 | 2,645 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_New');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if( empty($chapterid)
|| (!empty($addchapter) && !empty($chapternew)) )
{
if(empty($chapternew))
{
ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!","-1");
exit();
}
$dsql = new DedeSql();
$row = $dsql->GetOne("Select * From #@__story_chapter where bookid='$bookid' order by chapnum desc");
if(is_array($row)) $nchapnum = $row['chapnum']+1;
else $nchapnum = 1;
$query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`memberid`,`chaptername`,`bookname`)
VALUES ('$bookid', '$catid', '$nchapnum', '0', '$chapternew','$bookname');";
$rs = $dsql->ExecuteNoneQuery($query);
if($rs){
$chapterid = $dsql->GetLastID();
}
else
{
ShowMsg("增加章节失败,请检查原因!","-1");
exit();
}
}else
{
$dsql = new DedeSql();
}
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
$addtime = time();
//本章最后一个漫画的排列顺次序
$lrow = $dsql->GetOne("Select sortid From #@__story_content where bookid='$bookid' And chapterid='$chapterid' order by sortid desc");
if(empty($lrow)) $sortid = 1;
else $sortid = $lrow['sortid']+1;
//处理上传的图片
if(!isset($isremote)) $isremote = 0;
//$bigpic = UploadOneImage('bigpic',$bigpicname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$postnum = 0;
for($i=1;$i<=$photonum;$i++)
{
$bigpic = UploadOneImage('imgfile'.$i,${'imgurl'.$i},$isremote);
if($bigpic!=''){
$titlen = ${'title'.$i};
if(empty($titlen)) $titlen = ${'title'};
$inQuery = "
INSERT INTO `#@__story_content`(`title`,`bookname`,`chapterid`,`catid`,`bcatid`,`booktype`,`bookid`,`sortid`,
`memberid`,`bigpic`,`body`,`addtime`,`adminid` )
VALUES ('$titlen','$bookname', '$chapterid', '$catid','$bcatid','$booktype', '$bookid','$sortid', '0', '$bigpic' , '', '$addtime','$adminID');";
$rs = $dsql->ExecuteNoneQuery($inQuery);
//if(!$rs) echo $inQuery."<hr>\r\n";
if($rs){
$sortid++;
$postnum++;
}
}
}
$arcID = $dsql->GetLastID();
//更新图书的内容数
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' ");
$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}',lastpost='".time()."' where id='$bookid' ");
//更新章节的内容数
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' And chapterid='$chapterid' ");
$dsql->ExecuteNoneQuery("Update #@__story_chapter set postnum='{$row['dd']}' where id='$chapterid' ");
if(empty($arcID)){
ShowMsg("没成功保存任何图片,可能是系统有问题!","-1");
exit();
}
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true,true);
if($artcontentUrl=="") $artcontentUrl = $cfg_book_url."/show-photo.php?id=$arcID&bookid=$bookid&chapterid=$chapterid";
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_add_photo.php?bookid={$bookid}'><u>继续发布</u></a>
<a href='$artUrl' target='_blank'><u>预览漫画</u></a>
<a href='$artcontentUrl' target='_blank'><u>预览内容</u></a>
<a href='../story_list_content.php?bookid={$bookid}'><u>本书所有内容</u></a>
<a href='../story_books.php'><u>管理所有图书</u></a>
";
$wintitle = "成功发布图片!";
$wecome_info = "连载管理::发布图片";
$win = new OxWindow();
$win->AddTitle("成功发布图片:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_add_photo_action.php | PHP | asf20 | 4,288 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if(!isset($remote)) $remote = 0;
if(!isset($dellink)) $dellink = 0;
if(!isset($autolitpic)) $autolitpic = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$uptime = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$body = stripslashes($body);
//把内容中远程的图片资源本地化
//------------------------------------
if($cfg_isUrlOpen && $remote==1){
$body = GetCurContent($body);
}
//自动摘要
if($description=='' && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = trim(preg_replace("/#p#|#e#/","",$description));
$description = addslashes($description);
}
//自动获取缩略图
if($autolitpic==1 && empty($litpic)){
$litpic = GetDDImgFromBody($body);
}
$body = addslashes($body);
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$aTables = GetChannelTable($dsql,$channelid);
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$aTables['maintable']}` set
typeid='$typeid',
typeid2='$typeid2',
sortrank='$sortrank',
redirecturl='$redirecturl',
iscommend='$iscommend',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
writer='$writer',
source='$source',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
templet='$templet',
shorttitle='$shorttitle',
arcatt='$arcatt',
likeid='$likeid'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$tables['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
//更新附加表
$addQuery = "Update `{$aTables['addtable']}` set typeid='$typeid',body='$body'{$inadd_f} where aid='$ID'";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'mid'=>$memberid,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($ID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../article_add.php?cid=$typeid'><u>发布新文章</u></a>
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives'><u>查看更改</u></a>
<a href='$artUrl' target='_blank'><u>查看文章</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理文章</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功更改文章!";
$wecome_info = "文章管理::更改文章";
$win = new OxWindow();
$win->AddTitle("成功更改文章:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/article_eidt_action.php | PHP | asf20 | 5,836 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_New');
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../../include/inc_bookfunctions.php");
if( empty($chapterid)
|| (!empty($addchapter) && !empty($chapternew)) )
{
if(empty($chapternew))
{
ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!","-1");
exit();
}
$dsql = new DedeSql();
$row = $dsql->GetOne("Select * From #@__story_chapter where bookid='$bookid' order by chapnum desc");
if(is_array($row)) $nchapnum = $row['chapnum']+1;
else $nchapnum = 1;
$query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`memberid`,`chaptername`,`bookname`)
VALUES ('$bookid', '$catid', '$nchapnum', '0', '$chapternew','$bookname');";
$rs = $dsql->ExecuteNoneQuery($query);
if($rs){
$chapterid = $dsql->GetLastID();
}
else
{
ShowMsg("增加章节失败,请检查原因!","-1");
exit();
}
}else
{
$dsql = new DedeSql();
}
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if(empty($bcatid)) $bcatid = 0;
if(empty($booktype)) $booktype = 0;
$addtime = time();
//处理上传的缩略图
//$litpic = GetDDImage('litpic',$litpicname,0);
$adminID = $cuserLogin->getUserID();
//本章最后一个小说的排列顺次序
$lrow = $dsql->GetOne("Select sortid From #@__story_content where bookid='$bookid' And chapterid='$chapterid' order by sortid desc");
if(empty($lrow)) $sortid = 1;
else $sortid = $lrow['sortid']+1;
//----------------------------------
$inQuery = "
INSERT INTO `#@__story_content`(`title`,`bookname`,`chapterid`,`catid`,`bcatid`,`bookid`,`booktype`,`sortid`,
`memberid`,`bigpic`,`body`,`addtime`,`adminid` )
VALUES ('$title','$bookname', '$chapterid', '$catid','$bcatid', '$bookid','$booktype','$sortid', '0', '' , '', '$addtime','$adminID');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
ShowMsg("把数据保存到数据库时出错,请检查!".$dsql->GetError().$inQuery,"-1");
$dsql->Close();
exit();
}
$arcID = $dsql->GetLastID();
WriteBookText($arcID,stripslashes($body));
//更新图书的内容数
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' ");
$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}',lastpost='".time()."' where id='$bookid' ");
//更新章节的内容数
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' And chapterid='$chapterid' ");
$dsql->ExecuteNoneQuery("Update #@__story_chapter set postnum='{$row['dd']}' where id='$chapterid' ");
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true,true);
if($artcontentUrl=="") $artcontentUrl = $cfg_book_path."/story.php?id=$arcID";
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_add_content.php?bookid={$bookid}'><u>继续发布</u></a>
<a href='$artUrl' target='_blank'><u>预览小说</u></a>
<a href='$artcontentUrl' target='_blank'><u>预览内容</u></a>
<a href='../story_list_content.php?bookid={$bookid}'><u>管理所有内容</u></a>
<a href='../story_books.php'><u>管理所有图书</u></a>
";
$wintitle = "成功发布文章!";
$wecome_info = "连载管理::发布文章";
$win = new OxWindow();
$win->AddTitle("成功发布文章:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_add_content_action.php | PHP | asf20 | 3,941 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_New')) {
CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
if($typeid2!=0) CheckCatalog($typeid2,"对不起,你没有操作栏目 {$typeid2} 的权限!");
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('litpic',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = addslashes($description);
}
//加入主档案表
//写入数据库
//-----------------------------------
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(ID,typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,likeid)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$likeid');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//软件链接列表
$softurl1 = stripslashes($softurl1);
$urls = "";
if($softurl1!="") $urls .= "{dede:link text='本地下载'} $softurl1 {/dede:link}\r\n";
for($i=2;$i<=9;$i++)
{
if(!empty(${'softurl'.$i}))
{
$servermsg = str_replace("'","",stripslashes(${'servermsg'.$i}));
$softurl = stripslashes(${'softurl'.$i});
if($servermsg=="") $servermsg = "下载地址".$i;
if($softurl!="" && $softurl!="http://")
{ $urls .= "{dede:link text='$servermsg'} $softurl {/dede:link}\r\n"; }
}
}
$urls = addslashes($urls);
$softsize = $softsize.$unit;
$inadd_f = '';
$inadd_v = '';
//----------------------------------
//分析处理附加表数据
//----------------------------------
if(!empty($cts['addtable']))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
//加入附加表
//----------------------------------
$query = "
INSERT INTO `{$cts['addtable']}`(aid,typeid,filetype,language,softtype,accredit,
os,softrank,officialUrl,officialDemo,softsize,softlinks,introduce{$inadd_f})
VALUES ('$arcID','$typeid','$filetype','$language','$softtype','$accredit',
'$os','$softrank','$officialUrl','$officialDemo','$softsize','$urls','$body'{$inadd_v});
";
if(!$dsql->ExecuteNoneQuery($query))
{
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From `{$cts['maintable']}` where ID='$arcID'");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID'");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../soft_add.php?cid=$typeid'><u>继续发布软件</u></a>
<a href='$artUrl' target='_blank'><u>查看软件</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布软件管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布一个软件!";
$wecome_info = "文章管理::发布软件";
$win = new OxWindow();
$win->AddTitle("成功发布软件:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/soft_add_action.php | PHP | asf20 | 6,504 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_New');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if($catid==0){
ShowMsg("请指定图书所属栏目!","-1");
exit();
}
$dsql = new DedeSql(false);
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
$pubdate = GetMkTime($pubdate);
$bookname = cn_substr($bookname,50);
if($keywords!="") $keywords = trim(cn_substr($keywords,60));
//处理上传的缩略图
$litpic = GetDDImage('litpic',$litpicname,0);
$adminID = $cuserLogin->getUserID();
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = addslashes($description);
}
//----------------------------------
$inQuery = "
INSERT INTO `#@__story_books`(`catid`,`bcatid`,`booktype`,`iscommend`,`click`,`freenum`,`bookname`,
`author`,`memberid`,`litpic`,`pubdate`,
`lastpost`,`postnum`,`lastfeedback`,`feedbacknum`,`weekcc`,`monthcc`,`weekup`,`monthup`,
`description`,`body`,`keywords`,`userip`,`senddate` )
VALUES ('$catid','$bcatid','$booktype', '$iscommend', '$click', '$freenum', '$bookname',
'$author', '0', '$litpic', '$pubdate',
'0', '0', '0', '0', '0', '0', '0', '0',
'$description' , '$body' , '$keywords', '','".time()."');
";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$dsql->Close();
ShowMsg("把数据保存到数据库时出错,请检查!","-1");
exit();
}
$arcID = $dsql->GetLastID();
$dsql->Close();
//生成HTML
//---------------------------------
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($arcID,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_add.php?catid=$catid'><u>继续发布图书</u></a>
<a href='$artUrl' target='_blank'><u>查看图书</u></a>
<a href='../story_add_content.php?bookid={$arcID}'><u>增加图书内容</u></a>
<a href='../story_books.php'><u>管理图书</u></a>
";
$wintitle = "成功发布图书!";
$wecome_info = "连载管理::发布图书";
$win = new OxWindow();
$win->AddTitle("成功发布一本图书:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_add_action.php | PHP | asf20 | 2,774 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_Del');
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
if(empty($action)){
ShowMsg("你没指定任何参数!","-1");
exit();
}
/*--------------------
function DelBook()
删除整本图书
-------------------*/
if($action=='delbook')
{
$dsql = new DedeSql(false);
$bids = explode(',',$bid);
$i = 0;
foreach($bids as $bid){
if(intval($bid)<=0) continue;
$i++;
$row = $dsql->GetOne("Select booktype From #@__story_books where id='$bid' ");
$dsql->ExecuteNoneQuery("Delete From #@__story_books where id='$bid' ");
$dsql->ExecuteNoneQuery("Delete From #@__story_chapter where bookid='$bid' ");
//删除图片
if($row['booktype']==1){
$dsql->SetQuery("Select bigpic From #@__story_content where bookid='$bid' ");
$dsql->Execute();
while($row = $dsql->GetArray()){
$bigpic = $row['bigpic'];
if( $bigpic!="" && !eregi('^http://',$bigpic) ) @unlink($cfg_basedir.$bigpic);
}
}
$dsql->ExecuteNoneQuery("Delete From #@__story_content where bookid='$bid' ");
}
$dsql->Close();
if(empty($ENV_GOBACK_URL)) $ENV_GOBACK_URL = 'story_books.php';
ShowMsg("成功删除 {$i} 本图书!",$ENV_GOBACK_URL);
exit();
}
/*--------------------
function DelStoryContent()
删除图书内容
-------------------*/
else if($action=='delcontent')
{
$dsql = new DedeSql();
$row = $dsql->GetOne("Select bigpic,chapterid,bookid From #@__story_content where id='$cid' ");
$chapterid = $row['chapterid'];
$bookid = $row['bookid'];
//如果图片不为空,先删除图片
if( $row['bigpic']!="" && !eregi('^http://',$row['bigpic']) ) @unlink($cfg_basedir.$row['bigpic']);
$dsql->ExecuteNoneQuery(" Delete From #@__story_content where id='$cid' ");
//更新图书记录
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid='$bookid' ");
$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}' where id='$bookid' ");
//更新章节记录
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where chapterid='$chapterid' ");
$dsql->ExecuteNoneQuery("Update #@__story_chapter set postnum='{$row['dd']}' where id='$chapterid' ");
$dsql->Close();
ShowMsg("成功删除指定内容!",$ENV_GOBACK_URL);
exit();
}
/*--------------------
function EditChapter()
保存章节信息
-------------------*/
else if($action=='editChapter')
{
$dsql = new DedeSql();
$dsql->ExecuteNoneQuery("Update #@__story_chapter set chaptername='$chaptername',chapnum='$chapnum' where id='$cid' ");
AjaxHead();
echo "<font color='red'>成功更新章节:{$chaptername} ! [<a href=\"javascript:CloseLayer('editchapter')\">关闭提示</a>]</font> <br /><br /> 提示:修改章节名称或章节序号直接在左边修改,然后点击右边的 [更新] 会保存。 ";
$dsql->Close();
exit();
}
/*--------------------
function DelChapter()
删除章节信息
-------------------*/
else if($action=='delChapter')
{
$dsql = new DedeSql();
$row = $dsql->GetOne("Select c.bookid,b.booktype From #@__story_chapter c left join #@__story_books b on b.id=c.bookid where c.id='$cid' ");
$bookid = $row['bookid'];
$booktype = $row['booktype'];
$dsql->ExecuteNoneQuery("Delete From #@__story_chapter where id='$cid' ");
//删除图片
if($booktype==1)
{
$dsql->SetQuery("Select bigpic From #@__story_content where bookid='$bookid' ");
$dsql->Execute();
while($row = $dsql->GetArray()){
$bigpic = $row['bigpic'];
if( $bigpic!="" && !eregi('^http://',$bigpic) ) @unlink($cfg_basedir.$bigpic);
}
}
$dsql->ExecuteNoneQuery("Delete From #@__story_content where chapterid='$cid' ");
//更新图书记录
$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid='$bookid' ");
$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}' where id='$bookid' ");
$dsql->Close();
ShowMsg("成功删除指定章节!",$ENV_GOBACK_URL);
exit();
exit();
}
/*---------------
function EditChapterAll()
批量修改章节
-------------------*/
else if($action=='upChapterSort')
{
if(isset($ids) && is_array($ids))
{
$dsql = new DedeSql();
foreach($ids as $cid){
$chaptername = ${'chaptername_'.$cid};
$chapnum= ${'chapnum_'.$cid};
$dsql->ExecuteNoneQuery("Update #@__story_chapter set chaptername='$chaptername',chapnum='$chapnum' where id='$cid' ");
}
$dsql->Close();
}
ShowMsg("成功更新指定章节信息!",$ENV_GOBACK_URL);
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_do.php | PHP | asf20 | 4,693 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_Edit');
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../../include/inc_bookfunctions.php");
if( empty($chapterid)
|| (!empty($addchapter) && !empty($chapternew)) )
{
if(empty($chapternew))
{
ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!","-1");
exit();
}
$dsql = new DedeSql();
$row = $dsql->GetOne("Select * From #@__story_chapter where bookid='$bookid' order by chapnum desc");
if(is_array($row)) $nchapnum = $row['chapnum']+1;
else $nchapnum = 1;
$query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`memberid`,`chaptername`,`bookname`)
VALUES ('$bookid', '$catid', '$nchapnum', '0', '$chapternew','$bookname');";
$rs = $dsql->ExecuteNoneQuery($query);
if($rs){
$chapterid = $dsql->GetLastID();
}
else
{
ShowMsg("增加章节失败,请检查原因!","-1");
exit();
}
}else
{
$dsql = new DedeSql();
}
//获得父栏目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if(empty($bcatid)) $bcatid = 0;
if(empty($booktype)) $booktype = 0;
$addtime = time();
//处理上传的缩略图
//$litpic = GetDDImage('litpic',$litpicname,0);
//$adminID = $cuserLogin->getUserID();
//本章最后一个小说的排列顺次序
//$lrow = $dsql->GetOne("Select sortid From #@__story_content where id='$cid' And chapterid='$chapterid' order by sortid desc");
//if(empty($lrow)) $sortid = 1;
//else $sortid = $lrow['sortid']+1;
//----------------------------------
$inQuery = "
Update `#@__story_content` set `title`='$title',`bookname`='$bookname',
`chapterid`='$chapterid',`sortid`='$sortid',`body`=''
where id='$cid'
";
if(!$dsql->ExecuteNoneQuery($inQuery)){
ShowMsg("更新数据时出错,请检查!".str_repolace("'","`",$dsql->GetError().$inQuery),"-1");
$dsql->Close();
exit();
}
WriteBookText($cid,stripslashes($body));
$dsql->Close();
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true,true);
if($artcontentUrl=="") $artcontentUrl = $cfg_book_url."/story.php?id={$cid}";
require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../story_content_edit.php?cid={$cid}'><u>继续编辑</u></a>
<a href='$artUrl' target='_blank'><u>预览小说</u></a>
<a href='$artcontentUrl' target='_blank'><u>预览内容</u></a>
<a href='../story_list_content.php?bookid={$bookid}'><u>本书所有内容</u></a>
<a href='../story_books.php'><u>管理所有图书</u></a>
";
$wintitle = "成功修改文章!";
$wecome_info = "连载管理::发布文章";
$win = new OxWindow();
$win->AddTitle("成功修改文章:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/story_edit_content_action.php | PHP | asf20 | 3,275 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,50))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$filesize = $filesize;
$playtime = $tms;
$width = GetAlabNum($width);
$height = GetAlabNum($height);
//处理远程的Flash
//------------------
if(empty($downremote)) $downremote = 0;
$rmflash = "";
if(eregi("^http://",$flashurl)
&& !eregi($cfg_basehost,$flashurl) && $downremote==1)
{
if($cfg_isUrlOpen) $rmflash = GetRemoteFlash($flashurl,$adminID);
}
if($width==0) $width = "500";
if($height==0) $height = "350";
if($rmflash!="") $flashurl = $rmflash;
if($flashurl==""){
ShowMsg("Flash地址不正确,或远程采集出错!","-1");
exit();
}
$dsql = new DedeSql(false);
$tables = GetChannelTable($dsql,$ID,'arc');
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$tables['maintable']}` set
typeid='$typeid',
typeid2='$typeid2',
sortrank='$sortrank',
redirecturl='$redirecturl',
iscommend='$iscommend',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
source='$source',
writer='$writer',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
shorttitle='$shorttitle',
arcatt='$arcatt',
likeid='$likeid'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$tables['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
//更新附加表
$addQuery = "
update `{$tables['addtable']}`
set typeid ='$typeid',
filesize ='$filesize',
playtime ='$playtime',
flashtype ='$flashtype',
flashrank ='$flashrank',
width ='$width',
height ='$height',
flashurl ='$flashurl'{$inadd_f}
where aid='$ID';
";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//生成HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'mid'=>$memberid,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
MakeArt($ID,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../flash_add.php?cid=$typeid'><u>发布新Flash作品</u></a>
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives'><u>查看更改</u></a>
<a href='$artUrl' target='_blank'><u>查看文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布Flash管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布一个Flash作品!";
$wecome_info = "文章管理::更改Flash";
$win = new OxWindow();
$win->AddTitle("成功更改一个Flash!");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/flash_edit_action.php | PHP | asf20 | 5,905 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$uptime = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$tables = GetChannelTable($dsql,$ID,'arc');
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$tables['maintable']}` set
typeid='$typeid',
typeid2='$typeid2',
sortrank='$sortrank',
iscommend='$iscommend',
redirecturl='$redirecturl',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
writer='$writer',
source='$source',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
shorttitle='$shorttitle',
arcatt='$arcatt',
likeid='$likeid'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$tables['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$addtable = $tables['addtable'];
if(empty($addtable)) $addtable = "";
if(empty($dede_addonfields)) $dede_addonfields = "";
$addonfields = explode(";",$dede_addonfields);
$upfield = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
if($vs[1]=="textdata"){
$vok = GetFieldValueA(${$vs[0]},$vs[1],$ID,'edit',${$vs[0].'_file'});
}else{
$vok = GetFieldValueA(${$vs[0]},$vs[1]);
}
$upfield .= ($upfield=='' ? " {$vs[0]} = '{$vok}' " : " ,{$vs[0]} = '{$vok}' ");
}
}
$addQuery = "Update `".$addtable."` set $upfield where aid='$ID'";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//更新HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'mid'=>$memberid,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$uptime,'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($ID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../archives_add.php?cid=$typeid'><u>发布新文档</u></a>
<a href='../archives_do.php?aid={$ID}&dopost=editArchives'><u>查看更改</u></a>
<a href='$artUrl' target='_blank'><u>预览文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理文档</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功更改文档!";
$wecome_info = "文章管理::更改文档";
$win = new OxWindow();
$win->AddTitle("成功更改文档:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/archives_edit_action.php | PHP | asf20 | 5,085 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_New')) {
CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
if($typeid2!=0) CheckCatalog($typeid2,"对不起,你没有操作栏目 {$typeid2} 的权限!");
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,50)." ");
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('litpic',$picname,$ddisremote);
$adminID = $cuserLogin->getUserID();
$filesize = $filesize.$unit;
$playtime = "$tm 分 $ts 秒";
$width = GetAlabNum($width);
$height = GetAlabNum($height);
//$flashurl = "";
//处理远程的Flash
//------------------
$rmflash = "";
if(empty($downremote)) $downremote = 0;
//直接从远程粘贴
if(eregi("embed",$remoteflash)){
$remoteflash = stripslashes($remoteflash);
require_once(dirname(__FILE__)."/../../include/pub_dedehtml2.php");
$dml = new DedeHtml2();
$dml->GetLinkType = "media";
$dml->SetSource($remoteflash,"",false);
$marr = $dml->Medias;
$rmfalsh = "";
if(!is_array($marr)) $rmfalsh = "";
else{
if(count($marr)==1)
{
foreach($marr as $k=>$v){
$rmfalsh = $k;
break;
}
}
else
{
foreach($marr as $k=>$v){
$rmfalsh = $k;
if(GetAlabNum($dml->MediaInfos[$rmfalsh][0])>300&&
GetAlabNum($dml->MediaInfos[$rmfalsh][1])>250)
{ break; }
}
}
$width = GetAlabNum($dml->MediaInfos[$rmfalsh][0]);
$height = GetAlabNum($dml->MediaInfos[$rmfalsh][1]);
}
$dml->Clear();
if($cfg_isUrlOpen && $downremote==1) $rmflash = GetRemoteFlash($rmfalsh,$adminID);
}
//Flash Url 为远程地址
else if(eregi("^http://",$flashurl)
&& !eregi($cfg_basehost,$flashurl) && $downremote==1)
{
if($cfg_isUrlOpen) $rmflash = GetRemoteFlash($flashurl,$adminID);
}
if($width==0) $width = "500";
if($height==0) $height = "350";
if($rmflash!="") $flashurl = $rmflash;
if($flashurl==""){
ShowMsg("Flash地址不正确,或远程采集出错!","-1");
exit();
}
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//加入数据库的SQL语句
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(
ID,typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,likeid)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$likeid');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
}
//加入附加表
//----------------------------------
$query = "
INSERT INTO `{$cts['addtable']}`(aid,typeid,filesize,playtime,flashtype,flashrank,width,height,flashurl{$inadd_f})
VALUES ('$arcID','$typeid','$filesize','$playtime','$flashtype','$flashrank','$width','$height','$flashurl'{$inadd_v});
";
$dsql->SetQuery($query);
if(!$dsql->ExecuteNoneQuery()){
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From {$cts['maintable']} where ID='$arcID'");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID'");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../flash_add.php?cid=$typeid'><u>继续发布Flash作品</u></a>
<a href='$artUrl' target='_blank'><u>查看文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布Flash管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布一个Flash作品!";
$wecome_info = "文章管理::发布Flash";
$win = new OxWindow();
$win->AddTitle("成功发布作品:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/flash_add_action.php | PHP | asf20 | 7,163 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_New,a_AccNew');
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if(!isset($autokey)) $autokey = 0;
if(!isset($remote)) $remote = 0;
if(!isset($dellink)) $dellink = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_New')) {
CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
if($typeid2!=0) CheckCatalog($typeid2,"对不起,你没有操作栏目 {$typeid2} 的权限!");
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$title = cn_substr($title,80);
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
$keywords = cn_substr($keywords,60);
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('litpic',$picname,$ddisremote);
if($keywords!="") $keywords = trim(cn_substr($keywords,56))." ";
$adminID = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
//加入数据库的SQL语句
//----------------------------------
$inQuery = "INSERT INTO `{$cts['maintable']}`(ID,
typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,likeid)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$likeid');";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("把数据保存到数据库主表`{$cts['maintable']}`时出错,请检查!".$gerr,"javascript:;");
exit();
}
//----------------------------------
//分析处理附加表数据
//----------------------------------
$autodes = false;
$autopic = false;
$dede_addtablename = $cts['addtable'];
$inadd_f = '';
$inadd_v = '';
if(!empty($dede_addonfields) && !empty($dede_addtablename))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
$inadd_v = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",".$vs[0];
$inadd_v .= ",'".${$vs[0]}."'";
}
}
$dsql->ExecuteNoneQuery("update `{$cts['maintable']}` set description='$description',litpic='$litpic' where ID='$arcID'; ");
$dsql->SetQuery("INSERT INTO `{$dede_addtablename}`(aid,typeid{$inadd_f}) Values('$arcID','$typeid'{$inadd_v}); ");
if(!$dsql->ExecuteNoneQuery())
{
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("Delete From `{$cts['maintable']}` where ID='$arcID' ");
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$arcID' ");
$dsql->Close();
ShowMsg("把数据保存到数据库附加表 `{$cts['addtable']}` 时出错,请检查原因!".$gerr,"javascript:;");
exit();
}
}
$artUrl = getfilenameonly($arcID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//写入全站搜索索引
$datas = array('aid'=>$arcID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$adminID,'mid'=>0,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>$senddate,'arcrank'=>$arcrank);
WriteSearchIndex($dsql,$datas);
unset($datas);
//写入Tag索引
InsertTags($dsql,$tag,$arcID,0,$typeid,$arcrank);
//生成HTML
//---------------------------------
MakeArt($arcID,true,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../archives_add.php?cid=$typeid'><u>继续发布文档</u></a>
<a href='../archives_do.php?aid={$arcID}&dopost=editArchives'><u>更改文档</u></a>
<a href='$artUrl' target='_blank'><u>预览文档</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布文档管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布文档!";
$wecome_info = "文章管理::发布文档";
$win = new OxWindow();
$win->AddTitle("成功发布文档:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/archives_add_action.php | PHP | asf20 | 5,718 |
<?php
require_once(dirname(__FILE__)."/../config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");
if(!isset($iscommend)) $iscommend = 0;
if(!isset($isjump)) $isjump = 0;
if(!isset($isbold)) $isbold = 0;
if($typeid==0){
ShowMsg("请指定文档的栏目!","-1");
exit();
}
if(empty($channelid)){
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
exit();
}
if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
exit();
}
if(!TestPurview('a_Edit')) {
if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
else CheckArcAdmin($ID,$cuserLogin->getUserID());
}
$arcrank = GetCoRank($arcrank,$typeid);
//对保存的内容进行处理
//--------------------------------
$iscommend = $iscommend + $isbold;
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($senddate,$sortup);
if($ishtml==0) $ismake = -1;
else $ismake = 0;
$shorttitle = cn_substr($shorttitle,36);
$color = cn_substr($color,10);
$writer = cn_substr($writer,30);
$source = cn_substr($source,50);
$description = cn_substr($description,250);
if($keywords!="") $keywords = trim(cn_substr($keywords,50))." ";
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; }
//自动摘要
if($description=="" && $cfg_auot_description>0){
$description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
$description = addslashes($description);
}
//处理上传的缩略图
if(empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
//更新数据库的SQL语句
//----------------------------------
$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
//更新数据库的SQL语句
//----------------------------------
$inQuery = "
update `{$cts['maintable']}` set
typeid='$typeid',
typeid2='$typeid2',
redirecturl='$redirecturl',
sortrank='$sortrank',
iscommend='$iscommend',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
source='$source',
writer='$writer',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
keywords='$keywords',
shorttitle='$shorttitle',
arcatt='$arcatt',
likeid='$likeid'
where ID='$ID'; ";
if(!$dsql->ExecuteNoneQuery($inQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//软件链接列表
$urls = "";
for($i=1;$i<=9;$i++)
{
if(!empty(${'softurl'.$i}))
{
$servermsg = str_replace("'","",stripslashes(${'servermsg'.$i}));
$softurl = stripslashes(${'softurl'.$i});
if($servermsg=="") $servermsg = "下载地址".$i;
if($softurl!="" && $softurl!="http://")
{ $urls .= "{dede:link text='$servermsg'} $softurl {/dede:link}\r\n"; }
}
}
$urls = addslashes($urls);
$softsize = $softsize;
//----------------------------------
//分析处理附加表数据
//----------------------------------
$inadd_f = '';
if(!empty($dede_addonfields))
{
$addonfields = explode(";",$dede_addonfields);
$inadd_f = "";
if(is_array($addonfields))
{
foreach($addonfields as $v)
{
if($v=="") continue;
$vs = explode(",",$v);
//HTML文本特殊处理
if($vs[1]=="htmltext"||$vs[1]=="textdata")
{
include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php');
}else{
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
}
$inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
}
}
}
//更新附加表
//----------------------------------
$addQuery = "
Update `{$cts['addtable']}`
set typeid ='$typeid',
filetype ='$filetype',
language ='$language',
softtype ='$softtype',
accredit ='$accredit',
os ='$os',
softrank ='$softrank',
officialUrl ='$officialUrl',
officialDemo ='$officialDemo',
softsize ='$softsize',
softlinks ='$urls',
introduce='$body'{$inadd_f}
where aid='$ID';
";
if(!$dsql->ExecuteNoneQuery($addQuery)){
$gerr = $dsql->GetError();
$dsql->Close();
ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;");
exit();
}
//生成HTML
//---------------------------------
$artUrl = getfilenameonly($ID, $typeid, $senddate, $title, $ismake, $arcrank, $money);
//更新全站搜索索引
$datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'mid'=>$memberid,'att'=>$arcatt,
'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate,
'addinfos'=>$description,'uptime'=>time(),'arcrank'=>$arcrank);
UpSearchIndex($dsql,$datas);
unset($datas);
//更新Tag索引
UpTags($dsql,$tag,$ID,0,$typeid,$arcrank);
MakeArt($ID,true);
//---------------------------------
//返回成功信息
//----------------------------------
$msg = "
请选择你的后续操作:
<a href='../soft_add.php?cid=$typeid'><u>发布新软件</u></a>
<a href='../archives_do.php?aid=".$ID."&dopost=editArchives'><u>继续修改</u></a>
<a href='$artUrl' target='_blank'><u>查看软件</u></a>
<a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布软件管理</u></a>
<a href='../catalog_main.php'><u>网站栏目管理</u></a>
";
$wintitle = "成功发布一个软件!";
$wecome_info = "文章管理::发布软件";
$win = new OxWindow();
$win->AddTitle("成功发布软件:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/action/soft_edit_action.php | PHP | asf20 | 6,119 |
<!--
function checkSubmitAlb()
{
if(document.form1.title.value==""){
alert("档案标题不能为空!");
return false;
}
if(document.form1.likeid.value!="" && HasNotVd(document.form1.likeid.value)){
alert("相关文档必须填写正确的ID,如ID1,ID2...");
return false;
}
if(document.form1.typeid.value==0){
alert("请选择档案的主类别!");
return false;
}
document.form1.imagebody.value = $Obj('copyhtml').innerHTML;
return true;
}
function CheckSelTable(nnum){
var cbox = $Obj('isokcheck'+nnum);
var seltb = $Obj('seltb'+nnum);
if(!cbox.checked) seltb.style.display = 'none';
else seltb.style.display = 'block';
}
var startNum = 1;
function MakeUpload(mnum)
{
var endNum = 0;
var upfield = document.getElementById("uploadfield");
var pnumObj = document.getElementById("picnum");
var fhtml = "";
var dsel = " checked='checked' ";
var dplay = "display:none";
if(mnum==0) endNum = startNum + Number(pnumObj.value);
else endNum = mnum;
if(endNum>120) endNum = 120;
for(startNum;startNum < endNum;startNum++)
{
if(startNum==1){
dsel = " checked='checked' ";
dplay = "block";
}else
{
dsel = " ";
dplay = "display:none";
}
fhtml = "";
fhtml += "<table width='600'><tr><td><input type='checkbox' name='isokcheck"+startNum+"' id='isokcheck"+startNum+"' value='1' class='np' "+dsel+" onClick='CheckSelTable("+startNum+")' />显示图片["+startNum+"]的选取框</td></tr></table>";
fhtml += "<table width=\"600\" border=\"0\" id=\"seltb"+startNum+"\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#E8F5D6\" style=\"margin-bottom:6px;margin-left:10px;"+dplay+"\"><tobdy>";
fhtml += "<tr bgcolor=\"#F4F9DD\">\r\n";
fhtml += "<td height=\"25\" colspan=\"2\"> <strong>图片"+startNum+":</strong></td>";
fhtml += "</tr>";
fhtml += "<tr bgcolor=\"#FFFFFF\"> ";
fhtml += "<td width=\"429\" height=\"25\"> 本地上传: ";
fhtml += "<input type=\"file\" name='imgfile"+startNum+"' style=\"width:330px\" onChange=\"SeePic(document.picview"+startNum+",document.form1.imgfile"+startNum+");\"></td>";
fhtml += "<td width=\"164\" rowspan=\"3\" align=\"center\"><img src=\"img/pview.gif\" width=\"150\" id=\"picview"+startNum+"\" name=\"picview"+startNum+"\"></td>";
fhtml += "</tr>";
fhtml += "<tr bgcolor=\"#FFFFFF\"> ";
fhtml += "<td height=\"25\"> 指定网址: ";
fhtml += "<input type=\"text\" name='imgurl"+startNum+"' style=\"width:260px\"> ";
fhtml += "<input type=\"button\" name='selpic"+startNum+"' value=\"选取\" style=\"width:65px\" class=\"inputbut\" onClick=\"SelectImageN('form1.imgurl"+startNum+"','big','picview"+startNum+"')\">";
fhtml += "</td></tr>";
fhtml += "<tr bgcolor=\"#FFFFFF\"> ";
fhtml += "<td height=\"56\"> 图片简介: ";
fhtml += "<textarea name='imgmsg"+startNum+"' style=\"height:46px;width:330px\"></textarea> </td>";
fhtml += "</tr></tobdy></table>\r\n";
upfield.innerHTML += fhtml;
}
}
function TestGet()
{
LoadTestDiv();
}
function LoadTestDiv()
{
var posLeft = 100; var posTop = 100;
var newobj = $Obj('_myhtml');
$Obj('imagebody').value = $Obj('copyhtml').innerHTML;
if($Obj('imagebody').value=='粘贴到这里...')
{
alert('你还没有粘贴任何东西都编辑框哦!');
return;
}
if(!newobj){
newobj = document.createElement("DIV");
newobj.id = '_myhtml';
newobj.style.position='absolute';
newobj.className = "dlg2";
newobj.style.top = posTop;
newobj.style.left = posLeft;
document.body.appendChild(newobj);
}
else{
newobj.style.display = "block";
}
var myajax = new DedeAjax(newobj,false,true,'-','-','...');
myajax.AddKey('myhtml',$Obj('imagebody').value);
myajax.SendPost2('album_testhtml.php');
DedeXHTTP = null;
}
function checkMuList(psid,cmid)
{
if($Obj(psid).checked) $Obj(cmid).style.display = 'block';
else $Obj(cmid).style.display = 'none';
}
--> | zyyhong | trunk/jiaju001/news/lic/album.js | JavaScript | asf20 | 4,130 |
<?php
$cfg_IsCanView=true;
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_userlogin.php");
if(empty($dopost)) $dopost="";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $cfg_softname." ".$cfg_version?></title>
<style type="text/css">
<!--
*{
padding:0px;
margin:0px;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
body {
margin: 0px;
background:#F7F7F7;
font-size:12px;
}
input{
vertical-align:middle;
}
img{
border:none;
vertical-align:middle;
}
a{
color:#333333;
}
a:hover{
color:#FF3300;
text-decoration:none;
}
.main{
width:640px;
margin:40px auto 0px;
border:4px solid #EEE;
background:#FFF;
padding-bottom:10px;
}
.main .title{
width:600px;
height:50px;
margin:0px auto;
background:url(images/login_toptitle.jpg) -10px 0px no-repeat;
text-indent:326px;
line-height:46px;
font-size:14px;
letter-spacing:2px;
color:#F60;
font-weight:bold;
}
.main .login{
width:560px;
margin:20px auto 0px;
overflow:hidden;
}
.main .login .inputbox{
width:260px;
float:left;
background:url(images/login_input_hr.gif) right center no-repeat;
}
.main .login .inputbox dl{
width:230px;
height:41px;
clear:both;
}
.main .login .inputbox dl dt{
float:left;
width:60px;
height:31px;
line-height:31px;
text-align:right;
font-weight:bold;
}
.main .login .inputbox dl dd{
width:160px;
float:right;
padding-top:1px;
}
.main .login .inputbox dl dd input{
font-size:12px;
font-weight:bold;
border:1px solid #888;
padding:4px;
background:url(images/login_input_bg.gif) left top no-repeat;
}
.main .login .butbox{
float:left;
width:200px;
margin-left:26px;
}
.main .login .butbox dl{
width:200px;
}
.main .login .butbox dl dt{
width:160px;
height:41px;
padding-top:5px;
}
.main .login .butbox dl dt input{
width:98px;
height:33px;
background:url(images/login_submit.gif) no-repeat;
border:none;
cursor:pointer;
}
.main .login .butbox dl dd{
height:21px;
line-height:21px;
}
.main .login .butbox dl dd a{
margin:5px;
}
.main .msg{
width:560px;
margin:10px auto;
clear:both;
line-height:17px;
padding:6px;
border:1px solid #FC9;
background:#FFFFCC;
color:#666;
}
.copyright{
width:640px;
text-align:right;
margin:10px auto;
font-size:10px;
color:#999999;
}
.copyright a{
font-weight:bold;
color:#F63;
text-decoration:none;
}
.copyright a:hover{
color:#000;
}
-->
</style>
<?php
if($dopost!="login"){
?>
<script type="text/javascript" language="javascript">
<!--
window.onload = function (){
userid = document.getElementById("userid");
userid.focus();
}
-->
</script>
<?php
}
?>
</head>
<body>
<?php
//检测安装目录安全性
if( is_dir(dirname(__FILE__).'/../install')
&& !file_exists(dirname(__FILE__).'/../install/install.lock') )
{
$fp = fopen(dirname(__FILE__).'/../install/install.lock', 'w') or die('安装目录无写入权限,无法进行写入锁定文件,请安装完毕删除安装目录!');
fwrite($fp,' ');
fclose($fp);
}
//检测后台目录是否更名
$cururl = GetCurUrl();
if(eregi('/dede/login',$cururl)) {
$redmsg = '<center><br /><br /><font color=\'red\'><b>你的管理目录使用默认名称dede,建议修改为其它名称会更安全!</b></font></center>';
}
else {
$redmsg = '';
}
echo $redmsg;
//--------------------------------
//登录检测
//--------------------------------
if($dopost=="login")
{
if(empty($validate)) $validate="";
else $validate = strtolower($validate);
$admindirs = explode('/',str_replace("\\","/",dirname(__FILE__)));
$admindir = $admindirs[count($admindirs)-1];
$svali = GetCkVdValue();
if(($validate=="" || $validate!=$svali) && $cfg_use_vdcode=='Y'){
ShowMsg("验证码不正确!","");
}else{
$cuserLogin = new userLogin($admindir);
if(!empty($userid)&&!empty($pwd))
{
$res = $cuserLogin->checkUser($userid,$pwd);
//成功登录
if($res==1){
$cuserLogin->keepUser($admindir);
if(!empty($gotopage)){
ShowMsg("成功登录,正在转向管理管理主页!",$gotopage);
exit();
}
else{
ShowMsg("成功登录,正在转向管理管理主页!","index.php");
exit();
}
}
else if($res==-1){
ShowMsg("你的用户名不存在!","");
}
else{
ShowMsg("你的密码错误!","");
}
}//<-密码不为空
else{
ShowMsg("用户和密码没填写完整!","");
}
}//<-验证用户
}
?>
<div class="main">
<div class="title">
管理登陆
</div>
<div class="login">
<form action="login.php" method="post">
<input type="hidden" name="gotopage" value="<?php if(!empty($gotopage)) echo $gotopage;?>">
<input type="hidden" name="dopost" value="login">
<div class="inputbox">
<dl>
<dt>用户名:</dt>
<dd><input type="text" name="userid" id="userid" size="20" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#888'" />
</dd>
</dl>
<dl>
<dt>密码:</dt>
<dd><input type="password" name="pwd" size="20" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#888'" />
</dd>
</dl>
<?php if($cfg_use_vdcode=='Y'){ ?>
<dl>
<dt>验证码:</dt>
<dd>
<input type="text" name="validate" size="4" onfocus="this.style.borderColor='#F90'" onblur="this.style.borderColor='#888'" />
<img src="../include/vdimgck.php" width="50" height="20" />
</dd>
</dl>
<?php } ?>
</div>
<div class="butbox">
<dl>
<dt><input name="submit" type="submit" value="" /></dt>
<dd><a href="http://www.dedecms.com">官方网站</a> | <a href="http://bbs.dedecms.com">技术论坛</a></dd>
</dl>
</div>
</form>
</div>
<?php if($cfg_use_vdcode!='Y'){ ?>
<div class="msg">
为了使程序有更大程度的兼容,后台默认关闭了验证码,为了你的登录更安全,请确认你的系统支持GD后,在后台参数中开启。
</div>
<?php } ?>
</div>
<div class="copyright">
Powered by <a href="http://www.dedecms.com">DEDECMS <?php echo $cfg_version?></a> Copyright ©2004-2008
</div>
</body>
</html>
<?php
if(is_object($dsql)) $dsql->Close();
?>
| zyyhong | trunk/jiaju001/news/lic/login.php | PHP | asf20 | 6,817 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Pm');
if(!isset($action)) $action = '';
if($action=="post"){
$msgfrom = '管理员';
$msgfromid = 0;
$msgtoid = 0;
$dateline = time();
$subject = cn_substr(trim(ClearHtml($subject)),70);
$message = cn_substr(trim(ClearHtml($message)),1000);
if(!isset($subject)||empty($subject)){
ShowMsg("短信标题不能为空!","-1");
exit();
}else if(!isset($message)||empty($message)){
ShowMsg("请填写短信内容!","-1");
exit();
}
$db = new DedeSql(false);
$rs = $db->ExecuteNoneQuery("INSERT INTO #@__pms(msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,message,isadmin) VALUES('$msgfrom','$msgfromid','$msgtoid','inbox',1,'{$subject}','$dateline','{$message}',1);");
if($rs)
{
$db->ExecuteNoneQuery("UPDATE #@__member SET newpm=newpm+1");
}
ShowMsg("短信已成功发送","-1");
$db->Close();
exit();
}
require_once(dirname(__FILE__)."/templets/member_pmall.htm");
?> | zyyhong | trunk/jiaju001/news/lic/member_pmall.php | PHP | asf20 | 1,003 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('co_NewRule');
if(empty($action)) $action = "";
$aid = ereg_replace("[^0-9]","",$aid);
if(empty($aid)){
ShowMsg("参数无效!","-1");
exit();
}
//----------------------------
//事件触发处理
//----------------------------
if($action=="save")
{
$notes = "
{dede:note
rulename=\\'$rulename\\'
etype=\\'$etype\\'
tablename=\\'$tablename\\'
autofield=\\'$autofield\\'
synfield=\\'$synfield\\'
channelid=\\'$channelid\\'
/}
";
for($i=1;$i<=50;$i++)
{
if( !isset(${"fieldname".$i}) ) break;
$fieldname = ${"fieldname".$i};
$comment = ${"comment".$i};
$intable = ${"intable".$i};
$source = ${"source".$i};
$makevalue = ${"makevalue".$i};
$notes .= "{dede:field name=\\'$fieldname\\' comment=\\'$comment\\' intable=\\'$intable\\' source=\\'$source\\'}$makevalue{/dede:field}\r\n";
}
$query = "
update #@__co_exrule set
channelid = '$channelid',
rulename='$rulename',
etype='$etype',
dtime='".time()."',
ruleset='$notes'
where aid='$aid'
";
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery($query);
$dsql->Close();
ShowMsg("成功更改一个规则!","co_export_rule.php");
exit();
}
else if($action=="delete")
{
if(empty($job)) $job="";
if($job=="") //确认提示
{
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
$wintitle = "删除数据规则模型";
$wecome_info = "<a href='co_export_rule.php'><u>数据规则模型</u></a>::删除规则";
$win = new OxWindow();
$win->Init("co_export_rule_edit.php","js/blank.js","POST");
$win->AddHidden("job","yes");
$win->AddHidden("action",$action);
$win->AddHidden("aid",$aid);
$win->AddTitle("你确实要删除[{$aid}]这个规则?");
$winform = $win->GetWindow("ok");
$win->Display();
}
else if($job=="yes") //操作
{
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__co_exrule where aid='$aid'");
$dsql->Close();
ShowMsg("成功删除一个规则!","co_export_rule.php");
exit();
}
exit();
}
else if($action=="export")
{
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select * From #@__co_exrule where aid='$aid'");
$dsql->Close();
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
$wintitle = "删除数据规则模型";
$wecome_info = "<a href='co_export_rule.php'><u>数据规则模型</u></a>::导出规则配置";
$win = new OxWindow();
$win->Init();
$win->AddTitle("以下为规则[{$aid}]的文本配置,你可以共享给你的朋友:");
$winform = $win->GetWindow("hand","<textarea name='cg' style='width:100%;height:300px'>".$row['ruleset']."</textarea><br/><br/>");
$win->Display();
exit();
}
////////////////////////////////
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select * From #@__co_exrule where aid='$aid'");
$dsql->Close();
$ruleset = $row['ruleset'];
$channelid = $row['channelid'];
$dtp = new DedeTagParse();
$dtp->LoadString($ruleset);
$noteid = 0;
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $ctag){
if($ctag->GetName()=='field') $noteid++;
}
}
else
{
ShowMsg("该规则不合法,无法进行更改!","-1");
$dsql->Close();
exit();
}
$noteinfos = $dtp->GetTagByName("note");
require_once(dirname(__FILE__)."/templets/co_export_rule_edit.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/co_export_rule_edit.php | PHP | asf20 | 3,537 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_collection.php");
if($nid=="")
{
ShowMsg("参数无效!","-1");
exit();
}
$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
require_once(dirname(__FILE__)."/templets/co_test_rule.htm");
$co->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_test_rule.php | PHP | asf20 | 354 |
<?php
//------------------------------------
//计划任务操作部份
//返回值标准
// 正常操作:返回下一个网址
// 执行某操作结束:返回 end
// 页面数据库类错误: 返回 error
// 用户验证不通过: 返回 task_config.php 里的相关值
// 其它错误:如服务器停止错误导致404或程序出错导致500错误等客户端会自动识别,并隔一段时间后重新尝试。
//------------------------------------
require_once(dirname(__FILE__)."/task_config.php");
if(empty($action)) $action = '';
$dsql = new DedeSql(false);
/*---------------
优化数据库
function _opdb(){ }
-----------------*/
if($action=='opdb')
{
$dsql->Close();
exit();
}
/*---------------
获取关键字
function _getkw(){ }
-----------------*/
else if($action == 'getkw')
{
$dsql->Close();
exit();
}
/*---------------
更新当天文档
function _mkday(){ }
-----------------*/
else if($action=='')
{
$dsql->Close();
exit();
}
/*---------------
更新所有HTML
function _mkall(){ }
-----------------*/
else if($action=='')
{
$dsql->Close();
exit();
}
/*---------------
更新相关ID
function _uplikeid(){ }
-----------------*/
else if($action=='uplikeid')
{
$dsql->Close();
exit();
}
/*---------------
自动采集
function _autoCt(){ }
-----------------*/
else if($action=='autoct')
{
$dsql->Close();
exit();
}
?> | zyyhong | trunk/jiaju001/news/lic/task_action.php | PHP | asf20 | 1,433 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/templets/sys_data_replace.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/sys_data_replace.php | PHP | asf20 | 146 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
function MediaType($tid,$nurl)
{
if($tid==1) return "图片";
else if($tid==2) return "FLASH";
else if($tid==3) return "视频/音频";
else return "附件/其它";
}
function GetFileSize($fs){
$fs = $fs/1024;
return sprintf("%10.1f",$fs)." K";
}
function UploadAdmin($adminid,$memberid)
{
if($adminid!='') return $adminid;
else return $memberid;
}
if(empty($keyword)) $keyword = "";
$addsql = " where (u.title like '%$keyword%' Or u.url like '%$keyword%') ";
if(empty($membertype)) $membertype = 0;
if($membertype==1) $addsql .= " And u.adminID>0 ";
else if($membertype==2) $addsql .= " And u.memberID>0 ";
if(empty($mediatype)) $mediatype = 0;
if($mediatype>1) $addsql .= " And u.mediatype='$membertype' ";
if(!empty($memberid)) $addsql .= " And u.memberID='$memberid' ";
else $memberid = 0;
if(!empty($memberid)) $addsql .= " And u.memberid='$memberid' ";
$sql = "Select u.aid,u.title,u.url,u.mediatype,u.filesize,u.memberID,u.uptime
,a.userid as adminname,m.userid as membername
From #@__uploads u
Left join #@__admin a on a.ID = u.adminID
Left join #@__member m on m.ID = u.memberID
$addsql order by u.aid desc";
$dlist = new DataList();
$dlist->pageSize = 10;
$dlist->SetParameter("mediatype",$mediatype);
$dlist->SetParameter("keyword",$keyword);
$dlist->SetParameter("membertype",$membertype);
$dlist->SetParameter("memberid",$memberid);
$dlist->SetSource($sql);
include(dirname(__FILE__)."/templets/media_main.htm");
$dlist->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/media_main.php | PHP | asf20 | 1,784 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('member_Edit');
if(!isset($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL = "";
else $ENV_GOBACK_URL="member_main.php";
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
$row=$dsql->GetOne("select * from #@__member where ID='$ID'");
$rowper=$dsql->GetOne("select * from #@__member_perinfo where ID='$ID'");
require_once(dirname(__FILE__)."/templets/member_view.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/member_view.php | PHP | asf20 | 475 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_datalist.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
if(!isset($ischeck)) $ischeck = -1;
if(!isset($keyword)) $keyword = "";
if($ischeck==0) $seloption = "<option value='0' selected>未审核</option>\r\n<option value='-1'>全部</option>\r\n";
else if($ischeck==1) $seloption = "<option value='1' selected>内页</option>\r\n<option value='-1'>全部</option>\r\n";
else if($ischeck==2) $seloption = "<option value='2' selected>首页</option>\r\n<option value='-1'>全部</option>\r\n";
else if($ischeck==3) $seloption = "<option value='3' selected>已审核</option>\r\n<option value='-1'>全部</option>\r\n";
else $seloption = "<option value='-1' selected>全部</option>\r\n";
function GetPic($pic)
{
if($pic=="") return "无图标";
else return "<img src='$pic' width='88' height='31' border='0'>";
}
function GetSta($sta)
{
if($sta==1) return "内页";
if($sta==2) return "首页";
else return "未审核";
}
$addquery = " where 1=1 ";
if($ischeck!=-1){
if($ischeck==3) $addquery .= " And ischeck>0 ";
else $addquery .= " And ischeck='$ischeck' ";
}
if(!empty($keyword)){
$addquery .= " And (url like '%$keyword%' OR webname like '%$keyword%') ";
}
$sql = "";
$sql = "Select * From #@__flink $addquery order by dtime desc";
$dlist = new DataList();
$dlist->Init();
$dlist->SetParameter("ischeck",$ischeck);
$dlist->SetParameter("keyword",$keyword);
$dlist->SetSource($sql);
$dlist->SetTemplet(dirname(__FILE__)."/templets/friendlink_main.htm");
$dlist->display();
$dlist->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/friendlink_main.php | PHP | asf20 | 1,763 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
$dsql = new DedeSql(false);
$aid = ereg_replace("[^0-9]","",$aid);
$row = $dsql->GetOne("Select * From #@__freelist where aid='$aid' ");
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede","{","}");
$dtp->LoadSource("--".$row['listtag']."--");
$ctag = $dtp->GetTag('list');
require_once(dirname(__FILE__)."/templets/freelist_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/freelist_edit.php | PHP | asf20 | 554 |
<?php
require_once(dirname(__FILE__)."/config.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
$dsql = new DedeSql(false);
if(empty($pagesize)) $pagesize = 18;
if(empty($pageno)) $pageno = 1;
if(empty($dopost)) $dopost = '';
if(empty($orderby)) $orderby = 'aid';
if(empty($keyword)){
$keyword = '';
$addget = '';
$addsql = '';
}else{
$addget = '&keyword='.urlencode($keyword);
$addsql = " where CONCAT(keyword,spwords) like '%$keyword%' ";
}
//重载列表
if($dopost=='getlist'){
AjaxHead();
GetKeywordList($dsql,$pageno,$pagesize,$orderby);
$dsql->Close();
exit();
}
//更新字段
else if($dopost=='update')
{
$aid = ereg_replace("[^0-9]","",$aid);
$count = ereg_replace("[^0-9]","",$count);
$istag = ereg_replace("[^0-9]","",$istag);
$keyword = trim($keyword);
$spwords = trim($spwords);
$dsql->ExecuteNoneQuery("Update #@__search_keywords set keyword='$keyword',spwords='$spwords',count='$count',istag='$istag' where aid='$aid';");
AjaxHead();
GetKeywordList($dsql,$pageno,$pagesize,$orderby);
$dsql->Close();
exit();
}
//删除字段
else if($dopost=='del')
{
$aid = ereg_replace("[^0-9]","",$aid);
$dsql->ExecuteNoneQuery("Delete From #@__search_keywords where aid='$aid';");
AjaxHead();
GetKeywordList($dsql,$pageno,$pagesize,$orderby);
$dsql->Close();
exit();
}
//第一次进入这个页面
if($dopost==''){
$row = $dsql->GetOne("Select count(*) as dd From #@__search_keywords $addsql ");
$totalRow = $row['dd'];
include(dirname(__FILE__)."/templets/search_keywords_main.htm");
$dsql->Close();
}
//获得特定的关键字列表
//---------------------------------
function GetKeywordList($dsql,$pageno,$pagesize,$orderby='aid'){
global $cfg_phpurl,$addsql;
$start = ($pageno-1) * $pagesize;
$printhead ="<table width='99%' border='0' cellpadding='1' cellspacing='1' bgcolor='#333333' style='margin-bottom:3px'>
<tr align='center' bgcolor='#E5F9FF' height='24'>
<td width='6%' height='23'><a href='#' onclick=\"ReloadPage('aid')\"><u>ID</u></a></td>
<td width='20%'>关键字</td>
<td width='25%'>分词结果</td>
<td width='6%'><a href='#' onclick=\"ReloadPage('count')\"><u>频率</u></a></td>
<td width='6%'><a href='#' onclick=\"ReloadPage('result')\"><u>结果</u></a></td>
<td width='10%'><a href='#' onclick=\"ReloadPage('istag')\"><u>是否Tag</u></a></td>
<td width='16%'><a href='#' onclick=\"ReloadPage('lasttime')\"><u>最后搜索时间</u></a></td>
<td>管理</td>
</tr>\r\n";
echo $printhead;
$dsql->SetQuery("Select * From #@__search_keywords $addsql order by $orderby desc limit $start,$pagesize ");
$dsql->Execute();
while($row = $dsql->GetArray()){
if($row['istag']){
$atag = "<input type='radio' class='np' name='istag{$row['aid']}' id='istag{$row['aid']}1' value='1' checked>是 <input type='radio' class='np' name='istag{$row['aid']}' id='istag{$row['aid']}0' value='2'>否";
}else{
$atag = "<input type='radio' class='np' name='istag{$row['aid']}' id='istag{$row['aid']}1' value='1'>是 <input type='radio' class='np' name='istag{$row['aid']}' id='istag{$row['aid']}0' value='2' checked>否";
}
$line = "
<tr align='center' bgcolor='#FFFFFF' onMouseMove=\"javascript:this.bgColor='#FCFEDA';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
<td height='24'>{$row['aid']}</td>
<td><input name='keyword' type='text' id='keyword{$row['aid']}' value='{$row['keyword']}' class='ininput'></td>
<td><input name='spwords' type='text' id='spwords{$row['aid']}' value='{$row['spwords']}' class='ininput'></td>
<td><input name='count' type='text' id='count{$row['aid']}' value='{$row['count']}' class='ininput'></td>
<td><a href='{$cfg_phpurl}/search.php?kwtype=0&keyword=".urlencode($row['keyword'])."&searchtype=titlekeyword' target='_blank'><u>{$row['result']}</u></a></td>
<td> $atag </td>
<td>".strftime("%y-%m-%d %H:%M:%S",$row['lasttime'])."</td>
<td>
<a href='#' onclick='UpdateNote({$row['aid']})'>更新</a> |
<a href='#' onclick='DelNote({$row['aid']})'>删除</a>
</td>
</tr>";
echo $line;
}
echo "</table>\r\n";
}
?>
| zyyhong | trunk/jiaju001/news/lic/search_tags_main.php | PHP | asf20 | 4,305 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Data');
if(empty($action)) $action = '';
/*-------------------------------
//列出数据库里的表
function __gettables()
--------------------------------*/
if($action=='gettables'){
AjaxHead();
$qbutton = "<input type='button' name='seldbtable' value='选择数据表' class='inputbut' onclick='SelectedTable()'>\r\n";
if($dbptype==2 && $dbname==""){
echo "<font color='red'>你没指定数据库名称!</font><br>";
echo $qbutton;
exit();
}
if($dbptype==3
&& (empty($dbhost) || empty($dbname) || empty($dbuser)))
{
echo "<font color='red'>你选择了“指定新的登录信息”,必须填写完所有数据库登录选项!</font><br>";
echo $qbutton;
exit();
}
if($dbptype==1){
$dsql = new DedeSql(false);
}
else if($dbptype==2){
$dsql = new DedeSql(false,false);
$dsql->SetSource($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$dbname,'');
$dsql->Open(false);
}
else if($dbptype==3){
$dsql = new DedeSql(false,false);
$dsql->SetSource($dbhost,$dbuser,$dbpwd,$dbname,'');
$dsql->Open(false);
}
if(!$dsql->linkID){
echo "<font color='red'>连接数据库失败!</font><br>";
echo $qbutton;
exit();
}
$dsql->SetQuery("Show Tables");
$dsql->Execute('t');
if($dsql->GetError()!=""){
echo "<font color='red'>找不到你所指定的数据库! $dbname</font><br>";
echo $qbutton;
}
echo "<select name='exptable' id='exptable' size='10' style='width:60%' onchange='ShowFields()'>\r\n";
while($row = $dsql->GetArray('t')){
echo "<option value='{$row[0]}'>{$row[0]}</option>\r\n";
}
echo "</select>\r\n";
$dsql->Close();
exit();
}
/*-------------------------------
//列出数据库表里的字段
function __getfields()
--------------------------------*/
if($action=='getfields'){
AjaxHead();
if($dbptype==1){
$dsql = new DedeSql(false);
}
else if($dbptype==2){
$dsql = new DedeSql(false,false);
$dsql->SetSource($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$dbname,'');
$dsql->Open(false);
}
else if($dbptype==3){
$dsql = new DedeSql(false,false);
$dsql->SetSource($dbhost,$dbuser,$dbpwd,$dbname,'');
$dsql->Open(false);
}
if(!$dsql->linkID){
echo "<font color='red'>连接数据源的数据库失败!</font><br>";
echo $qbutton;
exit();
}
$dsql->GetTableFields($exptable);
echo "<div style='border:1px solid #ababab;background-color:#FEFFF0;margin-top:6px;padding:3px;line-height:160%'>";
echo "表(".$exptable.")含有的字段:<br>";
while($row = $dsql->GetFieldObject()){
echo $row->name." ";
}
echo "</div>";
$dsql->Close();
exit();
}
/*-------------------------------
//保存用户设置,清空会员数据
function __saveSetting()
--------------------------------*/
else if($action=='savesetting'){
if(empty($validate)) $validate=="";
else $validate = strtolower($validate);
$svali = GetCkVdValue();
if($validate=="" || $validate!=$svali){
ShowMsg("安全确认码不正确!","javascript:;");
exit();
}
if(empty($userfield) || empty($pwdfield)){
ShowMsg("用户名和密码字段必须指定!","javascript:;");
exit();
}
$configfile = dirname(__FILE__)."/../include/config_hand.php";
$configfile_bak = dirname(__FILE__)."/../include/config_hand_bak.php";
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Update #@__sysconfig set value='$oldtype' where varname='cfg_pwdtype' ");
$dsql->ExecuteNoneQuery("Update #@__sysconfig set value='$oldmd5len' where varname='cfg_md5len' ");
$dsql->ExecuteNoneQuery("Update #@__sysconfig set value='$oldsign' where varname='cfg_ddsign' ");
$dsql->SetQuery("Select varname,value From #@__sysconfig order by aid asc");
$dsql->Execute();
copy($configfile,$configfile_bak) or die("保存配置{$configfile}时失败!请检测权限");
$fp = fopen($configfile,'w') or die("保存配置{$configfile}时失败!请检测权限");
flock($fp,3);
fwrite($fp,"<"."?php\r\n");
while($row = $dsql->GetArray()){
fwrite($fp,"\${$row['varname']} = '".str_replace("'","\\'",$row['value'])."';\r\n");
}
fwrite($fp,"?".">");
fclose($fp);
$dsql->ExecuteNoneQuery("Delete From #@__member ");
$dsql->ExecuteNoneQuery("Delete From #@__member_arctype ");
$dsql->ExecuteNoneQuery("Delete From #@__member_flink ");
$dsql->ExecuteNoneQuery("Delete From #@__member_guestbook ");
$dsql->ExecuteNoneQuery("Delete From #@__memberstow ");
$dsql->Close();
$nurl = GetCurUrl();
$nurl = str_replace("savesetting","converdata",$nurl);
ShowMsg("完成数据保存,并清空本系统的会员数据,现在开始导入数据!",$nurl);
exit();
}
/*-------------------------------
//保存用户设置,转换会员数据
function __ConverData()
--------------------------------*/
else if($action=='converdata'){
set_time_limit(0);
if(empty($tgmd5len)) $tgmd5len = 32;
if($tgmd5len < $cfg_md5len && $tgtype=='md5'){
ShowMsg("无法从短的MD5密码转换为更长的密码!","javascript:;");
exit();
}
$oldchar = $cfg_db_language;
$cfg_db_language = $dbchar;
if($dbptype==1){
$dsql = new DedeSql(false);
}
else if($dbptype==2){
$dsql = new DedeSql(false,false);
$dsql->SetSource($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$dbname,'');
$dsql->Open(false);
}
else if($dbptype==3){
$dsql = new DedeSql(false,false);
$dsql->SetSource($dbhost,$dbuser,$dbpwd,$dbname,'');
$dsql->Open(false);
}
if(!$dsql->linkID){
ShowMsg("连接数据源的数据库失败!","javascript:;");
exit();
}
$fieldsql = '';
$fieldsql = "$userfield,$pwdfield";
if($emailfield!='') $fieldsql .= ",$emailfield";
if($unamefield!='') $fieldsql .= ",$unamefield";
if($sexfield!='') $fieldsql .= ",$sexfield";
$dsql->SetQuery("Select $fieldsql From $exptable ");
$dsql->Execute();
$cfg_db_language = $oldchar;
$dsql2 = new DedeSql(false);
$c = 0;
while($row = $dsql->GetArray()){
$userid = addslashes($row[$userfield]);
if($tgtype=='none') $pwd = GetEncodePwd($row[$pwdfield]);
else if($tgtype=='md5'){
if($cfg_md5len < $tgmd5len) $pwd = substr($row[$pwdfield],0,$cfg_md5len);
else $pwd = $row[$pwdfield];
}else if($tgtype=='md5m16'){
$pwd = $row[$pwdfield];
}
$pwd = addslashes($pwd);
if(empty($unamefield)) $uname = $userid;
else $uname = addslashes($row[$unamefield]);
if(empty($emailfield)) $email = '';
else $email = addslashes($row[$emailfield]);
if(empty($sexfield)) $sex = '';
else{
$sex = $row[$sexfield];
if($sex==$sexman) $sex = '男';
else if($sex==$sexwoman) $sex = '女';
else $sex = '';
}
$ntime = time();
$inQuery = "
INSERT INTO #@__member(userid,pwd,uname,sex,birthday,membertype,money,
weight,height,job,province,city,myinfo,tel,oicq,email,homepage,
jointime,joinip,logintime,loginip,showaddr,address)
VALUES ('$userid','$pwd','$uname','$sex','0000-00-00','10','0',
'0','0','','0','0','','','','$email','','$ntime','$loginip','$ntime','','0','');";
$rs = $dsql2->ExecuteNoneQuery($inQuery);
if($rs) $c++;
}
$dsql->Close();
$dsql2->Close();
ShowMsg("成功导入 ".$c." 条数据!","javascript:;");
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/member_data_action.php | PHP | asf20 | 7,371 |
<?php
require_once(dirname(__FILE__)."/config.php");
$db = new DedeSql(false);
if(empty($action)){
$smalltypes = array();
$sql = "select typename, ID, smalltypes from #@__arctype where smalltypes<>''";
$db->SetQuery($sql);
$db->Execute();
$typesinfo = $types =array();
while($row = $db->GetArray())
{
$row['smalltypes'] = explode(',',$row['smalltypes']);
foreach($row['smalltypes'] as $smalltypeid)
{
$typesinfo[$smalltypeid][] = $row['typename'];
$types[$smalltypeid][] = $row['ID'];
}
}
$sql = "select * from #@__smalltypes order by disorder asc, id asc";
$db->SetQuery($sql);
$db->Execute();
while($smalltype = $db->GetArray())
{
$smalltype['types'] = $smalltype['relatetype'] = '';
if(!empty($typesinfo[$smalltype['id']]) && is_array($typesinfo[$smalltype['id']]))
{
$smalltype['relatetype'] = implode(', ', $typesinfo[$smalltype['id']]);
$smalltype['types'] = urlencode(implode(', ', $types[$smalltype['id']]));
}
$smalltypes[] = $smalltype;
}
include(dirname(__FILE__)."/templets/smalltype.htm");
/*
function add()
*/
}elseif($action == 'add')
{
$name = trim($name);
if($name == '' ) {
ShowMsg('小分类名称不能为空,将返回小分类管理页面','smalltype.php');
exit();
}
$disorder = intval($disorder);
$disorder = max(0, $disorder);
$description = trim($description);
$sql = "insert into #@__smalltypes (name, disorder, description) values ('$name', $disorder, '$description');";
$db->SetQuery($sql);
if($db->ExecuteNoneQuery())
{
ShowMsg('添加小分类成功,将返回小分类管理页面','smalltype.php');
exit();
}else
{
ShowMsg('更新小分类失败,将返回小分类管理页面','smalltype.php');
exit();
}
/*
function update()
*/
}elseif($action == 'update')
{
$errinfo = '';
foreach($disorders as $key => $disorder)
{
$names[$key] = trim($names[$key]);
if($names[$key] == '' ){
$errinfo .= "id为 $key 的小分类名称为空,未更新该条记录<br>";
continue;
}
$sql = "update #@__smalltypes set disorder=$disorder, name='$names[$key]', description='$descriptions[$key]' where id=$key";
$db->SetQuery($sql);
if(!$db->ExecuteNoneQuery())
{
$errinfo .= $sql."\n";
}
}
if(trim($errinfo) != '' )
{
ShowMsg($errinfo,'smalltype.php');
exit();
}else
{
ShowMsg('更新小分类成功,将返回小分类管理页面','smalltype.php');
exit;
}
/*
function delete()
*/
}elseif($action == 'delete')
{
$id = intval($id);
if($id < 1) {
ShowMsg('小分类编号不正确,将返回小分类管理页面','sectors.php');
exit();
}else {
$sql = "delete from #@__smalltypes where id=$id";
$db->SetQuery($sql);
if($db->ExecuteNoneQuery())
{
if($types != '')
{
$sql = "select ID, smalltypes from #@__arctype where ID in ($types)";
$db->SetQuery($sql);
$db->Execute();
while($row = $db->GetArray()){
$row['smalltypes'] = explode(',',$row['smalltypes']);
foreach($row['smalltypes'] as $key => $value)
{
if($value == $id){
unset($row['smalltypes'][$key]);
}
}
$smalltypes = implode(',',$row['smalltypes']);
$sql = "update #@__arctype set smalltypes='$smalltypes' where ID=$row[ID];";
$db->SetQuery($sql);
$db->ExecuteNoneQuery();
}
}
ShowMsg('删除小分类成功,将返回小分类管理页面', 'smalltype.php');
exit();
}else
{
ShowMsg('删除小分类失败,将返回小分类管理页面 ','smalltype.php');
exit();
}
}
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/smalltype.php | PHP | asf20 | 3,676 |
/*Powered by http://www.dedecms.com
Design & Css By Pig.Z (QQ:7859301)*/
*{
padding:0px;
margin:0px;
}
body{
color:#333333;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
height:76px;
overflow:hidden;
background:url(images/top_bg_hr.jpg) left top repeat-x;
}
/*---- link --------------*/
a{
color:#000;
}
a:hover{
color:#F00;
text-decoration:none;
}
/*---- Top Nav --------------*/
.topnav{
width:100%;
height:76px;
background:url(images/admin_tlogo.jpg) left top no-repeat;
text-align:right;
overflow:hidden;
float:right;
}
.sitenav{
float:right;
line-height:31px;
margin-top:5px;
clear:both;
margin-right:10px;
}
.sitenav .welcome{
float:left;
color:#FF9;
margin-right:10px;
}
.sitenav .welcome a{
display:block;
margin-top:8px;
float:left;
margin-right:4px;
}
.sitenav .welcome .username{
color:#FFF;
font-weight:bold;
}
.sitenav .sitelink{
float:left;
background:url(images/top_sitelink_bg.gif) left center no-repeat;
padding-left:10px;
color:#70A533;
}
.sitenav .sitelink a{
color:#CEE004;
margin:5px;
}
.sitenav .sitelink a:hover{
color:#FFF;
text-decoration:none;
}
.leftnav{
display:block;
clear:both;
float:right;
margin-top:6px;
height:34px;
width:100%;
}
.leftnav ul{
height:34px;
list-style:none;
display:block;
float:right;
background:url(images/top_nav_bg.jpg) left top repeat-x;
margin-right:4px;
}
.leftnav ul li.navleft{
width:26px;
height:34px;
background:url(images/top_nav_left.jpg) right top no-repeat;
}
.leftnav ul li.navright{
width:26px;
height:34px;
background:url(images/top_nav_right.jpg) right top no-repeat;
}
.leftnav ul li{
float:left;
}
.leftnav ul li a{
display:block;
line-height:34px;
color:#FFF;
width:74px;
text-align:center;
background:url(images/top_nav_sr.gif) center center no-repeat;
}
.leftnav ul li a:hover,.leftnav ul li.thisclass a{
color:#FF6600;
background:url(images/top_nav_on.gif) bottom center no-repeat;
padding-top:12px;
line-height:22px;
font-weight:bold;
text-decoration:none;
} | zyyhong | trunk/jiaju001/news/lic/css_top.css | CSS | asf20 | 2,144 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
function GetSta($sta)
{
if($sta==1) return "";
else return " checked";
}
if(empty($keyword)){ $keyword = ""; $addquery = ""; }
else $addquery = " where keyword like '%$keyword%'";
$sql = "Select * from #@__keywords $addquery order by rank desc";
$dlist = new DataList();
$dlist->Init();
$dlist->pageSize = 30;
$dlist->SetParameter("keyword",$keyword);
$dlist->SetSource($sql);
include(dirname(__FILE__)."/templets/article_keywords_main.htm");
$dlist->Close();
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/article_keywords_main.php | PHP | asf20 | 688 |
<?php
require_once(dirname(__FILE__)."/config.php");
if(empty($dopost)) $dopost = "";
if($dopost=="upload") //上传
{
require_once(dirname(__FILE__)."/../include/inc_photograph.php");
$sparr_image = Array("image/pjpeg","image/jpeg","image/gif","image/png","image/x-png","image/wbmp");
$sparr_flash = Array("application/x-shockwave-flash");
$okdd = 0;
$uptime = time();
$adminid = $cuserLogin->getUserID();
$dsql = new DedeSql(false);
for($i=0;$i<=40;$i++)
{
if(isset(${"upfile".$i}) && is_uploaded_file(${"upfile".$i}))
{
$filesize = ${"upfile".$i."_size"};
$upfile_type = ${"upfile".$i."_type"};
$upfile_name = ${"upfile".$i."_name"};
$dpath = strftime("%y%m%d",$uptime);
if(in_array($upfile_type,$sparr_image)){
$mediatype=1;
$savePath = $cfg_image_dir."/".$dpath;
}
else if(in_array($upfile_type,$sparr_false)){
$mediatype=2;
$savePath = $cfg_other_medias."/".$dpath;
}
else if(eregi('audio|media|video',$upfile_type)
&& eregi("\.".$cfg_softtype."$",$upfile_name)){
$mediatype=3;
$savePath = $cfg_other_medias."/".$dpath;
}
else if(eregi("\.".$cfg_softtype."$",$upfile_name)){
$mediatype=4;
$savePath = $cfg_soft_dir."/".$dpath;
}
else continue;
$filename = "{$adminid}_".strftime("%H%M%S",$uptime).mt_rand(100,999).$i;
$fs = explode(".",${"upfile".$i."_name"});
$filename = $filename.".".$fs[count($fs)-1];
$filename = $savePath."/".$filename;
if(!is_dir($cfg_basedir.$savePath)){
MkdirAll($cfg_basedir.$savePath,$GLOBALS['cfg_dir_purview']);
CloseFtp();
}
$fullfilename = $cfg_basedir.$filename;
if($mediatype==1){
@move_uploaded_file(${"upfile".$i},$fullfilename);
$info = "";
$data = getImagesize($fullfilename,$info);
$width = $data[0];
$height = $data[1];
if(in_array($upfile_type,$cfg_photo_typenames)) WaterImg($fullfilename,'up');
}else{
@move_uploaded_file(${"upfile".$i},$fullfilename);
}
if($i>1){ $ntitle = $title."_".$i; }
else $ntitle = $title;
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('$ntitle','$filename','$mediatype','$width','$height','$playtime','$filesize','$uptime','$adminid','0');
";
$okdd++;
$dsql->SetQuery($inquery);
$dsql->ExecuteNoneQuery();
}
}
$dsql->Close();
ShowMsg("成功上传 {$okdd} 个文件!","media_main.php");
exit();
}
require_once(dirname(__FILE__)."/templets/media_add.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/media_add.php | PHP | asf20 | 2,586 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_module');
require_once(dirname(__FILE__)."/../include/inc_modules.php");
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
if(empty($action)) $action = '';
$mdir = dirname(__FILE__).'/module';
if($action=='')
{
$dm = new DedeModule($mdir);
$modules = $dm->GetModuleList();
require_once(dirname(__FILE__)."/templets/module_main.htm");
$dm->Clear();
exit();
}
/*--------------
function Setup();
--------------*/
else if($action=='setup')
{
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
$filelists = $dm->GetFileLists($hash);
$filelist = '';
foreach($filelists as $v)
{
if(empty($v['name'])) continue;
if($v['type']=='dir') $v['type'] = '目录';
else $v['type'] = '文件';
$filelist .= "{$v['type']}|{$v['name']}\r\n";
}
$win = new OxWindow();
$win->Init("module_main.php","js/blank.js","post");
$win->mainTitle = "模块管理";
$win->AddTitle("<a href='module_main.php'>模块管理</a> >> 安装模块: {$infos['name']}");
$win->AddHidden("hash",$hash);
$win->AddHidden("action",'setupstart');
$msg = "
<style>.dtb{border-bottom:1px dotted #cccccc}</style>
<table width='750' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='200' height='26' class='dtb'>模块名称:</td>
<td width='550' class='dtb'>{$infos['name']}</td>
</tr>
<tr>
<td width='200' height='26' class='dtb'>文件大小:</td>
<td width='550' class='dtb'>{$infos['filesize']}</td>
</tr>
<tr>
<td height='26' class='dtb'>团队名称:</td>
<td class='dtb'>{$infos['team']}</td>
</tr>
<tr>
<td height='26' class='dtb'>发布时间:</td>
<td class='dtb'>{$infos['time']}</td>
</tr>
<tr>
<td height='26' class='dtb'>电子邮箱:</td>
<td class='dtb'>{$infos['email']}</td>
</tr>
<tr>
<td height='26' class='dtb'>官方网址:</td>
<td class='dtb'>{$infos['url']}</td>
</tr>
<tr>
<td height='26' class='dtb'>使用协议:</td>
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank'>点击浏览...</a></td>
</tr>
<tr>
<td height='26'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td> </td>
</tr>
<tr>
<td height='164' colspan='2'>
<textarea name='filelists' id='filelists' style='width:90%;height:200px'>{$filelist}</textarea>
</td>
</tr>
<tr>
<td height='26'>对于已存在文件处理方法:</td>
<td>
<input name='isreplace' type='radio' value='3' checked='checked' />
覆盖,保留旧文件副本
<input type='radio' name='isreplace' value='0' />
保留
<input name='isreplace' type='radio' value='1' />
覆盖
</td>
</tr>
</table>
";
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>");
$winform = $win->GetWindow("okonly","");
$win->Display();
$dm->Clear();
exit();
}
/*---------------
function SetupRun()
--------------*/
else if($action=='setupstart')
{
if(!is_writeable($mdir))
{
ShowMsg("目录 {$mdir} 不支持写入,这将导致安装程序没法正常创建!","-1");
exit();
}
$dm = new DedeModule($mdir);
$dm->WriteFiles($hash,$isreplace);
$filename = $dm->WriteSystemFile($hash,'setup');
$dm->WriteSystemFile($hash,'uninstall');
$dm->WriteSystemFile($hash,'readme');
$dm->Clear();
ShowMsg("成功解压相关文件,现转模块详细安装程序>>","module/".$filename);
exit();
}
/*--------------
function DelModule();
--------------*/
else if($action=='del')
{
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
$win = new OxWindow();
$win->Init("module_main.php","js/blank.js","post");
$win->mainTitle = "模块管理";
$win->AddTitle("<a href='module_main.php'>模块管理</a> >> 删除模块: {$infos['name']}");
$win->AddHidden("hash",$hash);
$win->AddHidden("action",'delok');
$msg = "
<style>.dtb{border-bottom:1px dotted #cccccc}</style>
<table width='750' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='200' height='26' class='dtb'>模块名称:</td>
<td width='550' class='dtb'>{$infos['name']}</td>
</tr>
<tr>
<td width='200' height='26' class='dtb'>文件大小:</td>
<td width='550' class='dtb'>{$infos['filesize']}</td>
</tr>
<tr>
<td height='26' class='dtb'>团队名称:</td>
<td class='dtb'>{$infos['team']}</td>
</tr>
<tr>
<td height='26' class='dtb'>发布时间:</td>
<td class='dtb'>{$infos['time']}</td>
</tr>
<tr>
<td height='26' class='dtb'>电子邮箱:</td>
<td class='dtb'>{$infos['email']}</td>
</tr>
<tr>
<td height='26' class='dtb'>官方网址:</td>
<td class='dtb'>{$infos['url']}</td>
</tr>
<tr>
<td height='26' class='dtb'>使用协议:</td>
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank'>点击浏览...</a></td>
</tr>
<tr>
<td height='26' colspan='2'>
删除模块仅删除这个模块的安装包文件,如果你已经安装,请执行<a href='module_main.php?hash={$hash}&action=uninstall'><u>卸载程序</u></a>来删除!
</td>
</tr>
</table>
";
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>");
$winform = $win->GetWindow("okonly","");
$win->Display();
$dm->Clear();
exit();
}
else if($action=='delok')
{
$dm = new DedeModule($mdir);
$modfile = $mdir."/".$dm->GetHashFile($hash);
unlink($modfile) or die("删除文件 {$modfile} 失败!");
ShowMsg("成功删除一个模块文件!","module_main.php");
exit();
}
/*--------------
function UnInstall();
--------------*/
else if($action=='uninstall')
{
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
$filelists = $dm->GetFileLists($hash);
$filelist = '';
foreach($filelists as $v)
{
if(empty($v['name'])) continue;
if($v['type']=='dir') $v['type'] = '目录';
else $v['type'] = '文件';
$filelist .= "{$v['type']}|{$v['name']}\r\n";
}
$win = new OxWindow();
$win->Init("module_main.php","js/blank.js","post");
$win->mainTitle = "模块管理";
$win->AddTitle("<a href='module_main.php'>模块管理</a> >> 卸载模块: {$infos['name']}");
$win->AddHidden("hash",$hash);
$win->AddHidden("action",'uninstallok');
$msg = "
<style>.dtb{border-bottom:1px dotted #cccccc}</style>
<table width='750' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='200' height='26' class='dtb'>模块名称:</td>
<td width='550' class='dtb'>{$infos['name']}</td>
</tr>
<tr>
<td width='200' height='26' class='dtb'>文件大小:</td>
<td width='550' class='dtb'>{$infos['filesize']}</td>
</tr>
<tr>
<td height='26' class='dtb'>团队名称:</td>
<td class='dtb'>{$infos['team']}</td>
</tr>
<tr>
<td height='26' class='dtb'>发布时间:</td>
<td class='dtb'>{$infos['time']}</td>
</tr>
<tr>
<td height='26' class='dtb'>电子邮箱:</td>
<td class='dtb'>{$infos['email']}</td>
</tr>
<tr>
<td height='26' class='dtb'>官方网址:</td>
<td class='dtb'>{$infos['url']}</td>
</tr>
<tr>
<td height='26' class='dtb'>使用协议:</td>
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank'>点击浏览...</a></td>
</tr>
<tr>
<td height='26'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td> </td>
</tr>
<tr>
<td height='164' colspan='2'>
<textarea name='filelists' id='filelists' style='width:90%;height:200px'>{$filelist}</textarea>
</td>
</tr>
<tr>
<td height='26'>对于模块的文件处理方法:</td>
<td>
<input type='radio' name='isreplace' value='0' checked='checked' />
手工删除文件,仅运行卸载程序
<input name='isreplace' type='radio' value='2' />
删除模块的所有文件
</td>
</tr>
</table>
";
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>");
$winform = $win->GetWindow("okonly","");
$win->Display();
$dm->Clear();
exit();
}
/*--------------
function UnInstallRun();
--------------*/
else if($action=='uninstallok')
{
$dm = new DedeModule($mdir);
$dm->DeleteFiles($hash,$isreplace);
$dm->DelSystemFile($hash,'readme');
$dm->DelSystemFile($hash,'setup');
$dm->Clear();
ShowMsg("成功完成文件移除,现在转向设置清理程序>>","module/".$hash."-uninstall.php");
exit();
}
/*--------------
function ShowReadme();
--------------*/
else if($action=='showreadme')
{
$dm = new DedeModule($mdir);
$msg = $dm->GetSystemFile($hash,'readme');
$msg = preg_replace("/(.*)<body/isU","",$msg);
$msg = preg_replace("/<\/body>(.*)/isU","",$msg);
$dm->Clear();
$win = new OxWindow();
$win->Init("module_main.php","js/blank.js","post");
$win->mainTitle = "模块管理";
$win->AddTitle("<a href='module_main.php'>模块管理</a> >> 使用协议:");
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>");
$winform = $win->GetWindow("hand");
$win->Display();
exit();
}
/*--------------
function ViewOne();
--------------*/
else if($action=='view')
{
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
$filelists = $dm->GetFileLists($hash);
$filelist = '';
$setupinfo = '';
foreach($filelists as $v)
{
if(empty($v['name'])) continue;
if($v['type']=='dir') $v['type'] = '目录';
else $v['type'] = '文件';
$filelist .= "{$v['type']}|{$v['name']}\r\n";
}
if(file_exists(dirname(__FILE__)."/module/{$hash}-readme.php")){
$setupinfo = "已安装 <a href='module_main.php?action=uninstall&hash={$hash}'>卸载</a>";
}else{
$setupinfo = "未安装 <a href='module_main.php?action=setup&hash={$hash}'>安装</a>";
}
$win = new OxWindow();
$win->Init("","js/blank.js","");
$win->mainTitle = "模块管理";
$win->AddTitle("<a href='module_main.php'>模块管理</a> >> 模块详情: {$infos['name']}");
$msg = "
<style>.dtb{border-bottom:1px dotted #cccccc}</style>
<table width='750' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='200' height='26' class='dtb'>模块名称:</td>
<td width='550' class='dtb'>{$infos['name']}</td>
</tr>
<tr>
<td width='200' height='26' class='dtb'>文件大小:</td>
<td width='550' class='dtb'>{$infos['filesize']}</td>
</tr>
<tr>
<td width='200' height='26' class='dtb'>是否已安装:</td>
<td width='550' class='dtb'>{$setupinfo}</td>
</tr>
<tr>
<td height='26' class='dtb'>团队名称:</td>
<td class='dtb'>{$infos['team']}</td>
</tr>
<tr>
<td height='26' class='dtb'>发布时间:</td>
<td class='dtb'>{$infos['time']}</td>
</tr>
<tr>
<td height='26' class='dtb'>电子邮箱:</td>
<td class='dtb'>{$infos['email']}</td>
</tr>
<tr>
<td height='26' class='dtb'>官方网址:</td>
<td class='dtb'>{$infos['url']}</td>
</tr>
<tr>
<td height='26' class='dtb'>使用协议:</td>
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank'>点击浏览...</a></td>
</tr>
<tr>
<td height='26'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td> </td>
</tr>
<tr>
<td height='164' colspan='2'>
<textarea name='filelists' id='filelists' style='width:90%;height:200px'>{$filelist}</textarea>
</td>
</tr>
</table>
";
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>");
$winform = $win->GetWindow("hand","");
$win->Display();
$dm->Clear();
exit();
}
/*--------------
function EditOne();
--------------*/
else if($action=='edit')
{
$dm = new DedeModule($mdir);
$minfos = $dm->GetModuleInfo($hash);
$modulname = $minfos['name'];
$team = $minfos['team'];
$mtime = $minfos['time'];
$email = $minfos['email'];
$url = $minfos['url'];
/*
$filelists = $dm->GetFileLists($hash);
$filelist = '';
$setupinfo = '';
$ds = array();
foreach($filelists as $v)
{
if(empty($v['name'])) continue;
$sonfile = false;
foreach($ds as $vv){
if(eregi("^".$vv,$v['name'])){ $sonfile=true; break; }
}
if(!$sonfile) $filelist .= "{$v['name']}\r\n";
if($v['type']=='dir') $ds[] = $v['name'];
}
*/
$filelist = $dm->GetSystemFile($hash,'oldfilelist',false);
$dm->Clear();
require_once(dirname(__FILE__)."/templets/module_edit.htm");
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/module_main.php | PHP | asf20 | 12,839 |
<?php
require_once(dirname(__FILE__)."/config.php");
if(empty($do)){
include './templets/baidunews.htm';
}else{
$baidunews = "<?xml version=\"1.0\" encoding=\"gb18030\" ?>\n";
$baidunews .= "<document>\n";
$baidunews .= "<webSite>$cfg_webname </webSite>\n";
$baidunews .= "<webMaster>$cfg_adminemail </webMaster>\n";
$baidunews .= "<updatePeri>$cfg_updateperi </updatePeri>\n";
$limit = $cfg_baidunews_limit;
if($limit > 100 || $limit < 1) $limit = 100;
$query = "select maintable.*, addtable.body, arctype.typename, arc.writer,arc.source
from #@__full_search maintable
left join #@__addonarticle addtable on addtable.aid=maintable.aid
left join #@__arctype arctype on arctype.ID=maintable.typeid
left join #@__archives arc on arc.ID=maintable.aid
where maintable.channelid=1 order by maintable.uptime desc limit $limit
";
$dsql->SetQuery($query);
$dsql->execute();
while($row = $dsql->getarray()){
$title = htmlspecialchars($row['title']);
if(strpos($row['url'],'http://') === false){
$link = $cfg_basehost.$row['url'];
}else{
$link = $row['url'];
}
$link = htmlspecialchars($link);
$description = htmlspecialchars($row['addinfos']);
$text = htmlspecialchars($row['body']);
$image = '';
$headlineimg = '';
$keywords = htmlspecialchars($row['keywords']);
$category = htmlspecialchars($row['typename']);
$author = htmlspecialchars($row['writer']);
$source = htmlspecialchars($row['source']);
$pubdate = htmlspecialchars(gmdate('Y-m-d H:i',$row['pubdate'] + $cfg_cli_time * 3600));
$baidunews .= "<item>\n";
$baidunews .= "<title>$title </title>\n";
$baidunews .= "<link>$link </link>\n";
$baidunews .= "<description>$description </description>\n";
$baidunews .= "<text>$text </text>\n";
$baidunews .= "<image>$image </image>\n";
$baidunews .= "<headlineImg />\n";
$baidunews .= "<keywords>$keywords </keywords>\n";
$baidunews .= "<category>$category </category>\n";
$baidunews .= "<author>$author </author>\n";
$baidunews .= "<source>$source </source>\n";
$baidunews .= "<pubDate>$pubdate </pubDate>\n";
$baidunews .= "</item>\n";
}
$baidunews .= "</document>\n";
$fp = fopen(dirname(__FILE__).'/'.$filename,'w');
fwrite($fp,$baidunews);
fclose($fp);
showmsg("<a href='{$filename}' target=\"_blank\">{$filename}生成成功</a>",'javascript:;');
} | zyyhong | trunk/jiaju001/news/lic/baidunews.php | PHP | asf20 | 2,411 |
<?php
require_once(dirname(__FILE__)."/../../include/inc_channel_unit_functions.php");
$GLOBALS['adminCats'] = array();
$GLOBALS['suserCatalog'] = '';
function GetOptionList($selid=0,$userCatalog=0,$channeltype=0)
{
global $OptionArrayList,$channels,$adminCats,$adminCatstrs,$suserCatalog;
$suserCatalog = $userCatalog;
$dsql = new DedeSql(false);
//读取频道模型信息
$dsql->SetQuery("Select ID,typename From #@__channeltype ");
$dsql->Execute();
$channels = Array();
while($row = $dsql->GetObject()) $channels[$row->ID] = $row->typename;
$OptionArrayList = "";
$adminCats = array();
if(!empty($userCatalog) && $userCatalog!='-1')
{
$adminCats = explode(',',$userCatalog);
$adminCatstrs = $userCatalog;
}
if($selid==0)
{
$query = "Select ID,typename,ispart,channeltype From #@__arctype where ispart<2 And reID=0 order by sortrank asc ";
$dsql->SetQuery($query);
$dsql->Execute();
while($row=$dsql->GetObject())
{
if(TestHasChannel($row->ID,$channeltype)==0) continue;
if( TestAdmin() || $userCatalog==-1 )
{
if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(封面频道)</option>\r\n";
else if($row->ispart==2) $OptionArrayList .= "";
else if($row->channeltype!=$channeltype) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>\r\n";
else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
}else
{
if(in_array($row->ID,$adminCats))
{
if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(封面频道)</option>\r\n";
else if($row->ispart==2) $OptionArrayList .= "";
else if($row->channeltype!=$channeltype) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>\r\n";
else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
LogicGetOptionArray($row->ID,"─",$channeltype,$dsql,false);
}else
{
$haspurcat = false;
$query = "Select ID From #@__arctype where ispart<2 And reID={$row->ID} order by sortrank asc ";
$dsql->Execute('sel'.$row->ID,$query);
while($nrow = $dsql->GetObject('sel'.$row->ID)){
if(in_array($nrow->ID,$adminCats)){ $haspurcat=true; break; }
}
if($haspurcat){
$OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(没权限)</option>\r\n";
LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
}
}
}
}
}else
{
$row = $dsql->GetOne("Select ID,typename,ispart,channeltype From #@__arctype where ID='$selid'");
$channeltype = $row['channeltype'];
if($row['ispart']==1) $OptionArrayList .= "<option value='$selid' class='option1' selected>".$row['typename']."(封面频道)</option>\r\n";
else $OptionArrayList .= "<option value='$selid' class='option3' selected>".$row['typename']."</option>\r\n";
LogicGetOptionArray($selid,"─",$channeltype,$dsql,false);
}
return $OptionArrayList;
}
function LogicGetOptionArray($ID,$step,$channeltype,$dsql,$testpur=true)
{
global $OptionArrayList,$channels,$adminCats,$suserCatalog;
$dsql->SetQuery("Select ID,typename,ispart,channeltype From #@__arctype where reID='".$ID."' And ispart<2 order by sortrank asc");
$dsql->Execute($ID);
while($row=$dsql->GetObject($ID))
{
if($suserCatalog!=-1 && $testpur && !TestAdmin() && !in_array($row->ID,$adminCats)) continue;
if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>$step".$row->typename."(封面频道)</option>\r\n";
else if($row->ispart==2) $OptionArrayList .="";
else if($row->channeltype!=$channeltype) $OptionArrayList .="";
else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>$step".$row->typename."</option>\r\n";
LogicGetOptionArray($row->ID,$step."─",$channeltype,$dsql,false);
}
}
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_catalog_options.php | PHP | asf20 | 4,680 |
<?php
if(!isset($cfg_registerGlobals)){ require_once(dirname(__FILE__)."/../../include/config_base.php"); }
//获得是否推荐的表述
//---------------------------------
function IsCommendArchives($iscommend)
{
if($iscommend==5) return "<font color='blue'>(粗)</font>";
else if($iscommend==11) return "<font color='blue'>(荐)</font>";
else if($iscommend==16) return "<font color='blue'>(荐)(粗)</font>";
else return "";
}
//获得推荐的标题
//---------------------------------
function GetCommendTitle($title,$iscommend)
{
if($iscommend==5) return "<b>$title</b>";
else if($iscommend==11) return "$title<font color='red'>(推荐)</font>";
else if($iscommend==16) return "<b>$title<font color='red'>(推荐)</font></b>";
else return "$title";
}
//更换颜色
//--------------------
$GLOBALS['RndTrunID'] = 1;
function GetColor($color1,$color2)
{
$GLOBALS['RndTrunID']++;
if($GLOBALS['RndTrunID']%2==0) return $color1;
else return $color2;
}
//检查图片是否存在
//-----------------------
function CheckPic($picname)
{
if($picname!="") return $picname;
else return "img/dfpic.gif";
}
//判断内容是否生成HTML
//-----------------------
function IsHtmlArchives($ismake)
{
if($ismake==1) return "已生成";
else if($ismake==-1) return "仅动态";
else return "<font color='red'>未生成</font>";
}
//获得内容的限定级别名称
//-------------------------
function GetRankName($arcrank)
{
global $arcArray,$dsql;
if(!is_array($arcArray)){
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * from #@__arcrank");
$dsql->Execute('rn1');
while($row = $dsql->GetObject('rn1')){ $arcArray[$row->rank]=$row->membername; }
}
if(isset($arcArray[$arcrank])) return $arcArray[$arcrank];
else return "不限";
}
//判断内容是否为图片文章
//----------------------
function IsPicArchives($picname)
{
if($picname!="") return "<font color='red'>(图)</font>";
else return "";
}
//
//----------------
function GetChannelOptopns($dsql,$channelid)
{
global $arcrank,$adminid;
$options = "<option value='full_list.php'>所有频道...</option>\r\n";
$dsql->SetQuery("Select ID,typename,mancon From `#@__channeltype` where ID<>-1 And isshow=1 order by ID asc");
$dsql->Execute('rn2');
while($row = $dsql->GetObject('rn2'))
{
if(empty($row->mancon)) $mancon = "content_list.php?channelid=0&arcrank={$arcrank}&adminid={$adminid}";
else $mancon = $row->mancon;
if($row->ID==$channelid) $options .= "<option value='{$mancon}?channelid={$row->ID}&arcrank={$arcrank}&adminid={$adminid}' selected>{$row->typename}</option>\r\n";
else $options .= "<option value='{$mancon}?channelid={$row->ID}&arcrank={$arcrank}&adminid={$adminid}'>{$row->typename}</option>\r\n";
}
return $options;
}
?>
| zyyhong | trunk/jiaju001/news/lic/inc/inc_list_functions.php | PHP | asf20 | 2,843 |
<?php
function DelArc($aid,$onlyfile=false,$channelid=0)
{
global $dsql,$cuserLogin,$cfg_send_score;
if(!is_object($dsql)) $dsql = new DedeSql(false);
$tables = GetChannelTable($dsql,$aid,'arc');
//读取文档信息
$arctitle = "";
$arcurl = "";
$arcQuery = "
Select a.ID,a.title,a.typeid,
a.ismake,a.senddate,a.arcrank,c.addtable,
a.money,t.typedir,t.typename,a.adminID,a.memberID,
t.namerule,t.namerule2,t.ispart,
t.moresite,t.siteurl,t.siterefer,t.sitepath
from `{$tables['maintable']}` a
left join #@__arctype t on a.typeid=t.ID
left join #@__channeltype c on c.ID=a.channel
where a.ID='$aid'
";
$arcRow = $dsql->GetOne($arcQuery);
if(!TestPurview('a_Del,sys_ArcBatch')){
if(TestPurview('a_AccDel'))
{ if(!in_array($arcRow['typeid'],MyCatalogs())) return false; }
else if(TestPurview('a_MyDel'))
{ if($arcRow['adminID']!=$cuserLogin->getUserID()) return false; }
else
{ return false;}
}
if(!is_array($arcRow)) return false;
//删除数据库的内容
if(!$onlyfile)
{
$dsql->ExecuteNoneQuery("Delete From `{$tables['maintable']}` where ID='$aid'");
if($arcRow['addtable']!=""){
$dsql->ExecuteNoneQuery("Delete From `{$tables['addtable']}` where aid='$aid'");
}
$dsql->ExecuteNoneQuery("Delete From #@__feedback where aid='$aid'");
$dsql->ExecuteNoneQuery("Delete From #@__full_search where aid='$aid'");
$dsql->ExecuteNoneQuery("Delete From #@__memberstow where arcid='$aid'");
if($arcRow['memberID']>0){
$dsql->ExecuteNoneQuery("Update From #@__member set scores = scores-{$cfg_send_score},c1=c1-1 where ID='{$arcRow['memberID']}' ");
}
}
//删除HTML
if($arcRow['ismake']==-1||$arcRow['arcrank']!=0
||$arcRow['typeid']==0||$arcRow['money']>0){
return true;
}
$arcurl = GetFileUrl($arcRow['ID'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],
$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],false,'');
if(!ereg("\?",$arcurl)){
$truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']);
$htmlfile = $truedir.$arcurl;
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);
$arcurls = explode(".",$arcurl);
$sname = $arcurls[count($arcurls)-1];
$fname = ereg_replace("(\.$sname)$","",$arcurl);
for($i=2;$i<=100;$i++){
$htmlfile = $truedir.$fname."_$i".".".$sname;
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);
else break;
}
}
//删除文本文件
$ipath = $GLOBALS['cfg_cmspath']."/data/textdata/".(ceil($aid/5000))."/";
$filename = $GLOBALS['cfg_basedir'].$ipath."{$aid}.txt";
if(is_file($filename)) unlink($filename);
return true;
}
//获取真实路径
//--------------------------
function GetTruePath($siterefer,$sitepath)
{
if($GLOBALS['cfg_multi_site']=='Y'){
if($siterefer==1) $truepath = ereg_replace("/{1,}","/",$GLOBALS["cfg_basedir"]."/".$sitepath);
else if($siterefer==2) $truepath = $sitepath;
else $truepath = $GLOBALS["cfg_basedir"];
}else{
$truepath = $GLOBALS["cfg_basedir"];
}
return $truepath;
}
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_batchup.php | PHP | asf20 | 3,358 |
<?php
$autolitpic = (empty($autolitpic) ? '' : $autolitpic);
${$vs[0]} = stripslashes(${$vs[0]});
//获得文章body里的外部资源
if($cfg_isUrlOpen && $remote==1){ ${$vs[0]} = GetCurContent(${$vs[0]}); }
//去除内容中的站外链接
if($dellink==1)
{
${$vs[0]} = str_replace($cfg_basehost,'#basehost#',${$vs[0]});
${$vs[0]} = preg_replace("/(<a[ \t\r\n]{1,}href=[\"']{0,}http:\/\/[^\/]([^>]*)>)|(<\/a>)/isU","",${$vs[0]});
${$vs[0]} = str_replace('#basehost#',$cfg_basehost,${$vs[0]});
}
//自动摘要
if($description=="" && $cfg_auot_description>0)
{
$description = cn_substr(html2text(${$vs[0]}),$cfg_auot_description);
$description = trim(preg_replace("/#p#|#e#/","",$description));
$description = addslashes($description);
$autodes = true;
}
//自动获取缩略图
if($autolitpic==1 && $litpic==''){
$litpic = GetDDImgFromBody(${$vs[0]});
$autopic = true;
}
${$vs[0]} = addslashes(${$vs[0]});
${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_arc_makeauto.php | PHP | asf20 | 1,023 |
<?php
require_once(DEDEADMIN."/../include/pub_httpdown.php");
require_once(DEDEADMIN."/../include/inc_photograph.php");
require_once(DEDEADMIN."/../include/pub_oxwindow.php");
require_once(DEDEADMIN."/../include/inc_tag_functions.php");
require_once(DEDEADMIN."/../include/inc_custom_fields.php");
//---------------------------
//获得HTML里的外部资源,针对图集
//---------------------
function GetCurContentAlbum($body,$rfurl,&$firstdd)
{
global $cfg_multi_site,$cfg_basehost,$ddmaxwidth,$cfg_basedir;
include_once(DEDEADMIN."/../include/pub_collection_functions.php");
if(empty($ddmaxwidth)) $ddmaxwidth = 150;
$rsimg = '';
$cfg_uploaddir = $GLOBALS['cfg_image_dir'];
$cfg_basedir = $GLOBALS['cfg_basedir'];
$basehost = "http://".$_SERVER["HTTP_HOST"];
if($cfg_multi_site == 'N'){
$body = str_replace(strtolower($basehost),"",$body);
$body = str_replace(strtoupper($basehost),"",$body);
}else{
if($cfg_basehost!=$basehost){
$body = str_replace(strtolower($basehost),$cfg_basehost,$body);
$body = str_replace(strtoupper($basehost),$cfg_basehost,$body);
}
}
$img_array = array();
preg_match_all("/(src|SRC)=[\"|'| ]{0,}(http:\/\/(.*)\.(gif|jpg|jpeg|png))/isU",$body,$img_array);
$img_array = array_unique($img_array[2]);
$imgUrl = $cfg_uploaddir."/".strftime("%y%m%d",time());
$imgPath = $cfg_basedir.$imgUrl;
if(!is_dir($imgPath."/")){
MkdirAll($imgPath,$GLOBALS['cfg_dir_purview']);
CloseFtp();
}
$milliSecond = strftime("%H%M%S",time());
foreach($img_array as $key=>$value)
{
if(eregi($basehost,$value)) continue;
if($cfg_basehost!=$basehost && eregi($cfg_basehost,$value)) continue;
if(!eregi("^http://",$value)) continue;
$value = trim($value);
$itype = substr($value,0,-3);
if(!eregi("gif|jpg|png",$itype)) $itype = ".jpg";
$rndFileName = $imgPath."/".$milliSecond.$key.$itype;
$iurl = $imgUrl."/".$milliSecond.$key.$itype;
//下载并保存文件
//$rs = $htd->SaveToBin($rndFileName);
$rs = DownImageKeep($value,$rfurl,$rndFileName,"",0,30);
if($rs){
$litpicname = GetImageMapDD($iurl,$ddmaxwidth);
if(empty($firstdd) && !empty($litpicname)){
$firstdd = $litpicname;
if(!file_exists($cfg_basedir.$firstdd)) $firstdd = $iurl;
}
@WaterImg($rndFileName,'down');
$info = '';
$imginfos = GetImageSize($rndFileName,$info);
$rsimg .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
}
}
return $rsimg;
}
//---------------------------
//获得文章body里的外部资源
//---------------------------
function GetCurContent($body)
{
global $cfg_multi_site,$cfg_basehost;
$cfg_uploaddir = $GLOBALS['cfg_image_dir'];
$cfg_basedir = $GLOBALS['cfg_basedir'];
$htd = new DedeHttpDown();
$basehost = "http://".$_SERVER["HTTP_HOST"];
/*
//避免删除本地链接
if($cfg_multi_site == 'N'){
$body = str_replace(strtolower($basehost),"",$body);
$body = str_replace(strtoupper($basehost),"",$body);
}else{
if($cfg_basehost!=$basehost){
$body = str_replace(strtolower($basehost),$cfg_basehost,$body);
$body = str_replace(strtoupper($basehost),$cfg_basehost,$body);
}
}
*/
$img_array = array();
preg_match_all("/(src|SRC)=[\"|'| ]{0,}(http:\/\/(.*)\.(gif|jpg|jpeg|bmp|png))/isU",$body,$img_array);
$img_array = array_unique($img_array[2]);
$imgUrl = $cfg_uploaddir."/".strftime("%y%m%d",time());
$imgPath = $cfg_basedir.$imgUrl;
if(!is_dir($imgPath."/")){
MkdirAll($imgPath,$GLOBALS['cfg_dir_purview']);
CloseFtp();
}
$milliSecond = strftime("%H%M%S",time());
foreach($img_array as $key=>$value)
{
if(eregi($basehost,$value)) continue;
if($cfg_basehost!=$basehost && eregi($cfg_basehost,$value)) continue;
if(!eregi("^http://",$value)) continue;
//随机命名文件
$htd->OpenUrl($value);
$itype = $htd->GetHead("content-type");
if($itype=="image/gif") $itype = ".gif";
else if($itype=="image/png") $itype = ".png";
else $itype = ".jpg";
$value = trim($value);
$rndFileName = $imgPath."/".$milliSecond.$key.$itype;
$fileurl = $imgUrl."/".$milliSecond.$key.$itype;
//下载并保存文件
$rs = $htd->SaveToBin($rndFileName);
if($rs){
$body = str_replace($value,$fileurl,$body);
@WaterImg($rndFileName,'down');
}
}
$htd->Close();
return $body;
}
//------------------------------
//获取一个远程图片
//------------------------------
$GLOBALS['_i'] = 0;
function GetRemoteImage($url,$uid=0)
{
global $cuserLogin,$_i;
$_i++;
if(empty($uid)) $uid = $cuserLogin->getUserID();
$cfg_uploaddir = $GLOBALS['cfg_image_dir'];
$cfg_basedir = $GLOBALS['cfg_basedir'];
$revalues = Array();
$ok = false;
$htd = new DedeHttpDown();
$htd->OpenUrl($url);
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png","image/x-png","image/wbmp");
if(!in_array($htd->GetHead("content-type"),$sparr)){
return "";
}else{
$imgUrl = $cfg_uploaddir."/".strftime("%Y%m",time());
$imgPath = $cfg_basedir.$imgUrl;
CreateDir($imgUrl);
$itype = $htd->GetHead("content-type");
if($itype=="image/gif") $itype = ".gif";
else if($itype=="image/png") $itype = ".png";
else if($itype=="image/wbmp") $itype = ".bmp";
else $itype = ".jpg";
//$rndname = dd2char($uid."_".strftime("%H%M%S",time()).mt_rand(1000,9999));
$rndname = strftime("%d",$ntime).dd2char(strftime("%H%M%S",$ntime).'0'.$uid.'0'.mt_rand(1000,9999)).'-'.$_i;
$rndtrueName = $imgPath."/".$rndname.$itype;
$fileurl = $imgUrl."/".$rndname.$itype;
$ok = $htd->SaveToBin($rndtrueName);
//加水印
@WaterImg($rndtrueName,'down');
if($ok){
$info = '';
$data = GetImageSize($rndtrueName,$info);
$revalues[0] = $fileurl;
$revalues[1] = $data[0];
$revalues[2] = $data[1];
}
}
$htd->Close();
if($ok) return $revalues;
else return "";
}
//------------------------------
//获取一个远程Flash文件
//------------------------------
function GetRemoteFlash($url,$uid=0)
{
$cfg_uploaddir = $GLOBALS['media_dir'];
$cfg_basedir = $GLOBALS['cfg_basedir'];
$revalues = "";
$sparr = "application/x-shockwave-flash";
$htd = new DedeHttpDown();
$htd->OpenUrl($url);
if($htd->GetHead("content-type")!=$sparr){
return "";
}else{
$imgUrl = $cfg_uploaddir."/".strftime("%y%m%d",time());
$imgPath = $cfg_basedir.$imgUrl;
CreateDir($imgUrl);
$itype = ".swf";
$milliSecond = $uid."_".strftime("%H%M%S",time());
$rndFileName = $imgPath."/".$milliSecond.$itype;
$fileurl = $imgUrl."/".$milliSecond.$itype;
$ok = $htd->SaveToBin($rndFileName);
if($ok) $revalues = $fileurl;
}
$htd->Close();
return $revalues;
}
//---------------
//检测频道ID
//---------------
function CheckChannel($typeid,$channelid)
{
if($typeid==0) return true;
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select ispart,channeltype From #@__arctype where ID='$typeid' ");
if($row['ispart']!=0 || $row['channeltype']!=$channelid) { return false; }
else { return true; }
}
//---------------
//检测档案权限
//---------------
function CheckArcAdmin($aid,$adminid)
{
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select adminid From #@__archives where ID='$aid' ");
if($row['adminid']!=$adminid) return false;
else return true;
}
//---------------
//文档自动分页
//---------------
function SpLongBody(&$mybody,$spsize,$sptag)
{
if(strlen($mybody)<$spsize) return $mybody;
$bds = explode('<',$mybody);
$npageBody = "";
$istable = 0;
$mybody = "";
foreach($bds as $i=>$k)
{
if($i==0){ $npageBody .= $bds[$i]; continue;}
$bds[$i] = "<".$bds[$i];
if(strlen($bds[$i])>6){
$tname = substr($bds[$i],1,5);
if(strtolower($tname)=='table') $istable++;
else if(strtolower($tname)=='/tabl') $istable--;
if($istable>0){ $npageBody .= $bds[$i]; continue; }
else $npageBody .= $bds[$i];
}else{
$npageBody .= $bds[$i];
}
if(strlen($npageBody)>$spsize){
$mybody .= $npageBody.$sptag;
$npageBody = "";
}
}
if($npageBody!="") $mybody .= $npageBody;
return $mybody;
}
//-----------------------
//创建指定ID的文档
//-----------------------
function MakeArt($aid,$mkindex=true,$upcache=true)
{
global $cfg_makeindex,$cfg_basedir,$cfg_templets_dir,$cfg_df_style,$cfg_up_prenext,$typeid,$envs,$typeid;
include_once(DEDEADMIN."/../include/inc_archives_view.php");
if(!$upcache) $envs['nocache'] = true;
$arc = new Archives($aid);
$reurl = $arc->MakeHtml();
if($mkindex)
{
//更新上下篇文章
if($cfg_up_prenext=='Y' && !empty($typeid))
{
$preRow = $arc->dsql->GetOne("Select ID From `{$arc->MainTable}` where ID<$aid And ID>".($aid-1000)." And arcrank>-1 And typeid='$typeid' order by ID desc");
$nextRow = $arc->dsql->GetOne("Select ID From `{$arc->MainTable}` where ID>$aid And ID<".($aid+1000)." And arcrank>-1 And typeid='$typeid' order by ID asc");
if(is_array($preRow)){
$arc = new Archives($preRow['ID']);
$arc->MakeHtml();
}
if(is_array($nextRow)){
$arc = new Archives($nextRow['ID']);
$arc->MakeHtml();
}
}
//更新主页
if($cfg_makeindex=='Y')
{
$pv = new PartView();
$row = $pv->dsql->GetOne("Select * From #@__homepageset");
$templet = str_replace("{style}",$cfg_df_style,$row['templet']);
$homeFile = dirname(__FILE__)."/../".$row['position'];
$homeFile = str_replace("\\","/",$homeFile);
$homeFile = str_replace("//","/",$homeFile);
$fp = fopen($homeFile,"w") or die("主页文件:{$homeFile} 没有写权限!");
fclose($fp);
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
$pv->SaveToHtml($homeFile);
}
}
return $reurl;
}
//---------------------------
//上传缩略图
//--------------------------
/*
参数一
litpic 默认为上传表单的名称
值为 none\ddfirst 强制不查检上传
值为 ddfirst 则强制把已存在的本地图生成缩略图
参数二
picname 手工填写的图片路径
参数三
isremote 是否下载远程图片 0 为不下载, 1为下载到本地
*/
function GetDDImage($litpic,$picname,$isremote,$ntitle='')
{
global $cuserLogin,$cfg_ddimg_width,$cfg_ddimg_height;
global $cfg_basedir,$ddcfg_image_dir,$title,$dsql;
$ntime = time();
$saveinfo = false;
if($ntitle!='') $title = $ntitle;
$picname = trim($picname);
if(($litpic!='none'||$litpic!='ddfirst') &&
!empty($_FILES[$litpic]['tmp_name']) && is_uploaded_file($_FILES[$litpic]['tmp_name']))
//如果用户自行上传缩略图
{
$istype = 0;
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png");
$_FILES[$litpic]['type'] = strtolower(trim($_FILES[$litpic]['type']));
if(!in_array($_FILES[$litpic]['type'],$sparr)){
ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG格式的其中一种!","-1");
exit();
}
if(!empty($picname) && !eregi("^http://",$picname) && file_exists($cfg_basedir.$picname) ){
if(!is_object($dsql)) $dsql = new DedeSql();
$dsql->ExecuteNoneQuery("Delete From #@__uploads where url like '$picname' ");
$fullUrl = eregi_replace("\.([a-z]*)$","",$picname);
}else{
$savepath = $ddcfg_image_dir."/".strftime("%y%m%d",$ntime);
CreateDir($savepath);
$fullUrl = $savepath."/".dd2char(strftime("%H%M%S",$ntime).$cuserLogin->getUserID().mt_rand(1000,9999));
}
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";
@move_uploaded_file($_FILES[$litpic]['tmp_name'],$cfg_basedir.$fullUrl);
$litpic = $fullUrl;
@ImageResize($cfg_basedir.$fullUrl,$cfg_ddimg_width,$cfg_ddimg_height);
$saveinfo = true;
}else{
if($picname=='') return '';
//远程缩略
if($isremote==1 && eregi("^http://",$picname)){
$ddinfos = GetRemoteImage($picname,$cuserLogin->getUserID());
if(!is_array($ddinfos)) $litpic = "";
else{
$litpic = $ddinfos[0];
if($ddinfos[1] > $cfg_ddimg_width || $ddinfos[2] > $cfg_ddimg_height){
@ImageResize($cfg_basedir.$litpic,$cfg_ddimg_width,$cfg_ddimg_height);
}
}
$saveinfo = true;
}
//本地缩略
else{
//本地大图强制生成本地图缩略
if($litpic=='ddfirst' && !eregi("^http://",$picname)){
$oldpic = $cfg_basedir.$picname;
if(!eregi('_lit',$litpic)){
$litpic = str_replace('.','_lit.',$picname);
$saveinfo = true;
}
@ImageResize($oldpic,$cfg_ddimg_width,$cfg_ddimg_height,$cfg_basedir.$litpic);
}else{
$litpic = $picname;
}
}
}
$imgfile = $cfg_basedir.$litpic;
if($saveinfo && is_file($imgfile) && $litpic!=''){
$info = "";
$imginfos = GetImageSize($imgfile,$info);
//把新上传的图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('{$title} 缩略图','$litpic','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','".$cuserLogin->getUserID()."','0');
";
$dsql = new DedeSql();
$dsql->ExecuteNoneQuery($inquery);
}
return $litpic;
}
//检测栏目是否设置了浏览权限
function GetCoRank($arcrank,$typeid){
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select corank From #@__arctype where ID='$typeid' ");
if($row['corank']!=0) return $row['corank'];
else return $arcrank;
}
//图集里大图的小图
function GetImageMapDD($filename,$ddm,$oldname=''){
if($oldname!='' && !eregi("^http://",$oldname)){
$ddpicok = $oldname;
}else{
$ddn = substr($filename,-3);
$ddpicok = ereg_replace("\.".$ddn."$","-lp.".$ddn,$filename);
}
$toFile = $GLOBALS['cfg_basedir'].$ddpicok;
ImageResize($GLOBALS['cfg_basedir'].$filename,$ddm,300,$toFile);
return $ddpicok;
}
//------------------------
//上传一个未经处理的图片
//------------------------
/*
//参数一 upname 上传框名称
//参数二 handurl 手工填写的网址
//参数三 ddisremote 是否下载远程图片 0 不下, 1 下载
//参数四 ntitle 注解文字 如果表单有 title 字段可不管
*/
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;
}
//------------------
//取第一个图片为缩略图
//------------------
function GetDDImgFromBody(&$body)
{
$litpic = '';
preg_match_all("/(src|SRC)=[\"|'| ]{0,}(.*\.(gif|jpg|jpeg|bmp|png))/isU",$body,$img_array);
$img_array = array_unique($img_array[2]);
if(count($img_array)>0){
$picname = preg_replace("/[\"|'| ]{1,}/","",$img_array[0]);
if(ereg("_lit\.",$picname)) $litpic = $picname;
else $litpic = GetDDImage('ddfirst',$picname,0);
}
return $litpic;
}
//获得一个附加表单
//-----------------------------
function GetFormItemA($ctag)
{
return GetFormItem($ctag,'admin');
}
//---------------------------
//处理不同类型的数据
//---------------------------
function GetFieldValueA($dvalue,$dtype,$aid=0,$job='add',$addvar='')
{
return GetFieldValue($dvalue,$dtype,$aid,$job,$addvar,'admin');
}
//获得带值的表单(编辑时用)
//-----------------------------
function GetFormItemValueA($ctag,$fvalue)
{
return GetFormItemValue($ctag,$fvalue,'admin');
}
//载入自定义表单(用于发布)
function PrintAutoFieldsAdd(&$fieldset,$loadtype='all')
{
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
$dede_addonfields = "";
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $tid=>$ctag)
{
if($loadtype!='autofield'
|| ($loadtype=='autofield' && $ctag->GetAtt('autofield')==1) )
{
$dede_addonfields .= ( $dede_addonfields=="" ? $ctag->GetName().",".$ctag->GetAtt('type') : ";".$ctag->GetName().",".$ctag->GetAtt('type') );
echo GetFormItemA($ctag);
}
}
}
echo "<input type='hidden' name='dede_addonfields' value=\"".$dede_addonfields."\">\r\n";
}
//载入自定义表单(用于编辑)
function PrintAutoFieldsEdit(&$fieldset,&$fieldValues,$loadtype='all')
{
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
$dede_addonfields = "";
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $tid=>$ctag)
{
if($loadtype!='autofield'
|| ($loadtype=='autofield' && $ctag->GetAtt('autofield')==1) )
{
$dede_addonfields .= ( $dede_addonfields=='' ? $ctag->GetName().",".$ctag->GetAtt('type') : ";".$ctag->GetName().",".$ctag->GetAtt('type') );
echo GetFormItemValueA($ctag,$fieldValues[$ctag->GetName()]);
}
}
}
echo "<input type='hidden' name='dede_addonfields' value=\"".$dede_addonfields."\">\r\n";
}
function getfilenameonly($arcid, $typeid, $senddate, $title, $ismake, $arcrank, $money)
{
global $dsql;
require_once DEDEINC.'/inc_channel_unit_functions.php';
$row = $dsql->getone("select namerule, typedir, siterefer, sitepath ,channeltype from #@__arctype where ID='$typeid'");
if(is_array($row)){
if($row['channeltype'] == -2) return $GLOBALS['cfg_plus_dir']."/view.php?aid=$arcid";
$filename = GetFileNewName($arcid, $typeid, $senddate, $title, $ismake, $arcrank, $row['namerule'],
$row['typedir'],$money,$row['siterefer'], $row['sitepath']);
}else{
showmsg('栏目id错误','-1');
exit;
}
if($filename=="") $filename = $GLOBALS['cfg_plus_dir']."/view.php?aid=$arcid";
return $filename;
}
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_archives_functions.php | PHP | asf20 | 21,107 |
<?php
//获得字段创建信息
function GetFieldMake($dtype,$fieldname,$dfvalue,$mxlen)
{
$fields = array();
if($dtype=="int"||$dtype=="datetime"){
if($dfvalue=="" || ereg("[^0-9-]",$dfvalue)){ $dfvalue = 0; }
$fields[0] = " `$fieldname` int(11) NOT NULL default '$dfvalue';";
$fields[1] = "int(11)";
}else if($dtype=="float"){
if($dfvalue=="" || ereg("[^0-9\.-]",$dfvalue)){ $dfvalue = 0; }
$fields[0] = " `$fieldname` float NOT NULL default '$dfvalue';";
$fields[1] = "float";
}else if($dtype=="img"||$dtype=="media"||$dtype=="addon"||$dtype=="imgfile"){
if(empty($dfvalue)) $dfvalue = '';
if($mxlen=="") $mxlen = 200;
if($mxlen > 255) $mxlen = 100;
$fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';";
$fields[1] = "varchar($mxlen)";
}else if($dtype=="multitext"||$dtype=="htmltext"){
$fields[0] = " `$fieldname` mediumtext;";
$fields[1] = "mediumtext";
}else if($dtype=="textdata"){
if(empty($dfvalue)) $dfvalue = '';
$fields[0] = " `$fieldname` varchar(100) NOT NULL default '';";
$fields[1] = "varchar(100)";
}else if($dtype=="textchar"){
if(empty($dfvalue)) $dfvalue = '';
$fields[0] = " `$fieldname` char(100) NOT NULL default '$dfvalue';";
$fields[1] = "char(100)";
}
else{
if(empty($dfvalue)) $dfvalue = '';
if(empty($mxlen)) $mxlen = 100;
if($mxlen > 255) $mxlen = 250;
$fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';";
$fields[1] = "varchar($mxlen)";
}
return $fields;
}
//获得模型的列表字段
function GetAddFieldList(&$dtp,&$oksetting)
{
$oklist = '';
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($oksetting);
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $tagid=>$ctag)
{
if($ctag->GetAtt('islist')==1){
$oklist .= ($oklist=='' ? strtolower($ctag->GetName()) : ','.strtolower($ctag->GetName()) );
}
}
}
return $oklist;
}
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_admin_channel.php | PHP | asf20 | 2,045 |
<?php
//栏目选择
function GetTypeidSel($fname,$f1,$f2,$cc,$selv='0',$selname='请选择...',$pos='')
{
global $opall;
if(empty($opall)) $opall = 0;
$rstr = "<input type=\"hidden\" name=\"$f1\" value=\"$selv\">\r\n";
$rstr .= "<input type=\"button\" name=\"$f2\" value=\"$selname\" style=\"height:21px;width:150px;border:0px;background-image:url({$pos}img/ctbg.gif);padding-top:2px; background-color: transparent\" onClick=\"SelectCatalog('$fname','$f1','$f2',$cc,'$pos','$opall');\">\r\n";
return $rstr;
}
//数据库连接清理
function ClearAllLink()
{
}
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_admin_pub.php | PHP | asf20 | 596 |
<?php
require_once(dirname(__FILE__)."/../../include/config_base.php");
require_once(dirname(__FILE__)."/../../include/pub_dedetag.php");
if(!isset($cfg_ct_mode)) $cfg_ct_mode = 0;
$dsql = new DedeSql(false);
//载入可发布/管理频道
$listset = "";
$addset = "";
$plusset = "";
if($c==2||$c==9||$c==0)
{
$listsetn = '';
$listsetn .= "<m:item name='所有档案列表' link='content_list.php' rank='a_List,a_AccList' target='main' />\r\n";
$listsetn .= "<m:item name='我发布的文档' link='content_list.php?adminid=".$cuserLogin->getUserID()."' rank='a_List,a_AccList,a_MyList' target='main' />\r\n";
$listsetn .= "<m:item name='等审核的文档' link='content_list.php?arcrank=-1' rank='a_Check,a_AccCheck' target='main' />\r\n";
$listsetn .= "<m:item name='会员投稿文档' link='content_list.php?ismember=1' rank='a_Check,a_AccCheck' target='main' />\r\n";
$listsetn .= "<m:item name='分类信息列表' link='info_list.php' rank='a_List,a_AccList' target='main' />\r\n";
$dsql->SetQuery("Select ID,typename,addcon,mancon From #@__channeltype where ID<>-1 And isshow=1 order by ID asc");
$dsql->Execute();
while($row = $dsql->GetArray())
{
$dds = $dsql->GetOne("Select count(ID) as dd From `#@__arctype` where channeltype={$row['ID']} ");
if($dds['dd']<1) continue;
if($row['mancon']=='') $row['mancon'] = "content_list.php";
if($row['addcon']=='') $row['addcon'] = "archives_add.php";
$addset .= " <m:item name='发布".$row['typename']."' link='".$row['addcon']."?channelid=".$row['ID']."' rank='' target='main' />\r\n";
$listset .= " <m:item name='{$row['typename']}管理' link='{$row['mancon']}?channelid={$row['ID']}' rank='t_List,t_AccList' target='main' />\r\n";
}
//传统非分表管理模式
if($cfg_ct_mode!=1)
{
$listset = $listsetn;
}
$userChannel = $cuserLogin->getUserChannel();
if(ereg(',',$userChannel) && !TestPurview('admin_AllowAll')){
$addset = '';
$listset = $listsetn;
}
}
//载入插件
if($c==5||$c==0)
{
$dsql->SetQuery("Select * From #@__plus where isshow=1 order by aid asc");
$dsql->Execute();
while($row = $dsql->GetObject()){
$plusset .= $row->menustring."\r\n";
}
}
//////////////////////////
$menus = "
-----------------------------------------------
<m:top name='快捷菜单' display='block' c='9,' rank=''>
<m:item name='网站栏目管理' link='catalog_main.php' rank='t_List,t_AccList' target='main' />
<m:item name='所有档案列表' link='full_list.php' rank='a_List,a_AccList' target='main' />
<m:item name='我发布的文档' link='full_list.php?adminid=".$cuserLogin->getUserID()."' rank='a_List,a_AccList,a_MyList' target='main' />
<m:item name='等审核的文档' link='full_list.php?arcrank=-1' rank='a_Check,a_AccCheck' target='main' />
<m:item name='会员投稿文档' link='full_list.php?ismember=1' rank='a_Check,a_AccCheck' target='main' />
<m:item name='文档评论管理' link='feedback_main.php' rank='sys_Feedback' target='main' />
<m:item name='附件数据管理' link='media_main.php' rank='sys_Upload,sys_MyUpload' target='main' />
</m:top>
<m:top name='频道管理' display='block' c='1,' rank=''>
<m:item name='内容模型管理' link='mychannel_main.php' rank='c_List' target='main' />
<m:item name='网站栏目管理' link='catalog_main.php' rank='t_List,t_AccList' target='main' />
<m:item name='自由列表管理' link='freelist_main.php' rank='c_FreeList' target='main' />
<m:item name='单页文档管理' link='templets_one.php' rank='temp_One' target='main'/>
</m:top>
<m:top name='信息维护' c='2,' display='block'>
<m:item name='文档评论管理' link='feedback_main.php' rank='sys_Feedback' target='main' />
<m:item name='附件数据管理' link='media_main.php' rank='sys_Upload,sys_MyUpload' target='main' />
<m:item name='搜索关键词管理' link='search_keywords_main.php' rank='sys_Keyword' target='main' />
<m:item name='文档信息统计' link='content_tj.php' rank='sys_ArcTj' target='main' />
</m:top>
<m:top name='文档管理' c='2,' display='block'>
$listset
</m:top>
<m:top name='内容发布' c='9,' display='block' rank=''>
<m:item name='树形栏目结构' link='catalog_menu.php' rank='' target='_self' />
</m:top>
<m:top name='批量管理' c='2,' display='block'>
<m:item name='文档批量维护' link='content_batch_up.php' rank='sys_ArcBatch' target='main' />
<m:item name='重复标题检测' link='article_test_same.php' rank='sys_ArcBatch' target='main' />
<m:item name='文档错误修正' link='content_batch_up2.php' rank='sys_ArcBatch' target='main' />
<m:item name='文档关键词维护' link='article_keywords_main.php' rank='sys_Keyword' target='main' />
<m:item name='批量获取摘要' link='description_fetch.php' rank='sys_description' target='main' />
<m:item name='批量获取关键词' link='article_keywords_fetch.php' rank='sys_description' target='main' />
<m:item name='自动分页' link='pagination_main.php' rank='sys_description' target='main' />
<m:item name='提取文章缩略图' link='makeminiature/makeminiature.php' rank='sys_ArcBatch' target='main' />
<m:item name='数据库内容替换' link='sys_data_replace.php' rank='sys_ArcBatch' target='main' />
</m:top>
<m:top name='模块管理' c='6,' display='block'>
<m:item name='模块管理' link='module_main.php' rank='sys_module' target='main' />
<m:item name='上传新模块' link='module_upload.php' rank='sys_module' target='main' />
<m:item name='模块生成向导' link='module_make.php' rank='sys_module' target='main' />
<!--m:item name='官方模块列表' link='http://www.dedecms.com/modules.php' rank='' target='main' /-->
</m:top>
<m:top name='专题管理' display='block' c='4,' rank=''>
<m:item name='创建新专题' link='spec_add.php' rank='spec_New' target='main' />
<m:item name='专题列表' link='content_s_list.php' rank='spec_List' target='main' />
<m:item name='更新专题HTML' link='makehtml_spec.php' rank='sys_MakeHtml' target='main' />
</m:top>
<m:top name='自动任务' display='block' rank='' c='3,'>
<m:item name='一键更新网站' link='makehtml_all.php' rank='sys_MakeHtml' target='main' />
<m:item name='系统计划任务' link='makehtml_task.php' rank='sys_MakeHtml' target='main' />
</m:top>
<m:top name='HTML更新' display='block' rank='' c='3,'>
<m:item name='更新主页HTML' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新栏目HTML' link='makehtml_list.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新文档HTML' link='makehtml_archives.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新网站地图' link='makehtml_map_guide.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新RSS文件' link='makehtml_rss.php' rank='sys_MakeHtml' target='main' />
<m:item name='获取JS文件' link='makehtml_js.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新专题列表' link='makehtml_spec.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新自由列表' link='makehtml_freelist.php' rank='sys_MakeHtml' target='main' />
<m:item name='更新小说HTML' link='makehtml_story.php' rank='sys_MakeHtml' target='main' />
</m:top>
<m:top name='采集管理' display='block' rank='' c='4,'>
<m:item name='数据规则模型' link='co_export_rule.php' rank='co_NewRule' target='main' />
<m:item name='采集节点管理' link='co_main.php' rank='co_ListNote' target='main' />
<m:item name='已下载内容管理' link='co_url.php' rank='co_ViewNote' target='main' />
</m:top>
<m:top name='辅助插件' c='5,' display='block'>
<m:item name='插件管理器' link='plus_main.php' rank='sys_plus' target='main' />
$plusset
</m:top>
<m:top name='模板管理' display='block' c='9,10,' rank=''>
<m:item name='智能标记向导' link='mytag_tag_guide.php' rank='temp_Other' target='main'/>
<m:item name='自定义宏标记' link='mytag_main.php' rank='temp_MyTag' target='main'/>
<m:item name='全局标记测试' link='tag_test.php' rank='temp_Test' target='main'/>
<m:item name='浏览模板目录' link='catalog_do.php?dopost=viewTemplet' rank='temp_All' target='main'/>
</m:top>
~~addmenu~~
<m:top name='会员资料管理' c='4,' display='block'>
<m:item name='个人会员列表' link='member_main.php' rank='member_List' target='main' />
<m:item name='企业会员列表' link='company_main.php' rank='member_List' target='main' />
<m:item name='会员短信管理' link='member_pm.php' rank='member_Pm' target='main' />
<m:item name='积分兑换记录' link='money2scores.php' rank='member_List' target='main' />
</m:top>
<m:top name='会员业务管理' c='4,' display='block'>
<m:item name='点卡业务记录' link='member_card.php' rank='member_Operations' target='main' />
<m:item name='会员业务记录' link='member_operations.php' rank='member_Operations' target='main' />
</m:top>
<m:top name='会员相关设置' c='4,' display='block'>
<m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' />
<m:item name='积分头衔设置' link='member_scores.php' rank='member_Scores' target='main' />
<m:item name='会员产品分类' link='member_type.php' rank='member_Type' target='main' />
<m:item name='点卡产品分类' link='member_card_type.php' rank='member_Card' target='main' />
<m:item name='密码类型变换' link='member_password.php' rank='member_Data' target='main' />
</m:top>
<m:top name='互动模块设置' c='1,4,' display='block' rank=''>
<m:item name='行业管理' link='sectors.php' rank='sectors_All' target='main' />
<m:item name='地区管理' link='area.php' rank='area_All' target='main' />
<m:item name='小分类管理' link='smalltype.php' rank='smalltype_All' target='main' />
</m:top>
<m:top name='系统帐号管理' c='7,' display='block' rank=''>
<m:item name='更改个人资料' link='my_acc_edit.php' rank='sys_MdPwd' target='main' />
<m:item name='系统帐号管理' link='sys_admin_user.php' rank='sys_User' target='main' />
<m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' />
</m:top>
<m:top name='系统设置' c='7,' display='block' rank=''>
<m:item name='系统变量配置' link='sys_info.php' rank='sys_Edit' target='main' />
<m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' />
<m:item name='通行证设置' link='sys_passport.php' rank='sys_Passport' target='main' />
<m:item name='系统日志管理' link='log_list.php' rank='sys_Log' target='main' />
</m:top>
<m:top name='PW营销模块' display='block' c='5,' rank=''>
<m:item name='营销模块设置' link='code_main.php' rank='sys_Edit' target='main' />
</m:top>
<m:top name='快速设置' c='9,' display='block' rank=''>
<m:item name='系统帐号管理' link='sys_admin_user.php' rank='sys_User' target='main' />
<m:item name='系统变量配置' link='sys_info.php' rank='sys_Edit' target='main' />
<m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' />
<m:item name='通行证设置' link='sys_passport.php' rank='sys_Passport' target='main' />
</m:top>
<m:top name='频道设置' c='1,' display='block' rank=''>
<m:item name='自定义文档属性' link='content_att.php' rank='sys_Att' target='main' />
<m:item name='软件频道设置' link='soft_config.php' rank='sys_SoftConfig' target='main' />
<m:item name='防采集串混淆' link='article_string_mix.php' rank='sys_StringMix' target='main' />
<m:item name='来源管理' link='article_source_edit.php' rank='sys_Source' target='main' />
<m:item name='作者管理' link='article_writer_edit.php' rank='sys_Writer' target='main' />
</m:top>
<m:top name='数据库管理' c='7,' display='block' rank=''>
<m:item name='SQL命令运行器' link='sys_sql_query.php' rank='sys_Data' target='main' />
<m:item name='数据库备份' link='sys_data.php' rank='sys_Data' target='main' />
<m:item name='数据库还原' link='sys_data_revert.php' rank='sys_Data' target='main' />
</m:top>
<m:top name='系统帮助' c='7,9,10,' display='block'>
<m:item name='模板代码参考' link='http://www.dedecms.com/archives/templethelp/help/index.htm' rank='' target='_blank' />
<m:item name='官方论坛' link='http://bbs.dedecms.com/' rank='' target='_blank' />
</m:top>
-----------------------------------------------
";
function GetMenus($userrank)
{
global $c,$menus;
$catalog =(isset($c) ? $c : 2);
$headTemplet = "
<dl>
<dt><a href=\"###\" onclick=\"showHide('items~cc~');\" target=\"_self\">~channelname~</a></dt>
<dd id=\"items~cc~\" style=\"display:block;\">
<ul>
";
$footTemplet = " </ul>
</dd>
</dl>";
$itemTemplet = "<li><a href='~link~' target='~target~'>~itemname~</a></li>
";
/////////////////////////////////////////
$dtp = new DedeTagParse();
$dtp->SetNameSpace("m","<",">");
$dtp->LoadSource($menus);
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("m","<",">");
foreach($dtp->CTags as $i=>$ctag)
{
$lc = $ctag->GetAtt('c');
if($ctag->GetName()=="top"
&& (ereg($catalog.',',$lc) || $catalog=='0') )
{
echo "<!-- Item ".($i+1)." Strat -->\r\n";
$htmp = str_replace("~channelname~",$ctag->GetAtt("name"),$headTemplet);
$htmp = str_replace("~display~",$ctag->GetAtt("display"),$htmp);
$htmp = str_replace("~cc~",$i,$htmp);
echo $htmp;
$dtp2->LoadSource($ctag->InnerText);
if(!empty($dtp2->CTags) && is_array($dtp2->CTags)){
foreach($dtp2->CTags as $j=>$ctag2)
{
if($ctag2->GetName()=="item"
&& ($ctag2->GetAtt('rank')=='' || TestPurview($ctag2->GetAtt('rank')) )
)
{
$itemtmp = str_replace("~link~",$ctag2->GetAtt("link"),$itemTemplet);
$itemtmp = str_replace("~target~",$ctag2->GetAtt("target"),$itemtmp);
$itemtmp = str_replace("~n~",$i,$itemtmp);
$itemtmp = str_replace("~itemname~",$ctag2->GetAtt("name"),$itemtmp);
echo $itemtmp;
}
}
}
echo $footTemplet;
echo "<!-- Item ".($i+1)." End -->\r\n";
}
}
}//End Function
?> | zyyhong | trunk/jiaju001/news/lic/inc/inc_menu.php | PHP | asf20 | 14,427 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
$typeid = $cid = (!isset($cid) ? 0 : intval($cid));
$channelid = (!isset($channelid) ? 0 : intval($channelid));
$dsql = new DedeSql(false);
//读取归档信息
//------------------------------
$arcQuery = "Select t.typename as arctypename,t.smalltypes,c.* From #@__arctype t left join #@__channeltype c on c.ID=t.channeltype where t.ID='$typeid' ";
$cInfos = $typeinfo = $dsql->GetOne($arcQuery);
if(is_array($cInfos)){
$channelid = $typeinfo['ID'];
$addtable = $typeinfo['addtable'];
}
else if(!empty($channelid))
{
$query = " Select * From #@__channeltype where ID='$channelid'";
$cInfos = $dsql->GetOne($query);
$channelid = $cInfos['ID'];
$addtable = $cInfos['addtable'];
}
//获取小分类
$smalltypes = '';
if(is_array($typeinfo) && !empty($typeinfo['smalltypes']))
{
$sql = "select * from #@__smalltypes where id in($typeinfo[smalltypes]);";
$dsql->SetQuery($sql);
$dsql->Execute();
while($smalltype = $dsql->GetArray()){
$smalltypes .= '<option value="'.$smalltype['id'].'">'.$smalltype['name']."</option>\n";
}
}
//////////////////////地区数据处理s/////////////////////////////
$dsql->SetQuery("select * from #@__area");
$dsql->Execute();
$toparea = $subarea = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0){
$toparea[] = $sector;
}else{
$subarea[] = $sector;
}
}
$areacache = "toparea=new Array();\n\n";
$areaidname = $areaid2name = '-不限-';
foreach($toparea as $topkey => $topsector)
{
$areacache .= "toparea[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
$areacache .= "\t".'subareas'.$topsector['id'].'=new Array();'."\n";
$arrCount = 0;
foreach($subarea as $subkey => $subsector)
{
if($subsector['reid'] == $topsector['id'])
{
$areacache .= "\t".'subareas'.$topsector['id'].'['.$arrCount.']="'.$subsector['id'].'~'.$subsector['name'].'";'."\n";
$arrCount++;
}
}
}
//echo $areacache;exit;
//////////////////////地区数据处理e/////////////////////////////
//////////////////////行业数据处理s/////////////////////////////
$sql = "select * from #@__sectors";
$dsql->SetQuery($sql);
$dsql->Execute();
$topsectors = $subsectors = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0)
{
$topsectors[] = $sector;
}else
{
$subsectors[] = $sector;
}
}
$sectorcache = "topsectors=new Array();\n\n";
$sectoridname = $sectorid2name = '-不限-';
foreach($topsectors as $topkey => $topsector)
{
$sectorcache .= "topsectors[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
$sectorcache .= "\t".'subsectors'.$topsector['id'].'=new Array();'."\n";
$arrCount = 0;
foreach($subsectors as $subkey => $subsector)
{
if($subsector['reid'] == $topsector['id'])
{
$sectorcache .= "\t".'subsectors'.$topsector['id'].'['.$arrCount.']="'.$subsector['id'].'~'.$subsector['name'].'";'."\n";
$arrCount++;
}
}
}
//echo $sectorcache;exit;
//////////////////////行业数据处理e/////////////////////////////
require_once(dirname(__FILE__)."/templets/info_add.htm");
ClearAllLink();
exit();
?>
| zyyhong | trunk/jiaju001/news/lic/info_add.php | PHP | asf20 | 3,378 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__).'/../include/inc_arcbook_view.php');
CheckPurview('sys_MakeHtml');
if(!isset($action)) $action = '';
$dsql = new DedeSql(false);
//更新HTML操作
if($action=='make')
{
if(empty($start)) $start = 0;
$addquery = " id>='$starid' ";
if(!empty($endid) && $endid>$startid ) $addquery .= " And id<='$endid' ";
if(!empty($catid)) $addquery .= " And (catid='$catid' Or bcatid='$catid') ";
if(empty($makenum)) $makenum = 50;
$dsql->SetQuery("Select SQL_CALC_FOUND_ROWS id From #@__story_books where $addquery limit $start,$makenum ");
$dsql->Execute();
$n = 0;
$row = $dsql->GetOne("SELECT FOUND_ROWS() as dd ");
$limitrow = $row['dd'];
while($row = $dsql->GetObject()){
$start++;
$bv = new BookView($row->id,'book');
$artUrl = $bv->MakeHtml(false);
//echo "更新: <a href='$artUrl' target='_blank'>{$bv->Fields['bookname']}</a> OK!<br />\r\n";
//echo $row->id." - ";
}
if($start>=$limitrow){
ShowMsg("完成所有HTML的更新!","javascript:;");
}
else{
$hasMake = $limitrow - $start;
if($limitrow>0) $proportion = 100 - ceil(($hasMake / $limitrow) * 100);
ShowMsg("已更新至:{$proportion}% 继续更新其它内容...","makehtml_story.php?start={$start}&action=make&startid={$startid}&endid={$endid}&catid={$catid}&makenum={$makenum}");
}
$dsql->Close();
exit();
}
//读取所有栏目
$dsql->SetQuery("Select id,classname,pid,rank,booktype From #@__story_catalog order by rank asc");
$dsql->Execute();
$ranks = Array();
$btypes = Array();
$stypes = Array();
$booktypes = Array();
while($row = $dsql->GetArray()){
if($row['pid']==0) $btypes[$row['id']] = $row['classname'];
else $stypes[$row['pid']][$row['id']] = $row['classname'];
$ranks[$row['id']] = $row['rank'];
if($row['booktype']=='0') $booktypes[$row['id']] = '小说';
else $booktypes[$row['id']] = '漫画';
}
$lastid = $row['id'];
require_once(dirname(__FILE__)."/templets/makehtml_story.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/makehtml_story.php | PHP | asf20 | 2,073 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Edit');
require_once(dirname(__FILE__)."/../include/inc_photograph.php");
header("Content-Type: text/html; charset={$cfg_ver_lang}");
if($cfg_photo_support==""){ echo "你的系统没安装GD库,不允许使用本功能!"; }
$ImageWaterConfigFile = dirname(__FILE__)."/../include/inc_photowatermark_config.php";
if(empty($action)) $action = "";
if($action=="save")
{
$vars = array('photo_markup','photo_markdown','photo_wwidth','photo_wheight','photo_waterpos','photo_watertext','photo_fontsize','photo_fontcolor','photo_diaphaneity');
$configstr = "";
foreach($vars as $v){
${$v} = str_replace("'","",${$v});
$configstr .= "\${$v} = '".${$v}."';\r\n";
}
$shortname = "";
if(is_uploaded_file($newimg)){
$imgfile_type = strtolower(trim($newimg_type));
if(!in_array($imgfile_type,$cfg_photo_typenames)){
ShowMsg("上传的图片格式错误,请使用 {$cfg_photo_support}格式的其中一种!","-1");
exit();
}
if($imgfile_type=='image/bmp') $shortname = ".bmp";
else if($imgfile_type=='image/png') $shortname = ".png";
else if($imgfile_type=='image/gif') $shortname = ".gif";
else $shortname = ".jpg";
$photo_markimg = 'mark'.$shortname;
@move_uploaded_file($newimg,dirname(__FILE__)."/../include/data/".$photo_markimg);
}
$configstr .= "\$photo_markimg = '{$photo_markimg}';\r\n";
$configstr = "<"."?php\r\n".$configstr."?".">\r\n";
$fp = fopen($ImageWaterConfigFile,"w") or die("写入文件 $ImageWaterConfigFile 失败,请检查权限!");
fwrite($fp,$configstr);
fclose($fp);
echo "<script>alert('修改配置成功!');</script>\r\n";
}
require_once($ImageWaterConfigFile);
require_once(dirname(__FILE__)."/templets/sys_info_mark.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/sys_info_mark.php | PHP | asf20 | 1,890 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('member_Edit');
if(!isset($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL = "";
else $ENV_GOBACK_URL="member_main.php";
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
$row=$dsql->GetOne("select m.*, mc.* from #@__member m left join #@__member_cominfo mc on mc.id=m.ID where m.ID='$ID'");
$sql = "select * from #@__sectors";
$dsql->SetQuery($sql);
$dsql->Execute();
$topsectors = $subsectors = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0) {
$topsectors[] = $sector;
} else {
$subsectors[] = $sector;
}
}
$sectorcache = "<!--\ntopsectors=new Array();\n\n";
$typeid1name = $typeid2name = '-不限-';
foreach($topsectors as $topkey => $topsector)
{
if($topsector['id'] == $row['typeid1'])
{
$typeid1name = $topsector['name'];
}
$sectorcache .= "topsectors[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
$sectorcache .= "\t".'subsectors'.$topsector['id'].'=new Array();'."\n";
foreach($subsectors as $subkey => $subsector)
{
if($subsector['id'] == $row['typeid2'])
{
$typeid2name = $subsector['name'];
}
if($subsector['reid'] == $topsector['id'])
{//B1[0]="101~东城区";
$sectorcache .= "\t".'subsectors'.$topsector['id'].'['.$subkey.']="'.$subsector['id'].'~'.$subsector['name'].'";'."\n";
}
}
}
$sectorcache .= '-->';
require_once(dirname(__FILE__)."/templets/company_view.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/company_view.php | PHP | asf20 | 1,552 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typeunit_admin.php");
$ID = trim(ereg_replace("[^0-9]","",$ID));
//检查权限许可
CheckPurview('t_Del,t_AccDel');
//检查栏目操作许可
CheckCatalog($ID,"你无权删除本栏目!");
if(empty($dopost)) $dopost="";
if($dopost=="ok"){
$ut = new TypeUnit();
$ut->DelType($ID,$delfile);
//更新缓存
UpDateCatCache($dsql);
$ut->Close();
//更新树形菜单
$rndtime = time();
$uptree = "<script language='javascript'>
if(window.navigator.userAgent.indexOf('MSIE')>=1){
if(top.document.frames.menu.location.href.indexOf('catalog_menu.php')>=1)
{ top.document.frames.menu.location = 'catalog_menu.php?$rndtime'; }
}else{
if(top.document.getElementById('menu').src.indexOf('catalog_menu.php')>=1)
{ top.document.getElementById('menu').src = 'catalog_menu.php?$rndtime'; }
}
</script>";
echo $uptree;
ShowMsg("成功删除一个栏目!","catalog_main.php");
exit();
}
require_once(dirname(__FILE__)."/templets/catalog_del.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/catalog_del.php | PHP | asf20 | 1,154 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_List');
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
$query = "select * from #@__score2money_logs order by dateline desc";
$dlist = new DataList();
$dlist->Init();
$dlist->pageSize = 20;
$dlist->SetSource($query);
$log = $dlist->GetDataList();
$logs = array();
while($row = $log->GetArray('dm')) {
$row['dbdateline'] = GetDateTimeMk($row['dateline']);
$row['dbtype'] = $row['type'] == 'score2money' ? '积分 → 金币' : '金币 → 积分';
$logs[] = $row;
}
$page = $dlist->GetPageList(7);
require_once(dirname(__FILE__)."/templets/money2score.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/money2scores.php | PHP | asf20 | 699 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
if(empty($dopost)) $dopost = "";
if(empty($fmdo)) $fmdo = "";
if(!isset($ENV_GOBACK_URL)) $ENV_GOBACK_URL = '';
/*----------------
function __DelMember()
删除会员
----------------*/
if($dopost=="delmember")
{
CheckPurview('member_Del');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__member where ID='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__memberstow where uid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_guestbook where mid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_arctype where memberid='$ID'");
$dsql->ExecuteNoneQuery("Delete From #@__member_flink where mid='$ID'");
$dsql->Close();
ShowMsg("成功删除一个会员!",$ENV_GOBACK_URL);
exit();
}
$wintitle = "会员管理-删除会员";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::删除会员";
$win = new OxWindow();
$win->Init("member_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("你确实要删除(ID:".$ID.")这个会员?");
$winform = $win->GetWindow("ok");
$win->Display();
}
/*-----------------------------
function __UpOperations()
业务状态更改为已付款状态
------------------------------*/
else if($dopost=="upoperations")
{
CheckPurview('member_Operations');
if($nid==''){
ShowMsg("没选定要更改的业务记录!","-1");
exit();
}
$nids = explode('`',$nid);
$wh = '';
foreach($nids as $n){
if($wh=='') $wh = " where aid='$n' ";
else $wh .= " Or aid='$n' ";
}
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member_operation set sta=1 $wh ");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改指定的业务记录!",$ENV_GOBACK_URL);
exit();
}
/*----------------------------
function __OkOperations()
业务状态更改改完成状态
-----------------------------*/
else if($dopost=="okoperations")
{
CheckPurview('member_Operations');
if($nid==''){
ShowMsg("没选定要更改的业务记录!","-1");
exit();
}
$nids = explode('`',$nid);
$wh = '';
foreach($nids as $n){
if($wh=='') $wh = " where aid='$n' ";
else $wh .= " Or aid='$n' ";
}
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member_operation set sta=2 $wh ");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改指定的业务记录!",$ENV_GOBACK_URL);
exit();
}
/*----------------
function __UpRank()
会员升级
----------------*/
else if($dopost=="uprank")
{
CheckPurview('member_Edit');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$membertype = ereg_replace("[^0-9]","",$membertype);
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member set membertype='$membertype',uptype='0' where ID='$ID'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功升级一个会员!",$ENV_GOBACK_URL);
exit();
}
$dsql = new DedeSql(false);
$MemberTypes = "";
$dsql->SetQuery("Select rank,membername From #@__arcrank where rank>0");
$dsql->Execute();
$MemberTypes[0] = "普通会员";
while($row = $dsql->GetObject()){
$MemberTypes[$row->rank] = $row->membername;
}
$dsql->Close();
$options = "<select name='membertype' style='width:100'>\r\n";
foreach($MemberTypes as $k=>$v)
{
if($k!=$uptype) $options .= "<option value='$k'>$v</option>\r\n";
else $options .= "<option value='$k' selected>$v</option>\r\n";
}
$options .= "</select>\r\n";
$wintitle = "会员管理-会员升级";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::会员升级";
$win = new OxWindow();
$win->Init("member_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("会员升级:");
$win->AddItem("会员目前的等级:",$MemberTypes[$mtype]);
$win->AddItem("会员申请的等级:",$MemberTypes[$uptype]);
$win->AddItem("开通等级:",$options);
$winform = $win->GetWindow("ok");
$win->Display();
}
/*----------------
function __Recommend()
推荐会员
----------------*/
else if($dopost=="recommend")
{
CheckPurview('member_Edit');
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
if($matt==0){
$dsql->ExecuteNoneQuery("update #@__member set matt=1 where ID='$ID'");
$dsql->Close();
ShowMsg("成功设置一个会员推荐!",$ENV_GOBACK_URL);
exit();
}else{
$dsql->ExecuteNoneQuery("update #@__member set matt=0 where ID='$ID'");
$dsql->Close();
ShowMsg("成功取消一个会员推荐!",$ENV_GOBACK_URL);
exit();
}
}
/*----------------
function __AddMoney()
会员充值
----------------*/
else if($dopost=="addmoney")
{
CheckPurview('member_Edit');
if($fmdo=="yes")
{
$ID = ereg_replace("[^0-9]","",$ID);
$money = ereg_replace("[^0-9]","",$money);
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__member set money=money+$money where ID='$ID'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功给一个会员充值!",$ENV_GOBACK_URL);
exit();
}
if(empty($upmoney)) $upmoney = 500;
$wintitle = "会员管理-会员充值";
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::会员充值";
$win = new OxWindow();
$win->Init("member_do.php","js/blank.js","POST");
$win->AddHidden("fmdo","yes");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("ID",$ID);
$win->AddTitle("会员充值:");
$win->AddMsgItem("请输入充值点数:<input type='text' name='money' size='10' value='$upmoney'>",60);
$winform = $win->GetWindow("ok");
$win->Display();
}
/*----------------
function __EditUser()
更改会员
----------------*/
else if($dopost=="edituser")
{
CheckPurview('member_Edit');
$dsql = new DedeSql(false);
$uptime = GetMkTime($uptime);
$edpwd = '';
if($newpwd!=''){
$newpwd = GetEncodePwd($newpwd);
$edpwd = "pwd='$newpwd',";
}
$query1 = "update #@__member set
{$edpwd}
membertype = '$membertype',
uptime = '$uptime',
exptime = '$exptime',
money = '$money',
scores = '$scores',
email = '$email',
uname = '$uname',
sex = '$sex',
mybb = '$mybb',
spacename = '$spacename',
news = '$news'
where ID='$ID'";
$query2 = "update #@__member_perinfo set
uname = '$uname',
sex = '$sex',
birthday = '$birthday',
weight = '$weight',
height = '$height',
job = '$job',
province = '$province',
city = '$city',
myinfo = '$myinfo',
oicq = '$oicq',
tel = '$tel',
homepage = '$homepage',
fullinfo = '$fullinfo',
address = '$address'
where id='$ID'";
$dsql->ExecuteNoneQuery($query1);
$dsql->ExecuteNoneQuery($query2);
$dsql->Close();
ShowMsg("成功更改会员资料!",$ENV_GOBACK_URL);
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/member_do.php | PHP | asf20 | 7,210 |
<?php
$USEListStyle='pic';
$defaultPageSize = 10;
require_once(dirname(__FILE__)."/content_list.php");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/content_i_list.php | PHP | asf20 | 127 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('plus_投票模块');
if(empty($dopost)) $dopost = "";
//////////////////////////////////////////
if($dopost=="save")
{
//$ismore,$votename
$starttime = GetMkTime($starttime);
$endtime = GetMkTime($endtime);
$voteitems = "";
$j=0;
for($i=1;$i<=15;$i++)
{
if(!empty(${"voteitem".$i})){
$j++;
$voteitems .= "<v:note id=\\'$j\\' count=\\'0\\'>".${"voteitem".$i}."</v:note>\r\n";
}
}
$dsql = new DedeSql(false);
$inQuery = "
insert into #@__vote(votename,starttime,endtime,totalcount,ismore,votenote)
Values('$votename','$starttime','$endtime','0','$ismore','$voteitems');
";
$dsql->SetQuery($inQuery);
if(!$dsql->ExecuteNoneQuery())
{
$dsql->Close();
ShowMsg("增加投票失败,请检查数据是否非法!","-1");
exit();
}
$dsql->Close();
ShowMsg("成功增加一组投票!","vote_main.php");
exit();
}
$startDay = time();
$endDay = AddDay($startDay,30);
$startDay = GetDateTimeMk($startDay);
$endDay = GetDateTimeMk($endDay);
require_once(dirname(__FILE__)."/templets/vote_add.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/vote_add.php | PHP | asf20 | 1,153 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Log');
if(empty($dopost)){
ShowMsg("你没指定任何参数!","javascript:;");
exit();
}
//清空所有日志
if($dopost=="clear"){
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__log");
$dsql->Close();
ShowMsg("成功清空所有日志!","log_list.php");
exit();
}
else if($dopost=="del")
{
isset($_COOKIE['ENV_GOBACK_URL']) ? $bkurl =$_COOKIE['ENV_GOBACK_URL'] : $baurl="log_list.php";
$ids = explode('`',$ids);
$dquery = "";
foreach($ids as $id){
if($dquery=="") $dquery .= " lid='$id' ";
else $dquery .= " Or lid='$id' ";
}
if($dquery!="") $dquery = " where ".$dquery;
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Delete From #@__log $dquery");
$dsql->Close();
ShowMsg("成功删除指定的日志!",$bkurl);
exit();
}
else{
ShowMsg("无法识别你的请求!","javascript:;");
exit();
}
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/log_edit.php | PHP | asf20 | 988 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Operations');
require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
function GetMemberID($dsql,$mid){
if($mid==0) return '0';
$row = $dsql->GetOne("Select userid From #@__member where ID='$mid' ");
if(is_array($row)) return "<a href='member_view.php?ID={$mid}'>".$row['userid']."</a>";
else return '0';
}
function GetPType($tname){
if($tname=='card') return '点数卡';
else return '会员升级';
}
function GetSta($sta){
if($sta==0) return '未付款';
else if($sta==1) return '已付款';
else return '已完成';
}
if(empty($buyid)) $buyid = '';
$addsql = " where buyid like '%$buyid%' ";
if(isset($sta)){
$addsql .= " And sta='$sta' ";
}
$sql = "Select * From #@__member_operation $addsql order by aid desc";
$dlist = new DataList();
$dlist->Init();
$dlist->SetParameter("buyid",$buyid);
if(isset($sta)){
$dlist->SetParameter("sta",$sta);
}
$dlist->dsql->SetQuery("Select * From #@__moneycard_type ");
$dlist->dsql->Execute('ts');
while($rw = $dlist->dsql->GetArray('ts')){
$TypeNames[$rw['tid']] = $rw['pname'];
}
$dlist->SetSource($sql);
include(dirname(__FILE__)."/templets/member_operations.htm");
$dlist->Close();
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/member_operations.php | PHP | asf20 | 1,375 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Data');
//获取系统存在的表信息
$otherTables = Array();
$dedeSysTables = Array();
$channelTables = Array();
$dsql = new DedeSql(false);
$dsql->SetQuery("Select addtable From #@__channeltype");
$dsql->Execute();
while($row = $dsql->GetObject()){
$channelTables[] = $row->addtable;
}
$dsql->SetQuery("Show Tables");
$dsql->Execute('t');
while($row = $dsql->GetArray('t')){
if(ereg("^{$cfg_dbprefix}",$row[0])||in_array($row[0],$channelTables))
{ $dedeSysTables[] = $row[0]; }
else{ $otherTables[] = $row[0]; }
}
function TjCount($tbname,$dsql){
$row = $dsql->GetOne("Select count(*) as dd From $tbname");
return $row['dd'];
}
$mysql_version = $dsql->GetVersion();
$mysql_versions = explode(".",trim($mysql_version));
$mysql_version = $mysql_versions[0].".".$mysql_versions[1];
require_once(dirname(__FILE__)."/templets/sys_data.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/sys_data.php | PHP | asf20 | 984 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
require_once(DEDEADMIN."/../include/pub_dedetag.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
$aid = intval($aid);
$dsql = new DedeSql(false);
//读取归档信息
//------------------------------
$tables = GetChannelTable($dsql,$aid,'arc');
$arcQuery = "Select a.*,
arctype.typename, arctype.smalltypes,c.typename as channelname,r.membername as rankname,full.keywords as words
From `{$tables['maintable']}` a
left join #@__arctype arctype on arctype.ID = a.typeid
left join #@__channeltype c on c.ID=a.channel
left join #@__arcrank r on r.rank=a.arcrank
left join #@__full_search full on full.aid=a.ID
where a.ID='$aid' ";
$info = $dsql->GetOne($arcQuery);
$info['keywords'] = $info['words'];
if(!is_array($info)){
$dsql->Close();
ShowMsg("读取档案基本信息出错!","javascript:;");
exit();
}
$query = "Select * From #@__channeltype where ID='".$info['channel']."'";
$cInfos = $dsql->GetOne($query);
if(!is_array($cInfos)){
$dsql->Close();
ShowMsg("读取频道配置信息出错!","javascript:;");
exit();
}
$channelid = $info['channel'];
$addtable = $cInfos['addtable'];
$addQuery = "Select * From `{$cInfos['addtable']}` where aid='$aid'";
$addRow = $dsql->GetOne($addQuery,MYSQL_ASSOC);
$tags = GetTagFormLists($dsql,$aid);
foreach($addRow as $k=>$v){ if(!isset($info[$k])) $info[$k] = $v; }
//文章信息处理
$info['endtime'] = ($info['endtime']-$info['senddate'])/86400;
//小分类处理
if(!empty($info['smalltypes']))
{
$sql = "select * from #@__smalltypes where id in($info[smalltypes]);";
$dsql->SetQuery($sql);
$dsql->Execute();
$smalltypes = '';
while($smalltype = $dsql->GetArray())
{
$ifcheck ='';
if($smalltype['id'] == $info['smalltypeid']){ $ifcheck = 'selected'; }
$smalltypes .= '<option value="'.$smalltype['id'].'"'.$ifcheck.'>'.$smalltype['name']."</option>\n";
}
}
$body = $info["message"];
//////////////////////地区数据处理s/////////////////////////////
$sql = "select * from #@__area";
$dsql->SetQuery($sql);
$dsql->Execute();
$toparea = $subarea = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0){ $toparea[] = $sector; }
else{ $subarea[] = $sector; }
}
$areacache = "toparea=new Array();\n\n";
$areaidname = $areaid2name = '-不限-';
foreach($toparea as $topkey => $topsector)
{
if($topsector['id'] == $info['areaid'])
{
$areaidname = $topsector['name'];
}
$areacache .= "toparea[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
$areacache .= "\t".'subareas'.$topsector['id'].'=new Array();'."\n";
$arrCount = 0;
foreach($subarea as $subkey => $subsector)
{
if($subsector['id'] == $info['areaid2'])
{
$areaid2name = $subsector['name'];
}
if($subsector['reid'] == $topsector['id'])
{
$areacache .= "\t".'subareas'.$topsector['id'].'['.$arrCount.']="'.$subsector['id'].'~'.$subsector['name'].'";'."\n";
$arrCount++;
}
}
}
//echo $areacache;exit;
//////////////////////地区数据处理e/////////////////////////////
//////////////////////行业数据处理s/////////////////////////////
$sql = "select * from #@__sectors";
$dsql->SetQuery($sql);
$dsql->Execute();
$topsectors = $subsectors = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0)
{
$topsectors[] = $sector;
}else
{
$subsectors[] = $sector;
}
}
$sectorcache = "topsectors=new Array();\n\n";
$sectoridname = $sectorid2name = '-不限-';
foreach($topsectors as $topkey => $topsector)
{
if($topsector['id'] == $info['sectorid'])
{
$sectoridname = $topsector['name'];
}
$sectorcache .= "topsectors[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
$sectorcache .= "\t".'subsectors'.$topsector['id'].'=new Array();'."\n";
foreach($subsectors as $subkey => $subsector)
{
if($subsector['id'] == $info['sectorid2']){
$sectorid2name = $subsector['name'];
}
if($subsector['reid'] == $topsector['id'])
{
$sectorcache .= "\t".'subsectors'.$topsector['id'].'['.$subkey.']="'.$subsector['id'].'~'.$subsector['name'].'";'."\n";
}
}
}
//echo $sectorcache;exit;
//////////////////////行业数据处理e/////////////////////////////
if($info['adminid'] == 0)
{
$adminid = $cuserLogin->getUserID();
}else{
$adminid = $info['adminid'];
}
require_once(dirname(__FILE__)."/templets/info_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/info_edit.php | PHP | asf20 | 4,623 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('co_PlayNote');
require_once(dirname(__FILE__)."/../include/pub_collection.php");
if($totalnum==0)
{
ShowMsg("种子网址为零!","",1);
exit();
}
$dsql = new DedeSql(false);
//多线程模式初次设置
if(!isset($threadnum)) $threadnum = 0;
if(!isset($oldstart)) $oldstart = $startdd;
if(!isset($thethr)) $thethr = 0;
if(empty($islisten)) $islisten = 0;
if($threadnum>0)
{
$step = ceil($totalnum / $threadnum);
$j = 0;
for($i=1;$i<=$totalnum;$i++)
{
if($i%$step==0)
{
$j++;
$sdd = ($i-$step);
$surl = "co_gather_start_action.php?islisten=$islisten&thethr=$j&sptime=$sptime&nid=$nid&oldstart=$sdd&startdd=$sdd&totalnum=".($step * $j)."&pagesize=$pagesize";
echo "<iframe scrolling='no' name='thredfrm$j' frameborder='0' width='100%' height='200' src='$surl'></iframe>\r\n";
}
}
if($totalnum % $threadnum != 0)
{
$sdd = $j*$step;
$k = $j+1;
$surl = "co_gather_start_action.php?islisten=$islisten&thethr=$k&sptime=$sptime&nid=$nid&oldstart=$sdd&startdd=$sdd&totalnum=$totalnum&pagesize=$pagesize";
echo "<iframe scrolling='no' name='thredfrm$j' frameborder='0' width='100%' height='200' src='$surl'></iframe>\r\n";
}
exit();
}
if($totalnum > $startdd+$pagesize) $limitSql = " limit $startdd,$pagesize";
else $limitSql = " limit $startdd,".($totalnum - $startdd);
if($totalnum - $startdd < 1){
ShowMsg("完成当前下载任务!","javascript:;");
$dsql->Close();
exit();
}
$co = new DedeCollection();
$co->Init();
$co->LoadFromDB($nid);
$co->dsql->SetQuery("Update #@__conote set lasttime='".time()."' where nid=$nid");
$co->dsql->ExecuteNoneQuery();
$co->dsql->SetQuery("Select aid,url From #@__courl where nid=$nid $limitSql");
$co->dsql->Execute(99);
$tjnum = $startdd;
while($row = $co->dsql->GetObject(99))
{
$lrow = $co->dsql->GetOne("Select * From #@__co_listenurl where url like '".addslashes($row->url)."'");
if(is_array($lrow)){
if($islisten==0) continue;
}
else{
$inquery = "INSERT INTO #@__co_listenurl(nid,url) VALUES ('$nid', '".addslashes($row->url)."');";
$co->dsql->ExecuteNoneQuery($inquery);
}
$co->DownUrl($row->aid,$row->url);
$tjnum++;
if($sptime>0) sleep($sptime);
}
$co->Close();
if($totalnum-$oldstart!=0){
$tjlen = ceil( (($tjnum-$oldstart)/($totalnum-$oldstart)) * 100 );
$dvlen = $tjlen * 2;
$tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>";
$tjsta .= "<br/>完成线程 $thethr 的:$tjlen %,继续执行任务...";
}
if($tjnum < $totalnum){
ShowMsg($tjsta,"co_gather_start_action.php?islisten=$islisten&thethr=$thethr&sptime=$sptime&nid=$nid&oldstart=$oldstart&totalnum=$totalnum&startdd=".($startdd+$pagesize)."&pagesize=$pagesize","",500);
exit();
}else{
ShowMsg("完成当前下载任务!","javascript:;");
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_gather_start_action.php | PHP | asf20 | 3,012 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('temp_One');
if(empty($dopost)) $dopost = "";
if(empty($aid)) $aid = "";
$dsql = new DedeSql(false);
//////////////////////////////////////////
/*----------------------
function __saveedit();
-------------------*/
if($dopost=="saveedit")
{
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
$uptime = time();
$body = str_replace('"','\\"',$body);
$filename = ereg_replace("^/","",$nfilename);
//如果更改了文件名,删除旧文件
if($oldfilename!=$filename)
{
$oldfilename = $cfg_basedir.$cfg_cmspath."/".$oldfilename;
if(is_file($oldfilename)) unlink($oldfilename);
}
$inQuery = "
update #@__sgpage set
title='$title',
ismake='$ismake',
filename='$filename',
uptime='$uptime',
body='$body'
where aid='$aid';
";
$dsql->SetQuery($inQuery);
if(!$dsql->ExecuteNoneQuery())
{
$dsql->Close();
ShowMsg("更新页面数据时失败,请检查长相是否有问题!","-1");
exit();
}
$dsql->Close();
$filename = $cfg_basedir.$cfg_cmspath."/".$filename;
if($ismake==1){
$pv = new PartView();
$pv->SetTemplet(stripslashes($body),"string");
$pv->SaveToHtml($filename);
$pv->Close();
}
else{
$fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
fwrite($fp,stripslashes($body));
fclose($fp);
}
ShowMsg("成功更新一个页面!","templets_one.php");
exit();
}
/*----------------------
function __delete();
-------------------*/
else if($dopost=="delete")
{
$row = $dsql->GetOne("Select filename From #@__sgpage where aid='$aid'");
$filename = $cfg_basedir.$cfg_cmspath."/".$row['filename'];
$dsql->SetQuery("Delete From #@__sgpage where aid='$aid'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
if(is_file($filename)) unlink($filename);
ShowMsg("成功删除一个页面!","templets_one.php");
exit();
}
/*----------------------
function __make();
-------------------*/
else if($dopost=="make")
{
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
$dsql->SetQuery("update #@__sgpage set uptime='".time()."' where aid='$aid'");
$dsql->ExecuteNoneQuery();
$row = $dsql->GetOne("Select * From #@__sgpage where aid='$aid'");
$fileurl = $cfg_cmspath."/".$row['filename'];
$filename = $cfg_basedir.$cfg_cmspath."/".$row['filename'];
if($row['ismake']==1)
{
$pv = new PartView();
$pv->SetTemplet($row['body'],"string");
$pv->SaveToHtml($filename);
$pv->Close();
}
else
{
$fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
fwrite($fp,$row['body']);
fclose($fp);
}
$dsql->Close();
ShowMsg("成功更新一个页面!",$fileurl);
exit();
}
/*----------------------
function __makeAll();
-------------------*/
else if($dopost=="makeall")
{
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
$dsql->ExecuteNoneQuery("update #@__sgpage set uptime='".time()."'");
$row = $dsql->Execute('meoutside',"Select * From #@__sgpage ");
while($row = $dsql->GetArray('meoutside'))
{
$fileurl = $cfg_cmspath."/".$row['filename'];
$filename = $cfg_basedir.$cfg_cmspath."/".$row['filename'];
if($row['ismake']==1)
{
$pv = new PartView();
$pv->SetTemplet($row['body'],"string");
$pv->SaveToHtml($filename);
}
else
{
$fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
fwrite($fp,$row['body']);
fclose($fp);
}
}
$dsql->Close();
ShowMsg("成功更新所有页面!","templets_one.php");
exit();
}
$row = $dsql->GetOne("Select * From #@__sgpage where aid='$aid'");
require_once(dirname(__FILE__)."/templets/templets_one_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/templets_one_edit.php | PHP | asf20 | 3,944 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('co_NewRule');
require_once(dirname(__FILE__)."/../include/pub_datalist.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
$sql = "
Select
aid,rulename,etype,dtime
From #@__co_exrule
order by aid desc
";
$dlist = new DataList();
$dlist->Init();
$dlist->SetSource($sql);
$dlist->SetTemplet(dirname(__FILE__)."/templets/co_export_rule.htm");
$dlist->display();
$dlist->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_export_rule.php | PHP | asf20 | 565 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Type');
if(empty($dopost)) $dopost = "";
$dsql = new DedeSql(false);
//保存更改
//--------------------
if($dopost=="save")
{
$startID = 1;
$endID = $idend;
for(;$startID<=$endID;$startID++){
$query = '';
$tid = ${'ID_'.$startID};
$pname = ${'pname_'.$startID};
$money = ${'money_'.$startID};
$num = ${'num_'.$startID};
if(isset(${'check_'.$startID})){
if($pname!=''){
$query = "update #@__moneycard_type set pname='$pname',money='$money',num='$num' where tid='$tid'";
$dsql->ExecuteNoneQuery($query);
$query = "update #@__moneycard_record set money='$money',num='$num' where ctid='$tid' ; ";
$dsql->ExecuteNoneQuery($query);
}
}
else{
$query = "Delete From #@__moneycard_type where tid='$tid' ";
$dsql->ExecuteNoneQuery($query);
$query = "Delete From #@__moneycard_record where ctid='$tid' And isexp<>-1 ; ";
$dsql->ExecuteNoneQuery($query);
}
}
//增加新记录
if(isset($check_new) && $pname_new!=''){
$query = "Insert Into #@__moneycard_type(num,pname,money) Values('{$num_new}','{$pname_new}','{$money_new}');";
$dsql->ExecuteNoneQuery($query);
}
header("Content-Type: text/html; charset={$cfg_ver_lang}");
echo "<script> alert('成功更新点卡产品分类表!'); </script>";
}
require_once(dirname(__FILE__)."/templets/member_card_type.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/member_card_type.php | PHP | asf20 | 1,573 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('temp_Test');
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
$partcode = stripslashes($partcode);
if(empty($typeid)) $typeid = 0;
if(empty($showsource)) $showsource = "";
if($typeid>0) $pv = new PartView($typeid);
else $pv = new PartView();
$pv->SetTemplet($partcode,"string");
header("Content-Type: text/html; charset={$cfg_ver_lang}");
if($showsource==""||$showsource=="yes"){
echo "模板代码:";
echo "<span style='color:red;'><pre>".htmlspecialchars($partcode)."</pre></span>";
echo "结果:<hr size='1' width='100%'>";
}
$pv->Display();
$pv->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/tag_test_action.php | PHP | asf20 | 695 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_MakeHtml');
require_once(dirname(__FILE__)."/../include/inc_arclist_view.php");
/*
makehtml_list_action.php?
typeid=118
uptype=all
starttime=2007-01-16+15%3A24%3A05
maxpagesize=100
upnext=1
*/
if(!isset($upnext)) $upnext = 1;
if(empty($gotype)) $gotype = '';
if(empty($uptype)) $uptype = '';
if(empty($pageno)) $pageno=0;
if(empty($mkpage)) $mkpage = 1;
if(empty($typeid)) $typeid = 0;
if(empty($starttime)) $starttime = '';
if(empty($maxpagesize)) $maxpagesize = 50;
$adminID = $cuserLogin->getUserID();
header("Content-Type: text/html; charset={$cfg_ver_lang}");
$dsql = new DedeSql(false);
//普通生成
if($gotype=='')
{
if($upnext==1 || $typeid==0){
$tidss = TypeGetSunID($typeid,$dsql,"",0,true);
$idArray = explode(',',$tidss);
}else{
$idArray = array();
$idArray[] = $typeid;
}
}
//一键更新
else if($gotype=='mkall')
{
$mkcachefile = DEDEADMIN."/../data/mkall_cache_{$adminID}.php";
$idArray = array();
if(file_exists($mkcachefile)) include_once($mkcachefile);
}
$totalpage=count($idArray);
if(isset($idArray[$pageno])){
$tid = $idArray[$pageno];
}else{
if($gotype==''){
echo "完成所有文件创建!";
ClearAllLink();
exit();
}else if($gotype=='mkall')
{
ShowMsg("完成所有栏目列表更新,现在作最后数据优化!","makehtml_all.php?action=make&step=10");
ClearAllLink();
exit();
}
}
//更新数组所记录的栏目
if(!empty($tid))
{
if($uptype=='all'||$uptype=='') $lv = new ListView($tid);
else $lv = new ListView($tid,$starttime);
if($lv->TypeLink->TypeInfos['ispart']==0
&& $lv->TypeLink->TypeInfos['isdefault']!=-1)
{
$ntotalpage = $lv->TotalPage;
}else{
$ntotalpage = 1;
}
//如果栏目的文档太多,分多批次更新
if($ntotalpage<=$maxpagesize || $lv->TypeLink->TypeInfos['ispart']!=0
|| $lv->TypeLink->TypeInfos['isdefault']==-1)
{
$lv->MakeHtml();
$finishType = true;
}
else
{
$lv->MakeHtml($mkpage,$maxpagesize);
$finishType = false;
$mkpage = $mkpage + $maxpagesize;
if( $mkpage >= ($ntotalpage+1) ) $finishType = true;
}
}//!empty
$nextpage = $pageno+1;
if($nextpage >= $totalpage && $finishType)
{
if($gotype=='')
{
echo "<br>完成所有文件创建!";
ClearAllLink();
exit();
}else if($gotype=='mkall')
{
ShowMsg("完成所有栏目列表更新,现在作最后数据优化!","makehtml_all.php?action=make&step=10");
ClearAllLink();
exit();
}
}else
{
if($finishType){
$gourl = "makehtml_list_action.php?gotype={$gotype}&maxpagesize=$maxpagesize&typeid=$typeid&pageno=$nextpage&uptype=$uptype&starttime=".urlencode($starttime);
ClearAllLink();
ShowMsg("成功创建栏目:".$tid.",继续进行操作!",$gourl,0,100);
exit();
}else{
$gourl = "makehtml_list_action.php?gotype={$gotype}&mkpage=$mkpage&maxpagesize=$maxpagesize&typeid=$typeid&pageno=$pageno&uptype=$uptype&starttime=".urlencode($starttime);
ClearAllLink();
ShowMsg("栏目:".$tid.",继续进行操作...",$gourl,0,100);
exit();
}
}
?> | zyyhong | trunk/jiaju001/news/lic/makehtml_list_action.php | PHP | asf20 | 3,250 |
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/templets/makehtml_archives.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/makehtml_archives.php | PHP | asf20 | 214 |
<?php
@ob_start();
@set_time_limit(3600);
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Keyword');
header("Content-Type: text/html; charset={$cfg_ver_lang}");
echo "正在读取关键字数据库...<br/>\r\n";
flush();
$ws = "";
$wserr = "";
$wsnew = "";
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * from #@__keywords");
$dsql->Execute();
while($row = $dsql->GetObject())
{
if($row->sta==1)
$ws[$row->keyword] = 1;
else
$wserr[$row->keyword] = 1;
}
echo "完成关键字数据库的载入!<br/>\r\n";
flush();
echo "读取档案数据库,并对禁用的关键字和生字进行处理...<br/>\r\n";
flush();
$dsql->SetQuery("Select aid,keywords from #@__full_search");
$dsql->Execute();
while($row = $dsql->GetObject())
{
$keywords = explode(" ",trim($row->keywords));
$nerr = false;
$mykey = "";
if(is_array($keywords))
{
foreach($keywords as $v){
$v = trim($v);
if($v=="") continue;
if(isset($ws[$v])) $mykey .= $v." ";
else if(isset($wsnew[$v])){
$mykey .= $v." ";
$wsnew[$v]++;
}
else if(isset($wserr[$v])) $nerr = true;
else{
$mykey .= $v." ";
$wsnew[$v] = 1;
}
}
//如果关键字中有禁用的关键字,则更新文章的关键字
if($nerr)
{
$dsql->SetQuery("update #@__full_search set keywords='".addslashes($mykey)."' where aid='".$row->aid."' ");
$dsql->ExecuteNoneQuery();
}
}
}
echo "完成档案数据库的处理!<br/>\r\n";
flush();
if(is_array($wsnew))
{
echo "对关键字进行排序...<br/>\r\n";
flush();
arsort($wsnew);
echo "把关键字保存到数据库...<br/>\r\n";
flush();
foreach($wsnew as $k=>$v)
{
if(strlen($k)>20) continue;
$dsql->SetQuery("Insert Into #@__keywords(keyword,rank,sta,rpurl) Values('".addslashes($k)."','$v','1','')");
$dsql->Execute();
}
echo "完成关键字的导入!<br/>\r\n";
flush();
sleep(1);
}
else
{
echo "没发现任何新的关键字!<br/>\r\n";
flush();
sleep(1);
}
ClearAllLink();
ShowMsg("完成所有操作,现在转到关键字列表页!","article_keywords_main.php");
?> | zyyhong | trunk/jiaju001/news/lic/article_keywords_analyse.php | PHP | asf20 | 2,183 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
require_once(DEDEADMIN."/../include/pub_dedetag.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
$aid = intval($aid);
$dsql = new DedeSql(false);
//读取归档信息
//------------------------------
$tables = GetChannelTable($dsql,$aid,'arc');
$arcQuery = "Select c.typename as channelname,r.membername as rankname,a.* ,full.keywords as words
From `{$tables['maintable']}` a
left join #@__channeltype c on c.ID=a.channel
left join #@__arcrank r on r.rank=a.arcrank
left join #@__full_search full on full.aid=a.ID
where a.ID='$aid'";
$arcRow = $dsql->GetOne($arcQuery);
$arcRow['keywords'] = $arcRow['words'];
if(!is_array($arcRow)){
$dsql->Close();
ShowMsg("读取档案基本信息出错!","javascript:;");
exit();
}
$query = "Select * From #@__channeltype where ID='".$arcRow['channel']."'";
$cInfos = $dsql->GetOne($query);
if(!is_array($cInfos)){
$dsql->Close();
ShowMsg("读取频道配置信息出错!","javascript:;");
exit();
}
$channelid = $arcRow['channel'];
$addtable = $cInfos['addtable'];
$addRow = $dsql->GetOne("Select * From $addtable where aid='$aid'");
if(!is_array($addRow)){
$imgurls = "";
$pagestyle = 1;
$maxwidth = $cfg_album_width;
$irow = 4;
$icol = 4;
$isrm = 1;
}
else
{
$imgurls = $addRow["imgurls"];
$maxwidth = $addRow["maxwidth"];
$pagestyle = $addRow["pagestyle"];
$irow = $addRow["row"];
$icol = $addRow["col"];
$isrm = $addRow["isrm"];
$maxwidth = $addRow["maxwidth"];
}
$tags = GetTagFormLists($dsql,$aid);
require_once(dirname(__FILE__)."/templets/album_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/album_edit.php | PHP | asf20 | 1,785 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_plus');
if(empty($dopost)) $dopost = "";
if($dopost=="save"){
$plusname = str_replace("\\'","",$plusname);
$link = str_replace("\\'","",$link);
$target = str_replace("\\'","",$target);
$menustring = "<m:item name=\\'$plusname\\' link=\\'$link\\' rank=\\'plus_$plusname\\' target=\\'$target\\' />";
$dsql = new DedeSql(false);
$dsql->SetQuery("Insert Into #@__plus(plusname,menustring,writer,isshow,filelist) Values('$plusname','$menustring','$writer','1','$filelist');");
$dsql->Execute();
$dsql->Close();
ShowMsg("成功安装一个插件,请刷新导航菜单!","plus_main.php");
exit();
}
require_once(dirname(__FILE__)."/templets/plus_add.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/plus_add.php | PHP | asf20 | 777 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('plus_友情链接模块');
if(!empty($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL = $_COOKIE['ENV_GOBACK_URL'];
else $ENV_GOBACK_URL = friendlink_main.php;
if(empty($dopost)) $dopost = "";
if(isset($allid)){
$aids = explode(',',$allid);
if(count($aids)==1){
$ID = $aids[0];
$dopost = "delete";
}
}
if($dopost=="delete")
{
$dsql = new DedeSql(false);
$ID = ereg_replace("[^0-9]","",$ID);
$dsql->ExecuteNoneQuery("Delete From #@__flink where ID='$ID'");
$dsql->Close();
ShowMsg("成功删除一个链接!",$ENV_GOBACK_URL);
exit();
}
else if($dopost=="delall"){
if(isset($aids) && is_array($aids)){
$dsql = new DedeSql(false);
foreach($aids as $aid){
$aid = ereg_replace("[^0-9]","",$aid);
$dsql->ExecuteNoneQuery("Delete From #@__flink where ID='$aid'");
}
$dsql->Close();
ShowMsg("成功删除指定链接!",$ENV_GOBACK_URL);
exit();
}else{
ShowMsg("你没选定任何链接!",$ENV_GOBACK_URL);
exit();
}
}
else if($dopost=="saveedit")
{
$dsql = new DedeSql(false);
$ID = ereg_replace("[^0-9]","",$ID);
$query = "Update #@__flink set
sortrank='$sortrank',url='$url',webname='$webname',
logo='$logo',msg='$msg',
email='$email',typeid='$typeid',
ischeck='$ischeck' where ID='$ID'";
$dsql->SetQuery($query);
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改一个链接!",$ENV_GOBACK_URL);
exit();
}
$dsql = new DedeSql(false);
$myLink = $dsql->GetOne("Select #@__flink.*,#@__flinktype.typename From #@__flink left join #@__flinktype on #@__flink.typeid=#@__flinktype.ID where #@__flink.ID=$ID");
require_once(dirname(__FILE__)."/templets/friendlink_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/friendlink_edit.php | PHP | asf20 | 1,808 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
require_once(DEDEADMIN."/../include/pub_dedetag.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
$aid = intval($aid);
$dsql = new DedeSql(false);
$tables = GetChannelTable($dsql,$aid,'arc');
//读取归档信息
//------------------------------
$arcQuery = "Select c.typename as channelname,ar.membername as rankname,a.* ,full.keywords as words
From `{$tables['maintable']}` a
left join #@__channeltype c on c.ID=a.channel
left join #@__arcrank ar on ar.rank=a.arcrank
left join #@__full_search full on full.aid=a.ID
where a.ID='$aid'";
$addQuery = "Select * From `{$tables['addtable']}` where aid='$aid'";
$arcRow = $dsql->GetOne($arcQuery);
$arcRow['keywords'] = $arcRow['words'];
if(!is_array($arcRow)){
$dsql->Close();
ShowMsg("读取档案基本信息出错!","javascript:;");
exit();
}
$query = "Select * From #@__channeltype where ID='".$arcRow['channel']."'";
$cInfos = $dsql->GetOne($query);
if(!is_array($cInfos)){
$dsql->Close();
ShowMsg("读取频道配置信息出错!","javascript:;");
exit();
}
$channelid = $arcRow['channel'];
$addtable = $cInfos['addtable'];
$addQuery = "Select * From ".$cInfos['addtable']." where aid='$aid'";
$addRow = $dsql->GetOne($addQuery);
$tags = GetTagFormLists($dsql,$aid);
$newRowStart = 1;
$nForm = "";
if($addRow["softlinks"]!="")
{
$dtp = new DedeTagParse();
$dtp->LoadSource($addRow["softlinks"]);
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $ctag){
if($ctag->GetName()=="link"){
$nForm .= "
软件地址".$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'>
<br/>";
$newRowStart++;
}
}
}
$dtp->Clear();
}
require_once(dirname(__FILE__)."/templets/soft_edit.htm");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/soft_edit.php | PHP | asf20 | 2,176 |
<?php
error_reporting(0);
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typeunit_admin.php");
$userChannel = $cuserLogin->getUserChannel();
if(!isset($action)) $action = false;
if(!$action || $action=='info' || $action=='prompt'){
if(!isset($_POST['step'])){
include('./templets/code_main.htm');exit;
}else{
$lgpwd=md5($lgpwd);
$verify=md5("actionloginlguser{$lguser}lgpwd{$lgpwd}{$_SERVER[HTTP_USER_AGENT]}");
ObHeader("http://union.phpwind.com/index.php?action=login&lguser=$lguser&lgpwd=$lgpwd&verify=$verify");
}
}elseif($action=='key'){
if(!isset($cfg_siteid)||!$cfg_siteid){
$dsql = new DedeSql(false);
$rt = $dsql->GetOne("Select value From #@__sysconfig where varname='cfg_siteid'");
if(!$rt['value']){
$cfg_siteid = generatestr(16);
$dsql->ExecuteNoneQuery("Insert Into #@__sysconfig(info,varname,value) Values('PW营销系统密钥一','cfg_siteid','$cfg_siteid')");
$cfg_siteownerid = generatestr(18);
$dsql->ExecuteNoneQuery("Insert Into #@__sysconfig(info,varname,value) Values('PW营销系统密钥二','cfg_siteownerid','$cfg_siteownerid')");
$cfg_sitehash = '12'.SitStrCode(md5($cfg_siteid.$cfg_siteownerid),md5($cfg_siteownerid.$cfg_siteid));
$dsql->ExecuteNoneQuery("Insert Into #@__sysconfig(info,varname,value) Values('PW营销唯一识别码','cfg_sitehash','$cfg_sitehash')");
}
$dsql->SetQuery("Select varname,value From #@__sysconfig order by aid asc");
$dsql->Execute();
$configfile = dirname(__FILE__)."/../include/config_hand.php";
$configfile_bak = dirname(__FILE__)."/../include/config_hand_bak.php";
@copy($configfile,$configfile_bak) or die('读取文件权限出错,目录文件'.$configfile.'不可写!<a href="code_main.php">返回</a>');
$fp = @fopen($configfile,'w');
@flock($fp,3);
fwrite($fp,"<"."?php\r\n") or die('读取文件权限出错,目录文件'.$configfile.'不可写!<a href="code_main.php">返回</a>');
while($row = $dsql->GetArray()){
fwrite($fp,"\${$row['varname']} = '".str_replace("'","\\'",$row['value'])."';\r\n");
}
fwrite($fp,"?".">");
fclose($fp);
}
include('./templets/code_main.htm');exit;
}
function generatestr($len) {
mt_srand((double)microtime() * 1000000);
$keychars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ";
$maxlen = strlen($keychars)-1;
$str = '';
for ($i=0;$i<$len;$i++){
$str .= $keychars[mt_rand(0,$maxlen)];
}
return substr(md5($str.time().$_SERVER["HTTP_USER_AGENT"]),0,$len);
}
function SitStrCode($string,$key,$action='ENCODE'){
$string = $action == 'ENCODE' ? $string : base64_decode($string);
$len = strlen($key);
$code = '';
for($i=0; $i<strlen($string); $i++){
$k = $i % $len;
$code .= $string[$i] ^ $key[$k];
}
$code = $action == 'DECODE' ? $code : str_replace('=','',base64_encode($code));
return $code;
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/code_main.php | PHP | asf20 | 2,944 |
<?php
require_once(dirname(__FILE__)."/config.php");
@set_time_limit(1800);
if(empty($dopost)) $dopost = "";
if(empty($reset)) $reset = "";
header("Content-Type: text/html; charset={$cfg_ver_lang}");
//用户Action
if($dopost=="yes"){
if($reset=='yes'){
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Update #@__archives set templet='' where channel<>-1");
$dsql->Close();
echo "完成还原处理! Action has finish";
}else{
$dsql = new DedeSql(false);
if($autotype=='empty'){
$addquery = " And templet='' ";
}else if($autotype=='hand'){
if(!empty($startid)) $addquery .= " And ID>=$startid ";
if(!empty($endid)) $addquery .= " And ID<=$endid ";
}else{
$addquery = "";
}
$okquery = "Select ID From #@__archives where channel='$channeltype' $addquery ";
$dsql->SetQuery($okquery);
$dsql->Execute();
while($row = $dsql->GetArray()){
$temparticleok = addslashes(str_replace('{rand}',mt_rand($rndstart,$rndend),$temparticle));
$dsql->ExecuteNoneQuery("Update #@__archives set templet='$temparticleok' where ID='{$row['ID']}' ");
}
$dsql->Close();
echo "完成处理!";
}
exit();
}
//读取所有模型资料
$dsql = new DedeSql(false);
$dsql->SetQuery("select * from #@__channeltype where ID>-1 And isshow=1 order by ID");
$dsql->Execute();
while($row=$dsql->GetObject()){
$channelArray[$row->ID]['typename'] = $row->typename;
$channelArray[$row->ID]['nid'] = $row->nid;
}
require_once(dirname(__FILE__)."/templets/rnd_templets_main.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/rnd_templets_main.php | PHP | asf20 | 1,597 |
<?php
require_once(dirname(__FILE__)."/config.php");
if(!isset($nid)) $nid=0;
if(empty($_COOKIE["ENV_GOBACK_URL"])) $ENV_GOBACK_URL = "co_url.php";
else $ENV_GOBACK_URL = $_COOKIE["ENV_GOBACK_URL"];
//删除节点
/*
function co_delete()
*/
if($dopost=="delete")
{
CheckPurview('co_Del');
$dsql = new DedeSql(false);
$inQuery = "Delete From #@__courl where nid='$nid'";
$dsql->SetSql($inQuery);
$dsql->ExecuteNoneQuery();
$inQuery = "Delete From #@__conote where nid='$nid'";
$dsql->SetSql($inQuery);
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功删除一个节点!","co_main.php");
exit();
}
//清空采集内容
/*
function url_clear()
*/
else if($dopost=="clear")
{
CheckPurview('co_Del');
if(!isset($ids)) $ids="";
if(empty($ids))
{
$dsql = new DedeSql(false);
$inQuery = "Delete From #@__courl where nid='$nid'";
$dsql->ExecuteNoneQuery($inQuery);
$inQuery = "Delete From #@__co_listenurl where nid='$nid'";
$dsql->ExecuteNoneQuery($inQuery);
$dsql->Close();
ShowMsg("成功清空一个节点采集的内容!","co_main.php");
exit();
}
else
{
$dsql = new DedeSql(false);
$inQuery = "Delete From #@__courl where ";
$idsSql = "";
$ids = explode("`",$ids);
foreach($ids as $id) $idsSql .= "or aid='$id' ";
$idsSql = ereg_replace("^or ","",$idsSql);
$dsql->SetSql($inQuery.$idsSql);
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功删除指定的网址内容!",$ENV_GOBACK_URL);
exit();
}
}
//复制节点
/*
function co_copy()
*/
else if($dopost=="copy")
{
CheckPurview('co_AddNote');
if(empty($notename))
{
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
$wintitle = "采集管理-复制节点";
$wecome_info = "<a href='co_main.php'>采集管理</a>::复制节点";
$win = new OxWindow();
$win->Init("co_do.php","js/blank.js","POST");
$win->AddHidden("dopost",$dopost);
$win->AddHidden("nid",$nid);
$win->AddTitle("请输入新节点名称:");
$win->AddItem("新节点名称:","<input type='text' name='notename' value='' size='30'>");
$winform = $win->GetWindow("ok");
$win->Display();
exit();
}
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select * From #@__conote where nid='$nid'");
$inQuery = "
INSERT INTO #@__conote(typeid,gathername,arcsource,language,lasttime,savetime,noteinfo)
VALUES('".$row['typeid']."', '$notename','".addslashes($row['arcsource'])."', '".addslashes($row['language'])."',
'0','".time()."', '".addslashes($row['noteinfo'])."');
";
$rs = $dsql->ExecuteNoneQuery($inQuery);
$dsql->Close();
ShowMsg("成功复制一个节点!",$ENV_GOBACK_URL);
exit();
}
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_do.php | PHP | asf20 | 2,811 |
<?php
$cfg_IsCanView=true;
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_userlogin.php");
$cuserLogin = new userLogin();
$cuserLogin->exitUser();
header("location:index.php");
?> | zyyhong | trunk/jiaju001/news/lic/exit.php | PHP | asf20 | 250 |
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_List');
require_once(dirname(__FILE__)."/../include/pub_datalist.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
if(!isset($sex)) $sex = "0";
if(!isset($status)) $status = 0;
if($sex=="0") $sexform = "<option value='0'>性别</option>\r\n";
else $sexform = "<option value='$sex'>$sex</option>\r\n";
if(!isset($keyword)) $keyword = "";
else $keyword = trim($keyword);
if(empty($sortkey)) $sortkey = "ID";
else $sortkey = eregi_replace("[^a-z]","",$sortkey);
if($sortkey=="ID") $sortform = "<option value='ID'>ID/注册时间</option>\r\n";
else if($sortkey=="spaceshow") $sortform = "<option value='spaceshow'>空间访问量</option>\r\n";
else if($sortkey=="pageshow") $sortform = "<option value='pageshow'>文档总点击量</option>\r\n";
else $sortform = "<option value='logintime'>登录时间</option>\r\n";
$dsql = new DedeSql(false);
$whereSql = 'where type=0';
if($sex=="0") $whereSql .= " and sex like '%%' ";
else $whereSql .= " and sex like '$sex' ";
if($status == 1) $whereSql .= " and membertype=0";
if($keyword!=""){
$whereSql .= " And (userid like '%$keyword%' Or uname like '%$keyword%') ";
}
$attform = "";
if(!empty($att)){
if($att=="ad"){
$attform = "<option value='ad'>被推荐会员</option>\r\n";
$whereSql .= " And matt=1 ";
}
}
$MemberTypes = "";
$dsql->SetQuery("Select rank,membername From #@__arcrank where rank>0");
$dsql->Execute();
$MemberTypes[0] = '未审核会员';
while($row = $dsql->GetObject()){
$MemberTypes[$row->rank] = $row->membername;
}
$dsql->SetQuery("Select id,name From #@__area");
$dsql->Execute();
while($row = $dsql->GetObject()){
$Areas[$row->id] = $row->name;
}
function GetMemberName($rank)
{
global $MemberTypes;
if(isset($MemberTypes[$rank])){
return $MemberTypes[$rank];
}else{
return "";
}
}
function GetAreaName($e,$df)
{
global $Areas;
if(isset($Areas[$e])) return $Areas[$e];
else return $df;
}
function GetMAtt($m){
if($m<1) return "";
else return "<img src='img/adminuserico.gif' width='16' height='15'><font color='red'>(荐)</font>";
}
$sql = "select ID,userid,pwd,uname,sex,email,money,c1,c2,c3,matt,
logintime,loginip,membertype,scores,spaceshow,pageshow
From #@__member $whereSql order by $sortkey desc
";
$dlist = new DataList();
$dlist->Init();
$dlist->SetParameter("sex",$sex);
$dlist->SetParameter("status",$status);
$dlist->SetParameter("keyword",$keyword);
$dlist->SetSource($sql);
$dlist->SetTemplet(dirname(__FILE__)."/templets/member_main.htm");
$dlist->display();
$dlist->Close();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/member_main.php | PHP | asf20 | 2,764 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('co_EditNote');
$nid = ereg_replace("[^0-9]","",$nid);
if(empty($nid)){
ShowMsg("参数无效!","-1");
exit();
}
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select * From #@__conote where nid='$nid'");
$dsql->Close();
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
$wintitle = "导出采集规则";
$wecome_info = "<a href='co_main.php'><u>采集节点管理</u></a>::导出采集规则";
$win = new OxWindow();
$win->Init();
$win->AddTitle("以下为规则 [{$row['gathername']}] 的文本配置,你可以共享给你的朋友:");
$winform = $win->GetWindow("hand","<xmp style='color:#333333;background-color:#ffffff'>".$row['noteinfo']."</xmp>");
$win->Display();
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/co_export_corule.php | PHP | asf20 | 801 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('sys_MakeHtml');
$dsql = new DedeSql(false);
$cids = '';
$dsql->SetQuery("Select ID From `#@__channeltype` ");
$dsql->Execute();
while($row = $dsql->GetArray())
{
$cids .= ($cids=='' ? $row[0] : ','.$row[0]);
}
if($cids!='')
{
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__arctype` where NOT (channeltype in ($cids));");
if($rs>0){
$dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__arctype`;");
UpDateCatCache($dsql);
}
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__full_search` where NOT (channeltype in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__full_search`;");
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__archives` where NOT (channel in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archives`;");
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__archivesspec` where NOT (channel in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archivesspec`;");
}
ShowMsg("完成所有信息清理!","javascript:;");
ClearAllLink();
?> | zyyhong | trunk/jiaju001/news/lic/archives_clear.php | PHP | asf20 | 1,128 |
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('plus_文件管理器');
if(!isset($activepath)) $activepath=$cfg_cmspath;
$inpath = "";
$activepath = str_replace("..","",$activepath);
$activepath = ereg_replace("^/{1,}","/",$activepath);
if($activepath == "/") $activepath = "";
if($activepath == "") $inpath = $cfg_basedir;
else $inpath = $cfg_basedir.$activepath;
$activeurl = $activepath;
if(eregi($cfg_templets_dir,$activepath)) $istemplets = true;
else $istemplets = false;
require_once(dirname(__FILE__)."/templets/file_manage_main.htm");
ClearAllLink();
?>
| zyyhong | trunk/jiaju001/news/lic/file_manage_main.php | PHP | asf20 | 609 |
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: search.php 20900 2009-10-29 02:49:38Z tiger $
*/
define('NOROBOT', TRUE);
define('CURSCRIPT', 'search');
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_icons.php';
$discuz_action = 111;
$cachelife_time = 300; // Life span for cache of searching in specified range of time
$cachelife_text = 3600; // Life span for cache of text searching
$sdb = loadmultiserver('search');
$srchtype = empty($srchtype) ? '' : trim($srchtype);
$checkarray = array('posts' => '', 'trade' => '', 'qihoo' => '', 'threadsort' => '');
$searchid = isset($searchid) ? intval($searchid) : 0;
if($srchtype == 'trade' || $srchtype == 'threadsort' || $srchtype == 'qihoo') {
$checkarray[$srchtype] = 'checked';
} elseif($srchtype == 'title' || $srchtype == 'fulltext') {
$checkarray['posts'] = 'checked';
} else {
$srchtype = '';
$checkarray['posts'] = 'checked';
}
$keyword = isset($srchtxt) ? htmlspecialchars(trim($srchtxt)) : '';
$threadsorts = '';
if($srchtype == 'threadsort') {
$query = $db->query("SELECT * FROM {$tablepre}threadtypes WHERE special='1' ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$threadsorts .= '<option value="'.$type['typeid'].'" '.($type['typeid'] == intval($sortid) ? 'selected=selected' : '').'>'.$type['name'].'</option>';
}
}
$forumselect = forumselect('', '', '', TRUE);
if(!empty($srchfid) && !is_numeric($srchfid)) {
$forumselect = str_replace('<option value="'.$srchfid.'">', '<option value="'.$srchfid.'" selected="selected">', $forumselect);
}
$disabled = array();
$disabled['title'] = !$allowsearch ? 'disabled' : '';
$disabled['fulltext'] = $allowsearch != 2 ? 'disabled' : '';
if(!submitcheck('searchsubmit', 1)) {
include template('search');
} else {
if($srchtype == 'qihoo') {
require DISCUZ_ROOT.'./include/search_qihoo.inc.php';
exit();
} elseif(!$allowsearch) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif($srchtype == 'trade') {
require DISCUZ_ROOT.'./include/search_trade.inc.php';
exit;
} elseif($srchtype == 'threadsort' && $sortid) {
require DISCUZ_ROOT.'./include/search_sort.inc.php';
exit;
}
$orderby = in_array($orderby, array('dateline', 'replies', 'views')) ? $orderby : 'lastpost';
$ascdesc = isset($ascdesc) && $ascdesc == 'asc' ? 'asc' : 'desc';
if(!empty($searchid)) {
require_once DISCUZ_ROOT.'./include/misc.func.php';
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$index = $sdb->fetch_first("SELECT searchstring, keywords, threads, tids FROM {$tablepre}searchindex WHERE searchid='$searchid'");
if(!$index) {
showmessage('search_id_invalid');
}
$keyword = htmlspecialchars($index['keywords']);
$keyword = $keyword != '' ? str_replace('+', ' ', $keyword) : '';
$index['keywords'] = rawurlencode($index['keywords']);
$index['searchtype'] = preg_replace("/^([a-z]+)\|.*/", "\\1", $index['searchstring']);
$threadlist = array();
$query = $sdb->query("SELECT * FROM {$tablepre}threads WHERE tid IN ($index[tids]) AND displayorder>='0' ORDER BY $orderby $ascdesc LIMIT $start_limit, $tpp");
while($thread = $sdb->fetch_array($query)) {
$threadlist[] = procthread($thread);
}
$multipage = multi($index['threads'], $tpp, $page, "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes");
$url_forward = 'search.php?'.$_SERVER['QUERY_STRING'];
if($prompts['newbietask'] && $newbietaskid && $newbietasks[$newbietaskid]['scriptname'] == 'search'){
require_once DISCUZ_ROOT.'./include/task.func.php';
task_newbie_complete();
}
include template('search');
} else {
!($exempt & 2) && checklowerlimit($creditspolicy['search'], -1);
$srchuname = isset($srchuname) ? trim($srchuname) : '';
if($allowsearch == 2 && $srchtype == 'fulltext') {
periodscheck('searchbanperiods');
} elseif($srchtype != 'title') {
$srchtype = 'title';
}
$forumsarray = array();
if(!empty($srchfid)) {
foreach((is_array($srchfid) ? $srchfid : explode('_', $srchfid)) as $forum) {
if($forum = intval(trim($forum))) {
$forumsarray[] = $forum;
}
}
}
$fids = $comma = '';
foreach($_DCACHE['forums'] as $fid => $forum) {
if($forum['type'] != 'group' && (!$forum['viewperm'] && $readaccess) || ($forum['viewperm'] && forumperm($forum['viewperm']))) {
if(!$forumsarray || in_array($fid, $forumsarray)) {
$fids .= "$comma'$fid'";
$comma = ',';
}
}
}
if($threadplugins && $specialplugin) {
$specialpluginstr = implode("','", $specialplugin);
$special[] = 127;
} else {
$specialpluginstr = '';
}
$specials = $special ? implode(',', $special) : '';
$srchfilter = in_array($srchfilter, array('all', 'digest', 'top')) ? $srchfilter : 'all';
$searchstring = $srchtype.'|'.addslashes($srchtxt).'|'.intval($srchuid).'|'.$srchuname.'|'.addslashes($fids).'|'.intval($srchfrom).'|'.intval($before).'|'.$srchfilter.'|'.$specials.'|'.$specialpluginstr;
$searchindex = array('id' => 0, 'dateline' => '0');
$query = $sdb->query("SELECT searchid, dateline,
('$searchctrl'<>'0' AND ".(empty($discuz_uid) ? "useip='$onlineip'" : "uid='$discuz_uid'")." AND $timestamp-dateline<$searchctrl) AS flood,
(searchstring='$searchstring' AND expiration>'$timestamp') AS indexvalid
FROM {$tablepre}searchindex
WHERE ('$searchctrl'<>'0' AND ".(empty($discuz_uid) ? "useip='$onlineip'" : "uid='$discuz_uid'")." AND $timestamp-dateline<$searchctrl) OR (searchstring='$searchstring' AND expiration>'$timestamp')
ORDER BY flood");
while($index = $sdb->fetch_array($query)) {
if($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) {
$searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']);
break;
} elseif($adminid != '1' && $index['flood']) {
showmessage('search_ctrl', 'search.php');
}
}
if($searchindex['id']) {
$searchid = $searchindex['id'];
} else {
if(!$srchtxt && !$srchuid && !$srchuname && !$srchfrom && !in_array($srchfilter, array('digest', 'top')) && !is_array($special)) {
showmessage('search_invalid', 'search.php');
} elseif(isset($srchfid) && $srchfid != 'all' && !(is_array($srchfid) && in_array('all', $srchfid)) && empty($forumsarray)) {
showmessage('search_forum_invalid', 'search.php');
} elseif(!$fids) {
showmessage('group_nopermission', NULL, 'NOPERM');
}
if($adminid != '1' && $maxspm) {
if(($sdb->result_first("SELECT COUNT(*) FROM {$tablepre}searchindex WHERE dateline>'$timestamp'-60")) >= $maxspm) {
showmessage('search_toomany', 'search.php');
}
}
$digestltd = $srchfilter == 'digest' ? "t.digest>'0' AND" : '';
$topltd = $srchfilter == 'top' ? "AND t.displayorder>'0'" : "AND t.displayorder>='0'";
if(!empty($srchfrom) && empty($srchtxt) && empty($srchuid) && empty($srchuname)) {
$searchfrom = $before ? '<=' : '>=';
$searchfrom .= $timestamp - $srchfrom;
$sqlsrch = "FROM {$tablepre}threads t WHERE $digestltd t.fid IN ($fids) $topltd AND t.lastpost$searchfrom";
$expiration = $timestamp + $cachelife_time;
$keywords = '';
} else {
$sqlsrch = $srchtype == 'fulltext' ?
"FROM {$tablepre}posts p, {$tablepre}threads t WHERE $digestltd t.fid IN ($fids) $topltd AND p.tid=t.tid AND p.invisible='0'" :
"FROM {$tablepre}threads t WHERE $digestltd t.fid IN ($fids) $topltd";
if($srchuname) {
$srchuid = $comma = '';
$srchuname = str_replace('*', '%', addcslashes($srchuname, '%_'));
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username LIKE '".str_replace('_', '\_', $srchuname)."' LIMIT 50");
while($member = $db->fetch_array($query)) {
$srchuid .= "$comma'$member[uid]'";
$comma = ', ';
}
if(!$srchuid) {
$sqlsrch .= ' AND 0';
}
} elseif($srchuid) {
$srchuid = "'$srchuid'";
}
if($srchtxt) {
if(preg_match("(AND|\+|&|\s)", $srchtxt) && !preg_match("(OR|\|)", $srchtxt)) {
$andor = ' AND ';
$sqltxtsrch = '1';
$srchtxt = preg_replace("/( AND |&| )/is", "+", $srchtxt);
} else {
$andor = ' OR ';
$sqltxtsrch = '0';
$srchtxt = preg_replace("/( OR |\|)/is", "+", $srchtxt);
}
$srchtxt = str_replace('*', '%', addcslashes($srchtxt, '%_'));
foreach(explode('+', $srchtxt) as $text) {
$text = trim($text);
if($text) {
$sqltxtsrch .= $andor;
$sqltxtsrch .= $srchtype == 'fulltext' ? "(p.message LIKE '%".str_replace('_', '\_', $text)."%' OR p.subject LIKE '%$text%')" : "t.subject LIKE '%$text%'";
}
}
$sqlsrch .= " AND ($sqltxtsrch)";
}
if($srchuid) {
$sqlsrch .= ' AND '.($srchtype == 'fulltext' ? 'p' : 't').".authorid IN ($srchuid)";
}
if(!empty($srchfrom)) {
$searchfrom = ($before ? '<=' : '>=').($timestamp - $srchfrom);
$sqlsrch .= " AND t.lastpost$searchfrom";
}
if(!empty($specials)) {
$sqlsrch .= " AND special IN (".implodeids($special).")";
}
if(!empty($specialpluginstr)) {
$sqlsrch .= " AND iconid IN (".implodeids($specialplugin).")";
}
$keywords = str_replace('%', '+', $srchtxt).(trim($srchuname) ? '+'.str_replace('%', '+', $srchuname) : '');
$expiration = $timestamp + $cachelife_text;
}
$threads = $tids = 0;
$maxsearchresults = $maxsearchresults ? intval($maxsearchresults) : 500;
$query = $sdb->query("SELECT ".($srchtype == 'fulltext' ? 'DISTINCT' : '')." t.tid, t.closed, t.author $sqlsrch ORDER BY tid DESC LIMIT $maxsearchresults");
while($thread = $sdb->fetch_array($query)) {
if($thread['closed'] <= 1 && $thread['author']) {
$tids .= ','.$thread['tid'];
$threads++;
}
}
$db->free_result($query);
$db->query("INSERT INTO {$tablepre}searchindex (keywords, searchstring, useip, uid, dateline, expiration, threads, tids)
VALUES ('$keywords', '$searchstring', '$onlineip', '$discuz_uid', '$timestamp', '$expiration', '$threads', '$tids')");
$searchid = $db->insert_id();
!($exempt & 2) && updatecredits($discuz_uid, $creditspolicy['search'], -1);
}
showmessage('search_redirect', "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes");
}
}
?> | zyyhong | trunk/jiaju001/newbbs/bbs/search.php | PHP | asf20 | 10,779 |
<? if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('login');
0
|| checktplrefresh('D:\Website\newbbs\bbs\././templates/default/login.htm', 'D:\Website\newbbs\bbs\././templates/default/seccheck.htm', 1268614959, '1', './templates/default')
;?><? include template('header', '0', ''); if(!empty($message)) { ?>
<?=$ucsynlogin?>
<script type="text/javascript" reload="1">
<? if($message == 2) { ?>
hideWindow('login');
showWindow('register', '<?=$location?>');
<? } elseif($message == 1) { ?>
display('main_messaqge');
display('layer_login');
display('layer_message');
<? if($groupid == 8) { ?>
$('messageleft').innerHTML = '<p>欢迎您回来 <?=$usergroups?> <?=$discuz_user?></p><p>您的帐号处于非激活状态</p>';
$('messageright').innerHTML = '<a href="memcp.php">个人中心</a>';
setTimeout("window.location.href='memcp.php'", <?=$mrefreshtime?>);
<? } else { ?>
$('messageleft').innerHTML = '<p>欢迎您回来 <?=$usergroups?> <?=$discuz_user?></p>';
<? if(!empty($floatlogin)) { ?>
$('messageright').innerHTML = '<a href="javascript:;" onclick="location.reload()">如果页面没有响应,请点这里刷新</a>';
setTimeout('location.reload()', <?=$mrefreshtime?>);
<? } else { $dreferer = str_replace('&', '&', dreferer()); ?>$('messageright').innerHTML = '<a href="<?=$dreferer?>">现在将转入登录前页面</a>';
setTimeout("window.location.href='<?=$dreferer?>'", <?=$mrefreshtime?>);
<? } } if($_DCACHE['settings']['frameon'] && $_DCOOKIE['frameon'] == 'yes') { ?>
if(top != self) {
parent.leftmenu.location.reload();
}
<? } } ?>
</script>
<? } else { if(empty($infloat)) { ?>
<div id="nav"><a href="<?=$indexname?>"><?=$bbname?></a> <?=$navigation?></div>
<div id="wrap" class="wrap s_clear">
<div class="main"><div class="content nofloat">
<? } ?>
<div class="fcontent" id="main_messaqge">
<div id="layer_login">
<h3 class="float_ctrl">
<em id="returnmessage">用户登录</em>
<span><? if(!empty($infloat)) { ?><a href="javascript:;" class="float_close" onclick="hideWindow('login')" title="关闭">关闭</a><? } ?></span>
</h3>
<div class="postbox">
<form method="post" name="login" id="loginform" class="s_clear" onsubmit="<? if($pwdsafety) { ?>pwmd5('password3');<? } ?>pwdclear = 1;ajaxpost('loginform', 'returnmessage', 'returnmessage', 'onerror');return false;" action="logging.php?action=login&loginsubmit=yes<? if(!empty($infloat)) { ?>&floatlogin=yes<? } ?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
<input type="hidden" name="referer" value="<?=$referer?>" />
<div class="loginform nolabelform">
<div class="float_typeid selectinput" id="account">
<select name="loginfield" style="float:left;width:50px;" id="loginfield">
<option value="username">用户名</option>
<option value="uid">UID</option>
<option value="email">Email</option>
</select>
<input type="text" name="username" autocomplete="off" size="36" class="txt" tabindex="1" value="<?=$username?>" />
</div>
<p class="selectinput loginpsw">
<label for="password3">密 码 :</label>
<input type="password" id="password3" name="password" onfocus="clearpwd()" onkeypress="detectCapsLock(event, this)" size="36" class="txt" tabindex="1" />
</p>
<div id="seccodelayer"><? if($secqaacheck || $seccodecheck) { if($secqaacheck) { ?>
<input name="secanswer" id="secanswer" type="text" autocomplete="off" style="width:50px" value="验证问答" class="txt" href="ajax.php?action=updatesecqaa" tabindex="1">
<span id="checksecanswer"><img src="images/common/none.gif" width="16" height="16"></span>
<? } if($seccodecheck) { ?>
<input name="seccodeverify" id="seccodeverify_<?=CURSCRIPT?>" type="text" autocomplete="off" style="width:50px" value="验证码" class="txt" href="ajax.php?action=updateseccode" tabindex="1">
<a href="javascript:;" onclick="updateseccode();doane(event);">换一个</a>
<span id="checkseccodeverify_<?=CURSCRIPT?>"><img src="images/common/none.gif" width="16" height="16"></span>
<? } ?>
<script type="text/javascript" reload="1">
var profile_seccode_invalid = '验证码输入错误,请重新填写。';
var profile_secanswer_invalid = '验证问答回答错误,请重新填写。';
var lastseccode = lastsecanswer = secfocus ='';
var secanswerObj = $('secanswer');
var seccodeObj = $('seccodeverify_<?=CURSCRIPT?>');
var secstatus = {'secanswer':0,'seccodeverify_<?=CURSCRIPT?>':0};
if(secanswerObj) {
secanswerObj.onclick = secanswerObj.onfocus = showIdentifying;
secanswerObj.onblur = function(e) {if(!secfocus) $('secanswer_menu').style.display='none';checksecanswer();doane(e);};
}
if(seccodeObj) {
seccodeObj.onclick = seccodeObj.onfocus = showIdentifying;
seccodeObj.onblur = function(e) {if(!secfocus) $('seccodeverify_<?=CURSCRIPT?>_menu').style.display='none';checkseccode();doane(e);};
}
function showIdentifying(e) {
var obj = BROWSER.ie ? event.srcElement : e.target;
if(!$(obj.id + '_menu')) {
obj.value = '';
ajaxmenu($(obj.id), 0, 1, 3, '12', function() {
secstatus[obj.id] = 1;
$(obj.id + '_menu').onmouseover = function() { secfocus = 1; }
$(obj.id + '_menu').onmouseout = function() { secfocus = '';$(obj.id).focus(); }
});
} else if(secstatus[obj.id] == 1) {
$(obj.id + '_menu').style.display = '';
}
obj.unselectable = 'off';
obj.focus();
doane(e);
}
function updateseccode(op) {
if(isUndefined(op)) {
ajaxget('ajax.php?action=updateseccode', seccodeObj.id + '_menu', 'ajaxwaitid', '', '', '$(seccodeObj.id + \'_menu\').style.display = \'\'');
} else {
window.document.seccodeplayer.SetVariable("isPlay", "1");
}
seccodeObj.focus();
}
function checkseccode() {
var seccodeverify = seccodeObj.value;
if(seccodeverify == lastseccode) {
return;
} else {
lastseccode = seccodeverify;
}
var cs = $('checkseccodeverify_<?=CURSCRIPT?>');
<? if($seccodedata['type'] != 1) { ?>
if(!(/[0-9A-Za-z]{4}/.test(seccodeverify))) {
warning(cs, profile_seccode_invalid);
return;
}
<? } else { ?>
if(seccodeverify.length != 2) {
warning(cs, profile_seccode_invalid);
return;
}
<? } ?>
ajaxresponse('checkseccodeverify_<?=CURSCRIPT?>', 'action=checkseccode&seccodeverify=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(seccodeverify) : seccodeverify));
}
function checksecanswer() {
var secanswer = secanswerObj.value;
if(secanswer == lastsecanswer) {
return;
} else {
lastsecanswer = secanswer;
}
ajaxresponse('checksecanswer', 'action=checksecanswer&secanswer=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(secanswer) : secanswer));
}
function ajaxresponse(objname, data) {
var x = new Ajax('XML', objname);
x.get('ajax.php?inajax=1&' + data, function(s){
var obj = $(objname);
if(s.substr(0, 7) == 'succeed') {
obj.style.display = '';
obj.innerHTML = '<img src="<?=IMGDIR?>/check_right.gif" width="16" height="16" />';
obj.className = "warning";
} else {
warning(obj, s);
}
});
}
function warning(obj, msg) {
if((ton = obj.id.substr(5, obj.id.length)) != 'password2') {
$(ton).select();
}
obj.style.display = '';
obj.innerHTML = '<img src="<?=IMGDIR?>/check_error.gif" width="16" height="16" />';
obj.className = "warning";
}
</script><? } ?></div>
<div class="float_typeid selecttype">
<select id="questionid" name="questionid" change="if($('questionid').value > 0) {$('answer').style.display='';} else {$('answer').style.display='none';}">
<option value="0">安全提问</option>
<option value="1">母亲的名字</option>
<option value="2">爷爷的名字</option>
<option value="3">父亲出生的城市</option>
<option value="4">您其中一位老师的名字</option>
<option value="5">您个人计算机的型号</option>
<option value="6">您最喜欢的餐馆名称</option>
<option value="7">驾驶执照的最后四位数字</option>
</select>
</div>
<p><input type="text" name="answer" id="answer" style="display:none" autocomplete="off" size="36" class="txt" tabindex="1" /></p>
</div>
<div class="logininfo multinfo">
<h4>没有帐号?<a href="<?=$regname?>" onclick="hideWindow('login');showWindow('register', this.href);return false;" title="注册帐号"><?=$reglinkname?></a></h4>
<p><a href="javascript:;" onclick="display('layer_login');display('layer_lostpw');" title="找回密码">找回密码</a></p>
<p><a href="javascript:;" onclick="ajaxget('member.php?action=clearcookies&formhash=<?=FORMHASH?>', 'returnmessage', 'returnmessage');return false;" title="清除痕迹">清除痕迹</a></p>
</div>
<p class="fsubmit s_clear">
<? if($sitemessage['login']) { ?><a href="javascript:;" id="custominfo_login" class="right"><img src="<?=IMGDIR?>/info.gif" alt="帮助" /></a><? } ?>
<button class="submit" type="submit" name="loginsubmit" value="true" tabindex="1">登录</button>
<input type="checkbox" class="checkbox" name="cookietime" id="cookietime" tabindex="1" value="2592000" <?=$cookietimecheck?> /> <label for="cookietime">记住我的登录状态</label>
</p>
</form>
</div>
</div>
<div id="layer_lostpw" style="display: none;">
<h3 class="float_ctrl">
<em id="returnmessage3">找回密码</em>
<span><? if(!empty($infloat)) { ?><a href="javascript:;" class="float_close" onclick="hideWindow('login')" title="关闭">关闭</a><? } ?></span>
</h3>
<div class="postbox">
<form method="post" id="lostpwform" class="s_clear" onsubmit="ajaxpost('lostpwform', 'returnmessage3', 'returnmessage3', 'onerror');return false;" action="member.php?action=lostpasswd&lostpwsubmit=yes&infloat=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
<input type="hidden" name="handlekey" value="lostpwform" />
<div class="loginform">
<label><em>用户名:</em><input type="text" name="username" size="25" value="" tabindex="1" class="txt" /></label>
<label><em>Email:</em><input type="text" name="email" size="25" value="" tabindex="1" class="txt" /></label>
</div>
<div class="logininfo multinfo">
<h4>没有帐号?<a href="<?=$regname?>" onclick="hideWindow('login');showWindow('register', this.href);return false;" title="注册帐号"><?=$reglinkname?></a></h4>
<p><a href="javascript:;" onclick="display('layer_login');display('layer_lostpw');">返回登录</a></p>
</div>
<p class="fsubmit s_clear">
<em> </em>
<button class="submit" type="submit" name="lostpwsubmit" value="true" tabindex="100">提交</button>
</p>
</form>
</div>
</div>
</div>
<div id="layer_message" class="fcontent alert_win" style="display: none;">
<h3 class="float_ctrl">
<em>用户登录</em>
<span><? if(!empty($infloat)) { ?><a href="javascript:;" class="float_close" onclick="hideWindow('login')" title="关闭">关闭</a><? } ?></span>
</h3>
<hr class="shadowline" />
<div class="postbox"><div class="alert_right">
<div id="messageleft"></div>
<p class="alert_btnleft" id="messageright"></p>
</div>
</div>
<script src="<?=$jspath?>md5.js?<?=VERHASH?>" type="text/javascript" reload="1"></script>
<script type="text/javascript" reload="1">
var pwdclear = 0;
function initinput_login() {
document.body.focus();
$('loginform').username.focus();
simulateSelect('loginfield');
simulateSelect('questionid');
}
if(BROWSER.ie && BROWSER.ie < 7) {
setTimeout('initinput_login()', 500);
} else {
initinput_login();
}
<? if($sitemessage['login']) { ?>
showPrompt('custominfo_login', 'click', '<? echo trim($sitemessage['login'][array_rand($sitemessage['login'])]); ?>', <?=$sitemessage['time']?>);
<? } if($pwdsafety) { ?>
var pwmd5log = new Array();
function pwmd5() {
numargs = pwmd5.arguments.length;
for(var i = 0; i < numargs; i++) {
if(!pwmd5log[pwmd5.arguments[i]] || $(pwmd5.arguments[i]).value.length != 32) {
pwmd5log[pwmd5.arguments[i]] = $(pwmd5.arguments[i]).value = hex_md5($(pwmd5.arguments[i]).value);
}
}
}
<? } ?>
function clearpwd() {
if(pwdclear) {
$('password3').value = '';
}
pwdclear = 0;
}
function messagehandle_lostpwform(key) {
if(key == 141) {
$('messageleft').innerHTML = '<p>取回密码的方法发送到您的信箱中,请在 3 天之内到论坛修改您的密码。</p>';
$('messageright').innerHTML = '<a href="javascript:;" onclick="hideMenu(\'fwin_login\', \'win\')">关闭</a>';
}
}
</script>
<? } updatesession(); if(empty($infloat)) { ?>
</div></div>
</div>
<? } include template('footer', '0', ''); ?> | zyyhong | trunk/jiaju001/newbbs/bbs/forumdata/templates/1_1_login.tpl.php | PHP | asf20 | 12,427 |
<? if(!defined('IN_DISCUZ')) exit('Access Denied'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<title><?=$navtitle?> <?=$bbname?> <?=$seotitle?> - Powered by Discuz!</title>
<?=$seohead?>
<meta name="keywords" content="<?=$metakeywords?><?=$seokeywords?>" />
<meta name="description" content="<?=$metadescription?> <?=$bbname?> <?=$seodescription?> - Discuz! Board" />
<meta name="generator" content="Discuz! <?=$version?>" />
<meta name="author" content="Discuz! Team and Comsenz UI Team" />
<meta name="copyright" content="2001-2009 Comsenz Inc." />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<link rel="archives" title="<?=$bbname?>" href="<?=$boardurl?>archiver/" />
<?=$rsshead?>
<?=$extrahead?><link rel="stylesheet" type="text/css" href="forumdata/cache/style_<?=STYLEID?>_common.css?<?=VERHASH?>" /><link rel="stylesheet" type="text/css" href="forumdata/cache/scriptstyle_<?=STYLEID?>_<?=CURSCRIPT?>.css?<?=VERHASH?>" />
<? if($forum['ismoderator']) { ?>
<link href="forumdata/cache/style_1_moderator.css?mpd" rel="stylesheet" type="text/css" />
<? } ?><script type="text/javascript">var STYLEID = '<?=STYLEID?>', IMGDIR = '<?=IMGDIR?>', VERHASH = '<?=VERHASH?>', charset = '<?=$charset?>', discuz_uid = <?=$discuz_uid?>, cookiedomain = '<?=$cookiedomain?>', cookiepath = '<?=$cookiepath?>', attackevasive = '<?=$attackevasive?>', disallowfloat = '<?=$disallowfloat?>', creditnotice = '<? if($creditnotice) { ?><?=$creditnames?><? } ?>', <? if(in_array(CURSCRIPT, array('viewthread', 'forumdisplay'))) { ?>gid = parseInt('<?=$thisgid?>')<? } elseif(CURSCRIPT == 'index') { ?>gid = parseInt('<?=$gid?>')<? } else { ?>gid = 0<? } ?>, fid = parseInt('<?=$fid?>'), tid = parseInt('<?=$tid?>')</script>
<script src="<?=$jspath?>common.js?<?=VERHASH?>" type="text/javascript"></script>
</head>
<body id="<?=CURSCRIPT?>" onkeydown="if(event.keyCode==27) return false;">
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<div id="header">
<div class="wrap s_clear">
<h2><a href="<?=$indexname?>" title="<?=$bbname?>"><?=BOARDLOGO?></a></h2>
<div id="umenu">
<? if($discuz_uid) { ?>
<cite><a href="space.php?uid=<?=$discuz_uid?>" class="noborder"><?=$discuz_userss?></a><? if($allowinvisible) { ?><span id="loginstatus"><? if(!empty($invisible)) { ?><a href="member.php?action=switchstatus" onclick="ajaxget(this.href, 'loginstatus');doane(event);">隐身</a><? } else { ?><a href="member.php?action=switchstatus" title="我要隐身" onclick="ajaxget(this.href, 'loginstatus');doane(event);">在线</a><? } ?></span><? } ?></cite>
<span class="pipe">|</span>
<? if($ucappopen['UCHOME']) { ?>
<a href="<?=$uchomeurl?>/space.php?uid=<?=$discuz_uid?>" target="_blank">空间</a>
<? } elseif($ucappopen['XSPACE']) { ?>
<a href="<?=$xspaceurl?>/?uid-<?=$discuz_uid?>" target="_blank">空间</a>
<? } ?>
<a id="myprompt" href="notice.php" <? if($prompt) { ?>class="new" onmouseover="showMenu({'ctrlid':this.id})"<? } ?>>提醒</a>
<span id="myprompt_check"></span>
<a href="pm.php" id="pm_ntc" target="_blank">短消息</a>
<? if($taskon) { ?>
<a id="task_ntc" <? if($doingtask) { ?>href="task.php?item=doing" class="new" title="您有未完成的任务"<? } else { ?>href="task.php"<? } ?> target="_blank">论坛任务</a>
<? } ?>
<span class="pipe">|</span>
<a href="memcp.php">个人中心</a>
<? if($discuz_uid && $adminid > 1) { ?><a href="modcp.php?fid=<?=$fid?>" target="_blank">管理面板</a><? } if($discuz_uid && $adminid == 1) { ?><a href="admincp.php" target="_blank">管理中心</a><? } ?>
<a href="logging.php?action=logout&formhash=<?=FORMHASH?>">退出</a>
<? } elseif(!empty($_DCOOKIE['loginuser'])) { ?>
<cite><a id="loginuser" class="noborder"><?=$_DCOOKIE['loginuser']?></a></cite>
<a href="logging.php?action=login" onclick="showWindow('login', this.href);return false;">激活</a>
<a href="logging.php?action=logout&formhash=<?=FORMHASH?>">退出</a>
<? } else { ?>
<a href="<?=$regname?>" onclick="showWindow('register', this.href);return false;" class="noborder"><?=$reglinkname?></a>
<a href="logging.php?action=login" onclick="showWindow('login', this.href);return false;">登录</a>
<? } ?>
</div>
<div id="ad_headerbanner"><? if($admode && !empty($advlist['headerbanner'])) { ?><?=$advlist['headerbanner']?><? } ?></div>
<div id="menu">
<ul>
<? if($_DCACHE['settings']['frameon'] > 0) { ?>
<li>
<span class="frameswitch">
<script type="text/javascript">
if(top == self) {
<? if(($_DCACHE['settings']['frameon'] == 2 && !defined('CACHE_FILE') && in_array(CURSCRIPT, array('index', 'forumdisplay', 'viewthread')) && (($_DCOOKIE['frameon'] == 'yes' && $_GET['frameon'] != 'no') || (empty($_DCOOKIE['frameon']) && empty($_GET['frameon']))))) { ?>
top.location = 'frame.php?frameon=yes&referer='+escape(self.location);
<? } ?>
document.write('<a href="frame.php?frameon=yes" target="_top" class="frameon">分栏模式<\/a>');
} else {
document.write('<a href="frame.php?frameon=no" target="_top" class="frameoff">平板模式<\/a>');
}
</script>
</span>
</li>
<? } if(is_array($navs)) { foreach($navs as $id => $nav) { if($id == 3) { if(!empty($plugins['jsmenu'])) { ?>
<?=$nav['nav']?>
<? } if(!empty($plugins['links'])) { if(is_array($plugins['links'])) { foreach($plugins['links'] as $module) { if(!$module['adminid'] || ($module['adminid'] && $adminid > 0 && $module['adminid'] >= $adminid)) { ?><li><?=$module['url']?></li><? } } } } } else { if(!$nav['level'] || ($nav['level'] == 1 && $discuz_uid) || ($nav['level'] == 2 && $adminid > 0) || ($nav['level'] == 3 && $adminid == 1)) { ?><?=$nav['nav']?><? } } } } if(in_array($BASEFILENAME, $navmns)) { $mnid = $BASEFILENAME; } elseif($navmngs[$BASEFILENAME]) { if(is_array($navmngs[$BASEFILENAME])) { foreach($navmngs[$BASEFILENAME] as $navmng) { if($navmng['0'] == array_intersect_assoc($navmng['0'], $_GET)) { $mnid = $navmng['1']; } } } } ?>
</ul>
<script type="text/javascript">
var currentMenu = $('mn_<?=$mnid?>') ? $('mn_<?=$mnid?>') : $('mn_<?=$navmns['0']?>');
currentMenu.parentNode.className = 'current';
</script>
</div>
<? if(!empty($stylejumpstatus)) { ?>
<script type="text/javascript">
function setstyle(styleid) {
str = unescape('<? echo str_replace("'", "\\'", urlencode($_SERVER['QUERY_STRING'])); ?>');
str = str.replace(/(^|&)styleid=\d+/ig, '');
str = (str != '' ? str + '&' : '') + 'styleid=' + styleid;
location.href = '<?=$BASESCRIPT?>?' + str;
}
</script>
<ul id="style_switch"><? if(is_array($styles)) { foreach($styles as $id => $stylename) { ?><li<? if($id == STYLEID) { ?> class="current"<? } ?>><a href="###" onclick="setstyle(<?=$id?>)" title="<?=$stylename?>" style="background: <?=$styleicons[$id]?>;"><?=$stylename?></a></li><? } } ?></ul>
<? } ?>
</div>
<div id="myprompt_menu" style="display:none" class="promptmenu">
<div class="promptcontent">
<ul class="s_clear"><? if(is_array($prompts)) { foreach($prompts as $promptkey => $promptdata) { if($promptkey) { ?><li<? if(!$promptdata['new']) { ?> style="display:none"<? } ?>><a id="prompt_<?=$promptkey?>" href="<? if($promptdata['script']) { ?><?=$promptdata['script']?><? } else { ?>notice.php?filter=<?=$promptkey?><? } ?>" target="_blank"><?=$promptdata['name']?> (<?=$promptdata['new']?>)</a></li><? } } } ?></ul>
</div>
</div>
</div>
<?=$pluginhooks['global_header']?> | zyyhong | trunk/jiaju001/newbbs/bbs/forumdata/templates/1_1_header_notice.tpl.php | PHP | asf20 | 7,689 |
<? if(!defined('IN_DISCUZ')) exit('Access Denied'); funcstat(); stat_code(); $s = ob_get_contents(); ob_end_clean(); $s = preg_replace("/([\x01-\x08\x0b-\x0c\x0e-\x1f])+/", ' ', $s); $s = str_replace(array(chr(0), ']]>'), array(' ', ']]>'), $s); ?><?=$s?>
<? if($prompts['newbietask'] && $newbietasks) { include template('task_newbie_js', '0', ''); } ?>
]]></root><? exit; ?> | zyyhong | trunk/jiaju001/newbbs/bbs/forumdata/templates/1_1_footer_ajax.tpl.php | PHP | asf20 | 380 |