PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/e/class/qinfofun.php

https://github.com/westeast/xwdede
PHP | 1239 lines | 1107 code | 25 blank | 107 comment | 164 complexity | 8ce932051b083de64245e40149320be7 MD5 | raw file
  1. <?php
  2. //新用户投稿验证
  3. function qCheckNewMemberAddInfo($registertime){
  4. global $user_register,$public_r;
  5. if(empty($public_r['newaddinfotime']))
  6. {
  7. return '';
  8. }
  9. if(empty($user_register))
  10. {
  11. $registertime=to_time($registertime);
  12. }
  13. if(time()-$registertime<=$public_r['newaddinfotime']*60)
  14. {
  15. printerror('NewMemberAddInfoError','',1);
  16. }
  17. }
  18. //屏蔽字符
  19. function qCheckInfoCloseWord($mid,$add,$closewordsf,$closewords){
  20. if(empty($closewordsf)||$closewordsf=='|'||empty($closewords)||$closewords=='|')
  21. {
  22. return '';
  23. }
  24. $fr=explode('|',$closewordsf);
  25. $count=count($fr);
  26. $r=explode('|',$closewords);
  27. $countr=count($r);
  28. for($i=0;$i<$count;$i++)
  29. {
  30. if(empty($fr[$i]))
  31. {
  32. continue;
  33. }
  34. for($j=0;$j<$countr;$j++)
  35. {
  36. if($r[$j]&&stristr($add[$fr[$i]],$r[$j]))
  37. {
  38. $GLOBALS['msgclosewords']=$r[$j];
  39. printerror("HaveCloseWords","history.go(-1)",1);
  40. }
  41. }
  42. }
  43. }
  44. //提交字段值的处理
  45. function DoqValue($mid,$f,$val){
  46. global $public_r,$emod_r;
  47. $val=RepPhpAspJspcodeText($val);
  48. if(strstr($emod_r[$mid]['editorf'],','.$f.','))//编辑器
  49. {
  50. $val=ClearNewsBadCode($val);
  51. }
  52. else
  53. {
  54. $val=doehtmlstr($val);//替换html
  55. if(!strstr($emod_r[$mid]['tobrf'],','.$f.',')&&strstr($emod_r[$mid]['dohtmlf'],','.$f.','))//加回车
  56. {
  57. $val=doebrstr($val);
  58. }
  59. }
  60. return $val;
  61. }
  62. //过滤
  63. function ClearNewsBadCode($text){
  64. $text=preg_replace(array('!<script!i','!</script>!i','!<link!i','!<iframe!i','!</iframe>!i','!<meta!i','!<body!i'),array('&lt;script','&lt;/script&gt;','&lt;link','&lt;iframe','&lt;/iframe&gt;','&lt;meta','&lt;body'),$text);
  65. return $text;
  66. }
  67. //返回字段值的处理
  68. function DoReqValue($mid,$f,$val){
  69. global $public_r,$emod_r;
  70. if($emod_r[$mid]['savetxtf']&&$emod_r[$mid]['savetxtf']==$f)//存文本
  71. {
  72. $val=stripSlashes(GetTxtFieldText($val));
  73. }
  74. if(strstr($emod_r[$mid]['editorf'],','.$f.','))//编辑器
  75. {
  76. return $val;
  77. }
  78. $val=dorehtmlstr($val);//替换html
  79. if(!strstr($emod_r[$mid]['tobrf'],','.$f.',')&&strstr($emod_r[$mid]['dohtmlf'],','.$f.','))//加回车
  80. {
  81. $val=dorebrstr($val);
  82. }
  83. return $val;
  84. }
  85. //替换html代码
  86. function doehtmlstr($str){
  87. $str=htmlspecialchars($str,ENT_QUOTES);
  88. return $str;
  89. }
  90. //还原html代码
  91. function dorehtmlstr($str){
  92. return $str;
  93. }
  94. //替换回车
  95. function doebrstr($str){
  96. $str=str_replace("\n","<br />",$str);
  97. return $str;
  98. }
  99. //还原回车
  100. function dorebrstr($str){
  101. $str=str_replace("<br />","\n",$str);
  102. $str=str_replace("<br>","\n",$str);
  103. return $str;
  104. }
  105. //投稿生成内容页面
  106. function qAddGetHtml($classid,$id){
  107. $titleurl=DoGetHtml($classid,$id);
  108. return $titleurl;
  109. }
  110. //投稿生成页面
  111. function qAddListHtml($classid,$mid,$qaddlist,$listdt){
  112. global $class_r;
  113. if($qaddlist==0)//不生成
  114. {
  115. return "";
  116. }
  117. elseif($qaddlist==1)//生成当前栏目
  118. {
  119. if(!$listdt)
  120. {
  121. $sonclass="|".$classid."|";
  122. QReClassHtml($sonclass);
  123. }
  124. }
  125. elseif($qaddlist==2)//生成首页
  126. {
  127. QReIndex();
  128. }
  129. elseif($qaddlist==3)//生成父栏目
  130. {
  131. $featherclass=$class_r[$classid]['featherclass'];
  132. if($featherclass&&$featherclass!="|")
  133. {
  134. QReClassHtml($featherclass);
  135. }
  136. }
  137. elseif($qaddlist==4)//生成当前栏目与父栏目
  138. {
  139. $featherclass=$class_r[$classid]['featherclass'];
  140. if(empty($featherclass))
  141. {
  142. $featherclass="|";
  143. }
  144. if(!$listdt)
  145. {
  146. $featherclass.=$classid."|";
  147. }
  148. QReClassHtml($featherclass);
  149. }
  150. elseif($qaddlist==5)//生成父栏目与首页
  151. {
  152. QReIndex();
  153. $featherclass=$class_r[$classid]['featherclass'];
  154. if($featherclass&&$featherclass!="|")
  155. {
  156. QReClassHtml($featherclass);
  157. }
  158. }
  159. elseif($qaddlist==6)//生成当前栏目、父栏目与首页
  160. {
  161. QReIndex();
  162. $featherclass=$class_r[$classid]['featherclass'];
  163. if(empty($featherclass))
  164. {
  165. $featherclass="|";
  166. }
  167. if(!$listdt)
  168. {
  169. $featherclass.=$classid."|";
  170. }
  171. QReClassHtml($featherclass);
  172. }
  173. }
  174. //投稿生成栏目
  175. function QReClassHtml($sonclass){
  176. global $empire,$dbtbpre,$class_r;
  177. $r=explode("|",$sonclass);
  178. $count=count($r);
  179. for($i=1;$i<$count-1;$i++)
  180. {
  181. //终极栏目
  182. if($class_r[$r[$i]]['islast'])
  183. {
  184. if(!$class_r[$r[$i]]['listdt'])
  185. {
  186. ListHtml($r[$i],'',0,$userlistr);
  187. }
  188. }
  189. elseif($class_r[$r[$i]]['islist']==1)//列表式父栏目
  190. {
  191. if(!$class_r[$r[$i]]['listdt'])
  192. {
  193. ListHtml($r[$i],'',3);
  194. }
  195. }
  196. elseif($class_r[$r[$i]]['islist']==3)//栏目绑定信息式
  197. {
  198. ReClassBdInfo($r[$i]);
  199. }
  200. else//父栏目
  201. {
  202. $cr=$empire->fetch1("select classtempid from {$dbtbpre}enewsclass where classid='$r[$i]'");
  203. $classtemp=$class_r[$r[$i]]['islist']==2?GetClassText($r[$i]):GetClassTemp($cr['classtempid']);
  204. NewsBq($r[$i],$classtemp,0,0);
  205. }
  206. }
  207. }
  208. //投稿生成首页
  209. function QReIndex(){
  210. $indextemp=GetIndextemp();
  211. NewsBq($classid,$indextemp,1,0);
  212. }
  213. //验证权限
  214. function CheckQdoinfo($classid,$id,$userid,$tbname,$adminqinfo,$ecms=0){
  215. global $empire,$dbtbpre,$emod_r,$class_r;
  216. $r=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id='$id' and classid='$classid' and ismember=1 and userid='$userid' limit 1");
  217. if(!$r[id])
  218. {
  219. printerror("HaveNotLevelQInfo","history.go(-1)",1);
  220. }
  221. if($adminqinfo==1)//管理未审核信息
  222. {
  223. if($r[checked])
  224. {
  225. printerror("ClassSetNotAdminQCInfo","history.go(-1)",1);
  226. }
  227. }
  228. elseif($adminqinfo==2)//只可编辑未审核信息
  229. {
  230. if($r[checked]||$ecms!=1)
  231. {
  232. printerror("ClassSetNotEditQCInfo","history.go(-1)",1);
  233. }
  234. }
  235. elseif($adminqinfo==3)//只可删除未审核信息
  236. {
  237. if($r[checked]||$ecms!=2)
  238. {
  239. printerror("ClassSetNotDelQCInfo","history.go(-1)",1);
  240. }
  241. }
  242. elseif($adminqinfo==4)//管理所有信息
  243. {}
  244. elseif($adminqinfo==5)//只可编辑所有信息
  245. {
  246. if($ecms!=1)
  247. {
  248. printerror("ClassSetNotEditQInfo","history.go(-1)",1);
  249. }
  250. }
  251. elseif($adminqinfo==6)//只可删除所有信息
  252. {
  253. if($ecms!=2)
  254. {
  255. printerror("ClassSetNotDelQInfo","history.go(-1)",1);
  256. }
  257. }
  258. else//不能管理投稿
  259. {
  260. printerror("ClassSetNotAdminQInfo","history.go(-1)",1);
  261. }
  262. //副表
  263. $mid=$class_r[$classid]['modid'];
  264. if($emod_r[$mid]['tbdataf']&&$emod_r[$mid]['tbdataf']<>',')
  265. {
  266. $selectdataf=substr($emod_r[$mid]['tbdataf'],1,-1);
  267. $finfor=$empire->fetch1("select ".$selectdataf." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$r[id]'");
  268. $r=array_merge($r,$finfor);
  269. }
  270. return $r;
  271. }
  272. //组合下载/影视
  273. function DoqReturnDownPath($path,$ecms=0){
  274. global $fun_r;
  275. $downqz="";
  276. $fen=0;
  277. $fuser=0;
  278. $f_exp="::::::";
  279. $r_exp="\r\n";
  280. $returnstr="";
  281. $path=str_replace($f_exp,"",$path);
  282. $path=str_replace($r_exp,"",$path);
  283. if($ecms==0)
  284. {
  285. $name=$fun_r['DownPath']."1";
  286. }
  287. else
  288. {
  289. $name="1";
  290. }
  291. if($path)
  292. {
  293. $returnstr=$name.$f_exp.$path.$f_exp.$fuser.$f_exp.$fen.$f_exp.$downqz.$r_exp;
  294. }
  295. //去掉最后的字符
  296. $returnstr=substr($returnstr,0,strlen($returnstr)-2);
  297. return $returnstr;
  298. }
  299. //返回下载/影视地址
  300. function DoReqDownPath($downpath){
  301. if(empty($downpath))
  302. {
  303. return "";
  304. }
  305. $f_exp="::::::";
  306. $r_exp="\r\n";
  307. $r=explode($r_exp,$downpath);
  308. $r1=explode($f_exp,$r[0]);
  309. return $r1[1];
  310. }
  311. //特殊字段处理
  312. function DoqSpecialValue($mid,$f,$value,$add,$infor,$ecms=0){
  313. global $public_r,$loginin,$emod_r;
  314. if($f=="morepic")//图片集
  315. {
  316. $add['msavepic']=0;
  317. $value=ReturnMorepicpath($add['msmallpic'],$add['mbigpic'],$add['mpicname'],$add['mdelpicid'],$add['mpicid'],$add,$add['mpicurl_qz'],$ecms);
  318. $value=doehtmlstr($value);
  319. }
  320. elseif($f=="downpath")//下载地址
  321. {
  322. $value=DoqReturnDownPath($value,0);
  323. $value=doehtmlstr($value);
  324. }
  325. elseif($f=="onlinepath")//在线地址
  326. {
  327. $value=DoqReturnDownPath($value,1);
  328. $value=doehtmlstr($value);
  329. }
  330. elseif($f=="newstext")//内容
  331. {
  332. //远程保存
  333. //$value=addslashes(CopyImg(stripSlashes($value),$add[copyimg],$add[copyflash],$add[classid],$add[qz_url],$loginin,$add['id'],$add['filepass'],$add['mark']));
  334. }
  335. //存文本
  336. if($emod_r[$mid]['savetxtf']&&$f==$emod_r[$mid]['savetxtf'])
  337. {
  338. if($ecms==1)
  339. {
  340. //建立目录
  341. $newstexttxt_r=explode("/",$infor[$f]);
  342. $thetxtfile=$newstexttxt_r[2];
  343. $truevalue=MkDirTxtFile($newstexttxt_r[0]."/".$newstexttxt_r[1],$thetxtfile);
  344. }
  345. else
  346. {
  347. //建立目录
  348. $thetxtfile=GetFileMd5();
  349. $truevalue=MkDirTxtFile(date("Y/md"),$thetxtfile);
  350. }
  351. //写放文件
  352. EditTxtFieldText($truevalue,$value);
  353. $value=$truevalue;
  354. }
  355. return $value;
  356. }
  357. //检测点数是否足够
  358. function MCheckEnoughFen($userfen,$userdate,$fen){
  359. if(!($userdate-time()>0))
  360. {
  361. if($userfen+$fen<0)
  362. {
  363. printerror("HaveNotFenAQinfo","history.go(-1)",1);
  364. }
  365. }
  366. }
  367. //返回字段
  368. function ReturnQAddinfoF($mid,$add,$infor,$classid,$filepass,$userid,$username,$ecms=0){
  369. global $empire,$dbtbpre,$public_r,$emod_r,$tranpicturetype,$mediaplayertype,$realplayertype,$tranflashtype;
  370. $pr=$empire->fetch1("select qaddtran,qaddtransize,qaddtranimgtype,qaddtranfile,qaddtranfilesize,qaddtranfiletype,closewords,closewordsf from {$dbtbpre}enewspublic limit 1");
  371. $isadd=$ecms==0?1:0;
  372. qCheckInfoCloseWord($mid,$add,$pr['closewordsf'],$pr['closewords']);//屏蔽字符验证
  373. //检测必填字段
  374. $mustr=explode(",",$emod_r[$mid]['mustqenterf']);
  375. $mustcount=count($mustr)-1;
  376. for($i=1;$i<$mustcount;$i++)
  377. {
  378. $mf=$mustr[$i];
  379. if(strstr($emod_r[$mid]['filef'],','.$mf.',')||strstr($emod_r[$mid]['imgf'],','.$mf.',')||strstr($emod_r[$mid]['flashf'],','.$mf.',')||$mf=='downpath'||$mf=='onlinepath')//附件
  380. {
  381. $mfilef=$mf."file";
  382. //上传文件
  383. if($_FILES[$mfilef]['name'])
  384. {
  385. if(strstr($emod_r[$mid]['imgf'],','.$mf.','))//图片
  386. {
  387. if(!$pr['qaddtran'])
  388. {
  389. printerror("CloseQTranPic","",1);
  390. }
  391. }
  392. else//附件
  393. {
  394. if(!$pr['qaddtranfile'])
  395. {
  396. printerror("CloseQTranFile","",1);
  397. }
  398. }
  399. }
  400. elseif(!trim($add[$mf])&&!$infor[$mf])
  401. {
  402. printerror("EmptyQMustF","",1);
  403. }
  404. }
  405. else
  406. {
  407. $chmustval=ReturnCheckboxAddF($add[$mf],$mid,$mf);//复选框
  408. if(!trim($chmustval))
  409. {
  410. printerror("EmptyQMustF","",1);
  411. }
  412. }
  413. }
  414. //字段处理
  415. $dh="";
  416. $tranf="";
  417. $fr=explode(',',$emod_r[$mid]['qenter']);
  418. $count=count($fr)-1;
  419. for($i=1;$i<$count;$i++)
  420. {
  421. $f=$fr[$i];
  422. if($f=='special.field'||($ecms==0&&!strstr($emod_r[$mid]['canaddf'],','.$f.','))||($ecms==1&&!strstr($emod_r[$mid]['caneditf'],','.$f.',')))
  423. {continue;}
  424. //附件
  425. $add[$f]=str_replace('[!#@-','',$add[$f]);
  426. if(strstr($emod_r[$mid]['filef'],','.$f.',')||strstr($emod_r[$mid]['imgf'],','.$f.',')||strstr($emod_r[$mid]['flashf'],','.$f.',')||$f=='downpath'||$f=='onlinepath')
  427. {
  428. //上传附件
  429. $filetf=$f."file";
  430. if($_FILES[$filetf]['name'])
  431. {
  432. $filetype=GetFiletype($_FILES[$filetf]['name']);//取得文件类型
  433. if(CheckSaveTranFiletype($filetype))
  434. {
  435. printerror("NotQTranFiletype","",1);
  436. }
  437. if(strstr($emod_r[$mid]['imgf'],','.$f.','))//图片
  438. {
  439. if(!$pr['qaddtran'])
  440. {
  441. printerror("CloseQTranPic","",1);
  442. }
  443. if(!strstr($pr['qaddtranimgtype'],"|".$filetype."|"))
  444. {
  445. printerror("NotQTranFiletype","",1);
  446. }
  447. if($_FILES[$filetf]['size']>$pr['qaddtransize']*1024)
  448. {
  449. printerror("TooBigQTranFile","",1);
  450. }
  451. if(!strstr($tranpicturetype,','.$filetype.','))
  452. {
  453. printerror("NotQTranFiletype","",1);
  454. }
  455. }
  456. else//附件
  457. {
  458. if(!$pr['qaddtranfile'])
  459. {
  460. printerror("CloseQTranFile","",1);
  461. }
  462. if(!strstr($pr['qaddtranfiletype'],"|".$filetype."|"))
  463. {
  464. printerror("NotQTranFiletype","",1);
  465. }
  466. if($_FILES[$filetf]['size']>$pr['qaddtranfilesize']*1024)
  467. {
  468. printerror("TooBigQTranFile","",1);
  469. }
  470. if(strstr($emod_r[$mid]['flashf'],','.$f.','))//flash
  471. {
  472. if(!strstr($tranflashtype,",".$filetype.","))
  473. {printerror("NotQTranFiletype","",1);}
  474. }
  475. if($f=="onlinepath")//视频
  476. {
  477. if(strstr($wmv_type,",".$filetype.","))
  478. {}
  479. }
  480. }
  481. $tranf.=$dh.$f;
  482. $dh=",";
  483. $fval="[!#@-".$f."-@!]";
  484. }
  485. else
  486. {
  487. $fval=$add[$f];
  488. if($ecms==1&&$infor[$f]&&!trim($fval))
  489. {
  490. $fval=$infor[$f];
  491. //特殊字段
  492. if($f=="downpath"||$f=="onlinepath")
  493. {
  494. $fval=DoReqDownPath($fval);
  495. }
  496. }
  497. }
  498. }
  499. elseif($f=='newstime')//时间
  500. {
  501. if($add[$f])
  502. {
  503. $fval=to_time($add[$f]);
  504. }
  505. else
  506. {
  507. $fval=time();
  508. }
  509. }
  510. elseif($f=='newstext')//内容
  511. {
  512. if($ecms==0)
  513. {
  514. $fval=DoReplaceKeyAndWord($add[$f],1);//替换关键字和字符
  515. }
  516. else
  517. {
  518. $fval=$add[$f];
  519. }
  520. }
  521. elseif($f=='infoip') //ip
  522. {
  523. $fval=egetip();
  524. }
  525. elseif($f=='infozm') //字母
  526. {
  527. $fval=$add[$f]?$add[$f]:GetInfoZm($add[title]);
  528. }
  529. else
  530. {
  531. $add[$f]=ReturnCheckboxAddF($add[$f],$mid,$f);//复选框
  532. $fval=$add[$f];
  533. }
  534. $fval=DoFFun($mid,$f,$fval,$isadd,1);//执行函数
  535. ChIsOnlyAddF($mid,$infor[id],$f,$fval,1);//唯一值
  536. $fval=DoqValue($mid,$f,$fval);
  537. $fval=DoqSpecialValue($mid,$f,$fval,$add,$infor,$ecms);
  538. $fval=RepPostStr2($fval);
  539. if($ecms==1)
  540. {
  541. SameDataAddF($info[id],$classid,$mid,$f,$fval);
  542. }
  543. $fval=addslashes($fval);
  544. if($ecms==0)//添加
  545. {
  546. if(strstr($emod_r[$mid]['tbdataf'],','.$f.','))//副表
  547. {
  548. $ret_r[2].=",".$f;
  549. $ret_r[3].=",'".$fval."'";
  550. }
  551. else
  552. {
  553. $ret_r[0].=",".$f;
  554. $ret_r[1].=",'".$fval."'";
  555. }
  556. }
  557. else//编辑
  558. {
  559. if($f=='infoip') //ip
  560. {
  561. continue;
  562. }
  563. if(strstr($emod_r[$mid]['tbdataf'],','.$f.','))//副表
  564. {
  565. $ret_r[3].=",".$f."='".$fval."'";
  566. }
  567. else
  568. {
  569. $ret_r[0].=",".$f."='".$fval."'";
  570. }
  571. }
  572. }
  573. //上传附件
  574. if($tranf)
  575. {
  576. if($ecms==0)
  577. {
  578. $infoid=0;
  579. }
  580. else
  581. {
  582. $infoid=$infor['id'];
  583. $filepass=0;
  584. }
  585. $tranr=explode(",",$tranf);
  586. $count=count($tranr);
  587. for($i=0;$i<$count;$i++)
  588. {
  589. $tf=$tranr[$i];
  590. $tffile=$tf."file";
  591. $tfr=DoTranFile($_FILES[$tffile]['tmp_name'],$_FILES[$tffile]['name'],$_FILES[$tffile]['type'],$_FILES[$tffile]['size'],$classid);
  592. if($tfr['tran'])
  593. {
  594. //文件类型
  595. $mvf=$tf."mtfile";
  596. if(strstr($emod_r[$mid]['imgf'],','.$tf.','))//图片
  597. {
  598. $type=1;
  599. }
  600. elseif(strstr($emod_r[$mid]['flashf'],','.$tf.','))//flash
  601. {
  602. $type=2;
  603. }
  604. elseif($add[$mvf]==1)//多媒体
  605. {
  606. $type=3;
  607. }
  608. else//附件
  609. {
  610. $type=0;
  611. }
  612. //写入数据库
  613. $filetime=date("Y-m-d H:i:s");
  614. $filesize=(int)$_FILES[$tffile]['size'];
  615. $classid=(int)$classid;
  616. $sql=$empire->query("insert into {$dbtbpre}enewsfile(filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,fpath) values('$tfr[filename]','$filesize','[Member]".$username."','$tfr[filepath]','$filetime','$classid','[".$tf."]".addslashes(RepPostStr($add[title]))."','$type','$infoid','$filepass','$public_r[fpath]');");
  617. //删除旧文件
  618. if($ecms==1&&$infor[$tf])
  619. {
  620. DelYQTranFile($classid,$infor['id'],$infor[$tf],$tf);
  621. }
  622. $repfval=$tfr['url'];
  623. }
  624. else
  625. {
  626. $repfval=$infor[$tf];
  627. //特殊字段
  628. if($tf=="downpath"||$tf=="onlinepath")
  629. {
  630. $repfval=DoReqDownPath($repfval);
  631. }
  632. }
  633. if($ecms==0)//添加
  634. {
  635. $ret_r[1]=str_replace("[!#@-".$tf."-@!]",$repfval,$ret_r[1]);
  636. $ret_r[3]=str_replace("[!#@-".$tf."-@!]",$repfval,$ret_r[3]);
  637. }
  638. else//编辑
  639. {
  640. $ret_r[0]=str_replace("[!#@-".$tf."-@!]",$repfval,$ret_r[0]);
  641. $ret_r[3]=str_replace("[!#@-".$tf."-@!]",$repfval,$ret_r[3]);
  642. }
  643. }
  644. }
  645. $ret_r[4]=$emod_r[$mid]['deftb'];
  646. return $ret_r;
  647. }
  648. //删除原附件
  649. function DelYQTranFile($classid,$id,$file,$tf){
  650. global $empire,$dbtbpre;
  651. //特殊字段
  652. if($tf=="downpath"||$tf=="onlinepath")
  653. {
  654. $file=DoReqDownPath($file);
  655. }
  656. if(empty($file))
  657. {
  658. return "";
  659. }
  660. $r=explode("/",$file);
  661. $count=count($r);
  662. $filename=$r[$count-1];
  663. $fr=$empire->fetch1("select filename,path,fileid,fpath,classid from {$dbtbpre}enewsfile where classid='$classid' and id='$id' and filename='$filename' limit 1");
  664. if($fr['fileid'])
  665. {
  666. $sql=$empire->query("delete from {$dbtbpre}enewsfile where fileid='$fr[fileid]'");
  667. DoDelFile($fr);
  668. }
  669. }
  670. //信息投稿
  671. function DodoInfo($add,$ecms=0){
  672. global $empire,$public_r,$emod_r,$level_r,$class_r,$dbtbpre,$fun_r;
  673. //验证来源
  674. if($ecms==0||$ecms==1)
  675. {
  676. CheckCanPostUrl();
  677. }
  678. //开启投稿
  679. if($public_r['addnews_ok'])
  680. {
  681. printerror("CloseQAdd","",1);
  682. }
  683. $classid=(int)$add['classid'];
  684. $mid=(int)$class_r[$classid]['modid'];
  685. if(!$mid||!$classid)
  686. {
  687. printerror("EmptyQinfoCid","",1);
  688. }
  689. $tbname=$emod_r[$mid]['tbname'];
  690. $qenter=$emod_r[$mid]['qenter'];
  691. if(!$tbname||!$qenter||$qenter==',')
  692. {
  693. printerror("ErrorUrl","history.go(-1)",1);
  694. }
  695. $muserid=(int)getcvar('mluserid');
  696. $musername=RepPostVar(getcvar('mlusername'));
  697. $mrnd=RepPostVar(getcvar('mlrnd'));
  698. //取得栏目信息
  699. $isadd=0;
  700. if($ecms==0)
  701. {
  702. $isadd=1;
  703. }
  704. $setuserday='';
  705. $cr=DoQCheckAddLevel($classid,$muserid,$musername,$mrnd,$ecms,$isadd);
  706. $setuserday=$cr['checkaddnumquery'];
  707. $filepass=(int)$add['filepass'];
  708. $id=(int)$add['id'];
  709. //组合标题属性
  710. $titlecolor=RepPostStr(RepPhpAspJspcodeText($add[titlecolor]));
  711. $titlefont=TitleFont($add[titlefont],$titlecolor);
  712. $titlecolor="";
  713. $titlefont="";
  714. $ztid=ZtId($add['ztid']);
  715. $ttid=(int)$add['ttid'];
  716. $keyboard=addslashes(RepPostStr(trim(DoReplaceQjDh($add[keyboard]))));
  717. //返回关键字组合
  718. if($keyboard&&strstr($qenter,',special.field,'))
  719. {
  720. $keyboard=str_replace('[!--f--!]','',$keyboard);
  721. $keyid=GetKeyid($keyboard,$classid,$id,$class_r[$classid][link_num]);
  722. }
  723. //验证码
  724. $keyvname='checkinfokey';
  725. //-----------------增加
  726. if($ecms==0)
  727. {
  728. //时间
  729. $lasttime=getcvar('lastaddinfotime');
  730. if($lasttime)
  731. {
  732. if(time()-$lasttime<$public_r['readdinfotime'])
  733. {
  734. printerror("QAddInfoOutTime","",1);
  735. }
  736. }
  737. //验证码
  738. if($cr['qaddshowkey'])
  739. {
  740. ecmsCheckShowKey($keyvname,$add['key'],1);
  741. }
  742. //返回字段
  743. $ret_r=ReturnQAddinfoF($mid,$add,$infor,$classid,$filepass,$muserid,$musername,0);
  744. $checked=$cr['checkqadd'];
  745. $havehtml=0;
  746. $newspath=date($cr['newspath']);
  747. $truetime=time();
  748. $newstime=$truetime;
  749. $newstempid=$cr['newstempid'];
  750. $haveaddfen=0;
  751. //强制签发
  752. $isqf=0;
  753. if($cr['wfid'])
  754. {
  755. $checked=0;
  756. $isqf=1;
  757. }
  758. //增扣点
  759. if($checked&&$muserid)
  760. {
  761. AddInfoFen($cr['addinfofen'],$muserid);
  762. $haveaddfen=1;
  763. }
  764. if(empty($muserid))
  765. {
  766. $musername=$fun_r['guest'];
  767. }
  768. //会员投稿数更新
  769. if($setuserday)
  770. {
  771. $empire->query($setuserday);
  772. }
  773. //发布时间
  774. if(!strstr($qenter,',newstime,'))
  775. {
  776. $ret_r[0]=",newstime".$ret_r[0];
  777. $ret_r[1]=",'$newstime'".$ret_r[1];
  778. }
  779. //主表
  780. $sql=$empire->query("insert into {$dbtbpre}ecms_".$tbname."(classid,onclick,newspath,keyboard,keyid,userid,username,ztid,checked,istop,truetime,ismember,dokey,isgood,titlefont,titleurl,filename,groupid,newstempid,plnum,firsttitle,isqf,userfen,totaldown,closepl,havehtml,lastdotime,haveaddfen,infopfen,infopfennum,votenum,stb,ttid".$ret_r[0].") values('$classid',0,'$newspath','$keyboard','$keyid','".$muserid."','".addslashes($musername)."','$ztid','$checked',0,'$truetime',1,1,0,'$titlefont','','',0,'$newstempid',0,0,'$isqf',0,0,0,'$havehtml','$truetime','$haveaddfen',0,0,0,'$ret_r[4]','$ttid'".$ret_r[1].");");
  781. $id=$empire->lastid();
  782. //副表
  783. $fsql=$empire->query("insert into {$dbtbpre}ecms_".$tbname."_data_".$ret_r[4]."(id,classid".$ret_r[2].") values('$id','$classid'".$ret_r[3].");");
  784. //扣点记录
  785. if($haveaddfen)
  786. {
  787. if($cr['addinfofen']<0)
  788. {
  789. BakDown($classid,$id,0,$muserid,$musername,RepPostStr($add[title]),abs($cr['addinfofen']),3);
  790. }
  791. }
  792. //签发
  793. if($isqf==1)
  794. {
  795. InfoInsertToWorkflow($id,$classid,$cr['wfid'],$muserid,addslashes($musername));
  796. }
  797. //文件命名
  798. $filename=ReturnInfoFilename($classid,$id,'');
  799. $usql=$empire->query("update {$dbtbpre}ecms_".$tbname." set filename='$filename' where id='$id'");
  800. //修改ispic
  801. UpdateTheIspic($classid,$id);
  802. //修改附件
  803. if($filepass)
  804. {
  805. $filesql=$empire->query("update {$dbtbpre}enewsfile set classid='$classid',id='$id',cjid=0 where cjid='$filepass'");
  806. }
  807. //清除验证码
  808. ecmsEmptyShowKey($keyvname);
  809. esetcookie("qeditinfo","",0);
  810. //生成页面
  811. if($checked&&!$cr['showdt'])
  812. {
  813. $titleurl=qAddGetHtml($classid,$id);
  814. }
  815. //生成列表
  816. if($checked)
  817. {
  818. qAddListHtml($classid,$mid,$cr['qaddlist'],$cr['listdt']);
  819. //生成上一篇
  820. if($cr['repreinfo'])
  821. {
  822. $prer=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id<$id and classid='$classid' and checked=1 order by id desc limit 1");
  823. GetHtml($prer,'');
  824. }
  825. }
  826. if($sql)
  827. {
  828. $reurl=DoingReturnUrl("AddInfo.php?classid=$classid&mid=$mid",$add['ecmsfrom']);
  829. if($add['gotoinfourl']&&$checked)//返回内容页
  830. {
  831. if($cr['showdt']==1)
  832. {
  833. $reurl=$public_r[newsurl]."e/action/ShowInfo/?classid=$classid&id=$id";
  834. }
  835. elseif($cr['showdt']==2)
  836. {
  837. $reurl=$public_r[newsurl]."e/action/ShowInfo.php?classid=$classid&id=$id";
  838. }
  839. else
  840. {
  841. $reurl=$titleurl;
  842. }
  843. }
  844. esetcookie("lastaddinfotime",time(),time()+3600*24);//设置最后发表时间
  845. printerror("AddQinfoSuccess",$reurl,1);
  846. }
  847. else
  848. {printerror("DbError","history.go(-1)",1);}
  849. }
  850. //---------------修改
  851. elseif($ecms==1)
  852. {
  853. if(!$id)
  854. {
  855. printerror("ErrorUrl","history.go(-1)",1);
  856. }
  857. //检测权限
  858. $infor=CheckQdoinfo($classid,$id,$muserid,$tbname,$cr['adminqinfo'],1);
  859. //检测时间
  860. if($public_r['qeditinfotime'])
  861. {
  862. if(time()-$infor['truetime']>$public_r['qeditinfotime']*60)
  863. {
  864. printerror("QEditInfoOutTime","history.go(-1)",1);
  865. }
  866. }
  867. $addfield='';
  868. //返回字段
  869. $ret_r=ReturnQAddinfoF($mid,$add,$infor,$classid,$filepass,$muserid,$musername,1);
  870. if($keyboard)
  871. {
  872. $addfield=",keyboard='$keyboard',keyid='$keyid'";
  873. }
  874. //修改是否需要审核
  875. if($cr['qeditchecked'])
  876. {
  877. $infor['checked']=0;
  878. $addfield.=",checked=0";
  879. $relist=1;
  880. //删除原页面
  881. DelNewsFile($infor[filename],$infor[newspath],$infor[classid],$infor[newstext],$infor[groupid]);
  882. }
  883. //会员投稿数更新
  884. if($setuserday)
  885. {
  886. //$empire->query($setuserday);
  887. }
  888. $lastdotime=time();
  889. //主表
  890. $sql=$empire->query("update {$dbtbpre}ecms_".$tbname." set lastdotime=$lastdotime,havehtml=0,ztid='$ztid',ttid='$ttid'".$addfield.$ret_r[0]." where id=$id and classid=$classid and userid='$muserid' and ismember=1");
  891. //副表
  892. $fsql=$empire->query("update {$dbtbpre}ecms_".$tbname."_data_".$infor[stb]." set classid='$classid'".$ret_r[3]." where id='$id'");
  893. //修改ispic
  894. UpdateTheIspic($classid,$id);
  895. //更新附件
  896. UpdateTheFileEdit($classid,$id);
  897. esetcookie("qeditinfo","",0);
  898. //生成页面
  899. if($infor['checked']&&!$cr['showdt'])
  900. {
  901. $titleurl=qAddGetHtml($classid,$id);
  902. }
  903. //生成列表
  904. if($infor['checked']||$relist==1)
  905. {
  906. qAddListHtml($classid,$mid,$cr['qaddlist'],$cr['listdt']);
  907. }
  908. //生成上一篇
  909. if($cr['repreinfo']&&$infor['checked'])
  910. {
  911. $prer=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id<$id and classid='$classid' and checked=1 order by id desc limit 1");
  912. GetHtml($prer,'');
  913. }
  914. if($sql)
  915. {
  916. $reurl=DoingReturnUrl("ListInfo.php?mid=$mid",$add['ecmsfrom']);
  917. if($add['editgotoinfourl']&&$infor['checked'])//返回内容页
  918. {
  919. if($cr['showdt']==1)
  920. {
  921. $reurl=$public_r[newsurl]."e/action/ShowInfo/?classid=$classid&id=$id";
  922. }
  923. elseif($cr['showdt']==2)
  924. {
  925. $reurl=$public_r[newsurl]."e/action/ShowInfo.php?classid=$classid&id=$id";
  926. }
  927. else
  928. {
  929. $reurl=$titleurl;
  930. }
  931. }
  932. printerror("EditQinfoSuccess",$reurl,1);
  933. }
  934. else
  935. {printerror("DbError","history.go(-1)",1);}
  936. }
  937. //---------------删除
  938. elseif($ecms==2)
  939. {
  940. if(!$id)
  941. {
  942. printerror("ErrorUrl","history.go(-1)",1);
  943. }
  944. //检测权限
  945. $r=CheckQdoinfo($classid,$id,$muserid,$tbname,$cr['adminqinfo'],2);
  946. $stf=$emod_r[$mid]['savetxtf'];
  947. $pf=$emod_r[$mid]['pagef'];
  948. //分页字段
  949. if($pf)
  950. {
  951. if(strstr($emod_r[$mid]['tbdataf'],','.$pf.','))
  952. {
  953. $finfor=$empire->fetch1("select ".$pf." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$id'");
  954. $r[$pf]=$finfor[$pf];
  955. }
  956. }
  957. //存文本
  958. if($stf)
  959. {
  960. $newstextfile=$r[$stf];
  961. $r[$stf]=GetTxtFieldText($r[$stf]);
  962. //删除文件
  963. DelTxtFieldText($newstextfile);
  964. }
  965. //删除信息文件
  966. DelNewsFile($r[filename],$r[newspath],$classid,$r[$pf],$r[groupid]);
  967. $sql=$empire->query("delete from {$dbtbpre}ecms_".$tbname." where id=$id and classid=$classid and userid='$muserid' and ismember=1");
  968. $fsql=$empire->query("delete from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id=$id");
  969. esetcookie("qdelinfo","",0);
  970. //删除其它表记录
  971. $delsql=$empire->query("delete from {$dbtbpre}enewswfinfo where id='$id' and classid='$classid'");
  972. $delsql=$empire->query("delete from {$dbtbpre}enewswfinfolog where id='$id' and classid='$classid'");
  973. $delsql=$empire->query("delete from {$dbtbpre}enewsinfovote where id='$id' and classid='$classid'");
  974. $delsql=$empire->query("delete from {$dbtbpre}enewsdiggips where id='$id' and classid='$classid'");
  975. //删除附件
  976. DelNewsTheFile($id,$classid);
  977. //生成列表
  978. if($r['checked'])
  979. {
  980. qAddListHtml($classid,$mid,$cr['qaddlist'],$cr['listdt']);
  981. //生成上一篇
  982. if($cr['repreinfo'])
  983. {
  984. $prer=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id<$id and classid='$classid' and checked=1 order by id desc limit 1");
  985. GetHtml($prer,'');
  986. //下一篇
  987. $nextr=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id>$id and classid='$classid' and checked=1 order by id limit 1");
  988. if($nextr['id'])
  989. {
  990. GetHtml($nextr,'');
  991. }
  992. }
  993. }
  994. if($sql)
  995. {
  996. $reurl=DoingReturnUrl("ListInfo.php?mid=$mid",$add['ecmsfrom']);
  997. printerror("DelQinfoSuccess",$reurl,1);
  998. }
  999. else
  1000. {printerror("DbError","history.go(-1)",1);}
  1001. }
  1002. else
  1003. {
  1004. printerror("ErrorUrl","",1);
  1005. }
  1006. }
  1007. //投稿权限检测
  1008. function DoQCheckAddLevel($classid,$userid,$username,$rnd,$ecms=0,$isadd=0){
  1009. global $empire,$dbtbpre,$level_r,$public_r;
  1010. $r=$empire->fetch1("select * from {$dbtbpre}enewsclass where classid='$classid'");
  1011. if(!$r['classid']||$r[wburl])
  1012. {
  1013. printerror("EmptyQinfoCid","",1);
  1014. }
  1015. if(!$r['islast'])
  1016. {
  1017. printerror("MustLast","",1);
  1018. }
  1019. if($r['openadd'])
  1020. {
  1021. printerror("NotOpenCQInfo","",1);
  1022. }
  1023. //是否登陆
  1024. if($ecms==1||$ecms==2||($r['qaddgroupid']&&$r['qaddgroupid']<>','))
  1025. {
  1026. $user=islogin($userid,$username,$rnd);
  1027. //验证新会员投稿
  1028. if($isadd==1&&$public_r['newaddinfotime'])
  1029. {
  1030. qCheckNewMemberAddInfo($user[registertime]);
  1031. }
  1032. }
  1033. //会员组
  1034. if($r['qaddgroupid']&&$r['qaddgroupid']<>',')
  1035. {
  1036. if(!strstr($r['qaddgroupid'],','.$user[groupid].','))
  1037. {
  1038. printerror("HaveNotLevelAQinfo","history.go(-1)",1);
  1039. }
  1040. }
  1041. if($isadd==1)
  1042. {
  1043. //检测是否足够点数
  1044. if($r['addinfofen']<0&&$user['userid'])
  1045. {
  1046. MCheckEnoughFen($user['userfen'],$user['userdate'],$r['addinfofen']);
  1047. }
  1048. //检测投稿数
  1049. if($r['qaddgroupid']&&$r['qaddgroupid']<>','&&$level_r[$user[groupid]]['dayaddinfo'])
  1050. {
  1051. $r['checkaddnumquery']=DoQCheckAddNum($user['userid'],$user['groupid']);
  1052. }
  1053. }
  1054. //审核
  1055. if(($ecms==0||$ecms==1)&&$userid)
  1056. {
  1057. if(!$user[groupid])
  1058. {
  1059. $user=islogin($userid,$username,$rnd);
  1060. }
  1061. if($level_r[$user[groupid]]['infochecked'])
  1062. {
  1063. $r['checkqadd']=1;
  1064. $r['qeditchecked']=0;
  1065. }
  1066. }
  1067. return $r;
  1068. }
  1069. //检查投稿数
  1070. function DoQCheckAddNum($userid,$groupid){
  1071. global $empire,$dbtbpre,$level_r,$public_r;
  1072. $ur=$empire->fetch1("select userid,todayinfodate,todayaddinfo from {$dbtbpre}enewsmemberadd where userid='$userid' limit 1");
  1073. $thetoday=date("Y-m-d");
  1074. if($ur['userid'])
  1075. {
  1076. if($thetoday!=$ur['todayinfodate'])
  1077. {
  1078. $query="update {$dbtbpre}enewsmemberadd set todayinfodate='$thetoday',todayaddinfo=1 where userid='$userid'";
  1079. }
  1080. else
  1081. {
  1082. if($ur['todayaddinfo']>=$level_r[$groupid]['dayaddinfo'])
  1083. {
  1084. printerror("CrossDayInfo",$public_r['newsurl'],1);
  1085. }
  1086. $query="update {$dbtbpre}enewsmemberadd set todayaddinfo=todayaddinfo+1 where userid='$userid'";
  1087. }
  1088. }
  1089. else
  1090. {
  1091. $query="replace into {$dbtbpre}enewsmemberadd(userid,todayinfodate,todayaddinfo) values('$userid','$thetoday',1);";
  1092. }
  1093. return $query;
  1094. }
  1095. //上传附件
  1096. function DoQTranFile($add,$file,$file_name,$file_type,$file_size,$userid,$username,$rnd,$ecms=0){
  1097. global $empire,$dbtbpre,$public_r,$tranpicturetype,$tranflashtype;
  1098. if($public_r['addnews_ok'])//关闭投稿
  1099. {
  1100. $ecms!=1?printerror("NotOpenCQInfo","",9):ECMS_QEditorPrintError(1,'','','NotOpenCQInfo','','');
  1101. }
  1102. $filepass=(int)$add['filepass'];
  1103. $classid=(int)$add['classid'];
  1104. if(!$file_name||!$filepass||!$classid)
  1105. {
  1106. $ecms!=1?printerror("EmptyQTranFile","",9):ECMS_QEditorPrintError(1,'','','EmptyQTranFile','','');
  1107. }
  1108. //验证权限
  1109. $userid=(int)$userid;
  1110. $username=RepPostVar($username);
  1111. $rnd=RepPostVar($rnd);
  1112. DoQCheckAddLevel($classid,$userid,$username,$rnd,0,0);
  1113. $filetype=GetFiletype($file_name);//取得文件类型
  1114. if(CheckSaveTranFiletype($filetype))
  1115. {
  1116. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1117. }
  1118. $type=(int)$add['type'];
  1119. $pr=$empire->fetch1("select qaddtran,qaddtransize,qaddtranimgtype,qaddtranfile,qaddtranfilesize,qaddtranfiletype from {$dbtbpre}enewspublic limit 1");
  1120. if($type==1)//图片
  1121. {
  1122. if(!$pr['qaddtran'])
  1123. {
  1124. $ecms!=1?printerror("CloseQTranPic","",9):ECMS_QEditorPrintError(1,'','','CloseQTranPic','','');
  1125. }
  1126. if(!strstr($pr['qaddtranimgtype'],"|".$filetype."|"))
  1127. {
  1128. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1129. }
  1130. if($file_size>$pr['qaddtransize']*1024)
  1131. {
  1132. $ecms!=1?printerror("TooBigQTranFile","",9):ECMS_QEditorPrintError(1,'','','TooBigQTranFile','','');
  1133. }
  1134. if(!strstr($tranpicturetype,','.$filetype.','))
  1135. {
  1136. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1137. }
  1138. }
  1139. elseif($type==2)//flash
  1140. {
  1141. if(!$pr['qaddtranfile'])
  1142. {
  1143. $ecms!=1?printerror("CloseQTranFile","",9):ECMS_QEditorPrintError(1,'','','CloseQTranFile','','');
  1144. }
  1145. if(!strstr($pr['qaddtranfiletype'],"|".$filetype."|"))
  1146. {
  1147. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1148. }
  1149. if($file_size>$pr['qaddtranfilesize']*1024)
  1150. {
  1151. $ecms!=1?printerror("TooBigQTranFile","",9):ECMS_QEditorPrintError(1,'','','TooBigQTranFile','','');
  1152. }
  1153. if(!strstr($tranflashtype,','.$filetype.','))
  1154. {
  1155. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1156. }
  1157. }
  1158. else//附件
  1159. {
  1160. if(!$pr['qaddtranfile'])
  1161. {
  1162. $ecms!=1?printerror("CloseQTranFile","",9):ECMS_QEditorPrintError(1,'','','CloseQTranFile','','');
  1163. }
  1164. if(!strstr($pr['qaddtranfiletype'],"|".$filetype."|"))
  1165. {
  1166. $ecms!=1?printerror("NotQTranFiletype","",9):ECMS_QEditorPrintError(1,'','','NotQTranFiletype','','');
  1167. }
  1168. if($file_size>$pr['qaddtranfilesize']*1024)
  1169. {
  1170. $ecms!=1?printerror("TooBigQTranFile","",9):ECMS_QEditorPrintError(1,'','','TooBigQTranFile','','');
  1171. }
  1172. }
  1173. $r=DoTranFile($file,$file_name,$file_type,$file_size,$classid);
  1174. if(empty($r[tran]))
  1175. {
  1176. $ecms!=1?printerror("TranFail","",9):ECMS_QEditorPrintError(1,'','','TranFail','','');
  1177. }
  1178. //写入数据库
  1179. $filetime=date("Y-m-d H:i:s");
  1180. $r[filesize]=(int)$r[filesize];
  1181. $classid=(int)$classid;
  1182. $sql=$empire->query("insert into {$dbtbpre}enewsfile(filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,fpath) values('$r[filename]','$r[filesize]','[Member]".$username."','$r[filepath]','$filetime','$classid','$r[filename]','$type','$filepass','$filepass','$public_r[fpath]');");
  1183. //编辑器
  1184. if($ecms==1)
  1185. {
  1186. ECMS_QEditorPrintError(0,$r[url],$r[filename],'',$r[filename],$r[filesize]);
  1187. }
  1188. else
  1189. {
  1190. echo"<script>opener.document.add.".$add['field'].".value='".$r['url']."';window.close();</script>";
  1191. }
  1192. db_close();
  1193. $empire=null;
  1194. exit();
  1195. }
  1196. //----------- 编辑器 --------------
  1197. //提示信息
  1198. function ECMS_QEditorPrintError($errorNumber,$fileUrl,$fileName,$customMsg,$fileno,$filesize){
  1199. if(empty($errorNumber))
  1200. {
  1201. $errorNumber=0;
  1202. $filesize=ChTheFilesize($filesize);
  1203. }
  1204. else
  1205. {
  1206. @include LoadLang("pub/q_message.php");
  1207. $customMsg=$qmessage_r[$customMsg];
  1208. }
  1209. $errorNumber=(int)$errorNumber;
  1210. echo"<script type=\"text/javascript\">window.parent.OnUploadCompleted($errorNumber,'".addslashes($fileUrl)."','".addslashes($fileName)."','".addslashes($customMsg)."','".addslashes($fileno)."','$filesize');</script>";
  1211. db_close();
  1212. exit();
  1213. }
  1214. ?>