function savethumb_action() { $upload_path = $this->uppath(); $upload_path = ltrim($upload_path, '.'); if (stripos(trim($_POST['img1']), $upload_path) === false) { $this->ACT_layer_msg("非法操作!", 8, $_SERVER['HTTP_REFERER']); } include LIB_PATH . "sizer.class.php"; $sizer = new Sizer("../data/upload/company/" . date('Ymd') . '/'); $t_name = $sizer->sizeIt(); $company = $this->obj->DB_select_once("company", "`uid`='" . $this->uid . "'", "`logo`"); if ($company['logo']) { if ($company['logo'] != './' . $this->config['sy_unit_icon']) { unlink_pic('.' . $company['logo']); } } else { $this->get_integral_action($this->uid, "integral_avatar", "上传头像"); } $ref = $this->obj->update_once("company", array('logo' => str_replace("../data/upload/company/", "./data/upload/company/", $t_name[1])), array('uid' => $this->uid)); if ($ref) { echo 1; } else { echo 2; } }
function savethumb_action() { $upload_path = $this->uppath(); $upload_path = ltrim($upload_path, '.'); if (stripos(trim($_POST['img1']), $upload_path) === false || stripos(trim($_POST['img2']), $upload_path) === false) { $this->ACT_layer_msg("非法操作!", 8, $_SERVER['HTTP_REFERER']); } include LIB_PATH . "sizer.class.php"; $sizer = new Sizer("../data/upload/user/" . date('Ymd') . '/'); $t_name = $sizer->sizeIt(); $resume = $this->obj->DB_select_once("resume", "`uid`='" . $this->uid . "'", "`photo`,`resume_photo`"); if ($resume['photo'] != './' . $this->config['sy_member_icon']) { unlink_pic('.' . $resume['photo']); } if ($resume['resume_photo'] != './' . $this->config['sy_member_icon']) { unlink_pic('.' . $resume['resume_photo']); } if ($resume['photo'] == '') { $this->get_integral_action($this->uid, "integral_avatar", "上传头像"); } $resume_photo = str_replace("../data/upload/user/", "./data/upload/user/", $t_name[1]); $photo = str_replace("../data/upload/user/", "./data/upload/user/", $t_name[2]); $ref = $this->obj->update_once("resume", array('resume_photo' => $resume_photo, 'photo' => $photo), array('uid' => $this->uid)); $this->obj->DB_update_all("resume_expect", "`photo`='" . $photo . "'", "`uid`='" . $this->uid . "'"); if ($ref) { $this->obj->member_log("上传头像"); echo 1; } else { echo 2; } }
function savethumb_action() { $upload_path = $this->uppath(); $upload_path = ltrim($upload_path, '.'); $M = $this->MODEL('friend'); if (stripos(trim($_POST['img1']), $upload_path) === false || stripos(trim($_POST['img2']), $upload_path) === false) { $this->ACT_layer_msg("非法操作!", 8, $_SERVER['HTTP_REFERER']); } include LIB_PATH . "sizer.class.php"; $sizer = new Sizer("../data/upload/friend/" . date('Ymd') . '/'); $t_name = $sizer->sizeIt(); $finfo = $M->GetFriendInfo(array("uid" => $this->uid), array("field" => "`pic`,`pic_big`")); if ($finfo['pic'] != '../' . $this->config['sy_member_icon']) { unlink_pic($finfo['pic']); } if ($finfo['pic_big'] != '../' . $this->config['sy_member_icon']) { unlink_pic($finfo['pic_big']); } $ref = $M->SaveFriendInfo(array('pic_big' => $t_name[1], 'pic' => $t_name[1]), array('uid' => $this->uid)); if ($ref) { $this->addstate("我刚更换了新头像,快来看看吧。"); $M->member_log("更换了新头像"); echo 1; } else { echo 2; } }
<?php /** * This page grabs the Image object out of the $_SESSION and gives it to the generator * * @author Casper Wilkes <*****@*****.**> */ require '../boot.php'; // Set up the view and title // $view = 'generator'; $page_title = 'Generated'; // Get the Image object // $image = $_SESSION['image']; // Instatiate the sizer // $generator = new Sizer($image); // Use the name to display the image and pass it to the download button // $name = $image->get('name'); // Resize the image // if ($generator->resize()) { // Resize successful, output image and download button // $messages = '<p><button value="Download"><a href="download.php?image=' . $name . '" title="Download Image">Download Image</a></button></p>'; $output = '<img src="' . 'assets/images/resized/' . $name . '"/>'; } else { // Something went wrong $output = ''; $messages = '<p>Could not generate image at this time. Check logs and try again.</p>'; } // Set up template // require VIEWS . DS . 'base.php';