本文整理匯總了PHP中Images::getImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::getImage方法的具體用法?PHP Images::getImage怎麽用?PHP Images::getImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::getImage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
//Check if user is logged in and trying to delete their own image
require_once './includes/session_timeout.php';
require_once './includes/dbcon.php';
if (!isset($_SESSION['username'])) {
header("Location: login.php");
die;
}
if (!isset($_GET["id"])) {
header("Location: index.php");
die;
}
$id = $_GET["id"];
$userID = $_SESSION['userID'];
require_once './includes/Images/Images.php';
$dbImages = new Images($conn);
$image = $dbImages->getImage($id);
if ($image[5] != $userID) {
header("Location: userpage.php");
die;
}
//Safe to delete
unlink("./img/thumbs/thumb_{$image[2]}");
unlink("./img/large/{$image[2]}");
$result = $dbImages->deleteImage($id);
if ($result) {
header("Location: userpage.php");
die;
} else {
echo "Eitthvað bilaði. <a href='userpage.php'>Til baka?</a>";
}
示例2: Images
<?php
require_once './includes/dbcon.php';
require_once './includes/Images/Images.php';
$status = false;
$dbImages = new Images($conn);
$list = $dbImages->imageList();
for ($i = count($list) - 1; $i >= 0; $i--) {
if ($dbImages->getImage($list[$i][0])[7] == 1) {
echo "<article>\n <p>" . htmlspecialchars($list[$i][2]) . "</p>\n <figure class='img'>\n <a href='browse.php?img={$list[$i][0]}'><img src='./img/thumbs/thumb_{$list[$i][1]}'></a>\n </figure>\n <div class='fadeout'></div>\n </article>\n ";
}
}
示例3: setResponse
break;
case 'PUT':
if (!empty($action)) {
$response['data'] = $images->setActive($action);
$success = true;
}
break;
case 'DELETE':
if (!empty($action)) {
$response['data'] = $images->deleteImage($action);
$success = true;
}
break;
case 'GET':
if ($action == "search") {
$response['data'] = $images->getImage($_GET['user']);
$success = true;
}
if ($action == null) {
$response['data'] = $images->getImages();
$success = true;
}
break;
default:
break;
}
if (!$success) {
$response = setResponse($response, $api_response_code, 3);
}
}
deliver_response($response);
示例4: count
$nextimg = $rowNumber < count($list) - 1 ? $list[$rowNumber + 1][0] : 0;
$previmg = $rowNumber > 0 ? $list[$rowNumber - 1][0] : 0;
shuffle($list);
$randomimg = $list[0][0];
}
if (isset($validReview)) {
if (isset($_SESSION['userID']) && $_SESSION['userID'] == $imgOwnerID) {
$dbImages->updateImage($imgID, $nafn, $texti, $flokkur, $visibility);
$imgname = $nafn;
$imgdesc = $texti;
}
}
if (isset($_POST['reviewImage']) && !isset($validReview)) {
echo "Gekk ekki";
}
if ($dbImages->getImage($_GET["img"])[7] == 3) {
if (isset($_SESSION['userID']) && $dbImages->getImage($_GET["img"])[5] == $_SESSION['userID']) {
# no errors
} else {
$error = true;
}
}
if (!$error) {
?>
<div>
<h3 id="image"><?php
echo htmlentities($imgname);
?>
</h3>
<a href="<?php
echo './img/large/' . $imgpath;
示例5: foreach
<td class="td-tbl-clr"><?php
echo Translations::Translate("Select file");
?>
</td>
<td class="td-tbl-clr"><?php
echo Translations::Translate("Actions");
?>
</td>
</tr>
<?php
foreach ($types as $typeIndex => $fieldName) {
?>
<?php
$image = Images::getImage($parentType, $parentId, $typeIndex);
?>
<tr>
<td class="td-tbl-clr" style="width:183px;">
<?php
echo Translations::Translate(Constants::getNameOfImgType($typeIndex));
?>
</td>
<td class="td-tbl-clr" style="width: 189px;">
<?php
if ($image != null) {
?>
<img class="image-preview" src="<?php
echo AdminFunctions::GetImageUrl($image->picture);
?>