本文整理汇总了PHP中w函数的典型用法代码示例。如果您正苦于以下问题:PHP w函数的具体用法?PHP w怎么用?PHP w使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: read_dir
public function read_dir($path, $filter = false, $sd = false)
{
if (substr($path, -1) != '/') {
$path .= '/';
}
if (!$this->open_socket($path)) {
return false;
}
$r = w();
while (false !== ($row = @readdir($this->socket))) {
if ($row == '.' || $row == '..') {
continue;
}
if (is_dir($path . $row)) {
if ($sd === 'files') {
continue;
}
$r[$f] = $this->read_dir($path . $row . '/', $filter . $sd);
} else {
if ($sd === 'dir' || $filter !== false && !preg_match('#' . $filter . '#', trim($f))) {
continue;
}
$r[] = $f;
}
}
@closedir($fp);
if (count($r)) {
array_multisort($r);
}
return $r;
}
开发者ID:nopticon,项目名称:mag,代码行数:31,代码来源:filesystem.php
示例2: home
public function home()
{
global $user;
$v = $this->__(w('alias filename ext'));
if (!f($v['alias']) || !f($v['filename'])) {
_fatal();
}
$sql = 'SELECT tree_id
FROM _tree
WHERE tree_alias = ?';
if (!($tree = _fieldrow(sql_filter($sql, $v['alias'])))) {
_fatal();
}
$sql = 'SELECT *
FROM _downloads
WHERE download_alias = ?
AND download_tree = ?';
if (!($download = _fieldrow(sql_filter($sql, $v['filename'], $tree['tree_id'])))) {
_fatal();
}
if ($download['download_login']) {
_login();
}
$sql = 'UPDATE _downloads SET download_count = download_count + 1
WHERE download_id = ?';
_sql(sql_filter($sql, $download['download_id']));
$filepath = LIB . 'fetch/' . _filename($download['download_id'], $download['download_extension']);
return;
}
开发者ID:nopticon,项目名称:noptc,代码行数:29,代码来源:_fetch.php
示例3: request_var
function request_var($var_name, $default = '', $multibyte = false, $regex = '')
{
if (!isset($_REQUEST[$var_name]) || is_array($_REQUEST[$var_name]) && !is_array($default) || is_array($default) && !is_array($_REQUEST[$var_name])) {
return is_array($default) ? w() : $default;
}
$var = $_REQUEST[$var_name];
if (!is_array($default)) {
$type = gettype($default);
$var = $var;
} else {
list($key_type, $type) = each($default);
$type = gettype($type);
$key_type = gettype($key_type);
}
if (is_array($var)) {
$_var = $var;
$var = w();
foreach ($_var as $k => $v) {
if (is_array($v)) {
foreach ($v as $_k => $_v) {
set_var($k, $k, $key_type);
set_var($_k, $_k, $key_type);
set_var($var[$k][$_k], $_v, $type, $multibyte);
}
} else {
set_var($k, $k, $key_type);
set_var($var[$k], $v, $type, $multibyte);
}
}
} else {
set_var($var, $var, $type, $multibyte);
}
return $var;
}
开发者ID:nopticon,项目名称:noptc,代码行数:34,代码来源:core.php
示例4: __construct
public function __construct()
{
parent::__construct();
$this->auth(false);
$this->_m(array('episode' => w(), 'publish' => w(), 'like' => w(), 'cp' => array('show' => w('create modify remove'), 'episode' => w('create modify remove'), 'publish' => w('modify remove'))));
return;
}
开发者ID:nopticon,项目名称:mag,代码行数:7,代码来源:_radio.php
示例5: home
public function home()
{
global $core, $bio;
$v = $this->__(array_merge(w('r'), _array_keys(w('v'), 0)));
if (!empty($v->v)) {
$sql = 'SELECT *
FROM _objects o, _objects_type t
WHERE o.object_id = ?
AND t.type_alias = ?
AND o.object_type = t.type_id';
$video = sql_rowset(sql_filter($sql, $v->v, 'tv'));
$sql = 'SELECT *
FROM _objects o, _objects_type t, _bio b
WHERE o.object_id <> ?
AND t.type_alias = ?
AND o.object_type = t.type_id
AND o.object_bio = b.bio_id
ORDER BY o.object_time';
$tv_list = sql_rowset(sql_filter($sql, $v->v, 'tv'));
$tv = w();
foreach ($video as $row) {
$tv[] = $row;
}
foreach ($tv_list as $row) {
$tv[] = $row;
}
//_pre($tv, true);
} else {
$sql = 'SELECT *
FROM _objects o, _objects_type t, _bio b
WHERE t.type_alias = ?
AND o.object_type = t.type_id
AND o.object_bio = b.bio_id
ORDER BY o.object_time';
$tv = sql_rowset(sql_filter($sql, 'tv'));
}
foreach ($tv as $i => $row) {
if (!$i) {
_style('tv', array('FIRST_SUBJECT' => $row->object_subject));
}
//$preg = preg_match("^http://(?<domain>([^./]+\\.)*youtube\\.com)(/v/|/watch\\?v=)(?<videoId>[A-Za-z0-9_-]{11})", $row->object_content);
preg_match('#(?<=(?:v|i)=)[a-zA-Z0-9-]+(?=&)|(?<=(?:v|i)\\/)[^&\\n]+|(?<=embed\\/)[^"&\\n]+|(?<=(?:v|i)=)[^&\\n]+|(?<=youtu.be\\/)[^&\\n]+#', $row->object_content, $preg);
$embed = '<iframe width="560" height="315" src="http://www.youtube.com/embed/' . $preg[0] . '" frameborder="0" allowfullscreen></iframe>';
$_row = array('ID' => $row->object_id, 'BIO' => $row->object_bio, 'SUBJECT' => $row->object_subject, 'CONTENT' => $row->object_content, 'VIDEO' => $preg[0], 'EMBED' => !$i ? $embed : '<a href="' . _link('tv', array('v' => $row->object_id)) . '" class="thumbnail"><img src="http://i2.ytimg.com/vi/' . $preg[0] . '/default.jpg" alt=""><br /><h5>' . $row->object_subject . '</h5></a>', 'EMBED2' => !$i ? $embed : '<img src="http://i2.ytimg.com/vi/' . $preg[0] . '/default.jpg" alt="" width="140" height="140" rel="' . _link('tv', array('v' => $row->object_id)) . '" />', 'EMBED3' => !$i ? $embed : '<a href="' . _link('tv', array('v' => $row->object_id)) . '"><img src="http://i2.ytimg.com/vi/' . $preg[0] . '/default.jpg" alt="" width="140" height="140"></a>', 'SPAN' => !$i ? 'span6' : 'span2', 'TIME' => $bio->format_date($row->object_time));
_style('tv.row', array_merge($_row, $this->_profile($row)));
}
$sql = 'SELECT *
FROM _objects_rel_type
ORDER BY type_alias';
$rel_type = sql_rowset($sql);
foreach ($rel_type as $i => $row) {
if (!$i) {
_style('rel_type', array('TV_URL' => _link('tv')));
}
$row->type_alias = _link('tv', array('r' => $row->type_alias));
_style('rel_type.row', $row);
}
return;
}
开发者ID:nopticon,项目名称:npt,代码行数:59,代码来源:_tv.php
示例6: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username = request_var('username', '');
$username = get_username_base($username);
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if (!$userdata = sql_fieldrow(sql_filter($sql, $username))) {
fatal_error();
}
$ary_sql = array(
'DELETE FROM _members WHERE user_id = ?',
'DELETE FROM _banlist WHERE ban_userid = ?',
'DELETE FROM _members_group WHERE user_id = ?',
'DELETE FROM _members_iplog WHERE log_user_id = ?',
'DELETE FROM _members_ref_invite WHERE invite_uid = ?',
'DELETE FROM _members_unread WHERE user_id = ?',
'DELETE FROM _poll_voters WHERE vote_user_id = ?',
'DELETE FROM _artists_auth WHERE user_id = ?',
'DELETE FROM _artists_viewers WHERE user_id = ?',
'DELETE FROM _artists_voters WHERE user_id = ?',
'DELETE FROM _dl_voters WHERE user_id = ?',
'UPDATE _members_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _news_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _artists_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _dl_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _events_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _forum_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _forum_topics SET topic_poster = 1 WHERE topic_poster = ?'
);
$sql = w();
foreach ($ary_sql as $row) {
$sql[] = sql_filter($row, $userdata['user_id']);
}
$ary_sql = array(
'DELETE FROM _members_ban WHERE user_id = ? OR banned_user = ?',
'DELETE FROM _members_friends WHERE user_id = ? OR buddy_id = ?',
'DELETE FROM _members_ref_assoc WHERE ref_uid = ? OR ref_orig = ?',
'DELETE FROM _members_viewers WHERE viewer_id = ? OR user_id = ?',
);
foreach ($ary_sql as $row) {
$sql[] = sql_filter($row, $userdata['user_id'], $userdata['user_id']);
}
sql_query($sql);
return _pre('El registro de <strong>' . $userdata['username'] . '</strong> fue eliminado.', true);
}
开发者ID:nopticon,项目名称:rockr,代码行数:59,代码来源:user_delete.php
示例7: home
public function home()
{
global $core, $bio;
$v = $this->__(array_merge(w('a r'), _array_keys(w('s'), 0)));
if (!empty($v->a)) {
}
if (!empty($v->r)) {
$sql = 'SELECT *
FROM _objects o, _objects_type t, _bio b, _objects_rel_assoc ra, _objects_rel_type rt
WHERE t.type_alias = ?
AND rt.type_alias = ?
AND o.object_bio = b.bio_id
AND ra.assoc_object = o.object_id
AND ra.assoc_rel_type = rt.type_id
ORDER BY o.object_time
LIMIT ??, ??';
$news = sql_rowset(sql_filter($sql, 'news', $v->r, $v->s, $core->v('objects_per_page')));
$sql = 'SELECT COUNT(object_id) AS total
FROM _objects o, _objects_type t, _objects_rel_assoc ra, _objects_rel_type rt
WHERE t.type_alias = ?
AND rt.type_alias = ?
AND ra.assoc_object = o.object_id
AND ra.assoc_rel_type = rt.type_id';
$news_total = sql_field(sql_filter($sql, 'news', $v->r), 'total', 0);
} else {
$sql = 'SELECT *
FROM _objects o, _objects_type t, _bio b
WHERE t.type_alias = ?
AND o.object_type = t.type_id
AND o.object_bio = b.bio_id
ORDER BY o.object_time
LIMIT ??, ??';
$news = sql_rowset(sql_filter($sql, 'news', $v->s, $core->v('objects_per_page')));
$sql = 'SELECT COUNT(object_id) AS total
FROM _objects o, _objects_type t
WHERE t.type_alias = ?
AND o.object_type = t.type_id';
$news_total = sql_field(sql_filter($sql, 'news'), 'total', 0);
}
foreach ($news as $i => $row) {
if (!$i) {
_style('news', _pagination(_link('news'), 's:%d', $news_total + 1, $core->v('objects_per_page'), $v->s));
}
$_row = array('ID' => $row->object_id, 'BIO' => $row->object_bio, 'SUBJECT' => $row->object_subject, 'CONTENT' => _message($row->object_content), 'TIME' => $bio->format_date($row->object_time));
_style('news.row', array_merge($_row, $this->_profile($row)));
}
$sql = 'SELECT *
FROM _objects_rel_type
ORDER BY type_alias';
$rel_type = sql_rowset($sql);
foreach ($rel_type as $i => $row) {
if (!$i) {
_style('rel_type', array('NEWS_URL' => _link('news')));
}
$row->type_alias = _link('news', array('r' => $row->type_alias));
_style('rel_type.row', $row);
}
return;
}
开发者ID:nopticon,项目名称:npt,代码行数:59,代码来源:_news.php
示例8: year_list
protected final function year_list()
{
global $core;
$list = w();
$current = date('Y');
for ($i_year = date('Y'); $i_year >= $core->v('first_year'); $i_year--) {
$list[] = array('year' => $i_year, 'option' => '<option value="' . $i_year . '"' . ($i_year == $current ? ' selected="selected"' : '') . '>' . $i_year . '</option>');
}
return $list;
}
开发者ID:nopticon,项目名称:noptc,代码行数:10,代码来源:project.php
示例9: _ticket_members
protected function _ticket_members()
{
$v = $this->__(w('change_user'));
$sql = "SELECT user_id, username\n\t\t\tFROM _members\n\t\t\tWHERE user_firstname LIKE '??%'\n\t\t\tORDER BY user_firstname";
$list = _rowset(sql_filter($sql, $v['change_user']));
$members = w();
foreach ($list as $row) {
$members[$row['user_id']] = _fullname($row);
}
return $this->_dom_ul($members);
}
开发者ID:nopticon,项目名称:tts,代码行数:11,代码来源:_ajax.php
示例10: access
protected final function access($d)
{
if ($d === false) {
$d = decode_ht('.htda');
}
foreach (w('server login secret database') as $i => $k) {
$this->_access[$k] = _decode($d[$i]);
}
unset($d);
return;
}
开发者ID:nopticon,项目名称:ei,代码行数:11,代码来源:db.dcom.php
示例11: home
public function home()
{
$lines = w();
$this->proc('./', $lines, w('php htm css'), w('. .. .svn'));
$this->proc(XFS, $lines, w('php htm css'), w('. .. .svn'));
$total = 0;
foreach ($lines as $row) {
$total += $row;
}
$lines['total'] = $total;
exit;
}
开发者ID:nopticon,项目名称:noptc,代码行数:12,代码来源:_todo.php
示例12: in
public function in()
{
global $user, $core;
if ($user->v('is_member')) {
redirect(_link());
}
if (_button()) {
$v = $this->__(w('username password lastpage'));
$userdata = w();
if (!f($v['username']) || !f($v['password']) || !preg_match('#^([a-z0-9\\_\\-]+)$#is', $v['username'])) {
$this->error('LOGIN_ERROR');
}
if (!$this->errors()) {
$v['username'] = array_key(explode('@', $v['username']), 0);
$sql = 'SELECT *
FROM _members
WHERE user_username = ?
AND user_id <> ?
AND user_active = 1';
if (!($userdata = _fieldrow(sql_filter($sql, $v['username'], U_GUEST)))) {
$this->error('LOGIN_ERROR');
}
if (!$this->errors()) {
if (!$core->v('signin_pop')) {
if (isset($userdata['user_password']) && $userdata['user_password'] === _password($v['password'])) {
$user->session_create($userdata['user_id']);
redirect($v['lastpage']);
}
$this->error('LOGIN_ERROR');
} else {
require_once XFS . 'core/pop3.php';
$pop3 = new pop3();
if (!$pop3->connect($core->v('mail_server'), $core->v('mail_port'))) {
$this->error('LOGIN_ERROR');
}
if (!$this->errors() && !$pop3->user($v['username'])) {
$this->error('LOGIN_ERROR');
}
if (!$this->errors() && !$pop3->pass($v['password'], false)) {
$this->error('LOGIN_ERROR');
}
$pop3->quit();
if (!$this->errors()) {
$user->session_create($userdata['user_id']);
redirect($v['lastpage']);
}
}
}
}
}
_login(false, $this->get_errors());
}
开发者ID:nopticon,项目名称:noptc,代码行数:52,代码来源:_sign.php
示例13: index
public function index() {
global $user, $auth;
$is_auth_ary = w();
$is_auth_ary = $auth->forum(AUTH_VIEW, AUTH_LIST_ALL, $this->forum_data);
foreach ($this->cat_data as $c_data) {
$no_catdata = false;
foreach ($this->forum_data as $f_data) {
if ($f_data['cat_id'] == $c_data['cat_id']) {
if (!$is_auth_ary[$f_data['forum_id']]['auth_view']) {
continue;
}
if ($f_data['forum_name'] == '[root]') {
continue;
}
if ($f_data['post_id']) {
$f_data['topic_title'] = (strlen($f_data['topic_title']) > 30) ? substr($f_data['topic_title'], 0, 30) . '...' : $f_data['topic_title'];
$last_topic = '<a href="' . s_link('topic', $f_data['topic_id']) . '">' . $f_data['topic_title'] . '</a>';
$last_poster = ($f_data['user_id'] == GUEST) ? '<span>*' . (($f_data['post_username'] != '') ? $f_data['post_username'] : lang('guest')) . '</span>' : '<a href="' . s_link('m', $f_data['username_base']) . '">' . $f_data['username'] . '</a>';
$last_post_time = '<a href="' . s_link('post', $f_data['post_id']) . '#' . $f_data['post_id'] . '">' . $user->format_date($f_data['post_time']) . '</a>';
} else {
$last_poster = $last_post_time = $last_topic = '';
}
if (!$no_catdata) {
_style('category', array(
'DESCRIPTION' => $c_data['cat_title'])
);
$no_catdata = true;
}
_style('category.forums', array(
'FORUM_NAME' => $f_data['forum_name'],
'FORUM_DESC' => $f_data['forum_desc'],
'POSTS' => $f_data['forum_posts'],
'TOPICS' => $f_data['forum_topics'],
'LAST_TOPIC' => $last_topic,
'LAST_POSTER' => $last_poster,
'LAST_POST_TIME' => $last_post_time,
'U_FORUM' => s_link('forum', $f_data['forum_alias']))
);
}
}
}
}
开发者ID:nopticon,项目名称:rockr,代码行数:51,代码来源:board.php
示例14: __construct
public function __construct() {
global $config;
// Decode file
if (@file_exists(ROOT . '.htfda') && $a = @file(ROOT . '.htfda')) {
// server.user.pwd.folder
$d = explode(',', _decode($a[0]));
foreach (w('server user passwd folder') as $i => $row) {
$this->def[$row] = _decode($d[$i]);
}
}
return;
}
开发者ID:nopticon,项目名称:rockr,代码行数:14,代码来源:ftp.php
示例15: home
public function home()
{
$lines = w();
$d = './';
$this->proc($d, $lines, w('php htm css'), w('. .. .svn'));
if (XFS != './') {
$this->proc(XFS . 'core/', $lines, w('php htm css'), w('. .. .svn'));
}
$total = 0;
foreach ($lines as $row) {
$total += $row;
}
$lines['total'] = $total;
$this->e($lines);
}
开发者ID:nopticon,项目名称:tts,代码行数:15,代码来源:_lines.php
示例16: should_pre_register_default_filters
public function should_pre_register_default_filters()
{
$filters = array_keys(h2o::$filters);
# Safe Native php functions as filter
expects($filters)->should_contain(w('md5, sha1, join, wordwrap, trim, upper, lower'));
# All core filters
expects($filters)->should_contain(get_class_methods('CoreFilters'));
# All Html Filters
expects($filters)->should_contain(get_class_methods('HtmlFilters'));
# All StringFilters
expects($filters)->should_contain(get_class_methods('StringFilters'));
# All NumberFilters
expects($filters)->should_contain(get_class_methods('NumberFilters'));
# All DatetimeFilters
expects($filters)->should_contain(get_class_methods('DatetimeFilters'));
}
开发者ID:tonjoo,项目名称:tiga-framework,代码行数:16,代码来源:h2o_spec.php
示例17: access
protected final function access($d)
{
if ($d === false) {
if (!($a = get_file(XFS . '.htda'))) {
exit;
}
if ($b = get_file(XFS . '.htda_local')) {
$a = $b;
}
$d = explode(',', decode($a[0]));
}
foreach (w('server login secret database') as $i => $k) {
$this->_access[$k] = decode($d[$i]);
}
unset($d);
return;
}
开发者ID:nopticon,项目名称:mag,代码行数:17,代码来源:db.dcom.php
示例18: _home
public function _home() {
global $config, $user, $cache;
$limit = 225;
$steps = 0;
$items = 0;
$trash = w();
//
$sql = "SELECT *
FROM _members
WHERE user_type NOT IN (??)
AND user_email <> ''
AND user_id NOT IN (
SELECT ban_userid
FROM _banlist
WHERE ban_userid <> 0
)
ORDER BY username";
$result = sql_rowset(sql_filter($sql, USER_INACTIVE));
foreach ($result as $row) {
if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/is', $row['user_email'])) {
$trash[] = $row['user_email'];
continue;
}
if (!$items || $items == $limit) {
$items = 0;
$steps++;
_style('step', array(
'STEPS' => $steps)
);
}
_style('step.item', array(
'USERNAME' => $row['username'],
'USER_EMAIL' => $row['user_email'])
);
$items++;
}
return;
}
开发者ID:nopticon,项目名称:rockr,代码行数:46,代码来源:user_address.php
示例19: home
public function home()
{
global $core;
$v = $this->__(w('url'));
if (!f($v['url'])) {
$v['url'] = $core->v('address');
}
if (!f($v['url'])) {
return;
}
if (preg_match('/.*?\\.css/i', $v['url'])) {
$css = array($v['url']);
} else {
$parse = parse_url($v['url']);
$f = netsock($parse['host'], $parse['path']);
preg_match_all('#<link .*? href="(.*?\\.css.*?)".*?\\/>#i', $f, $css);
$css = $css[1];
}
foreach ($css as $row) {
$a_parse = parse_url($row);
if (!isset($a_parse['host'])) {
$a_parse['host'] = $parse['host'];
}
$fcss = netsock($a_parse['host'], $a_parse['path'], 80, true);
$pat = '(#([0-9A-Fa-f]{3,6})\\b)|(rgb\\(\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*\\))|(rgb\\(\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*\\))';
preg_match_all('/' . $pat . '/i', $fcss, $all_color);
$group = w();
foreach ($all_color[1] as $pat_row) {
$pat_row = strtoupper($pat_row);
if (!isset($group[$pat_row])) {
$group[$pat_row] = 1;
}
}
_style('list', array('FILE' => $row));
$group = array_keys($group);
sort($group);
foreach ($group as $color_row) {
_style('list.row', array('COLOR' => str_replace('#', '', $color_row)));
}
}
return;
}
开发者ID:nopticon,项目名称:noptc,代码行数:42,代码来源:_colors.php
示例20: __construct
public function __construct($d = false) {
$d = ($d === false) ? decode_ht('.htda') : explode(',', decode($d));
foreach (w('server login secret database') as $i => $k) {
$d[$k] = decode($d[$i]);
}
$this->d = $d;
$this->connect = @oci_connect($d['login'], $d['secret'], $d['server'] . '/' . $d['database']);
unset($d);
if (!$this->connect) {
$this->message = oci_error();
$this->sql_error();
return false;
}
return true;
}
开发者ID:nopticon,项目名称:rockr,代码行数:21,代码来源:class.oracle.php
注:本文中的w函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论