How to create Pinterest-like script - step 3

How to create Pinterest-like script – step 3 I hope you’re looking forward to a new lesson. For today I prepared few important changes. For the first – this is a new login and registration system for our script, the second – since today we are going to use database to keep information about members, photos, and for future comments. Now, you need to log in to be able to upload photos. Today I’ll publish all updated files of our script, in case if you want to investigate everything at your local computer – you always can download full package with sources.

如何创建类似Pinterest的脚本–步骤3我希望您期待新的课程。 今天,我准备了一些重要的更改。 首先,这是一个新的脚本登录和注册系统,其次,从今天开始,我们将使用数据库来保存有关成员,照片和将来的评论的信息。 现在,您需要登录才能上传照片。 今天,我将发布脚本的所有更新文件,以防万一您想在本地计算机上调查所有内容–您始终可以下载带有源代码的完整软件包。

Now you can check our demo and download the sources here:

现在,您可以查看我们的演示并在此处下载资源:

现场演示

[sociallocker]

[社交储物柜]

打包下载

[/sociallocker]

[/ sociallocker]

步骤1. SQL (Step 1. SQL)

To better understand how it works – let’s look at all the new database tables:

为了更好地理解它的工作原理,我们来看一下所有新的数据库表:


CREATE TABLE `pd_profiles` (`id` int(10) unsigned NOT NULL auto_increment,`first_name` varchar(255) NOT NULL default '',`last_name` varchar(255) NOT NULL default '',`email` varchar(255) NOT NULL default '',`password` varchar(40) NOT NULL default '',`salt` varchar(10) NOT NULL default '',`status` enum('active','passive') NOT NULL default 'active',`role` tinyint(4) unsigned NOT NULL default '1',`date_reg` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
INSERT INTO `pd_profiles` (`first_name`, `last_name`, `email`, `password`, `salt`, `status`, `role`, `date_reg`) VALUES
('test user first name', 'test user last name', 'user@user.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 1, NOW()),
('moderator first name', 'moderator last name', 'moderator@moderator.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 2, NOW()),
('admin first name', 'admin last name', 'admin@admin.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 3, NOW()),
('test user 2 first name', 'test user 2 last name', 'user2@user.com', 'b88c654d6c68fc37f4dda1d29935235eea9a845b', 'testing', 'active', 1, NOW());
CREATE TABLE IF NOT EXISTS `pd_photos` (`id` int(10) unsigned NOT NULL auto_increment,`title` varchar(255) default '',`filename` varchar(255) default '',`owner` int(11) NOT NULL,`when` int(11) NOT NULL default '0',`comments_count` int(11) NOT NULL default '0',PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `pd_photos` (`title`, `filename`, `owner`, `when`) VALUES
('Item #1', 'pic1.jpg', 1, UNIX_TIMESTAMP()),
('Item #2', 'pic2.jpg', 2, UNIX_TIMESTAMP()+1),
('Item #3', 'pic3.jpg', 3, UNIX_TIMESTAMP()+2),
('Item #4', 'pic4.jpg', 4, UNIX_TIMESTAMP()+3);
CREATE TABLE IF NOT EXISTS `pd_items_cmts` (`c_id` int(11) NOT NULL AUTO_INCREMENT ,`c_item_id` int(12) NOT NULL default '0',`c_ip` varchar(20) default NULL,`c_name` varchar(64) default '',`c_text` text NOT NULL ,`c_when` int(11) NOT NULL default '0',PRIMARY KEY (`c_id`),KEY `c_item_id` (`c_item_id`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8;

There are three tables, the first one (pd_profiles) keeps information about members, the second one (pd_photos) keep info about all photos, and the third one is for comments. Please pay attention, that all members have the same password: ‘password’. You have to use email and password to login into system.

一共有三个表格,第一个(pd_profiles)保存有关成员的信息,第二个(pd_photos)保存有关所有照片的信息,第三个用于评论。 请注意,所有成员都使用相同的密码:“ password”。 您必须使用电子邮件和密码登录系统。

步骤2. HTML (Step 2. HTML)

I made small corrections in our ‘index.html’ template file. As you know, we don’t have to display upload form for usual visitors, it is only for logged in members. But, we have to display login and join forms for visitors. Please look at updated html markup of our index page:

我在“ index.html”模板文件中做了一些小的更正。 如您所知,我们不必为普通访问者显示上传表单,仅针对已登录的成员。 但是,我们必须为访问者显示登录和加入表单。 请查看我们索引页面的更新的html标记:

templates / index.html (templates/index.html)


<!DOCTYPE html>
<html lang="en" ><head><meta charset="utf-8" /><meta name="author" content="Script Tutorials" /><title>How to create Pinterest-like script - step 3 | Script Tutorials</title><!-- add styles --><link href="css/main.css" rel="stylesheet" type="text/css" /><link href="css/colorbox.css" rel="stylesheet" type="text/css" /><!-- add scripts --><script src="js/jquery.min.js"></script><script src="js/jquery.colorbox-min.js"></script><script src="js/jquery.masonry.min.js"></script><script src="js/script.js"></script></head><body><!-- header panel --><div class="header_panel"><!-- logo --><a href="#" class="logo"></a><!-- search form --><form action="" method="get" class="search"><input autocomplete="off" name="q" size="27" placeholder="Search" type="text" /><input name="search" type="submit" /></form><!-- navigation menu --><ul class="nav"><li><a href="#">About<span></span></a><ul><li><a href="#">Help</a></li><li><a href="#">Pin It Button</a></li><li><a href="#" target="_blank">For Businesses</a></li><li class="div"><a href="#">Careers</a></li><li><a href="#">Team</a></li><li><a href="#">Blog</a></li><li class="div"><a href="#">Terms of Service</a></li><li><a href="#">Privacy Policy</a></li><li><a href="#">Copyright</a></li><li><a href="#">Trademark</a></li></ul></li>{menu_elements}<li><a href="https://www.script-tutorials.com/pinterest-like-script-step-3/">Back to tutorial</a></li></ul></div>{extra_data}<!-- main container --><div class="main_container">{images_set}</div></body>
</html>

As you see – I added two new template keys: {menu_elements} – this keys will contain extra join and login forms for visitors, and Upload, Profile and Logout menu elements for logged-in members. Our new key {extra_data} contains join and login forms for visitors, and upload form for members. All these forms – pure CSS-driven forms.

如您所见-我添加了两个新的模板键:{menu_elements}-该键将包含用于访客的额外联接和登录表单,以及用于已登录成员的Upload,Profile和Logout菜单元素。 我们的新键{extra_data}包含访问者的加入和登录表单,以及成员的上载表单。 所有这些形式–纯CSS驱动的形式。

步骤3. PHP (Step 3. PHP)

As you might imagine – all our php files were modified. Let’s start with main index file:

如您所料–我们所有的php文件都已修改。 让我们从主索引文件开始:

index.php (index.php)


// set warning level
if (version_compare(phpversion(), '5.3.0', '>=')  == 1)error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
elseerror_reporting(E_ALL & ~E_NOTICE);
require_once('classes/CMySQL.php');
require_once('classes/CMembers.php');
require_once('classes/CPhotos.php');
// get login data
list ($sLoginMenu, $sExtra) = $GLOBALS['CMembers']->getLoginData();
// get all photos
$sPhotos = $GLOBALS['CPhotos']->getAllPhotos();
// draw common page
$aKeys = array('{menu_elements}' => $sLoginMenu,'{extra_data}' => $sExtra,'{images_set}' => $sPhotos
);
echo strtr(file_get_contents('templates/index.html'), $aKeys);

As you see – it is much smaller now. But in the same time you can see that I added three new classes: CMySQL (to work with database), CMembers (to work with members) and CPhotos (to work with photos). Well, this file displays Login and Join forms for visitors and Upload form for active members. Also, we display all photos at this page. The second updated file is:

如您所见–现在它要小得多。 但是在同一时间,您可以看到我添加了三个新类:CMySQL(用于数据库),CMembers(用于成员)和CPhotos(用于照片)。 好吧,此文件为访问者显示“登录”和“加入”表单,为活动成员显示“上传”表单。 另外,我们在此页面上显示所有照片。 第二个更新的文件是:

service.php (service.php)


// set warning level
if (version_compare(phpversion(), '5.3.0', '>=')  == 1)error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
elseerror_reporting(E_ALL & ~E_NOTICE);
require_once('classes/CMySQL.php');
require_once('classes/CMembers.php');
require_once('classes/CPhotos.php');
if (! isset($_SESSION['member_id']) && $_POST['Join'] == 'Join') {$GLOBALS['CMembers']->registerProfile();
}
$i = (int)$_GET['id'];
if (! $i) { // if something is wrong - relocate to error pageheader('Location: error.php');exit;
}
$aPhotoInfo = $GLOBALS['CPhotos']->getPhotoInfo($i);
$aOwnerInfo = $GLOBALS['CMembers']->getProfileInfo($aPhotoInfo['owner']);
$sOwnerName = ($aOwnerInfo['first_name']) ? $aOwnerInfo['first_name'] : $aOwnerInfo['email'];
$sPhotoTitle = $aPhotoInfo['title'];
$sPhotoDate = $GLOBALS['CPhotos']->formatTime($aPhotoInfo['when']);
$sFolder = 'photos/';
$sFullImgPath = $sFolder . 'f_' . $aPhotoInfo['filename'];
?>
<div class="pin bigpin"><div class="owner"><a href="#" class="button follow_button">Follow</a><a target="_blank" class="owner_img" href="#"><img alt="<?= $sOwnerName ?>" src="images/avatar.jpg" /></a><p class="owner_name"><a target="_blank" href="#"><?= $sOwnerName ?></a></p><p class="owner_when">Uploaded on <?= $sPhotoDate ?></p></div><div class="holder"><div class="actions"><a href="#" class="button">Repin</a><a href="#" class="button">Like</a></div><a class="image" href="#" title="<?= $sPhotoTitle ?>"><img alt="<?= $sPhotoTitle ?>" src="<?= $sFullImgPath ?>"></a></div><p class="desc"><?= $sPhotoTitle ?></p><div class="comments"></div><form class="comment" method="post" action="#"><input type="hidden" name="id" value="0" /><textarea placeholder="Add a comment..." maxlength="1000"></textarea><button type="button" class="button">Comment</button></form>
</div>

I just added an user registration. In addition, we do not need to pass the full name of the file to see larger version. Instead, we pass the image ID. The next updated file is uploader:

我刚刚添加了一个用户注册。 此外,我们无需传递文件的全名即可查看较大版本。 相反,我们传递图像ID。 下一个更新的文件是上载器:

upload.php (upload.php)


// set warning level
if (version_compare(phpversion(), '5.3.0', '>=')  == 1)error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
elseerror_reporting(E_ALL & ~E_NOTICE);
require_once('classes/CMySQL.php');
require_once('classes/CMembers.php');
require_once('classes/CPhotos.php');
function uploadImageFile() { // Note: GD library is required for this upload function$iDefWidth = 192; // default photos width (in case of resize)$iFDefWidth = 556; // full default photos width (in case of resize)if ($_SERVER['REQUEST_METHOD'] == 'POST') {$iWidth = $iHeight = $iFDefWidth; // desired image dimensions$iJpgQuality = 75;if ($_FILES) {// if there are no errors and filesize less than 400kbif (! $_FILES['image_file']['error'] && $_FILES['image_file']['size'] < 400 * 1024) {if (is_uploaded_file($_FILES['image_file']['tmp_name'])) {// new unique filename$sTempFileName = 'photos/' . md5(time().rand());// move uploaded file into cache foldermove_uploaded_file($_FILES['image_file']['tmp_name'], $sTempFileName);// change file permission to 644@chmod($sTempFileName, 0644);// if temp file existsif (file_exists($sTempFileName) && filesize($sTempFileName) > 0) {$aSize = getimagesize($sTempFileName); // obtain image infoif (!$aSize) {@unlink($sTempFileName);return;}// check for image type and create a new image from fileswitch($aSize[2]) {case IMAGETYPE_JPEG:$sExt = '.jpg';$vImg = @imagecreatefromjpeg($sTempFileName);break;case IMAGETYPE_PNG:$sExt = '.png';$vImg = @imagecreatefrompng($sTempFileName);break;default:@unlink($sTempFileName);return;}// get source image width and height$iSrcWidth = imagesx($vImg);$iSrcHeight = imagesy($vImg);// recalculate height (depends on width)$iHeight = $iSrcHeight * $iWidth / $iSrcWidth;// create a new true color image$vDstImg = @imagecreatetruecolor($iWidth, $iHeight);// copy and resizeimagecopyresampled($vDstImg, $vImg, 0, 0, 0, 0, $iWidth, $iHeight, $iSrcWidth, $iSrcHeight);// add a blank image object into DB$iLastId = $GLOBALS['CPhotos']->insertBlankPhoto($_FILES['image_file']['name'], $_SESSION['member_id']);// define a result image filename$sResultFileName = 'photos/f_pic' . $iLastId . $sExt;// update filename for our object$GLOBALS['CPhotos']->updateFilename($iLastId, 'pic' . $iLastId . $sExt);// output image to file and set permission 644imagejpeg($vDstImg, $sResultFileName, $iJpgQuality);@chmod($sResultFileName, 0644);// and, prepare a thumbnail as well$iWidth = $iDefWidth;$iHeight = $iSrcHeight * $iWidth / $iSrcWidth;$vDstThImg = @imagecreatetruecolor($iWidth, $iHeight);imagecopyresampled($vDstThImg, $vImg, 0, 0, 0, 0, $iWidth, $iHeight, $iSrcWidth, $iSrcHeight);$sResultThumnName = 'photos/pic' . $iLastId . $sExt;imagejpeg($vDstThImg, $sResultThumnName, $iJpgQuality);@chmod($sResultThumnName, 0644);// unlink temp file@unlink($sTempFileName);return $sResultFileName;}}}}}
}
// upload available only for logged in members
if ($_SESSION['member_id'] && $_SESSION['member_status'] == 'active' && $_SESSION['member_role']) {$sImage = uploadImageFile();echo '1';
}

Now, only logged members can upload photos (as I told in the beginning). Well, I think that now it is important to review all our new classes as well:

现在,只有登录的会员才能上传照片(正如我在开头所述)。 好吧,我认为现在同样重要的是复习我们所有的新课程:

classes / CMembers.php (classes/CMembers.php)


/*
* Members class
*/
class CMembers {// constructorfunction CMembers() {session_start();}// get login box functionfunction getLoginData() {if (isset($_GET['logout'])) { // logout processif (isset($_SESSION['member_email']) && isset($_SESSION['member_pass']))$this->performLogout();}if ($_POST && $_POST['email'] && $_POST['password']) { // login processif ($this->checkLogin($_POST['email'], $_POST['password'], false)) { // successful login$this->performLogin($_POST['email'], $_POST['password']);header('Location: index.php');exit;}} else { // in case if we are already logged inif (isset($_SESSION['member_email']) && $_SESSION['member_email'] && $_SESSION['member_pass']) {$aReplaces = array('{name}' => $_SESSION['member_email'],'{status}' => $_SESSION['member_status'],'{role}' => $_SESSION['member_role'],);// display Profiles menu and Logout$sLoginMenu = <<<EOF
<li><a href="#add_form" id="add_pop">Add +</a></li>
<li><a href="#">Profile<span></span></a><ul><li><a href="#">Invite Friends</a></li><li><a href="#">Find Friends</a></li><li class="div"><a href="#">Boards</a></li><li><a href="#">Pins</a></li><li><a href="#">Likes</a></li><li class="div"><a href="#">Settings</a></li><li><a href="#">Logout</a></li></ul>
</li>
<li><a href="index.php?logout">Logout</a></li>
EOF;$sExtra = <<<EOF
<!-- upload form -->
<a href="#x" class="overlay" id="add_form"></a>
<div class="popup"><div class="header"><a class="close" href="#close">x</a><h2>Upload a Pin</h2></div><form id="upload_form"><input type="file" name="image_file" id="image_file" onchange="" /></form><div id="upload_result"></div>
</div>
EOF;return array($sLoginMenu, $sExtra);}}// display Join and Login menu buttons$sLoginMenu = <<<EOF
<li><a href="#join_form" id="join_pop">Join</a></li>
<li><a href="#login_form" id="login_pop">Login</a></li>
EOF;$sExtra = <<<EOF
<!-- join form -->
<a href="#x" class="overlay2" id="join_form"></a>
<div class="popup"><div class="header"><a class="close" href="#close">x</a><h2>Create your account</h2></div><form method="POST" action="service.php"><ul class="ctrl_grp"><li><input type="text" name="email" /><label>Email Address</label><span class="fff"></span></li><li><input type="password" name="password" /><label>Password</label><span class="fff"></span></li><li><input type="text" name="first_name" /><label>First Name</label><span class="fff"></span></li><li><input type="text" name="last_name" /><label>Last Name</label><span class="fff"></span></li></ul><div><input type="hidden" name="Join" value="Join" /><button class="submit_button" type="submit">Create Account</button></div></form>
</div>
<!-- login form -->
<a href="#x" class="overlay3" id="login_form"></a>
<div class="popup"><div class="header"><a class="close" href="#close">x</a><h2>Login</h2></div><form method="POST" action="index.php"><ul class="ctrl_grp"><li><input type="text" name="email" id="id_email"><label>Email</label><span class="fff"></span></li><li><input type="password" name="password" id="id_password"><label>Password</label><span class="fff"></span></li></ul><div><button class="submit_button" type="submit">Login</button></div></form>
</div>
EOF;return array($sLoginMenu, $sExtra);}// perform loginfunction performLogin($sEmail, $sPass) {$this->performLogout();// make variables safe$sEmail = $GLOBALS['MySQL']->escape($sEmail);$aProfile = $GLOBALS['MySQL']->getRow("SELECT * FROM `pd_profiles` WHERE `email`='{$sEmail}'");// $sPassEn = $aProfile['password'];$iPid = $aProfile['id'];$sSalt = $aProfile['salt'];$sStatus = $aProfile['status'];$sRole = $aProfile['role'];$sPass = sha1(md5($sPass) . $sSalt);$_SESSION['member_id'] = $iPid;$_SESSION['member_email'] = $sEmail;$_SESSION['member_pass'] = $sPass;$_SESSION['member_status'] = $sStatus;$_SESSION['member_role'] = $sRole;}// perform logoutfunction performLogout() {unset($_SESSION['member_id']);unset($_SESSION['member_email']);unset($_SESSION['member_pass']);unset($_SESSION['member_status']);unset($_SESSION['member_role']);}// check loginfunction checkLogin($sEmail, $sPass, $isHash = true) {// escape variables to make them self$sEmail = $GLOBALS['MySQL']->escape($sEmail);$sPass = $GLOBALS['MySQL']->escape($sPass);$aProfile = $GLOBALS['MySQL']->getRow("SELECT * FROM `pd_profiles` WHERE `email`='{$sEmail}'");$sPassEn = $aProfile['password'];if ($sEmail && $sPass && $sPassEn) {if (! $isHash) {$sSalt = $aProfile['salt'];$sPass = sha1(md5($sPass) . $sSalt);}return ($sPass == $sPassEn);}return false;}// profile registrationfunction registerProfile() {$sFirstname = $GLOBALS['MySQL']->escape($_POST['first_name']);$sLastname = $GLOBALS['MySQL']->escape($_POST['last_name']);$sEmail = $GLOBALS['MySQL']->escape($_POST['email']);$sPassword = $GLOBALS['MySQL']->escape($_POST['password']);if ($sEmail && $sPassword) {// check if email is already exists$aProfile = $GLOBALS['MySQL']->getRow("SELECT * FROM `pd_profiles` WHERE `email`='{$sEmail}'");if ($aProfile['id'] > 0) {// relocate to 'error' pageheader('Location: error.php');} else {// generate Salt and Cached password$sSalt = $this->getRandSaltCode();$sPass = sha1(md5($sPassword) . $sSalt);// add new member into database$sSQL = "INSERT INTO `pd_profiles` SET`first_name` = '{$sFirstname}',`last_name` = '{$sLastname}',`email` = '{$sEmail}',`password` = '{$sPass}',`salt` = '{$sSalt}',`status` = 'active',`role` = '1',`date_reg` = NOW();";$GLOBALS['MySQL']->res($sSQL);// autologin$this->performLogin($sEmail, $sPassword);// relocate back to index pageheader('Location: index.php');}} else {// otherwise - relocate to error pageheader('Location: error.php');}}// get random salt codefunction getRandSaltCode($iLen = 8) {$sRes = '';$sChars = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';for ($i = 0; $i < $iLen; $i++) {$z = rand(0, strlen($sChars) -1);$sRes .= $sChars[$z];}return $sRes;}// get certain member infofunction getProfileInfo($i) {$sSQL = "SELECT *FROM `pd_profiles`WHERE `id` = '{$i}'";$aInfos = $GLOBALS['MySQL']->getAll($sSQL);return $aInfos[0];}
}
$GLOBALS['CMembers'] = new CMembers();

The main members class contains next functions: getLoginData (this functions does several functions: login and logout processing, also it returns Join & Login menu buttons (with forms) and Upload & Logout buttons (with forms) for members), performLogin (to login), performLogout (to logout), checkLogin (to check login information), registerProfile (to register a new member), getRandSaltCode (to get random salt code), getProfileInfo (to get info about certain member). I think that it is enough functions for members for now. As you noticed, I use a new php file: error.php to generate errors, this is the very easy file:

主要的成员类包含以下功能:getLoginData(此函数具有多个功能:登录和注销处理,还返回成员的Join&Login菜单按钮(带有表单)和Upload&Logout按钮(带有表单)),performLogin(用于登录) ),performLogout(用于注销),checkLogin(用于检查登录信息),registerProfile(用于注册新成员),getRandSaltCode(用于获取随机盐代码),getProfileInfo(用于获取有关某些成员的信息)。 我认为目前对于成员来说已经足够了。 如您所见,我使用了一个新的php文件:error.php来生成错误,这是非常简单的文件:

error.php (error.php)


require_once('classes/CMySQL.php');
require_once('classes/CMembers.php');
// login system init and generation code
list ($sLoginMenu, $sExtra) = $GLOBALS['CMembers']->getLoginData();
// draw common page
$aKeys = array('{menu_elements}' => $sLoginMenu,'{extra_data}' => $sExtra,'{images_set}' => '<center><h1>Error Occurred, please try again</h1></center>'
);
echo strtr(file_get_contents('templates/index.html'), $aKeys);

…Finally, our last new class for today is:

…最后,我们今天的最后一班新课程是:

classes / CPhotos.php (classes/CPhotos.php)


/*
* Photos class
*/
class CPhotos {// constructorfunction CPhotos() {}// get all photosfunction getAllPhotos() {$sSQL = "SELECT *FROM `pd_photos`ORDER BY `when` DESC";$aPhotos = $GLOBALS['MySQL']->getAll($sSQL);$sPhotos = '';$sFolder = 'photos/';foreach ($aPhotos as $i => $aPhoto) {$iPhotoId = (int)$aPhoto['id'];$sFile = $aPhoto['filename'];$sTitle = $aPhoto['title'];$aPathInfo = pathinfo($sFolder . $sFile);$sExt = strtolower($aPathInfo['extension']);$sImages .= <<<EOL
<!-- pin element {$iPhotoId} -->
<div class="pin"><div class="holder"><div class="actions" pin_id="{$iPhotoId}"><a href="#" class="button">Repin</a><a href="#" class="button">Like</a><a href="#" class="button comment_tr">Comment</a></div><a class="image ajax" href="service.php?id={$iPhotoId}" title="{$sTitle}"><img alt="{$sTitle}" src="{$sFolder}{$sFile}"></a></div><p class="desc">{$sTitle}</p><p class="info"><span>XX likes</span><span>XX repins</span></p><form class="comment" method="post" action="" style="display: none"><input type="hidden" name="id" value="0" /><textarea placeholder="Add a comment..." maxlength="1000"></textarea><button type="button" class="button">Comment</button></form>
</div>
EOL;}return $sImages;}// get certain photo infofunction getPhotoInfo($i) {$sSQL = "SELECT * FROM `pd_photos` WHERE `id` = '{$i}'";$aInfos = $GLOBALS['MySQL']->getAll($sSQL);return $aInfos[0];}// format time by timestampfunction formatTime($iSec) {$sFormat = 'j F Y';return gmdate($sFormat, $iSec);}// insert a new blank photo into DBfunction insertBlankPhoto($sTitle, $iOwner) {$sTitle = $GLOBALS['MySQL']->escape($sTitle);$iOwner = (int)$iOwner;$sSQL = "INSERT INTO `pd_photos` SET `title` = '{$sTitle}', `owner` = '{$iOwner}', `when` = UNIX_TIMESTAMP()";$GLOBALS['MySQL']->res($sSQL);return $GLOBALS['MySQL']->lastId();}// update filenamefunction updateFilename($i, $sFilename) {$sFilename = $GLOBALS['MySQL']->escape($sFilename);$sSQL = "UPDATE `pd_photos` SET `filename` = '{$sFilename}' WHERE `id`='{$i}'";return $GLOBALS['MySQL']->res($sSQL);}
}
$GLOBALS['CPhotos'] = new CPhotos();

There are several more functions like: getAllPhotos (to get all set of photos for our index page), getPhotoInfo (to get info about certain image), formatTime (to format time for bigger popup version), insertBlankPhoto and updateFilename (to add a new image into database and update filename for that image)

还有其他一些功能,例如:getAllPhotos(获取索引页面的所有照片集),getPhotoInfo(获取有关特定图像的信息),formatTime(格式化较大的弹出版本的时间),insertBlankPhoto和updateFilename(添加新的图片进入数据库并更新该图片的文件名)

步骤4. CSS (Step 4. CSS)

In order to handle with two new forms (Join and Login) I had to update a bit popup styles:

为了处理两种新形式(Join和Login),我不得不更新一些弹出样式:

css / main.css (css/main.css)


/* upload form styles */
.overlay, .overlay2, .overlay3 {background-color: #FFFFFF;bottom: 0;display: none;left: 0;opacity: 0.8;position: fixed;right: 0;top: 0;z-index: 9;
}
.overlay:target, .overlay2:target, .overlay3:target {display: block;
}
.popup {background: none repeat scroll 0 0 #FCF9F9;border: 1px solid #F7F5F5;box-shadow: 0 2px 5px rgba(34, 25, 25, 0.5);display: inline-block;left: 50%;padding: 30px 30px 20px;position: fixed;top: 40%;visibility: hidden;width: 550px;z-index: 10;-webkit-transform: translate(-50%, -50%);-moz-transform: translate(-50%, -50%);-ms-transform: translate(-50%, -50%);-o-transform: translate(-50%, -50%);transform: translate(-50%, -50%);-webkit-transition: all 0.3s ease-in-out 0s;-moz-transition: all 0.3s ease-in-out 0s;-ms-transition: all 0.3s ease-in-out 0s;-o-transition: all 0.3s ease-in-out 0s;transition: all 0.3s ease-in-out 0s;
}
.overlay:target+.popup, .overlay2:target+.popup, .overlay3:target+.popup {top: 50%;opacity: 1 ;visibility: visible;
}

And, I added new styles for our new both forms:

而且,我为这两种新形式添加了新样式:


/* login & join form styles */
.ctrl_grp li {display: block;font-size: 21px;list-style: none outside none;margin-bottom: 18px;position: relative;
}
.ctrl_grp input[type="text"], .ctrl_grp input[type="password"] {background-color: transparent;border: 1px solid #AD9C9C;border-radius: 6px 6px 6px 6px;box-shadow: 0 1px rgba(34, 25, 25, 0.15) inset, 0 1px #FFFFFF;color: #221919;display: block;font-size: 18px;line-height: 1.4em;padding: 6px 12px;position: relative;transition: all 0.08s ease-in-out 0s;width: 95%;z-index: 3;
}
.ctrl_grp input[type="text"]:focus, .ctrl_grp input[type="password"]:focus {border-color: ##993300;box-shadow: 0 1px rgba(34, 25, 25, 0.15) inset, 0 1px rgba(255, 255, 255, 0.8), 0 0 14px rgba(235, 82, 82, 0.35);
}
.ctrl_grp label {-moz-user-select: none;color: #EFEFEF;display: block;font-size: 18px;left: 13px;line-height: 1.4em;position: absolute;top: 5px;transition: all 0.16s ease-in-out 0s;z-index: 2;
}
.ctrl_grp .fff {background-color: #FFFFFF;border-radius: 8px 8px 8px 8px;bottom: 0;left: 0;position: absolute;right: 0;top: 0;z-index: 1;
}
.submit_button {background-image: -moz-linear-gradient(center top , #FDFAFB, #F9F7F7 50%, #F6F3F4 50%, #F0EDED);border: 1px solid #BBBBBB;border-radius: 6px 6px 6px 6px;box-shadow: 0 1px rgba(255, 255, 255, 0.8), 0 1px rgba(255, 255, 255, 0.35) inset;color: #524D4D;cursor: pointer;display: inline-block;font-family: "helvetica neue",arial,sans-serif;font-size: 18px;font-weight: bold;line-height: 1em;margin: 0;padding: 0.45em 0.825em;text-align: center;text-shadow: 0 1px rgba(255, 255, 255, 0.9);transition: all 0.05s ease-in-out 0s;
}
.submit_button:hover {box-shadow: 0 1px rgba(255, 255, 255, 0.8), 0 1px rgba(255, 255, 255, 0.35) inset, 0 0 10px rgba(232, 230, 230, 0.75);
}
现场演示

结论 (Conclusion)

We have just finished our third lesson where we writing our own Pinterest-like script. I hope that you like it. It would be kind of you to share our materials with your friends. Good luck and welcome back!

我们刚刚结束了第三课,我们在其中编写了自己的类似Pinterest的脚本。 我希望你喜欢。 您希望与朋友分享我们的资料。 祝你好运,欢迎回来!

翻译自: https://www.script-tutorials.com/pinterest-like-script-step-3/

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 测试人生开启 Jmeter 数据库测试 + web测试(详细干货,强力建议收藏!)

    前言最近要用到Jmeter做负载测试,于是学习了一下Jmeter做数据库并发测试和web测试,这里做一个记录总结。文章面向新人,高手请无视。Jmeter是什么JMeter也称为“Apache JMeter”,它是一个开源的,100%基于Java的应用程序,带有图形界面(虽然比较丑)。 它旨在分析和衡量Web…...

    2024/4/25 11:32:59
  2. 前端基础笔记——复合选择器

    <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>/*交集选…...

    2024/4/15 19:49:29
  3. 社交+分销,商城小程序还有这些玩法?

    在传统电商的发展遭遇瓶颈的时候,社交电商凭借着小程序,成功取代了传统电商,成为电商领域的主流。 小程序的出现让微信成为了新的流量洼地,以小程序为基础配置的社交电商,也有了取代传统电商,成为了电商领域的领跑者的能力。一、为何小程序会是社交电商的标配? 社交流量…...

    2024/4/28 17:31:17
  4. 线程控制

    线程控制 线程限制PTHREAD_DESTRUCTOR_ITERATIONS 线程退出系统时试图销毁线程特定数据最大次数 _SC_THREAD_DESTRUCTOR_ITERATIONSPTHREAD_KEYS_MAX 进程可创建键的最大次数 _SC_THREAD_KEYS_MAXPTHREAD_STACK_MIN 一个线程的栈可用的最小字节数 _SC_THREAD_STA…...

    2024/4/24 22:23:39
  5. 欧科云链OKLink:公链战国时代复兴 以太坊2.0胜算几何?

    以太坊正在开启一个崭新的去中心化赛道。 经历了2019年公链格局的动荡,沉寂了一年的以太坊,终在公链的激烈拼杀中披荆斩棘,重返市值第二的宝座。 与此同时,随着多客户端测试网络Medalla的顺利运行,以太坊或将开启2.0的新篇章。 网络拥堵频发 “公链王者”跌落神坛 开创智能…...

    2024/4/26 8:49:38
  6. 实验8-2-5 判断回文字符串 (20分)

    本题要求编写函数,判断给定的一串字符是否为“回文”。所谓“回文”是指顺读和倒读都一样的字符串。如“XYZYX”和“xyzzyx”都是回文。 函数接口定义: bool palindrome( char *s ); 函数palindrome判断输入字符串char *s是否为回文。若是则返回true,否则返回false。 裁判测…...

    2024/4/15 14:02:06
  7. Ubuntu16.04下安装gcc-7.5.0教程

    目录一、安装包准备二、安装 一、安装包准备 本地gcc7.5.0版本所需安装包如下: gcc-7.5.0.tar.gz gmp-6.1.0.tar.bz2 mpc-1.0.3.tar.gz mpfr-3.1.4.tar.bz2 isl-0.16.1.tar.bz2 这几个安装包在国外网站下载速度很慢,用中国科学技术大学镜像下载地址速度很快的: https://mirr…...

    2024/4/15 14:02:05
  8. Ntrip 1.0 协议

    Ntrip 1.0 协议qzqanlhy13141.介绍Ntrip1.0 是基于http1.1 协议实现应用层协议,关于消息格式和状态代码,NtripClient NtripCaster通信是完全兼容的HTTP 1.1通信[1],其中Ntrip只使用无状态的连接。由Ntrip Server ,NtripCaster ,NtripClient 组成,Ntrip Caster 是一个真正的…...

    2024/4/15 14:02:03
  9. 浅谈JDBC 基础总结

    JDBC 持久化概述 持久化(persistence)**: 把数据保存到可掉电式存储设备中以供之后使用。 数据持久化意味着将内存中的数据保存到硬盘上加以”固化”而持久化的实现过程大多通过各种关系数据库来完成, 将内存中的数据存储在关系型数据库中当然也可以存储在磁盘文件、XML数据文…...

    2024/5/2 13:06:46
  10. 复合选择器

    <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>/*交集选…...

    2024/5/1 1:05:26
  11. java贪吃蛇实现——面向对象设计

    java实现贪吃蛇说在前面整体思路代码实现MainFrameSnakeNodeDirection整体调用总结 说在前面 一直想实现一个贪吃蛇,于是在CSDN github上都找到了许多源码,于是自己不到三百行,实现了一个贪吃蛇代码哈哈哈哈哈 虽然特别的简陋 但是包括了核心算法 super版的大家可以自己添加…...

    2024/4/23 16:36:31
  12. jQuery写发送弹幕效果

    要求:在输入框输入弹幕内容,点击发送,随机字体大小,随机颜色,随机位置,在显示区生成弹幕。 所需技术:jquery <!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content=&…...

    2024/4/18 17:06:30
  13. 2020-08-05 vue学习

    vue学习v-vind指令:将模板的属性与vue实例中的数据进行绑定,但是只是单向绑定.即vue实例中的数据改变,页面显示会变化,但是模板变化不会使实例中数据一同变化.简写:value v-model指令:标签的属性值(value>)与vue实例中的数据进行双向绑定.即数据变化,页面显示变化;页面变化,…...

    2024/5/1 9:37:46
  14. insert into ... select 由于SELECT表引起的死锁情况分析

    Insert into select请慎用。这天xxx接到一个需求,需要将表A的数据迁移到表B中去做一个备份。本想通过程序先查询查出来然后批量插入。但xxx觉得这样有点慢,需要耗费大量的网络I/O,决定采取别的方法进行实现。通过在Baidu的海洋里遨游,她发现了可以使用insert into select实…...

    2024/4/15 19:49:26
  15. nginx平滑升级

    nginx平滑升级 平滑升级是什么: 在线上业务不停止的情况下,进行nginx的升级 过程简述:在不影响老进程运行情况下启动新进程。 老进程负责处理还没有处理完的请求,但不在接受新的处理请求。 此时新进程接受处理新的请求。 当老进程处理完所有请求后,关闭所有连接后停止运行…...

    2024/4/22 15:31:44
  16. PXE网络安装已经无人值守安装教程

    PXE网络安装与Kickstart(无人值守)安装教程 PXE是由Intel公司开发的网络引导技术,工作在Client/Server模式中,允许客户机通过网络从远程服务器下载引导镜像,并加载安装文件或整个操作系统。若要搭建PXE网络体系,必须满足一下几个前提条件: 客户机的网卡支持PXE协议(集成…...

    2024/4/30 20:40:40
  17. MySQL:InnoDB存储引擎

    MySQL:InnoDB存储引擎 目录MySQL:InnoDB存储引擎参考资料一、MySQL体系结构和存储引擎1.1 MySQL体系结构1. 概念辨析2. MySQL数据库体系结构3. MySQL存储引擎4. 存储引擎对比二、功能层面:InnoDB架构、技术、特性2.1 InnoDB体系结构1. 后台线程2. 内存(1)缓冲池(2)LRU L…...

    2024/4/28 20:21:22
  18. 喜大普奔~~~~~~~KETTLE linux执行转换和作业

    基本信息: 政府大数据环境 linux deepin 没有yum apt-get 安装包管理 无法安装各种依赖 没有图形化界面 根据各种博客内容,尝试过 1 图形化界面安装 2 rpm 包依赖安装 3 yum apt 安装 都失败了。。。。政府大数据环境太难受了!!!!!! 正确的操作执行方法如下: 1. 在…...

    2024/4/15 19:49:20
  19. java基础-person类派生出student和teacher

    在前一段时间对Java做了一个简单的了解,最近确实有一些迷茫干脆就来整理前段时间学的,写第一个关于Java的博客吧… 言归正传,一个person类派生出来的student和teacher在这里需要用到派生,类的构造,以及this关键字。 派生 简单来说就是一个大的方面又产生两个比较小的方面就…...

    2024/4/25 5:11:43
  20. Pygame框架简单实现飞机大战(附有详细注释)

    飞机大战主游戏类 点击屏幕横向查看更舒服哦 """ 项目名称:简单飞机大战游戏 基于框架:Pygame 开发日期:2020.07 开发人员:Y 版本:**** """import sys # 导入内置模块sys 调用sys.exit() import pygame # 导入第三方模块pygame from plan…...

    2024/4/19 6:21:38

最新文章

  1. 【Redis】Redis命令(一)

    1.基本命令 1.1.切换DB 默认使用的是 0 号 DB&#xff0c;可以通过 select db 索引来切换 DB 1.2.查看 key 数量 dbsize 命令可以查看当前数据库中 key 的数量 1.3.删除当前库中数据 flushdb 命令仅仅删除的是当前数据库中的数据&#xff0c;不影响其它库 1.4.删除所有库中数据…...

    2024/5/5 12:30:03
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 同一个pdf在windows和linux中的页数不一样

    之前认为PDF的格式&#xff0c;至少页数是不会变化的&#xff0c;结果最近发现一个文档在windows和linux中的页数不一样&#xff0c;linux中的pdf进入像word一样排版变得紧凑了&#xff0c;原本在下一页的几行进入了上一页的末尾。问了gpt后得到这样的回答&#xff1a; PDF文档…...

    2024/5/5 6:48:14
  4. 数据结构——二叉树——二叉搜索树(Binary Search Tree, BST)

    目录 一、98. 验证二叉搜索树 二、96. 不同的二叉搜索树 三、538. 把二叉搜索树转换为累加树 二叉搜索树&#xff1a;对于二叉搜索树中的每个结点&#xff0c;其左子结点的值小于该结点的值&#xff0c;而右子结点的值大于该结点的值 一、98. 验证二叉搜索树 给你一个二叉树的…...

    2024/5/4 11:44:28
  5. 416. 分割等和子集问题(动态规划)

    题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义&#xff1a;dp[i][j]表示当背包容量为j&#xff0c;用前i个物品是否正好可以将背包填满&#xff…...

    2024/5/4 12:05:22
  6. 【Java】ExcelWriter自适应宽度工具类(支持中文)

    工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...

    2024/5/5 12:22:20
  7. Spring cloud负载均衡@LoadBalanced LoadBalancerClient

    LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon&#xff0c;直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件&#xff0c;我们讨论Spring负载均衡以Spring Cloud2020之后版本为主&#xff0c;学习Spring Cloud LoadBalance&#xff0c;暂不讨论Ribbon…...

    2024/5/4 14:46:16
  8. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

    一、背景需求分析 在工业产业园、化工园或生产制造园区中&#xff0c;周界防范意义重大&#xff0c;对园区的安全起到重要的作用。常规的安防方式是采用人员巡查&#xff0c;人力投入成本大而且效率低。周界一旦被破坏或入侵&#xff0c;会影响园区人员和资产安全&#xff0c;…...

    2024/5/4 23:54:44
  9. VB.net WebBrowser网页元素抓取分析方法

    在用WebBrowser编程实现网页操作自动化时&#xff0c;常要分析网页Html&#xff0c;例如网页在加载数据时&#xff0c;常会显示“系统处理中&#xff0c;请稍候..”&#xff0c;我们需要在数据加载完成后才能继续下一步操作&#xff0c;如何抓取这个信息的网页html元素变化&…...

    2024/5/4 12:10:13
  10. 【Objective-C】Objective-C汇总

    方法定义 参考&#xff1a;https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...

    2024/5/4 23:54:49
  11. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

    &#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】&#x1f30f;题目描述&#x1f30f;输入格…...

    2024/5/4 23:54:44
  12. 【ES6.0】- 扩展运算符(...)

    【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

    2024/5/4 14:46:12
  13. 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?

    文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕&#xff0c;各大品牌纷纷晒出优异的成绩单&#xff0c;摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称&#xff0c;在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁&#xff0c;多个平台数据都表现出极度异常…...

    2024/5/4 14:46:11
  14. Go语言常用命令详解(二)

    文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令&#xff0c;这些命令可以帮助您在Go开发中进行编译、测试、运行和…...

    2024/5/4 14:46:11
  15. 用欧拉路径判断图同构推出reverse合法性:1116T4

    http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b&#xff0c;我们在 a i a_i ai​ 和 a i 1 a_{i1} ai1​ 之间连边&#xff0c; b b b 同理&#xff0c;则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然&#xff0…...

    2024/5/5 2:25:33
  16. 【NGINX--1】基础知识

    1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息&#xff0c;并安装一些有助于配置官方 NGINX 软件包仓库的软件包&#xff1a; apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...

    2024/5/4 21:24:42
  17. Hive默认分割符、存储格式与数据压缩

    目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限&#xff08;ROW FORMAT&#xff09;配置标准HQL为&#xff1a; ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...

    2024/5/4 12:39:12
  18. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

    文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中&#xff0c;传感器和控制器产生大量周…...

    2024/5/4 13:16:06
  19. --max-old-space-size=8192报错

    vue项目运行时&#xff0c;如果经常运行慢&#xff0c;崩溃停止服务&#xff0c;报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中&#xff0c;通过JavaScript使用内存时只能使用部分内存&#xff08;64位系统&…...

    2024/5/4 16:48:41
  20. 基于深度学习的恶意软件检测

    恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞&#xff0c;例如可以被劫持的合法软件&#xff08;例如浏览器或 Web 应用程序插件&#xff09;中的错误。 恶意软件渗透可能会造成灾难性的后果&#xff0c;包括数据被盗、勒索或网…...

    2024/5/4 14:46:05
  21. JS原型对象prototype

    让我简单的为大家介绍一下原型对象prototype吧&#xff01; 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定&#xff0c;每一个构造函数都有一个 prototype 属性&#xff0c;指向另一个对象&#xff0c;所以我们也称为原型对象…...

    2024/5/5 3:37:58
  22. C++中只能有一个实例的单例类

    C中只能有一个实例的单例类 前面讨论的 President 类很不错&#xff0c;但存在一个缺陷&#xff1a;无法禁止通过实例化多个对象来创建多名总统&#xff1a; President One, Two, Three; 由于复制构造函数是私有的&#xff0c;其中每个对象都是不可复制的&#xff0c;但您的目…...

    2024/5/4 23:54:30
  23. python django 小程序图书借阅源码

    开发工具&#xff1a; PyCharm&#xff0c;mysql5.7&#xff0c;微信开发者工具 技术说明&#xff1a; python django html 小程序 功能介绍&#xff1a; 用户端&#xff1a; 登录注册&#xff08;含授权登录&#xff09; 首页显示搜索图书&#xff0c;轮播图&#xff0…...

    2024/5/4 9:07:39
  24. 电子学会C/C++编程等级考试2022年03月(一级)真题解析

    C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...

    2024/5/4 14:46:02
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57