Example #1
0
         Cookie('admin_att', $action);
     } else {
         $action = $_COOKIE['admin_att'];
     }
     !$action && ($action = 'att');
 }
 //pwatermark
 $pwatermark = GetGP('pwatermark');
 InitGP(array('config'), 'G');
 if ($pwatermark == 1) {
     require_once R_P . 'require/imgfunc.php';
     $source = $imgdir . '/water/watermark.jpg';
     $dstsrc = D_P . 'data/bbscache/watermark_preview.jpg';
     $db_waterfonts = $config['waterfonts'];
     $db_watermark = $config['watermark'];
     if (ImgWaterMark($source, $config['waterpos'], $config['waterimg'], $config['watertext'], $config['waterfont'], $config['watercolor'], $config['waterpct'], $config['jpgquality'], $dstsrc)) {
         $size1 = filesize($source);
         $size2 = filesize($dstsrc);
         $sizerate = round($size2 / $size1, 3) * 100;
         include PrintEot('setting');
         exit;
     } else {
         adminmsg('watermark_error');
     }
 }
 //pathumb
 $pathumb = GetGP('pathumb');
 InitGP(array('athumbsize'), 'G');
 if ($pathumb == 1) {
     require_once R_P . 'require/imgfunc.php';
     $source = $imgdir . '/water/watermark.jpg';
Example #2
0
function UploadFile($uid, $uptype = 'all', $thumbs = null)
{
    //fix by noizy
    global $ifupload, $db_attachnum, $db_uploadfiletype, $action, $replacedb, $winddb, $_G, $tdtime, $timestamp, $fid, $db_attachdir, $attachdir, $db_watermark, $db_waterwidth, $db_waterheight, $db_ifgif, $db_waterimg, $db_waterpos, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality, $db_ifathumb, $db_iffthumb, $db_athumbsize, $db_fthumbsize, $db_ifftp, $atc_attachment_name, $attach_ext, $savedir, $forumset;
    $uploaddb = array();
    foreach ($_FILES as $key => $value) {
        if (if_uploaded_file($value['tmp_name'])) {
            list($t, $i) = explode('_', $key);
            $i = (int) $i;
            $atc_attachment = $value['tmp_name'];
            $atc_attachment_name = S::escapeChar($value['name']);
            $atc_attachment_size = $value['size'];
            $attach_ext = strtolower(substr(strrchr($atc_attachment_name, '.'), 1));
            if (empty($attach_ext) || !isset($db_uploadfiletype[$attach_ext])) {
                uploadmsg($uptype, 'upload_type_error');
            }
            if ((int) $atc_attachment_size < 1) {
                uploadmsg($uptype, 'upload_size_0');
            }
            if ($db_uploadfiletype[$attach_ext] && $atc_attachment_size > $db_uploadfiletype[$attach_ext] * 1024) {
                uploadmsg($uptype, 'upload_size_error');
            }
            if ($uptype == 'face') {
                $ifreplace = 0;
                $db_attachdir = 1;
                $db_ifathumb = $db_iffthumb;
                $db_athumbsize = $db_fthumbsize;
                $savedir = $thumbdir = '';
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $savedir = 'upload/' . str_pad(substr($uid, -2), 2, '0', STR_PAD_LEFT);
                $fileuplodeurl = $thumbdir = "{$savedir}/{$uid}.{$attach_ext}";
            } elseif ($uptype == 'cnlogo') {
                $ifreplace = $db_ifathumb = 0;
                $db_attachdir = 1;
                $savedir = 'cn_img';
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $fileuplodeurl = "{$savedir}/colony_{$uid}.{$attach_ext}";
                $thumbdir = '';
            } elseif ($uptype == 'forumlogo') {
                $ifreplace = 0;
                $db_attachdir = 1;
                $db_ifathumb = 0;
                $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                $savedir = 'forumlogo';
                $fileuplodeurl = "{$savedir}/{$fid}.{$attach_ext}";
            } elseif ($uptype == 'photo') {
                if ($t == 'replace') {
                    $ifreplace = 1;
                    $fileuplodeurl = $replacedb[$i];
                    $tmpurl = strrchr($fileuplodeurl, '/');
                    $fileuplodename = $tmpurl ? substr($tmpurl, 1) : $fileuplodeurl;
                    $tmpname = $uptype . "_{$fileuplodename}";
                } else {
                    $ifreplace = 0;
                    $uid .= substr(md5($timestamp . $i . randstr(8)), 10, 15);
                    $tmpname = $uptype . "_{$uid}.{$attach_ext}";
                    $fileuplodeurl = $fileuplodename = "{$uid}.{$attach_ext}";
                    $db_ifathumb = 1;
                    if ($db_attachdir) {
                        $savedir = 'photo/';
                        if ($db_attachdir == 2) {
                            $savedir .= 'Day_' . date('ymd');
                        } elseif ($db_attachdir == 3) {
                            $savedir .= "Cyid_{$GLOBALS['cyid']}";
                        } else {
                            $savedir .= 'Mon_' . date('ym');
                        }
                        $fileuplodeurl = $savedir . '/' . $fileuplodeurl;
                    }
                }
                $thumbdir = str_replace($fileuplodename, 's_' . $fileuplodename, $fileuplodeurl);
            } else {
                if ($action == 'modify' && $t == 'replace' && isset($replacedb[$i])) {
                    $ifreplace = 1;
                    $fileuplodeurl = $replacedb[$i]['attachurl'];
                    $tmpurl = strrchr($fileuplodeurl, '/');
                    $tmpname = $uptype . '_' . ($tmpurl ? substr($tmpurl, 1) : $fileuplodeurl);
                } else {
                    $ifreplace = 0;
                    $attach_ext = preg_replace('/(php|asp|jsp|cgi|fcgi|exe|pl|phtml|dll|asa|com|scr|inf)/i', "scp_\\1", $attach_ext);
                    $winddb['uploadtime'] = $timestamp;
                    $winddb['uploadnum']++;
                    $prename = substr(md5($timestamp . $i . randstr(8)), 10, 15);
                    $tmpname = $uptype . "_{$prename}.{$attach_ext}";
                    $fileuplodeurl = $fid . "_{$uid}_{$prename}.{$attach_ext}";
                    if ($db_attachdir) {
                        if ($db_attachdir == 2) {
                            $savedir = "Type_{$attach_ext}";
                        } elseif ($db_attachdir == 3) {
                            $savedir = 'Mon_' . date('ym');
                        } elseif ($db_attachdir == 4) {
                            $savedir = 'Day_' . date('ymd');
                        } else {
                            $savedir = "Fid_{$fid}";
                        }
                        $fileuplodeurl = $savedir . '/' . $fileuplodeurl;
                    }
                }
                $thumbdir = "thumb/{$fileuplodeurl}";
            }
            $havefile = $ifthumb = 0;
            if ($db_ifftp || file_exists("{$attachdir}/{$fileuplodeurl}")) {
                $havefile = 1;
                $source = D_P . "data/tmp/{$tmpname}";
            } else {
                $source = "{$attachdir}/{$fileuplodeurl}";
            }
            if (!postupload($atc_attachment, $source)) {
                uploadmsg($uptype, 'upload_error');
            }
            if ($uptype == 'face') {
                $max_source = $attachdir . "/upload/tmp/max_{$tmpname}";
                if (!copy($source, $max_source)) {
                    uploadmsg($uptype, 'upload_error');
                }
                /*
                if (!postupload($atc_attachment,$max_source)) {
                	uploadmsg($uptype,'upload_error');
                }
                */
            }
            $ifupload = 3;
            $type = 'zip';
            $img_size[0] = $img_size[1] = 0;
            $size = ceil(filesize($source) / 1024);
            if (in_array($attach_ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'swf'))) {
                require_once R_P . 'require/imgfunc.php';
                if (!($img_size = GetImgSize($source, $attach_ext))) {
                    P_unlink($source);
                    uploadmsg($uptype, 'upload_content_error');
                }
                $ifupload = 1;
                $img_size[0] = $img_size['width'];
                $img_size[1] = $img_size['height'];
                unset($img_size['width'], $img_size['height']);
                $type = 'img';
                if ($attach_ext == 'swf') {
                    $type = 'zip';
                } elseif ($db_ifathumb) {
                    $thumburl = $havefile ? D_P . "data/tmp/thumb_{$tmpname}" : "{$attachdir}/{$thumbdir}";
                    list($db_thumbw, $db_thumbh) = explode("\t", $db_athumbsize);
                    list($cenTer, $sameFile) = explode("\t", $thumbs);
                    createFolder(dirname($thumburl));
                    if ($thumbsize = MakeThumb($source, $thumburl, $db_thumbw, $db_thumbh, $cenTer, $sameFile)) {
                        $img_size[0] = $thumbsize[0];
                        $img_size[1] = $thumbsize[1];
                        $source != $thumburl && ($ifthumb = 1);
                    }
                }
                if ($uptype == 'all' && $db_watermark && $forumset['watermark'] && $img_size[2] < '4' && $img_size[0] > $db_waterwidth && $img_size[1] > $db_waterheight && function_exists('imagecreatefromgif') && function_exists('imagealphablending') && ($attach_ext != 'gif' || function_exists('imagegif') && ($db_ifgif == 2 || $db_ifgif == 1 && (PHP_VERSION > '4.4.2' && PHP_VERSION < '5' || PHP_VERSION > '5.1.4'))) && ($db_waterimg && function_exists('imagecopymerge') || !$db_waterimg && function_exists('imagettfbbox'))) {
                    ImgWaterMark($source, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
                    if ($ifthumb == 1) {
                        ImgWaterMark($thumburl, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
                    }
                }
            } elseif ($attach_ext == 'txt') {
                if (preg_match('/(onload|submit|post|form)/i', readover($source))) {
                    P_unlink($source);
                    uploadmsg($uptype, 'upload_content_error');
                }
                $ifupload = 2;
                $type = 'txt';
            }
            require_once R_P . 'require/functions.php';
            if (pwFtpNew($GLOBALS['ftp'], $db_ifftp) && $GLOBALS['ftp']->upload($source, $fileuplodeurl)) {
                P_unlink($source);
                P_unlink("{$attachdir}/{$fileuplodeurl}");
                if ($ifthumb == 1) {
                    $GLOBALS['ftp']->mkdir("thumb/{$savedir}");
                    $GLOBALS['ftp']->upload($thumburl, $thumbdir) && P_unlink($thumburl);
                }
            } elseif ($havefile) {
                P_unlink("{$attachdir}/{$fileuplodeurl}");
                @rename($source, "{$attachdir}/{$fileuplodeurl}");
                if ($ifthumb == 1) {
                    P_unlink("{$attachdir}/{$thumbdir}");
                    @rename($thumburl, "{$attachdir}/{$thumbdir}");
                }
            }
            $uploaddb[] = array('id' => $i, 'ifreplace' => $ifreplace, 'name' => $atc_attachment_name, 'size' => $size, 'type' => $type, 'attachurl' => $fileuplodeurl, 'ifthumb' => $ifthumb, 'img_w' => $img_size[0], 'img_h' => $img_size[1], 'tmpname' => $tmpname);
        }
    }
    return $uploaddb;
}
 /**
  * @static
  */
 function waterMark($source, $ext, $imgsize = null)
 {
     global $db_watermark, $db_waterwidth, $db_waterheight, $db_ifgif, $db_waterimg, $db_waterpos, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality;
     empty($imgsize) && ($imgsize = GetImgSize($source, $ext));
     if (empty($imgsize)) {
         return;
     }
     if ($db_watermark && $imgsize['type'] < 4 && $imgsize['width'] > $db_waterwidth && $imgsize['height'] > $db_waterheight && function_exists('imagecreatefromgif') && function_exists('imagealphablending') && ($ext != 'gif' || function_exists('imagegif') && ($db_ifgif == 2 || $db_ifgif == 1 && (PHP_VERSION > '4.4.2' && PHP_VERSION < '5' || PHP_VERSION > '5.1.4'))) && ($db_waterimg && function_exists('imagecopymerge') || !$db_waterimg && function_exists('imagettfbbox'))) {
         ImgWaterMark($source, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
     }
 }
Example #4
0
 }
 $newattname = $fileuplodeurl = preg_replace('/^0_/', "{$fid}_", $rt['attachurl']);
 $savedir && ($fileuplodeurl = $savedir . '/' . $fileuplodeurl);
 $dstfile = "{$attachdir}/{$fileuplodeurl}";
 $srcfile = "{$attachdir}/mutiupload/{$rt['attachurl']}";
 $ifthumb = 0;
 if (in_array($attach_ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) {
     require_once R_P . 'require/imgfunc.php';
     if (!($img_size = GetImgSize($srcfile, $attach_ext))) {
         Showmsg('upload_content_error');
     }
     $img_size[0] = $img_size['width'];
     $img_size[1] = $img_size['height'];
     unset($img_size['width'], $img_size['height']);
     if ($db_watermark && $forumset['watermark'] && $img_size[2] < '4' && $img_size[0] > $db_waterwidth && $img_size[1] > $db_waterheight && function_exists('imagecreatefromgif') && function_exists('imagealphablending') && ($attach_ext != 'gif' || function_exists('imagegif') && ($db_ifgif == 2 || $db_ifgif == 1 && (PHP_VERSION > '4.4.2' && PHP_VERSION < '5' || PHP_VERSION > '5.1.4'))) && ($db_waterimg && function_exists('imagecopymerge') || !$db_waterimg && function_exists('imagettfbbox'))) {
         ImgWaterMark($srcfile, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
     }
     if ($db_ifathumb) {
         $thumbdir = "thumb/{$fileuplodeurl}";
         $thumburl = $db_ifftp ? D_P . "data/tmp/thumb_{$newattname}" : "{$attachdir}/{$thumbdir}";
         list($db_thumbw, $db_thumbh) = explode("\t", $db_athumbsize);
         createFolder(dirname($thumburl));
         if ($thumbsize = MakeThumb($srcfile, $thumburl, $db_thumbw, $db_thumbh)) {
             $img_size[0] = $thumbsize[0];
             $img_size[1] = $thumbsize[1];
             $ifthumb = 1;
         }
     }
     //Start elementupdate
     if ($db_ifpwcache & 512 && !$value['needrvrc'] && !$elementpic) {
         $elementpic = array('aid' => $rt['aid'], 'attachurl' => $fileuplodeurl, 'ifthumb' => $ifthumb);
Example #5
0
    $sql_about = $GETSQL->fSql("*", "`{$ODBC['tablepre']}about`", "", "ORDER BY `about_id`", $nPage * $nCount, $nCount);
    $fpageup = fPagesadmin($nNums, $nPage, $nCount, $cParameter, "showtable", 1);
    $smarty->assign('sql_about', $sql_about);
    $smarty->assign('fpageup', $fpageup);
    $smarty->display("about.htm");
}
if ($option == 'newsedit') {
    if ($type == 'edit') {
        die("<iframe name='releasediframe' width='700' height='600' frameborder=0 marginheight=0 marginwidth=0 scrolling=auto src='admin.php?action=about&option=newsedit&id={$id}'>您的浏览器不支持iframe</iframe>");
    }
    if ($_GET['update'] == 'img' && $_FILES['fileContent']['name'] != '') {
        include_once GetLang('image');
        include_once Getincludefun("image");
        $img = fUploadimg_process($_FILES['fileContent'], "{$config['attach']}/system/");
        if ($IMG_upment['watermark'] == '1') {
            ImgWaterMark("{$config['attach']}/system/{$img}", $IMG_upment['waterpos'], $IMG_upment['waterimg'], $IMG_upment['watertext'], $IMG_upment['waterfont'], $IMG_upment['watercolor'], $IMG_upment['waterpct']);
        }
        $cQuery = array("`img_picid`", "`img_picsrc`", "`img_picsize`", "`img_uid`");
        $cData = array($nowtime . $_POST['fileKey'], $img, $_FILES['fileContent']['size'], $uid);
        $GETSQL->fInsert("`{$ODBC['tablepre']}images`", $cQuery, $cData);
        header("Location: update.php?action=img&fileKey={$_POST['fileKey']}&img={$img}");
        exit;
    }
    if ($_POST['blog_title'] != '' && $_POST['blog_body'] != '') {
        if ($_POST['bid'] != '') {
            $GETSQL->fUpdate("`{$ODBC['tablepre']}about`", "`about_subject`='{$_POST['blog_title']}',\n\t\t\t`about_content`='{$_POST['blog_body']}'", "`about_id`='{$_POST['bid']}'");
            header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}修改成功") . "&a={$action}&p={$option}&id={$_POST['bid']}&u=admin");
        } else {
            $cQuery = array("`about_id`", "`about_subject`", "`about_content`");
            $cData = array($nowtime, $_POST['blog_title'], $_POST['blog_body']);
            $GETSQL->fInsert("`{$ODBC['tablepre']}about`", $cQuery, $cData);
Example #6
0
function UploadDiary($uid, $uptype = 'all', $thumbs = null)
{
    global $ifupload, $db_attachnum, $o_uploadsize, $a, $did, $replacedb, $winddb, $_G, $tdtime, $timestamp, $o_attachdir, $attachdir, $db_watermark, $db_waterwidth, $db_waterheight, $db_ifgif, $db_waterimg, $db_waterpos, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality, $db_ifathumb, $db_iffthumb, $db_athumbsize, $db_fthumbsize, $atc_attachment_name, $attach_ext, $savedir;
    $uploaddb = array();
    foreach ($_FILES as $key => $value) {
        if (if_uploaded_file($value['tmp_name'])) {
            list($t, $i) = explode('_', $key);
            $i = (int) $i;
            $atc_attachment = $value['tmp_name'];
            $atc_attachment_name = S::escapeChar($value['name']);
            $atc_attachment_size = $value['size'];
            $attach_ext = strtolower(substr(strrchr($atc_attachment_name, '.'), 1));
            if (empty($attach_ext) || !isset($o_uploadsize[$attach_ext])) {
                uploadmsg($uptype, 'upload_type_error');
            }
            if ((int) $atc_attachment_size < 1) {
                uploadmsg($uptype, 'upload_size_0');
            }
            if ($o_uploadsize[$attach_ext] && $atc_attachment_size > $o_uploadsize[$attach_ext] * 1024) {
                $GLOBALS['oversize'] = $o_uploadsize[$attach_ext];
                uploadmsg($uptype, 'upload_size_error');
            }
            if ($a == 'edit' && $t == 'replace' && isset($replacedb[$i])) {
                $ifreplace = 1;
                $fileuplodeurl = $replacedb[$i]['attachurl'];
                $tmpurl = strrchr($fileuplodeurl, '/');
                $tmpname = $uptype . '_' . ($tmpurl ? substr($tmpurl, 1) : $fileuplodeurl);
            } else {
                $ifreplace = 0;
                $attach_ext = preg_replace('/(php|asp|jsp|cgi|fcgi|exe|pl|phtml|dll|asa|com|scr|inf)/i', "scp_\\1", $attach_ext);
                $winddb['uploadtime'] = $timestamp;
                $winddb['uploadnum']++;
                $prename = substr(md5($timestamp . $i . randstr(8)), 10, 15);
                $tmpname = $uptype . "_{$prename}.{$attach_ext}";
                $fileuplodeurl = $uid . "_{$did}_{$prename}.{$attach_ext}";
                if ($o_attachdir) {
                    if ($o_attachdir == 1) {
                        $savedir = "Type_{$attach_ext}";
                    } elseif ($o_attachdir == 2) {
                        $savedir = 'Mon_' . date('ym');
                    } elseif ($o_attachdir == 3) {
                        $savedir = 'Day_' . date('ymd');
                    }
                    $fileuplodeurl = $savedir . '/' . $fileuplodeurl;
                }
            }
            $thumbdir = "thumb/diary/{$fileuplodeurl}";
            $havefile = $ifthumb = 0;
            $source = "{$attachdir}/diary/{$fileuplodeurl}";
            if (!postupload($atc_attachment, $source)) {
                uploadmsg($uptype, 'upload_error');
            }
            $ifupload = 3;
            $img_size[0] = $img_size[1] = 0;
            $size = ceil(filesize($source) / 1024);
            if (in_array($attach_ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) {
                require_once R_P . 'require/imgfunc.php';
                if (!($img_size = GetImgSize($source, $attach_ext))) {
                    P_unlink($source);
                    uploadmsg($uptype, 'upload_content_error');
                }
                $ifupload = 1;
                $img_size[0] = $img_size['width'];
                $img_size[1] = $img_size['height'];
                unset($img_size['width'], $img_size['height']);
                $type = 'img';
                if ($db_ifathumb) {
                    $thumburl = $havefile ? D_P . "data/tmp/thumb_{$tmpname}" : "{$attachdir}/{$thumbdir}";
                    list($db_thumbw, $db_thumbh) = explode("\t", $db_athumbsize);
                    list($cenTer, $sameFile) = explode("\t", $thumbs);
                    createFolder(dirname($thumburl));
                    if ($thumbsize = MakeThumb($source, $thumburl, $db_thumbw, $db_thumbh, $cenTer, $sameFile)) {
                        $img_size[0] = $thumbsize[0];
                        $img_size[1] = $thumbsize[1];
                        $source != $thumburl && ($ifthumb = 1);
                    }
                }
                if ($uptype == 'all' && $db_watermark && $img_size[2] < '4' && $img_size[0] > $db_waterwidth && $img_size[1] > $db_waterheight && function_exists('imagecreatefromgif') && function_exists('imagealphablending') && ($attach_ext != 'gif' || function_exists('imagegif') && ($db_ifgif == 2 || $db_ifgif == 1 && (PHP_VERSION > '4.4.2' && PHP_VERSION < '5' || PHP_VERSION > '5.1.4'))) && ($db_waterimg && function_exists('imagecopymerge') || !$db_waterimg && function_exists('imagettfbbox'))) {
                    ImgWaterMark($source, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
                    if ($ifthumb == 1) {
                        ImgWaterMark($thumburl, $db_waterpos, $db_waterimg, $db_watertext, $db_waterfont, $db_watercolor, $db_waterpct, $db_jpgquality);
                    }
                }
            }
            if ($havefile) {
                P_unlink("{$attachdir}/diary/{$fileuplodeurl}");
                @rename($source, "{$attachdir}/diary/{$fileuplodeurl}");
                if ($ifthumb == 1) {
                    P_unlink("{$attachdir}/{$thumbdir}");
                    @rename($thumburl, "{$attachdir}/{$thumbdir}");
                }
                if ($m_ifthumb == 1) {
                    //TODO $m_ifthumb?
                    P_unlink("{$attachdir}/{$m_thumbdir}/diary");
                    //TODO $m_thumbdir?
                    @rename($m_thumburl, "{$attachdir}/{$m_thumbdir}/diary");
                    //TODO $m_thumburl?
                }
                if ($s_ifthumb == 1) {
                    //TODO $m_ifthumb?
                    P_unlink("{$attachdir}/{$s_thumbdir}/diary");
                    //TODO $s_thumbdir?
                    @rename($s_thumburl, "{$attachdir}/{$s_thumbdir}/diary");
                    //TODO $s_thumburl?
                }
            }
            $uploaddb[] = array('id' => $i, 'ifreplace' => $ifreplace, 'name' => $atc_attachment_name, 'size' => $size, 'type' => $type, 'attachurl' => $fileuplodeurl, 'ifthumb' => $ifthumb, 'img_w' => $img_size[0], 'img_h' => $img_size[1]);
        }
    }
    return $uploaddb;
}
function WaterImg($srcFile,$fromGo='up')
{
   include(dirname(__FILE__)."/inc_photowatermark_config.php");
   if($photo_markup!='1') return;
   $info = "";
   $srcInfo = GetImageSize($srcFile,$info);
   $srcFile_w    = $srcInfo[0];
   $srcFile_h    = $srcInfo[1];
   if($srcFile_w < $photo_wwidth || $srcFile_h < $photo_wheight) return;
   if($fromGo=='up' && $photo_markup=='0') return;
   if($fromGo=='down' && $photo_markdown=='0') return;   
   $trueMarkimg = dirname(__FILE__).'/data/'.$photo_markimg;
   if(!file_exists($trueMarkimg) || empty($photo_markimg)) $trueMarkimg = "";
   ImgWaterMark($srcFile,$photo_waterpos,$trueMarkimg,$photo_watertext,$photo_fontsize,$photo_fontcolor,$photo_diaphaneity); 
}
Example #8
0
             $ncontent = str_replace("\n", "\\n", $ncontent);
             $ncontent = str_replace("\r", "\\r", $ncontent);
             $ncontent = str_replace("\"", "\\\"", $ncontent);
             $smarty->assign('ncontent', $ncontent);
             $smarty->assign('sql_hotelthread', $sql_hotelthread);
         }
         $smarty->assign('sql_hotel', $sql_hotel);
         $smarty->display("travelattredit.htm");
     }
 }
 if ($option == 'travelphoto') {
     $sql_hotel = $GETSQL->fSql("sc_id,sc_uid,sc_info,sc_traffic", "`{$ODBC['tablepre']}travel`", "`sc_id`='{$id}'", "", "", "", "U_B");
     if ($sql_hotel['sc_id'] != '' and $uid == $sql_hotel['sc_uid'] || in_array('travel', $authority) || $sql_pop['group_authority'] == 'all') {
         if ($_FILES['uploadphoto']['name'] != "" && $_POST['uploadsubject'] != '') {
             $img = "{$config['attach']}/travel/" . fUploadimg_process($_FILES['uploadphoto'], "{$config['attach']}/travel/", "simll/");
             ImgWaterMark($img, $IMG_upment['waterpos'], $IMG_upment['waterimg'], $IMG_upment['watertext'], $IMG_upment['waterfont'], $IMG_upment['watercolor'], $IMG_upment['waterpct']);
             $cQuery = array("`hi_id`", "`hi_hid`", "`hi_src`", "`hi_subject`", "`hi_date`");
             $cData = array($nowtime, $sql_hotel['sc_id'], $img, $_POST['uploadsubject'], fgetdate());
             $GETSQL->fInsert("`{$ODBC['tablepre']}travelimage`", $cQuery, $cData);
             $cQuery = array("`img_picid`", "`img_did`", "`img_picsrc`", "`img_picsize`", "`img_uid`");
             $cData = array($nowtime, $nowtime, $img, $_FILES['uploadphoto']['size'], $uid);
             $GETSQL->fInsert("`{$ODBC['tablepre']}images`", $cQuery, $cData);
             $GETSQL->fUpdate("`{$ODBC['tablepre']}travel`", "`sc_album`=`sc_album`+1", "`sc_id`='{$id}'");
             if ($actionhtml = GetCache('travel')) {
                 include_once $actionhtml;
                 if ($cache_config['cache'] == '1') {
                     P_unlink(R_P . "html/travel/travelphoto_I_{$id}.htm");
                     ffile("{$boardurl}index.php?action=travel&option=travelphoto&id={$id}", '', "r");
                 }
             }
             echo "<script type='text/javascript' language='javascript' src='lang/ajax.js'></script>\n\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\tvar s = new parent.dialog();s.init();\n\t\t\t\ts.set('src', 2);\n\t\t\t\ts.set('title', '系统提示信息');\n\t\t\t\ts.event('图片上传成功','parent.window.location.reload();','','parent.window.location.reload();');\n\t\t\t\t</script>";