本文整理汇总了PHP中Thumbnail::MakeNew方法的典型用法代码示例。如果您正苦于以下问题:PHP Thumbnail::MakeNew方法的具体用法?PHP Thumbnail::MakeNew怎么用?PHP Thumbnail::MakeNew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thumbnail
的用法示例。
在下文中一共展示了Thumbnail::MakeNew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$fileName = time() . $_FILES["filename"]["name"];
$size = $_FILES['flImage']["size"];
$size = $size / 1024 / 1024;
// converting in MB
$MAX_FILESIZE = MAX_FILESIZE;
if (move_uploaded_file($_FILES["filename"]["tmp_name"], "question_images/" . $fileName)) {
list($width, $height) = getimagesize("question_images/" . $fileName);
if ($width < MIN_ENTRY_RESOLUTION_WIDTH || $height < MIN_ENTRY_RESOLUTION_HEIGHT) {
$isValidUpload = false;
} else {
$pic = new Thumbnail();
$pic->filename = "question_images/" . $fileName;
$pic->filename2 = "question_images/image/image_" . $fileName;
$pic->maxW = 400;
$pic->SetNewWH();
$pic->MakeNew();
$pic->FinirPImage();
}
}
}
?>
<!--------------content bar-------->
<div id="main_bar">
<div id="main_box">
<div id="left_box">
<?php
if ($_SESSION['admin_type'] == 1) {
示例2: fbauth
//.........这里部分代码省略.........
$affs = $me['affiliations'];
$schoolid = -1;
$affs2 = array_reverse($affs);
if (is_array($affs2[0])) {
foreach ($affs2 as $indaff) {
if ($indaff['type'] == "college") {
$schoolid = $indaff['nid'];
$schoolname = $indaff['name'];
break;
}
}
}
if ($me['id'] == "100002408771848") {
$schoolid = -1;
}
if ($schoolid == "16777217") {
$schoolid = 1;
}
$checkschool = "select name from school where id='" . $schoolid . "'";
$db = new Database();
$db->query($checkschool);
$result = $db->getresult();
if (strlen($result['name'] < 1)) {
$insertschool = "insert into school set id='" . $schoolid . "', name='" . $schoolname . "'";
$db->query($insertschool);
}
if ($me['gender'] == 'male') {
$sex = 2;
} else {
$sex = 1;
}
$defaultpicture = "http://graph.facebook.com/" . $me['id'] . "/picture?type=large";
$contents = file_get_contents($defaultpicture);
$target_path = "/home/newportb/public_html/photos/";
$firstsubset = rand(100000, 9999999);
$secondsubset = rand(100000, 9999999);
$thirdsubset = rand(1000000, 99989999);
$generated_path = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_n.jpg";
while (file_exists($generated_path)) {
$firstsubset = rand(100000, 9999999);
$secondsubset = rand(100000, 9999999);
$thirdsubset = rand(1000000, 99989999);
$generated_path = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_n.jpg";
}
$full_target_path = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_f.jpg";
file_put_contents($full_target_path, $contents);
//NORMAL
$pic3 = new Thumbnail();
$pic3->filename = $full_target_path;
$pic3->filename2 = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_n.jpg";
$pic3->maxW = 170;
$pic3->maxH = 400;
$pic3->Text = "";
$pic3->SetNewWH();
$pic3->MakeNew();
$pic3->FinirPImage();
//SEARCH
$pic2 = new Thumbnail();
$pic2->filename = $full_target_path;
$pic2->filename2 = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_s.jpg";
$pic2->maxW = 100;
$pic2->maxH = 200;
$pic2->Text = "";
$pic2->SetNewWH();
$pic2->MakeNew();
$pic2->FinirPImage();
//THUMBNAIL
$pic2 = new Thumbnail();
$pic2->filename = $full_target_path;
$pic2->filename2 = $target_path . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "_t.jpg";
$pic2->maxW = 50;
$pic2->maxH = 50;
$pic2->Text = "";
$pic2->SetNewWH();
$pic2->MakeNew();
$pic2->FinirPImage();
unlink($full_target_path);
$registerdate = date("Y-m-d");
$dtime = date('Y-m-d H:i:s');
$me['name'] = str_replace("'", "'", $me['name']);
if ($accountstatusid != 1) {
$newfbuser = "INSERT INTO `user` \n\t\t\t\t\t(`id`, `email`, `password`, `accountstatusid`, `registerdate`, `name`, `schoolid`, `phone`, \n\t\t\t\t\t`phoneproviderid`, `graduationyear`, `schoolstatusid`, `sexid`, `residenceid`, `birthday`, \n\t\t\t\t\t`hometown`, `highschoolid`, `screennameid`, `websites`, `politicalid`)\n\t\t\t\t\tVALUES \n\t\t\t\t\t('" . $me['id'] . "', '" . $me['email'] . "', 'fblogin', '2', '" . $registerdate . "', '" . $me['name'] . "', '" . $schoolid . "', '', '', '', '1', '" . $sex . "', '', '" . $me['birthday'] . "', '', '', '', '', '');";
} else {
$newfbuser = "UPDATE `user` SET\n\t\t\t\t\t`email`='" . $me['email'] . "',\n\t\t\t\t\t`accountstatusid`='2', \n\t\t\t\t\t`registerdate`='" . $registerdate . "', \n\t\t\t\t\t`schoolid`='" . $schoolid . "', \n\t\t\t\t\t`schoolstatusid`='1', \n\t\t\t\t\t`sexid`='" . $sex . "', \n\t\t\t\t\t`birthday`='" . $me['birthday'] . "'\n\t\t\t\t\tWHERE `id`='" . $me['id'] . "' LIMIT 1\n\t\t\t\t\t";
}
$updateprofile = "insert into `profileupdates` (`id`, `userid`, `timestamp`) VALUES (NULL, '" . $me['id'] . "', '" . $dtime . "');";
$setpicture = "insert into `picture` (`userid`, `albumid`, `link`) VALUES ('" . $me['id'] . "', '0', '" . $firstsubset . "_" . $secondsubset . "_" . $thirdsubset . "');";
$site = new site();
if ($site->get_setting('email_alerts') == 1) {
$body = "Name: " . $me['name'] . ".<br>Email: " . $me['email'];
email::send('reports@harvardconnection.co', 'New Registration', $body);
}
$db->query($newfbuser);
$db->query($updateprofile);
$db->query($setpicture);
$this->newuser = true;
$this->fbauth($me);
return true;
}
}