本文整理汇总了PHP中_style函数的典型用法代码示例。如果您正苦于以下问题:PHP _style函数的具体用法?PHP _style怎么用?PHP _style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_style函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _home
public function _home() {
global $config, $user, $cache;
if (_button()) {
$forum_id = request_var('fid', 0);
$forum_alias = request_var('falias', '');
$sql = 'UPDATE _forums SET forum_alias = ?
WHERE forum_id = ?';
sql_query(sql_filter($sql, $forum_alias, $forum_id));
_pre($forum_id . ' > ' . $forum_alias, true);
}
$sql = 'SELECT forum_id, forum_name
FROM _forums
ORDER BY forum_order';
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('forums');
_style('forums.row', array(
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'])
);
}
return;
}
示例2: _home
public function _home() {
global $config, $user, $cache;
$this->_artist();
if ($this->remove()) {
return;
}
$sql = 'SELECT *
FROM _events e, _artists_events a
WHERE a.a_artist = ?
AND a.a_event = e.id
ORDER BY e.date DESC';
$result = sql_rowset(sql_filter($sql, $this->object['ub']));
foreach ($result as $i => $row) {
if (!$i) _style('events');
_style('events.row', array(
'ID' => $row['id'],
'TITLE' => $row['title'],
'DATE' => $user->format_date($row['date']))
);
}
return;
}
示例3: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
$sql = 'SELECT forum_id, forum_name
FROM _forums
ORDER BY forum_order ASC';
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('forums');
_style('forums.row', array(
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'])
);
}
return false;
}
$list = request_var('listContainer', array(0));
$orderid = 10;
foreach ($list as $catid) {
$sql = 'UPDATE _forums SET forum_order = ?
WHERE forum_id = ?';
sql_query(sql_filter($sql, $orderid, $catid));
$orderid += 10;
}
_pre('Update.', true);
}
示例4: _home
public function _home() {
global $config, $user, $cache;
$sql = 'SELECT e.event_topic, f.forum_name, t.topic_id, t.topic_title, t.topic_views, t.topic_replies
FROM _forum_topics t
LEFT JOIN _events e ON e.event_topic = t.topic_id
INNER JOIN _forums f ON t.forum_id = f.forum_id
WHERE t.forum_id NOT IN (38)
ORDER BY t.topic_time DESC
LIMIT 100';
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('topics');
_style('topics.row', array(
'TOPIC_ID' => s_link('topic', $row['topic_id']),
'TOPIC_FORUM' => $row['forum_name'],
'TOPIC_EVENT' => $row['event_topic'],
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_VIEWS' => $row['topic_views'],
'TOPIC_REPLIES' => $row['topic_replies'])
);
}
return;
}
示例5: _home
public function _home() {
global $config, $user, $comments;
$this->_artist();
if ((_button() && $this->create()) || (_button('remove') && $this->remove())) {
return;
}
$sql = 'SELECT *
FROM _artists_video
WHERE video_a = ?
ORDER BY video_added DESC';
$result = sql_rowset(sql_filter($sql, $this->object['ub']));
foreach ($result as $i => $row) {
if (!$i) _style('video');
_style('video.row', array(
'ID' => $row['video_id'],
'CODE' => $row['video_code'],
'NAME' => $row['video_name'],
'TIME' => $user->format_date($row['video_added']))
);
}
return;
}
示例6: _home
public function _home() {
global $config, $user, $cache;
$artist = request_var('a', '');
$redirect = request_var('r', '');
if (!empty($artist)) {
redirect(s_link('acp', array($redirect, 'a' => $artist)));
}
$artist_select = '';
if (!$user->is('founder')) {
$sql = 'SELECT ub
FROM _artists_auth
WHERE user_id = ?';
$artist_select = ' WHERE ub IN (' . _implode(',', sql_rowset(sql_filter($sql, $user->d('user_id')), false, 'ub')) . ') ';
}
$sql = 'SELECT ub, subdomain, name
FROM _artists
??
ORDER BY name';
$artists = sql_rowset(sql_filter($sql, $artist_select));
foreach ($artists as $i => $row) {
if (!$i) _style('artist_list');
_style('artist_list.row', array(
'URL' => s_link('acp', array($redirect, 'a' => $row['subdomain'])),
'NAME' => $row['name'])
);
}
return;
}
示例7: _home
public function _home() {
global $config, $user, $comments;
$this->_artist();
if (_button()) {
$message = request_var('message', '');
$message = $comments->prepare($message);
$sql = 'UPDATE _artists SET bio = ?
WHERE ub = ?';
sql_query(sql_filter($sql, $message, $this->object['ub']));
_style('updated');
}
$sql = 'SELECT bio
FROM _artists
WHERE ub = ?';
$bio = sql_field(sql_filter($sql, $this->object['ub']), 'bio');
v_style(array(
'MESSAGE' => $bio)
);
return;
}
示例8: run
public function run() {
global $user;
$sql = 'SELECT *
FROM _today_objects o
INNER JOIN _today_type t ON t.type_id = o.object_type
WHERE object_bio = ?
GROUP BY o.object_type
ORDER BY t.type_order, o.object_relation';
if (!$elements = sql_rowset(sql_filter($sql, $user->d('user_id')))) {
return false;
}
$this->downloads = new downloads();
foreach ($elements as $row) {
if ($response = $this->{$row['type_alias']}()) {
_style($row['type_alias'], array(
'ID' => $row['type_id'])
);
foreach ($response as $_row) {
_style($row['type_alias'] . '.row', $_row);
}
}
}
return;
}
示例9: 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;
}
示例10: 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;
}
示例11: _home
public function _home() {
global $config, $user, $cache;
$submit2 = _button('submit2');
if (_button() || $submit2) {
$news_id = request_var('news_id', 0);
$sql = 'SELECT *
FROM _news
WHERE news_id = ?';
if (!$news_data = sql_fieldrow(sql_filter($sql, $news_id))) {
fatal_error();
}
if ($submit2) {
$post_subject = request_var('post_subject', '');
$post_desc = request_var('post_desc', '', true);
$post_message = request_var('post_text', '', true);
if (empty($post_desc) || empty($post_message)) {
_pre('Campos requeridos.', true);
}
$comments = new _comments();
$post_message = $comments->prepare($post_message);
$post_desc = $comments->prepare($post_desc);
//
$sql = 'UPDATE _news SET post_subject = ?, post_desc = ?, post_text = ?
WHERE news_id = ?';
sql_query(sql_filter($sql, $post_subject, $post_desc, $post_message, $news_id));
$cache->delete('news');
redirect(s_link('news', $news_id));
}
if (_button()) {
_style('edit', array(
'ID' => $news_data['news_id'],
'SUBJECT' => $news_data['post_subject'],
'DESC' => $news_data['post_desc'],
'TEXT' => $news_data['post_text'])
);
}
}
if (!_button()) {
_style('field');
}
return;
}
示例12: home
public function home()
{
global $core;
$v = $this->__(array('a', 'p' => 0));
if (f($v['a'])) {
$sql = 'SELECT area_id
FROM _reference_area
WHERE area_alias = ?';
if (!_field(sql_filter($sql, $v['a']), 'area_id', 0)) {
_fatal();
}
$sql = 'SELECT COUNT(r.ref_id) AS total
FROM _reference r, _reference_area a
WHERE a.area_alias = ?
AND r.ref_area = a.area_id
ORDER BY r.ref_time DESC';
$ref_total = _field(sql_filter($sql, $v['a']), 'total', 0);
$sql = 'SELECT *
FROM _reference r, _reference_area a
WHERE a.area_alias = ?
AND r.ref_area = a.area_id
ORDER BY r.ref_time DESC
LIMIT ??, ??';
$ref = _rowset(sql_filter($sql, $v['a'], $v['p'], $core->v('ref_pages')));
} else {
$sql = 'SELECT COUNT(ref_id) AS total
FROM _reference
ORDER BY ref_time DESC';
$ref_total = _field($sql, 'total', 0);
$sql = 'SELECT *
FROM _reference r, _reference_area a
WHERE r.ref_area = a.area_id
ORDER BY r.ref_time DESC
LIMIT ??, ??';
$ref = _rowset(sql_filter($sql, $v['p'], $core->v('ref_pages')));
}
if ($v['p'] && $ref_total) {
redirect(_link());
} else {
_style('noref');
}
foreach ($ref as $i => $row) {
if (!$i) {
_style('ref');
}
if ($this->has_plugin($row['ref_content'])) {
$this->parse_plugin($row);
continue;
}
_style('ref.row', _vs(array('id' => $row['ref_id'], 'link' => _link($row['ref_alias']), 'subject' => $row['ref_subject'], 'content' => _message($row['ref_content']), 'time' => _format_date($row['ref_time'])), 'ref'));
}
return;
}
示例13: _home
public function _home() {
global $config, $cache, $user;
if (!_button()) {
$sql = 'SELECT cat_id, cat_name
FROM _news_cat
ORDER BY cat_id';
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('categories');
_style('categories.row', array(
'CAT_ID' => $row['cat_id'],
'CAT_NAME' => $row['cat_name'])
);
}
return false;
}
$t = request_var('news_id', 0);
$f = request_var('cat_id', 0);
if (!$f || !$t) {
fatal_error();
}
//
$sql = 'SELECT *
FROM _news
WHERE news_id = ?';
if (!$tdata = sql_fieldrow(sql_filter($sql, $t))) {
fatal_error();
}
//
$sql = 'SELECT *
FROM _news_cat
WHERE cat_id = ?';
if (!$fdata = sql_fieldrow(sql_filter($sql, $f))) {
fatal_error();
}
//
$sql = 'UPDATE _news SET cat_id = ?
WHERE news_id = ?';
sql_query(sql_filter($sql, $f, $t));
return redirect(s_link('news', $t));
}
示例14: elements
private function elements() {
$sql = 'SELECT *
FROM _win
ORDER BY win_date';
$win = sql_rowset($sql);
foreach ($win as $i => $row) {
if (!$ui) _style('win');
_style('win.row', array(
));
}
return;
}
示例15: _home
public function _home() {
global $config, $user, $cache;
if (_button()) {
$topic = request_var('topic', 0);
$sql = 'SELECT *
FROM _forum_topics
WHERE topic_id = ?';
if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) {
fatal_error();
}
$sql = 'UPDATE _forum_topics
SET topic_color = ?, topic_announce = 0, topic_important = 0
WHERE topic_id = ?';
sql_query(sql_filter($sql, '', $topic));
_style('updated', array(
'MESSAGE' => 'El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido normalizado.')
);
}
$sql = 'SELECT t.topic_id, t.topic_title, f.forum_name
FROM _forums f, _forum_topics t
WHERE f.forum_id = t.forum_id
AND (topic_announce = 1
OR topic_important = 1)
ORDER BY forum_order, topic_title';
$topics = sql_rowset($sql);
$forum_name = '';
foreach ($topics as $i => $row) {
if (!$i) _style('topics');
if ($forum_name != $row['forum_name']) _style('topics.forum', array('FORUM_NAME' => $row['forum_name']));
$forum_name = $row['forum_name'];
_style('topics.forum.row', array(
'TOPIC_ID' => $row['topic_id'],
'TOPIC_TITLE' => $row['topic_title'])
);
}
return;
}