function DoMarkSmallPic($add, $userid, $username) { global $empire, $class_r, $dbtbpre, $public_r, $efileftp_fr; //导入gd处理文件 if ($add['getsmall'] || $add['getmark']) { @(include ECMS_PATH . DASHBOARD . "/class/gd.php"); } else { printerror("EmptyDopicFileid", "history.go(-1)"); } $fileid = $add['fileid']; $count = count($fileid); if ($count == 0) { printerror("EmptyDopicFileid", "history.go(-1)"); } $add['classid'] = (int) $add['classid']; $modtype = (int) $add['modtype']; $fstb = (int) $add['fstb']; $fstb = eReturnFileStb($fstb); for ($i = 0; $i < $count; $i++) { $fileid[$i] = intval($fileid[$i]); $r = $empire->fetch1("select classid,filename,path,no,fpath from " . eReturnFileTable($modtype, $fstb) . " where fileid='{$fileid[$i]}'"); $rpath = $r['path'] ? $r['path'] . '/' : $r['path']; $fspath = ReturnFileSavePath($r[classid], $r[fpath]); $path = eReturnEcmsMainPortPath() . $fspath['filepath'] . $rpath; //moreport $yname = $path . $r[filename]; //缩略图 if ($add['getsmall']) { $filetype = GetFiletype($r[filename]); $insertfile = substr($r[filename], 0, strlen($r[filename]) - strlen($filetype)) . time(); $name = $path . "small" . $insertfile; GetMySmallImg($add['classid'], $r[no], $insertfile, $r[path], $yname, $add[width], $add[height], $name, $add['filepass'], $add['filepass'], $userid, $username, $modtype, $fstb); } //水印 if ($add['getmark']) { GetMyMarkImg($yname); //FileServer if ($public_r['openfileserver']) { $efileftp_fr[] = $yname; } } } printerror("DoMarkSmallPicSuccess", $_SERVER['HTTP_REFERER']); }
function GetInfoTranFstb($classid, $id, $fstb) { global $empire, $dbtbpre, $public_r, $class_r; if ($id) { $classid = (int) $classid; $id = (int) $id; if (!$classid || !$class_r[$classid]['tbname']) { return $public_r['filedeftb']; } $index_r = $empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . "_index where id='{$id}' limit 1"); if (!$index_r['id']) { return $public_r['filedeftb']; } //主表 $infotb = ReturnInfoMainTbname($class_r[$classid]['tbname'], $index_r['checked']); //返回表 $infor = $empire->fetch1("select fstb from " . $infotb . " where id='{$id}' limit 1"); $fstb = $infor['fstb']; } elseif ($fstb) { $fstb = eReturnFileStb($fstb); } else { $fstb = $public_r['filedeftb']; } $fstb = (int) $fstb; return $fstb; }
function eInsertFileTable($filename, $filesize, $path, $adduser, $classid, $no, $type, $id, $cjid, $fpath, $pubid, $modtype = 0, $fstb = 1) { global $empire, $dbtbpre, $public_r; $filetime = time(); $filesize = (int) $filesize; $classid = (int) $classid; $id = (int) $id; $cjid = (int) $cjid; $fpath = (int) $fpath; $type = (int) $type; $modtype = (int) $modtype; $filename = addslashes(RepPostStr($filename)); $no = addslashes(RepPostStr($no)); $adduser = RepPostVar($adduser); $path = addslashes(RepPostStr($path)); $pubid = RepPostVar($pubid); $fstb = (int) $fstb; if ($modtype == 0) { $fstb = eReturnFileStb($fstb); $sql = $empire->query("insert into {$dbtbpre}enewsfile_" . $fstb . "(pubid,filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,onclick,fpath) values('{$pubid}','{$filename}','{$filesize}','{$adduser}','{$path}','{$filetime}','{$classid}','{$no}','{$type}','{$id}','{$cjid}',0,'{$fpath}');"); } elseif ($modtype == 5) { $sql = $empire->query("insert into {$dbtbpre}enewsfile_public(filename,filesize,adduser,path,filetime,modtype,no,type,id,cjid,onclick,fpath) values('{$filename}','{$filesize}','{$adduser}','{$path}','{$filetime}',0,'{$no}','{$type}','{$id}','{$cjid}',0,'{$fpath}');"); } elseif ($modtype == 6) { $sql = $empire->query("insert into {$dbtbpre}enewsfile_member(filename,filesize,adduser,path,filetime,no,type,id,cjid,onclick,fpath) values('{$filename}','{$filesize}','{$adduser}','{$path}','{$filetime}','{$no}','{$type}','{$id}','{$cjid}',0,'{$fpath}');"); } else { $sql = $empire->query("insert into {$dbtbpre}enewsfile_other(filename,filesize,adduser,path,filetime,modtype,no,type,id,cjid,onclick,fpath) values('{$filename}','{$filesize}','{$adduser}','{$path}','{$filetime}','{$modtype}','{$no}','{$type}','{$id}','{$cjid}',0,'{$fpath}');"); } return $sql; }