本文整理汇总了PHP中Storage::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::select方法的具体用法?PHP Storage::select怎么用?PHP Storage::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage::select方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$key = '%';
$last_id = '';
if (isset($_POST['key']) && isset($_POST['last_id'])) {
$key = $_POST['key'];
$last_id = $_POST['last_id'];
}
$result = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' AND LOWER(title) LIKE LOWER('%{$key}%') OR REPLACE(title, ' ', '') LIKE LOWER('%{$key}%') ORDER BY meta_id DESC LIMIT 20 OFFSET {$last_id}");
$i = $last_id;
foreach ($result as $keys => $value) {
echo '<div id="leftVideo' . $i . '" more_id="' . $i . '" key="' . $key . '" class="video" onclick="video_click(' . $i . ')" video_yid="' . $value["yid"] . '" video_title="' . $value["title"] . '">
<img class="video-image" src="' . $value['thumbnail'] . '">
';
if ($value['viewers'] == 0 || $value['viewers'] == 1) {
echo '<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' View)</p>';
} else {
echo '<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' Views)</p>';
}
echo '<p class="video-author">' . $value['author'] . '</p>
<p class="video-description">' . $value['description'] . '</p>
</div>
';
$i++;
}
?>
<script type="text/javascript">
$(document).ready(function(){
$('.tooltipped').tooltip({delay: 50});
示例2: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$allowedExts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);
$index = $_GET['id'];
if (($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/jpg" || $_FILES["file"]["type"] == "image/pjpeg" || $_FILES["file"]["type"] == "image/x-png" || $_FILES["file"]["type"] == "image/png") && in_array($extension, $allowedExts)) {
if ($_FILES["file"]["error"] > 0) {
echo json_encode($allowedExts);
} else {
$ext = pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION);
$file_name = $_FILES["file"]["name"];
$tmp_url = 'img/thumbnail/' . $file_name . '_' . date('Y-m-d_H:m:s') . '.' . $ext;
$file_url = $_SERVER['DOCUMENT_ROOT'] . '/videotube/' . $tmp_url;
$edit['new_thumbnail'] = $tmp_url;
$data_video = $db->select("SELECT * FROM yapi WHERE id = '" . $index . "' LIMIT 1");
$old_picture = $data_video[0]['new_thumbnail'];
if ($old_picture != '') {
unlink($_SERVER['DOCUMENT_ROOT'] . '/videotube/' . $old_picture);
}
if (move_uploaded_file($_FILES["file"]["tmp_name"], $file_url)) {
$db->update('yapi', $edit, 'id="' . $index . '"');
$edit['status'] = 1;
$edit['tmp_url'] = $tmp_url;
echo json_encode($edit);
}
}
}
//end of if FILE
示例3: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$q = '%';
if (isset($_GET['q']) && $_GET['q'] != '') {
$key = $_GET['q'];
$result = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' AND BINARY LOWER(title) LIKE LOWER('%{$key}%') OR REPLACE(title, ' ', '') LIKE LOWER('%{$key}%') AND suggest != 1 ORDER BY meta_id DESC LIMIT 25");
} else {
$key = '%';
$result = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' AND suggest != 1 ORDER BY meta_id DESC LIMIT 25");
}
$resultq = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' AND suggest = 1 LIMIT 1");
$i = 1;
foreach ($resultq as $key => $value) {
# code...
echo '<div id="leftVideo' . $i . '" more_id="' . $i . '" key="' . $key . '" class="video" onclick="video_click(' . $i . ')" video_yid="' . $value["yid"] . '" video_title="' . $value["title"] . '">
<img class="video-image" src="' . $value['thumbnail'] . '">
<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' Views) <span class="right" style="background-color:yellow;color:black">EMPFOHLENES VIDEO</span></p>
<p class="video-author">' . $value['author'] . '</p>
<p class="video-description">' . $value['description'] . '</p>
</div>
';
}
$i = 2;
foreach ($result as $keys => $value) {
echo '<div id="leftVideo' . $i . '" more_id="' . $i . '" key="' . $key . '" class="video" onclick="video_click(' . $i . ')" video_yid="' . $value["yid"] . '" video_title="' . $value["title"] . '">
<img class="video-image" src="' . $value['thumbnail'] . '">
<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' Views)</p>
<p class="video-author">' . $value['author'] . '</p>
<p class="video-description">' . $value['description'] . '</p>
示例4: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$result = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' ORDER BY viewers DESC LIMIT 10");
foreach ($result as $keys => $value) {
echo '<div class="video" video_yid="' . $value["yid"] . '" video_title="' . $value["title"] . '">
<img class="video-image" src="' . $value['thumbnail'] . '">
';
if ($value['viewers'] == 0 || $value['viewers'] == 1) {
echo '<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' View)</p>';
} else {
echo '<p class="video-title">' . $value['title'] . ' (<i class="material-icons" style="position:relative;bottom:-0.2em;font-size:1.2em;">visibility</i> ' . $value['viewers'] . ' Views)</p>';
}
echo '<p class="video-author">' . $value['author'] . '</p>
<p class="video-description">' . $value['description'] . '</p>
</div>
';
}
示例5: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$key = strtolower($_GET['name']);
$result = $db->select("SELECT lists FROM playlist WHERE LOWER(name) LIKE LOWER('{$key}') ");
print_r($result[0]['lists']);
示例6: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$result = $db->select("SELECT * FROM yapi WHERE title IS NOT NULL AND title != '' AND new = 1 ORDER BY meta_id DESC");
$i = 2;
?>
<div class="row">
<?php
foreach ($result as $keys => $value) {
?>
<div class="col l3 m4 s6 neue_videos" id="leftVideo<?php
echo $i;
?>
" onclick="video_click(<?php
echo $i;
?>
)" video_yid="<?php
echo $value["yid"];
?>
" video_title="<?php
echo $value["title"];
?>
">
<?php
if ($value['new_thumbnail'] == '') {
?>
<img width="100px" height="100px" src="<?php
echo $value['thumbnail'];
?>
">
示例7: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$key = $_GET['yid'];
$result = $db->select("SELECT * FROM yapi WHERE yid = '{$key}'");
echo $json_response = json_encode($result);
示例8: date
$daten['password'] = $password->hash($_GET['password']);
$daten['created_at'] = date("Y-m-d H:i:s");
$db->insert('playlist', $daten);
} elseif ($_GET['action'] == 'delete') {
$id = $_GET['playlist_id'];
echo $id;
$db->delete('playlist', 'id=' . $id);
} elseif ($_GET['action'] == 'update') {
$_GET['daten'] = urldecode(stripslashes($_GET['daten']));
$daten['lists'] = $_GET['daten'];
$daten['name'] = $_GET['name'];
$daten['updated_at'] = date("Y-m-d H:i:s");
$db->update('playlist', $daten, 'name="' . $daten["name"] . '"');
} elseif ($_GET['action'] == 'check_name') {
$name = $_GET['name'];
$result = $db->select("SELECT EXISTS(SELECT 1 FROM playlist WHERE name ='{$name}' LIMIT 1) as checked");
/*
* if exists result is 1 else is 0
*/
print_r($result[0]['checked']);
} elseif ($_GET['action'] == 'check_password') {
$name = $_GET['name'];
$pass = $_GET['password'];
$result = $db->select("SELECT password FROM playlist WHERE name='{$name}' ");
if ($password->validate($pass, $result[0]['password'])) {
echo 1;
} else {
echo 0;
}
} elseif ($_GET['action'] == 'update_viewer') {
# code...
示例9: Storage
<?php
require_once '../libs/Storage.php';
$db = new Storage();
$data['getVideo'] = $db->select("SELECT meta_id,meta_value FROM wp_postmeta WHERE meta_key = '_tern_wp_youtube_video' ORDER BY meta_id DESC LIMIT 5");
if (!sizeof($data['getVideo'])) {
echo '<div class="alert alert-info">No Data.</div>';
} else {
foreach ($data['getVideo'] as $keys => $value) {
$yid = $value['meta_value'];
$check = $db->select("SELECT count(*) as count FROM yapi WHERE yid ='{$yid}'");
if ($check[0]['count'] == 0) {
$url = "https://www.youtube.com/watch?v=" . $yid;
$result = get_web_page($url);
//echo $url;
if ($result['errno'] != 0) {
echo "error: bad url | timeout | redirect loop ...";
} elseif ($result['http_code'] != 200) {
echo "error: no page | no permissions | no service ";
} else {
$page = $result['content'];
if ($result == TRUE) {
$str = $page;
$title = preg_match_all('/<meta itemprop="name" content="(.*)">/', $str, $parts2);
$thumbnail = preg_match_all('/<meta property="og:image" content="(.*)">/', $str, $parts3);
$description = preg_match_all('/<meta property="og:description" content="(.*)">/', $str, $parts4);
$author = preg_match_all('/<link itemprop="url" href="(.*)">/', $str, $parts5);
$daten['yid'] = $yid;
$daten['url'] = $url;
$daten['title'] = $parts2[1][0];
$daten['thumbnail'] = $parts3[1][0];