本文整理汇总了PHP中VFilter类的典型用法代码示例。如果您正苦于以下问题:PHP VFilter类的具体用法?PHP VFilter怎么用?PHP VFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
defined('_VALID') or die('Restricted Access!');
if ($config['game_module'] == '0') {
die;
}
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
require $config['BASE_DIR'] . '/classes/pagination.class.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
$code = array();
if (isset($_POST['game_id']) && isset($_POST['page'])) {
$filter = new VFilter();
$gid = $filter->get('game_id', 'INTEGER');
$page = $filter->get('page', 'INTEGER');
$uid = isset($_SESSION['uid']) ? intval($_SESSION['uid']) : NULL;
$sql = "SELECT COUNT(CID) AS total_comments FROM game_comments WHERE GID = " . $gid . " AND status = '1'";
$rsc = $conn->execute($sql);
$total = $rsc->fields['total_comments'];
$pagination = new Pagination(10, $page);
$limit = $pagination->getLimit($total);
$sql = "SELECT c.CID, c.UID, c.comment, c.addtime, s.username, s.photo, s.gender\n FROM game_comments AS c, signup AS s\n WHERE c.GID = " . $gid . " AND c.status = '1' AND c.UID = s.UID \n ORDER BY c.addtime DESC LIMIT " . $limit;
$rs = $conn->execute($sql);
$comments = $rs->getrows();
$page_link = $pagination->getPagination('game/' . $gid, 'p_game_comments_' . $gid . '_');
$page_link_b = $pagination->getPagination('game/' . $gid, 'pp_game_comments_' . $gid . '_');
$start_num = $pagination->getStartItem();
$end_num = $pagination->getEndItem();
$code[] = '<div class="blinkp">';
$code[] = $lang['global.showing'] . ' <strong>' . $start_num . '</strong> ' . $lang['global.to'] . ' <strong>' . $end_num . '</strong> ' . $lang['global.of'] . ' <strong>' . $total . '</strong> ' . $lang['global.comments'] . '.';
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:game_pagination.php
示例2: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
$data = array('status' => 0, 'msg' => '');
if (isset($_POST['video_id'])) {
$filter = new VFilter();
$video_id = $filter->get('video_id', 'INTEGER');
if (isset($_SESSION['uid'])) {
$sql = "SELECT VID FROM favourite WHERE VID = " . $video_id . " AND UID = " . intval($_SESSION['uid']) . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$data['msg'] = show_err($lang['ajax.favorite_video_exists']);
} else {
$sql = "SELECT VID FROM video WHERE VID = " . $video_id . " AND UID = " . intval($_SESSION['uid']) . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$data['msg'] = show_err($lang['ajax.favorite_video_self']);
} else {
$sql = "INSERT INTO favourite SET VID = " . $video_id . ", UID = " . intval($_SESSION['uid']);
$conn->execute($sql);
$sql = "UPDATE video SET fav_num = fav_num+1 WHERE VID = " . $video_id . " LIMIT 1";
$conn->execute($sql);
$data['msg'] = show_msg($lang['ajax.favorite_video_success']);
$data['status'] = 1;
}
}
} else {
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:favorite_video.php
示例3: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
$data = array('status' => 1, 'msg' => '');
if (isset($_POST['user_id'])) {
if (isset($_SESSION['uid'])) {
$uid = intval($_SESSION['uid']);
$filter = new VFilter();
$user_id = $filter->get('user_id', 'INTEGER');
if ($uid == $user_id) {
$data['msg'] = show_err('Invalid request!?');
} else {
$sql = "SELECT UID FROM video_subscribe WHERE UID = " . $uid . " AND SUID = " . $user_id . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() != 1) {
$data['msg'] = show_err($lang['ajax.remove_sub_exists']);
} else {
$data['status'] = 1;
$data['msg'] = show_msg($lang['ajax.remove_sub_success']);
$sql = "DELETE FROM video_subscribe WHERE UID = " . $uid . " AND SUID = " . $user_id . " LIMIT 1";
$conn->execute($sql);
$sql = "UPDATE signup SET popularity = popularity-1, points = points-2 WHERE UID = " . $uid . " LIMIT 1";
$conn->execute($sql);
}
}
} else {
$data['msg'] = show_err($lang['ajax.remove_sub_login']);
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:remove_subscriber.php
示例4: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
if (isset($_POST['friend_id'])) {
if (isset($_SESSION['uid'])) {
$filter = new VFilter();
$uid = intval($_SESSION['uid']);
$fid = $filter->get('friend_id', 'INTEGER');
$sql = "SELECT UID FROM friends WHERE UID = " . $uid . " AND FID = " . $fid . " AND status = 'Pending' LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$sql = "DELETE FROM friends WHERE UID = " . $uid . " AND FID = " . $fid . " LIMIT 1";
$conn->execute($sql);
$sql = "UPDATE signup SET total_friends = total_friends-1, popularity = popularity-2 WHERE UID = " . $uid . " LIMIT 1";
$conn->execute($sql);
$sql = "UPDATE signup SET points = points-2 WHERE UID = " . $fid . " LIMIT 1";
$conn->execute($sql);
$message = $lang['ajax.reject_friend_success'];
$sql = "SELECT u.username, u.email, p.friend_request FROM signup AS u, users_prefs AS p \n WHERE u.UID = " . $fid . " AND u.UID = p.UID LIMIT 1";
$rs = $conn->execute($sql);
if ($conn->Affected_Rows() === 1 && $rs->fields['friend_request'] == '1') {
$to = $rs->fields['email'];
$receiver = $rs->fields['username'];
$sql = "SELECT username FROM signup WHERE UID = " . $uid . " LIMIT 1";
$rs = $conn->execute($sql);
if ($conn->Affected_Rows() === 1) {
$username = $rs->fields['username'];
require $config['BASE_DIR'] . '/classes/email.class.php';
开发者ID:ecr007,项目名称:pr0n,代码行数:31,代码来源:reject_friend.php
示例5: defined
<?php
defined('_VALID') or die('Restricted Access!');
if ($config['game_module'] == '0') {
die;
}
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
require $config['BASE_DIR'] . '/include/function_user.php';
$response = array('status' => 0, 'msg' => '', 'debug' => '');
if (isset($_POST['game_id'])) {
if (isset($_SESSION['uid'])) {
$filter = new VFilter();
$gid = $filter->get('game_id', 'INTEGER');
$uid = intval($_SESSION['uid']);
$sql = "SELECT UID FROM game WHERE GID = " . $gid . " LIMIT 1";
$rs = $conn->execute($sql);
if ($conn->Affected_Rows() === 1) {
$game = $rs->getrows();
if ($uid == $game[0][0]) {
deleteGame($gid);
$response['status'] = 1;
$response['msg'] = show_msg_mb($lang['ajax.delete_game_success']);
} else {
$response['msg'] = show_err_mb($lang['ajax.delete_game_failed']);
}
} else {
$response['msg'] = show_err_mb($lang['ajax.delete_game_failed']);
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:delete_game.php
示例6: defined
<?php
defined('_VALID') or die('Restricted Access!');
Auth::checkAdmin();
// If Posted
if (isset($_POST['submit_media_mp4'])) {
$filter = new VFilter();
//config settings
$iphone_convert = $filter->get('iphone_convert', 'INTEGER');
//db settings
$iphone_ovc_profile = $filter->get('iphone_ovc_profile');
$iphone_resize_base = $filter->get('iphone_resize_base');
$iphone_resize_width = $filter->get('iphone_resize_width', 'INTEGER');
$iphone_resize_height = $filter->get('iphone_resize_height', 'INTEGER');
$iphone_ref_bitrate = $filter->get('iphone_ref_bitrate', 'INTEGER');
$iphone_ref_type = $filter->get('iphone_ref_type');
$iphone_blackbars = $filter->get('iphone_blackbars', 'INTEGER');
$iphone_encodepass = $filter->get('iphone_encodepass', 'INTEGER');
$iphone_audio_sampling = $filter->get('iphone_audio_sampling', 'INTEGER');
$iphone_audio_bitrate = $filter->get('iphone_audio_bitrate', 'INTEGER');
// Set Defaults
$iphone_ovc_profile = $iphone_ovc_profile == '' ? 'standard' : $iphone_ovc_profile;
$iphone_resize_base = $iphone_resize_base == '' ? 'both' : $iphone_resize_base;
$iphone_resize_width = $iphone_resize_width == '' ? '480' : $iphone_resize_width;
$iphone_resize_height = $iphone_resize_height == '' ? '320' : $iphone_resize_height;
$iphone_ref_bitrate = $iphone_ref_bitrate == '' ? '1500' : $iphone_ref_bitrate;
$iphone_ref_type = $iphone_ref_type == '' ? 'standard' : $iphone_ref_type;
$iphone_encodepass = $iphone_encodepass == '1' ? '1' : '2';
$iphone_blackbars = $iphone_blackbars == '0' ? '0' : '1';
$iphone_audio_sampling = $iphone_audio_sampling == '' ? '48000' : $iphone_audio_sampling;
$iphone_audio_bitrate = $iphone_audio_bitrate == '' ? '128' : $iphone_audio_bitrate;
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:iphone.php
示例7: elseif
$sql = "SELECT FID FROM friends WHERE UID = " . $uid . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() != 1) {
$access = false;
$_URL = $config['BASE_URL'] . '/error/private_messages_friends';
}
} elseif ($config['private_msgs'] == 'disabled') {
$access = false;
$_URL = $config['BASE_URL'] . '/error/private_messages_disabled';
}
if (!$access) {
VRedirect::go($_URL);
}
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/classes/validation.class.php';
$filter = new VFilter();
$subject = $filter->get('s', 'STRING', 'GET');
$compose = array('receiver' => '', 'friend' => '', 'subject' => $subject, 'body' => '', 'save_outbox' => 1, 'send_self' => 0);
if (isset($query['1']) && $query['1'] != '') {
$valid = new VValidation();
if ($valid->usernameExists($query['1'])) {
$compose['receiver'] = $query['1'];
}
}
if (isset($_POST['send_mail'])) {
$valid = new VValidation();
$receiver = $filter->get('receiver');
$friend = $filter->get('receiver_friend');
$subject = $filter->get('subject');
$body = $filter->process(trim($_POST['body']), array('a'), array('href'));
if ($receiver == '') {
开发者ID:ecr007,项目名称:pr0n,代码行数:31,代码来源:compose.php
示例8: defined
<?php
defined('_VALID') or die('Restricted Access!');
Auth::checkAdmin();
//include($config['BASE_DIR'].'/include/function_conversions.php');
if (isset($_POST['submit_media_mp4'])) {
$filter = new VFilter();
//config settings
$hd_convert = $filter->get('hd_convert', 'INTEGER');
//db settings
$condition_value = $filter->get('condition_value', 'INTEGER');
$hd_ovc_profile = $filter->get('hd_ovc_profile');
$hd_resize_base = $filter->get('hd_resize_base');
$hd_resize_width = $filter->get('hd_resize_width', 'INTEGER');
$hd_resize_height = $filter->get('hd_resize_height', 'INTEGER');
$hd_ref_bitrate = $filter->get('hd_ref_bitrate', 'INTEGER');
$hd_ref_type = $filter->get('hd_ref_type');
$hd_blackbars = $filter->get('hd_blackbars', 'INTEGER');
$hd_encodepass = $filter->get('hd_encodepass', 'INTEGER');
$hd_audio_sampling = $filter->get('hd_audio_sampling', 'INTEGER');
$hd_audio_bitrate = $filter->get('hd_audio_bitrate', 'INTEGER');
//prep
$hd_ovc_profile = $hd_ovc_profile == '' ? 'standard' : $hd_ovc_profile;
$hd_resize_base = $hd_resize_base == '' ? 'both' : $hd_resize_base;
$hd_resize_width = $hd_resize_width == '' ? '640' : $hd_resize_width;
$hd_resize_height = $hd_resize_height == '' ? '480' : $hd_resize_height;
$hd_ref_bitrate = $hd_ref_bitrate == '' ? '1500' : $hd_ref_bitrate;
$hd_ref_type = $hd_ref_type == '' ? 'standard' : $hd_ref_type;
$hd_encodepass = $hd_encodepass == '1' ? '1' : '2';
$hd_blackbars = $hd_blackbars == '0' ? '0' : '1';
$hd_audio_sampling = $hd_audio_sampling == '' ? '48000' : $hd_audio_sampling;
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:mp4.php
示例9: defined
<?php
defined('_VALID') or die('Restricted Access!');
Auth::checkAdmin();
if (isset($_POST['submit_media_mp4'])) {
$filter = new VFilter();
//db settings
$flv_ovc_profile = $filter->get('flv_ovc_profile');
$flv_resize_base = $filter->get('flv_resize_base');
$flv_resize_width = $filter->get('flv_resize_width', 'INTEGER');
$flv_resize_height = $filter->get('flv_resize_height', 'INTEGER');
$flv_ref_bitrate = $filter->get('flv_ref_bitrate', 'INTEGER');
$flv_ref_type = $filter->get('flv_ref_type');
$flv_blackbars = $filter->get('flv_blackbars', 'INTEGER');
$flv_encodepass = $filter->get('flv_encodepass', 'INTEGER');
$flv_audio_sampling = $filter->get('flv_audio_sampling', 'INTEGER');
$flv_audio_bitrate = $filter->get('flv_audio_bitrate', 'INTEGER');
//prep
$flv_ovc_profile = $flv_ovc_profile == '' ? 'standard' : $flv_ovc_profile;
$flv_resize_base = $flv_resize_base == '' ? 'both' : $flv_resize_base;
$flv_resize_width = $flv_resize_width == '' ? '480' : $flv_resize_width;
$flv_resize_height = $flv_resize_height == '' ? '320' : $flv_resize_height;
$flv_ref_bitrate = $flv_ref_bitrate == '' ? '1500' : $flv_ref_bitrate;
$flv_ref_type = $flv_ref_type == '' ? 'standard' : $flv_ref_type;
$flv_encodepass = $flv_encodepass == '1' ? '1' : '2';
$flv_blackbars = $flv_blackbars == '0' ? '0' : '1';
$flv_audio_sampling = $flv_audio_sampling == '' ? '48000' : $flv_audio_sampling;
$flv_audio_bitrate = $flv_audio_bitrate == '' ? '128' : $flv_audio_bitrate;
if ($flv_ref_bitrate == '') {
$errors[] = 'Video Bit-rate for converted videos cannot be left blank!';
} elseif (!is_numeric($flv_ref_bitrate)) {
开发者ID:ecr007,项目名称:pr0n,代码行数:31,代码来源:flv.php
示例10: defined
<?php
defined('_VALID') or die('Restricted Access!');
if ($config['game_module'] == '0') {
die;
}
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
$data = array('msg' => '', 'status' => 0, 'debug' => '');
if (isset($_POST['parent_id']) && isset($_POST['comment_id'])) {
if (isset($_SESSION['uid'])) {
$filter = new VFilter();
$uid = intval($_SESSION['uid']);
$cid = $filter->get('comment_id', 'INTEGER');
$gid = $filter->get('parent_id', 'INTEGER');
$sql = "DELETE FROM game_comments WHERE UID = " . $uid . " AND GID = " . $gid . " AND CID = " . $cid . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$data['status'] = 1;
$sql = "UPDATE game SET total_comments = total_comments-1 WHERE GID = " . $gid . " LIMIT 1";
$conn->execute($sql);
$data['msg'] = $lang['ajax.comment_delete_success'];
} else {
$data['msg'] = $lang['ajax.comment_delete_failed'];
}
} else {
$data['msg'] = $lang['ajax.comment_delete_login'];
}
} else {
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:game_comment_delete.php
示例11: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/auth.class.php';
require $config['BASE_DIR'] . '/classes/filter.class.php';
if ($config['blog_module'] == '0') {
VRedirect::go($config['BASE_URL'] . '/error/page_invalid');
}
$auth = new Auth();
$auth->check();
$uid = intval($_SESSION['uid']);
$username = $_SESSION['username'];
$blog_title = NULL;
$blog_content = NULL;
if (isset($_POST['blog_add_submit'])) {
$filter = new VFilter();
$title = $filter->get('blog_title');
$content = $_POST['blog_content'];
if ($title == '') {
$errors[] = $lang['blog.edit_title_empty'];
$err['title'] = 1;
} elseif (strlen($title) > 100) {
$errors[] = $lang['blog.edit_title_big'];
$err['title'] = 1;
} else {
$blog_title = $title;
}
if ($content == '') {
$errors[] = $lang['blog.edit_content_empty'];
$err['content'] = 1;
} elseif (strlen($content) > 3000) {
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:add.php
示例12: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/auth.class.php';
require $config['BASE_DIR'] . '/classes/image.class.php';
require $config['BASE_DIR'] . '/classes/filter.class.php';
$auth = new Auth();
$auth->check();
if (isset($_SESSION['uid']) && $uid != $_SESSION['uid']) {
session_write_close();
header('Location: ' . $config['BASE_URL'] . '/error/album_permission');
die;
}
if (isset($_POST['add_photos_submit'])) {
$photos = 0;
$filter = new VFilter();
$image = new VImageConv();
foreach ($_FILES as $key => $values) {
if ($values['tmp_name'] != '') {
if (is_uploaded_file($values['tmp_name']) && ($check = getimagesize($values['tmp_name']))) {
$ext = strtolower(substr($values['name'], strrpos($values['name'], '.') + 1));
if (!check_image($values['tmp_name'], $ext)) {
continue;
}
$photo_expl = explode('_', $key);
$photo_nr = $photo_expl['1'];
$caption = $filter->get('caption_' . $photo_nr);
$sql_add = NULL;
if ($caption != '') {
$sql_add = ", caption = '" . mysql_real_escape_string($caption) . "'";
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:addphotos.php
示例13: constructQuery
function constructQuery()
{
global $smarty;
$query = array();
$query_count = "SELECT COUNT(f.UID) AS total_users FROM signup AS u, users_flags AS f WHERE f.UID = u.UID";
$query_select = "SELECT u.*, f.RID, f.reason, f.message, f.addtime, f.flag_id\n FROM signup AS u, users_flags AS f\n WHERE f.UID = u.UID";
$query_option = array();
$option_orig = array('username' => '', 'email' => '', 'country' => '', 'name' => '', 'gender' => '', 'relation' => '', 'sort' => 'u.UID', 'order' => 'DESC', 'display' => 10);
$all = isset($_GET['all']) ? intval($_GET['all']) : 0;
if ($all == 1) {
unset($_SESSION['search_users_option']);
}
$option = isset($_SESSION['search_users_flagged_option']) ? $_SESSION['search_users_flagged_option'] : $option_orig;
if (isset($_POST['search_videos'])) {
global $config;
require $config['BASE_DIR'] . '/classes/filter.class.php';
$filter = new VFilter();
$option['username'] = $filter->get('username');
$option['email'] = $filter->get('email');
$option['country'] = $filter->get('country');
$option['name'] = $filter->get('name');
$option['gender'] = $filter->get('gender');
$option['relation'] = $filter->get('relation');
$option['sort'] = $filter->get('sort');
$option['order'] = $filter->get('order');
$option['display'] = $filter->get('display', 'INTEGER');
if ($option['username'] != '') {
$query_option[] = " AND u.username LIKE '%" . mysql_real_escape_string($option['username']) . "%'";
}
if ($option['email'] != '') {
$query_option[] = " AND u.email LIKE '%" . mysql_real_escape_string($option['email']) . "%'";
}
if ($option['country'] != '') {
$query_option[] = " AND u.country LIKE '%" . mysql_real_escape_string($option['country']) . "%'";
}
if ($option['name'] != '') {
$query_option[] = " AND ( u.fname LIKE '%" . mysql_real_escape_string($option['name']) . "%' OR u.lname LIKE '%" . mysql_real_escape_string($option['name']) . "%'";
}
if ($option['gender'] != '') {
$query_option[] = " AND u.gender = '" . mysql_real_escape_string($option['gender']) . "'";
}
if ($option['relation'] != '') {
$query_option[] = " AND u.relation = '" . mysql_real_escape_string($option['relation']) . "'";
}
$_SESSION['search_users_flagged_option'] = $option;
}
$query_option[] = " ORDER BY " . $option['sort'] . " " . $option['order'];
$query['select'] = $query_select . implode(' ', $query_option);
$query['count'] = $query_count . implode(' ', $query_option);
$query['page_items'] = $option['display'];
$smarty->assign('option', $option);
return $query;
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:53,代码来源:flagged.php
示例14: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/auth.class.php';
require $config['BASE_DIR'] . '/classes/filter.class.php';
if ($config['blog_module'] == '0') {
VRedirect::go($config['BASE_URL'] . '/error/page_invalid');
}
$auth = new Auth();
$auth->check();
$uid = intval($_SESSION['uid']);
$username = $_SESSION['username'];
$blog_title = NULL;
$blog_content = NULL;
if (isset($_POST['blog_edit_submit'])) {
$filter = new VFilter();
$title = $filter->get('blog_title');
$content = $filter->get('blog_content');
if ($title == '') {
$errors[] = $lang['blog.edit_title_empty'];
$err['title'] = 1;
} elseif (strlen($title) > 100) {
$errors[] = $lang['blog.edit_title_big'];
$err['title'] = 1;
} else {
$blog_title = $title;
}
if ($content == '') {
$errors[] = $lang['blog.edit_content_empty'];
$err['content'] = 1;
} elseif (strlen($content) > 3000) {
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:edit.php
示例15: defined
<?php
defined('_VALID') or die('Restricted Access!');
require $config['BASE_DIR'] . '/classes/filter.class.php';
$filter = new VFilter();
$mail_id = $filter->get('id', 'INTEGER', 'GET');
if (!$mail_id) {
VRedirect::go($config['BASE_URL'] . '/error/mail_missing');
}
$sql = "SELECT m.mail_id, m.sender, m.receiver, m.subject, m.body, s.photo, s.gender\n FROM mail AS m, signup AS s\n WHERE ( m.sender = '" . mysql_real_escape_string($username) . "' OR m.receiver = '" . mysql_real_escape_string($username) . "' )\n AND m.mail_id = " . $mail_id . " AND m.sender = s.username AND m.status = '1'\n LIMIT 1";
$rs = $conn->execute($sql);
if (!$conn->Affected_Rows()) {
VRedirect::go($config['BASE_URL'] . '/error/mail_missing');
}
$mail = $rs->getrows();
$mail = $mail['0'];
$sql = "UPDATE mail SET readed = '1' WHERE mail_id = " . $mail_id . " LIMIT 1";
$conn->execute($sql);
$smarty->assign('mail', $mail);
开发者ID:ecr007,项目名称:pr0n,代码行数:19,代码来源:read.php
示例16: construct_vote
function construct_vote($likes, $dislikes)
{
$output = array();
$output[] = '<div class="pull-left">';
$output[] = '<i class="glyphicon glyphicon-thumbs-up"></i> <span id="photo_likes" class="text-white">' . $likes . '</span>';
$output[] = '</div>';
$output[] = '<div class="pull-right">';
$output[] = '<i class="glyphicon glyphicon-thumbs-down"></i> <span id="photo_dislikes" class="text-white">' . $dislikes . '</span>';
$output[] = '</div>';
$output[] = '<div class="clearfix"></div>';
return implode("\n", $output);
}
$data = array('msg' => '', 'rate' => 0, 'likes' => 0, 'dislikes' => 0, 'debug' => '');
if (isset($_POST['item_id']) && isset($_POST['vote'])) {
$allowed = false;
$filter = new VFilter();
$photo_id = $filter->get('item_id', 'INTEGER');
$vote = $filter->get('vote', 'STRING');
$sql = "SELECT p.rate, p.likes, p.dislikes, a.rate AS arate, a.likes AS alikes, a.dislikes AS adislikes FROM photos AS p, albums AS a\n WHERE p.PID = " . $photo_id . " AND a.AID = p.AID LIMIT 1";
$rs = $conn->execute($sql);
$rate = $rs->fields['rate'];
$likes = $rs->fields['likes'];
$dislikes = $rs->fields['dislikes'];
$arate = $rs->fields['arate'];
$alikes = $rs->fields['alikes'];
$adislikes = $rs->fields['adislikes'];
if ($config['photo_rate'] == 'user') {
if (isset($_SESSION['uid'])) {
$uid = intval($_SESSION['uid']);
$allowed = true;
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:vote_photo.php
示例17: VImageConv
}
if (!$errors) {
$dst = $config['BASE_DIR'] . '/media/users/orig/' . $image_name;
$image = new VImageConv();
$image->process($avatar_tmp, $dst, 'MAX_HEIGHT', 240, 200);
$image->resize(true);
if (file_exists($dst) && filesize($dst) > 100) {
$_SESSION['message'] = $lang['user.avatar_upload_msg'];
$_SESSION['uploaded'] = true;
VRedirect::go($config['BASE_URL'] . '/user/avatar');
}
}
}
}
if (isset($_POST['avatar_crop_submit'])) {
$filter = new VFilter();
$x = $filter->get('x1', 'INTEGER');
$y = $filter->get('y1', 'INTEGER');
$width = $filter->get('width', 'INTEGER');
$height = $filter->get('height', 'INTEGER');
$uid = $user['UID'];
$src = $config['BASE_DIR'] . '/media/users/orig/' . $uid . '.jpg';
$dst = $config['BASE_DIR'] . '/media/users/' . $uid . '.jpg';
$image = new VImageConv();
$image->process($src, $dst, 'EXACT', 100, 120);
$image->crop($x, $y, $width, $height, true);
if (file_exists($dst) && filesize($dst) > 100) {
$sql = "UPDATE signup SET photo = '" . intval($user['UID']) . ".jpg' WHERE UID = " . intval($uid) . " LIMIT 1";
$conn->execute($sql);
$_SESSION['message'] = $lang['user.avatar_crop_msg'];
VRedirect::go($config['BASE_URL'] . '/user/avatar');
开发者ID:ecr007,项目名称:pr0n,代码行数:31,代码来源:avatar.php
示例18: array
}
}
$output = array();
$output[] = '<ul>';
$output[] = '<li><span' . $class_1 . '> </span></li>';
$output[] = '<li><span' . $class_2 . '> </span></li>';
$output[] = '<li><span' . $class_3 . '> </span></li>';
$output[] = '<li><span' . $class_4 . '> </span></li>';
$output[] = '<li><span' . $class_5 . '> </span></li>';
$output[] = '</ul>';
return implode("\n", $output);
}
$data = array('msg' => '', 'rating_code' => '', 'rate' => 0, 'ratedby' => 0, 'debug' => '');
if (isset($_POST['user_id']) && isset($_POST['rating'])) {
$allowed = false;
$filter = new VFilter();
$user_id = $filter->get('user_id', 'INTEGER');
$vote = $filter->get('rating', 'INTEGER');
$sql = "SELECT rate, ratedby FROM signup WHERE UID = " . $user_id . " LIMIT 1";
$rs = $conn->execute($sql);
$rate = $rs->fields['rate'];
$ratedby = $rs->fields['ratedby'];
if ($config['rating'] == 'user') {
if (isset($_SESSION['uid'])) {
$uid = intval($_SESSION['uid']);
$allowed = true;
}
} else {
$allowed = true;
}
if ($allowed) {
开发者ID:ecr007,项目名称:pr0n,代码行数:31,代码来源:rate_user.php
示例19: get_request_arg
}
if ($config['edit_videos'] == '0') {
VRedirect::go($config['BASE_URL'] . '/error/page_invalid');
}
Auth::check();
$vid = get_request_arg('edit');
if (!$vid) {
VRedirect::go($config['BASE_URL'] . '/error/video_missing');
}
$uid = (int) $_SESSION['uid'];
$sql = "SELECT VID FROM video WHERE VID = " . $vid . " AND UID = " . $uid . " AND active = '1' LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows()) {
$categories = get_categories();
if (isset($_POST['edit_submit'])) {
$filter = new VFilter();
$title = $filter->get('title');
$keyword = $filter->get('keyword');
$channel = $filter->get('channel', 'INTEGER');
$type = $filter->get('type');
$thumb = $filter->get('thumb', 'INTEGER');
if ($title == '') {
$errors[] = $lang['upload.video_title_empty'];
$err['title'] = 1;
}
if ($keyword == '') {
$errors[] = $lang['upload.video_tags_empty'];
$err['tags'] = 1;
} else {
$keyword = prepare_string($keyword, false);
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:edit.php
示例20: defined
<?php
defined('_VALID') or die('Restricted Access!');
if ($config['game_module'] == '0') {
die;
}
require $config['BASE_DIR'] . '/classes/filter.class.php';
require $config['BASE_DIR'] . '/include/compat/json.php';
require $config['BASE_DIR'] . '/include/adodb/adodb.inc.php';
require $config['BASE_DIR'] . '/include/dbconn.php';
$data = array('status' => 0, 'msg' => '', 'debug' => '');
if (isset($_POST['item_id']) && isset($_POST['flag_id']) && isset($_POST['message'])) {
$filter = new VFilter();
$game_id = $filter->get('item_id', 'INTEGER');
$flag_id = $filter->get('flag_id');
$flag_message = $filter->get('message');
if (isset($_SESSION['uid'])) {
$uid = intval($_SESSION['uid']);
if ($flag_id == '' or strlen($flag_id) > 14) {
$data['msg'] = show_err_mb($lang['ajax.flag_invalid']);
} else {
$sql = "SELECT GID FROM game_flags WHERE GID = " . $game_id . " AND UID = " . $uid . " LIMIT 1";
$conn->execute($sql);
if ($conn->Affected_Rows() == 1) {
$data['msg'] = show_err_mb($lang['ajax.flag_game_exists']);
} else {
$sql = "INSERT INTO game_flags (GID, UID, reason, message, add_date)\n VALUES (" . $game_id . ", " . $uid . ", '" . mysql_real_escape_string($flag_id) . "',\n '" . mysql_real_escape_string($flag_message) . "', '" . date('Y-m-d') . "')";
$conn->execute($sql);
$data['status'] = 1;
$data['msg'] = show_msg_mb($lang['ajax.flag_game_success']);
}
开发者ID:humor-zo,项目名称:chaofan,代码行数:31,代码来源:flag_game.php
注:本文中的VFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论