本文整理汇总了PHP中_implode函数的典型用法代码示例。如果您正苦于以下问题:PHP _implode函数的具体用法?PHP _implode怎么用?PHP _implode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_implode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _home
public function _home() {
global $config, $cache;
if (!_button()) {
$sql = 'SELECT ub, name
FROM _artists
ORDER BY name';
return _rowset_style($sql, 'artists');
}
$name = request_var('name', '');
$sql = 'SELECT *
FROM _artists
WHERE name = ?';
if (!$a_data = sql_fieldrow(sql_filter($sql, $name))) {
fatal_error();
}
$sql = 'SELECT m.user_id, m.user_email
FROM _artists_auth a, _members m
WHERE a.ub = ?
AND a.user_id = m.user_id';
$result = sql_rowset(sql_filter($sql, $a_data['ub']));
$mods = w();
foreach ($result as $row) {
$mods[] = $row['user_id'];
}
if (count($mods)) {
foreach ($mods as $i => $each) {
$sql = 'SELECT COUNT(user_id) AS total
FROM _artists_auth
WHERE user_id = ?';
$total = sql_field(sql_filter($sql, $each), 'total', 0);
if ($total > 1) {
unset($mods[$i]);
}
}
}
if (count($mods)) {
$sql = 'UPDATE _members SET user_auth_control = 0
WHERE user_id IN (??)';
$d_sql[] = sql_filter($sql, _implode(',', $mods));
}
$ary_sql = array(
'DELETE FROM _artists WHERE ub = ?',
'DELETE FROM _artists_auth WHERE ub = ?',
'DELETE FROM _artists_fav WHERE ub = ?',
'DELETE FROM _artists_images WHERE ub = ?',
'DELETE FROM _artists_log WHERE ub = ?',
'DELETE FROM _artists_lyrics WHERE ub = ?',
'DELETE FROM _artists_posts WHERE post_ub = ?',
'DELETE FROM _artists_stats WHERE ub = ?',
'DELETE FROM _artists_viewers WHERE ub = ?',
'DELETE FROM _artists_voters WHERE ub = ?',
'DELETE FROM _artists_votes WHERE ub = ?',
'DELETE FROM _forum_topics WHERE topic_ub = ?',
'DELETE FROM _dl WHERE ub = ?'
);
$d_sql = sql_filter($ary_sql, $a_data['ub']);
$sql = 'SELECT topic_id
FROM _forum_topics
WHERE topic_ub = ?';
if ($topics = sql_rowset(sql_filter($sql, $a_data['ub']), false, 'topic_id')) {
$d_sql[] = sql_filter('DELETE FROM _forum_posts
WHERE topic_id IN (??)', _implode(',', $topics));
}
$sql = 'SELECT id
FROM _dl
WHERE ub = ?';
if ($downloads = sql_rowset(sql_filter($sql, $a_data['ub']), false, 'id')) {
$ary_sql = array(
'DELETE FROM _dl_fav WHERE dl_id IN (??)',
'DELETE FROM _dl_posts WHERE download_id IN (??)',
'DELETE FROM _dl_vote WHERE ud IN (??)',
'DELETE FROM _dl_voters WHERE ud IN (??)'
);
$d_sql = array_merge($d_sql, sql_filter($ary_sql, _implode(',', $downloads)));
}
if (!_rm($config['artists_path'] . $a_data['ub'])) {
_pre('Error al eliminar directorio de artista.', true);
}
sql_query($d_sql);
// Cache
$cache->delete('ub_list a_last_images');
redirect(s_link('a'));
}
示例2: _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;
}
示例3: _home
public function _home() {
global $config, $user, $cache;
$username = request_var('username', '');
$ip = request_var('ip', '');
if (_button() && ($username || $ip)) {
if ($username) {
$username_base = get_username_base($username);
$sql = 'SELECT m.username, l.*
FROM _members m, _members_iplog l
WHERE m.user_id = l.log_user_id
AND m.username_base = ?
ORDER BY l.log_time DESC';
$sql = sql_filter($sql, $username_base);
} else if ($ip) {
$sql = 'SELECT m.username, l.*
FROM _members m, _members_iplog l
WHERE m.user_id = l.log_user_id
AND l.log_ip = ?
ORDER BY l.log_time DESC';
$sql = sql_filter($sql, $ip);
}
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('log');
_style('log.row', array(
'UID' => $row['log_user_id'],
'USERNAME' => $row['username'],
'TIME' => $user->format_date($row['log_time']),
'ENDTIME' => (($row['log_endtime']) ? $user->format_date($row['log_endtime']) : ' '),
'DIFFTIME' => (($row['log_endtime']) ? _implode(' ', timeDiff($row['log_endtime'], $row['log_time'], true, 1)) : ' '),
'IP' => $row['log_ip'],
'AGENT' => $row['log_agent'])
);
}
}
return;
}
示例4: home
function home()
{
$sql = 'SELECT *
FROM _members
WHERE user_type = ?
AND user_birthday LIKE ?
AND user_birthday_last < ?
ORDER BY user_username
LIMIT ??';
$birthday = _rowset(sql_filter($sql, 1, '%' . date('md'), date('Y'), 10));
if (!$birthday) {
$this->e('None.');
}
$process = w();
foreach ($birthday as $i => $row) {
if (!$i) {
@set_time_limit(0);
require XFS . 'core/emailer.php';
$emailer = new emailer();
}
$emailer->format('plain');
$emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
$emailer->use_template('user_birthday');
$emailer->email_address($row['user_email']);
$emailer->assign_vars(array('USERNAME' => $row['user_username']));
$emailer->send();
$emailer->reset();
$process[$row['user_id']] = $row['user_username'];
}
if (count($process)) {
$sql = 'UPDATE _members SET user_birthday_last = ?
WHERE user_id IN (??)';
_sql(sql_filter($sql, date('Y'), _implode(',', array_keys($process))));
}
return $this->e('Done @ ' . implode(',', array_values($process)));
}
示例5: _optimize_home
protected function _optimize_home()
{
$tables = array();
$sql = 'SHOW TABLES';
foreach (_rowset($sql) as $row) {
foreach ($row as $v) {
$tables[] = $v;
}
}
$sql = 'OPTIMIZE TABLE ' . _implode(', ', $tables);
_sql($sql);
return $this->e('Done.');
}
示例6: childs
private function childs($use_child = true)
{
global $user;
$svar = $use_child ? 'child' : 'child2';
if (!($s_child = count($this->{$svar}))) {
return;
}
$d_images = w();
if ($this->data['tree_schilds']) {
$sql = 'SELECT tree_id, image_id, image_extension
FROM _images
WHERE tree_id IN (??)
ORDER BY RAND()';
$images = _rowset(sql_filter($sql, _implode(',', array_keys($this->{$svar}))));
foreach ($images as $rows) {
if (!isset($d_images[$row['tree_id']])) {
$d_images[$row['tree_id']] = _filename($row['image_id'], $row['image_extension']);
}
}
}
_style($svar, array('ORDER_URL' => _link($this->data['tree_id'], array('order', 0, 0, 0, 0))));
// TODO: Replace _linkf funcion to _link_alias
foreach ($this->{$svar} as $a => $row) {
_style($svar . '.item', array('ID' => $row['tree_id'], 'U' => _linkf($a, $row['tree_furl']), 'L' => $user->ls('tree', 'title', $row), 'I' => isset($d_images[$a]) ? $d_images[$a] : 'def.gif', 'DU' => $this->u_dynamic($row)));
}
if ($use_child) {
$this->childs(false);
}
return;
}
示例7: _avatar
function _avatar($v)
{
if (!f($v['bio_avatar'])) {
return _lib('d', 'no', 'jpg');
}
$path = array($v['bio_alias'][0], $v['bio_alias'][1], $v['bio_alias']);
return _lib(LIB_AVATAR, _implode('/', $path), $v['bio_avatar']) . '#' . $v['bio_avatar_up'];
}
示例8: use_helper
use_helper('Field', 'Link');
$item_i18n = $item['SiteI18n'][0];
?>
<div><?php
echo list_link($item_i18n, 'sites');
?>
</div>
<div><?php
$routes_quantity = $item['routes_quantity'];
if (is_scalar($routes_quantity) && $routes_quantity > 0) {
$routes_quantity = __('%1% routes_quantity', array('%1%' => $routes_quantity));
} else {
$routes_quantity = '';
}
echo _implode(' - ', array(displayWithSuffix($item['elevation'], 'meters'), get_paginated_value_from_list($item['site_types'], 'app_sites_site_types'), $routes_quantity, get_paginated_value_from_list($item['rock_types'], 'mod_sites_rock_types_list')));
?>
</div>
<div><?php
if (isset($item['linked_docs'])) {
echo __('access'), ' ';
include_partial('parkings/parkings4list', array('parkings' => $item['linked_docs']));
}
?>
</div>
<div><?php
include_partial('documents/regions4list', array('geoassociations' => $item['geoassociations']));
?>
</div>
示例9: use_helper
<?php
use_helper('Field', 'Link');
$item_i18n = $item['BookI18n'][0];
?>
<div class="right"><?php
echo get_paginated_activities($item['activities']);
?>
</div>
<div><?php
echo list_link($item_i18n, 'books');
?>
</div>
<div>
<?php
echo _implode(' - ', array($item['author'], $item['editor'], $item['publication_date']));
?>
</div>
<div>
<?php
echo _implode(' - ', array(get_paginated_value_from_list($item['book_types'], 'mod_books_book_types_list'), get_paginated_value_from_list($item['langs'], 'app_languages_book')));
?>
</div>
<div><?php
echo picto_tag('picto_images', __('nb_linked_images')), ' ', isset($item['nb_images']) ? $item['nb_images'] : '0', ' ', picto_tag('action_comment', __('nb_comments')), ' ', isset($item['nb_comments']) ? link_to($item['nb_comments'], '@document_comment?module=books&id=' . $item_i18n['id'] . '&lang=' . $item_i18n['culture']) : '0';
?>
</div>
示例10: remove
private function remove() {
global $config, $cache;
$remove = request_var('s_downloads', array(0));
if (!count($remove)) {
return;
}
$sql = 'SELECT *
FROM _dl
WHERE id IN (??)
AND ub = ?';
if ($result = sql_rowset(sql_filter($sql, _implode(',', $remove), $this->object['ub']))) {
foreach ($result as $row) {
$path = artist_root($this->object['ub'] . ' media ' . $row['id'] . '.mp3');
_rm($path);
$sql = 'DELETE FROM _dl
WHERE id = ?';
sql_query(sql_filter($sql, $row['id']));
$cache->delete('downloads_list');
}
redirect(s_link('acp', array('artist_media', 'a' => $this->object['subdomain'])));
}
return;
}
示例11: _implode_and
function _implode_and($glue, $last_glue, $pieces, $empty = false) {
$response = _implode($glue, $pieces, $empty);
$last = strrpos($response, $glue);
if ($last !== false) {
$response = substr_replace($response, $last_glue, $last, count($glue) + 1);
}
return $response;
}
示例12: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$topics = request_var('topic_id', '');
$topics = array_map('intval', explode(',', $topics));
$forums_id_sql = $topics_id = w();
$sql = 'SELECT forum_id, topic_id
FROM _forum_topics
WHERE topic_id IN (??)';
$result = sql_rowset(sql_filter($sql, _implode(', ', $topics)));
foreach ($result as $row) {
$forums_id_sql[] = (int) $row['forum_id'];
$topics_id[] = (int) $row['topic_id'];
}
$topic_id_sql = _implode(',', $topics_id);
//
$sql = 'SELECT post_id
FROM _forum_posts
WHERE topic_id IN (??)';
$posts_id = sql_rowset(sql_filter($sql, $topic_id_sql), false, 'post_id');
$post_id_sql = _implode(',', $posts_id);
//
$sql = 'SELECT vote_id
FROM _poll_options
WHERE topic_id IN (??)';
$votes_id = sql_rowset(sql_filter($sql, $topic_id_sql), false, 'vote_id');
$vote_id_sql = _implode(',', $votes_id);
//
$sql = 'SELECT poster_id, COUNT(post_id) AS posts
FROM _forum_posts
WHERE topic_id IN (??)
GROUP BY poster_id';
$result = sql_rowset(sql_filter($sql, $topic_id_sql));
$members_sql = w();
foreach ($result as $row) {
$sql = 'UPDATE _members SET user_posts = user_posts - ??
WHERE user_id = ?';
$members_sql[] = sql_filter($sql, $row['posts'], $row['poster_id']);
}
sql_query($members_sql);
//
// Got all required info so go ahead and start deleting everything
//
$sql = 'DELETE
FROM _forum_topics
WHERE topic_id IN (??)';
sql_query(sql_filter($sql, $topic_id_sql));
$sql = 'DELETE
FROM _forum_topics_fav
WHERE topic_id IN (??)';
sql_query(sql_filter($sql, $topic_id_sql));
if ($post_id_sql != '') {
$sql = 'DELETE
FROM _forum_posts
WHERE post_id IN (??)';
sql_query(sql_filter($sql, $post_id_sql));
}
if ($vote_id_sql != '') {
$sql = 'DELETE
FROM _poll_options
WHERE vote_id IN (??)';
sql_query(sql_filter($sql, $vote_id_sql));
$sql = 'DELETE
FROM _poll_results
WHERE vote_id IN (??)';
sql_query(sql_filter($sql, $vote_id_sql));
$sql = 'DELETE
FROM _poll_voters
WHERE vote_id IN (??)';
sql_query(sql_filter($sql, $vote_id_sql));
}
//
$sql = 'DELETE FROM _members_unread
WHERE element = 8
AND item IN (??)';
sql_query(sql_filter($sql, $topic_id_sql));
//
foreach ($forums_id_sql as $forum_id)
{
//.........这里部分代码省略.........
示例13: list_link
$summit_name = $summit_2['name'];
}
echo list_link($item_i18n, 'routes', $summit_name) . ' ' . $has_gps_track;
if (isset($item['name']) && $summit_name != $summit_2['name']) {
$link = list_link($summit_2, 'summits');
echo '<br /><small>', __('route linked with', array('%1%' => $link)), '</small>';
}
?>
</div>
<div>
<?php
$height_diff_up = is_scalar($item['height_diff_up']) ? $item['height_diff_up'] . __('meters') : NULL;
if ($height_diff_up != NULL && is_scalar($item['difficulties_height'])) {
$height_diff_up .= ' (' . $item['difficulties_height'] . __('meters') . ')';
}
echo _implode(' - ', array(displayWithSuffix($item['max_elevation'], 'meters'), get_paginated_value($item['facing'], 'app_routes_facings'), $height_diff_up, field_route_ratings_data($item, false)));
?>
</div>
<div><?php
if (isset($item['linked_docs'])) {
echo __('access'), ' ';
include_partial('parkings/parkings4list', array('parkings' => $item['linked_docs']));
}
?>
</div>
<div><?php
include_partial('documents/regions4list', array('geoassociations' => $item['geoassociations']));
?>
</div>
<div><?php
echo picto_tag('picto_images', __('nb_linked_images')), ' ', isset($item['nb_images']) ? $item['nb_images'] : '0', ' ', picto_tag('action_comment', __('nb_comments')), ' ', isset($item['nb_comments']) ? link_to($item['nb_comments'], '@document_comment?module=routes&id=' . $item_i18n['id'] . '&lang=' . $item_i18n['culture']) : '0', ' ', picto_tag('picto_outings', __('nb_outings')), ' ', isset($item['nb_linked_docs']) ? $item['nb_linked_docs'] : '0';
示例14: _home
public function _home() {
global $config, $user, $cache, $comments;
if (!_button()) {
return false;
}
$post_mode = request_var('post_mode', 0);
$post_subject = request_var('post_subject', '');
$post_message = request_var('post_message', '', true);
$post_skip = request_var('post_skip', '', true);
$post_reply = request_var('post_reply', 0);
$post_message = $comments->prepare($post_message);
$skip_list = '';
if (!empty($post_skip)) {
$e_skip = explode(nr(), $post_skip);
foreach ($e_skip as $i => $row) {
$row = get_username_base($row);
$e_skip[$i] = "'" . sql_escape($row) . "'";
}
$sql = 'SELECT user_id
FROM _members
WHERE username_base IN (' . _implode(',', $e_skip) . ')';
$user_skip = sql_rowset($sql, false, 'user_id');
$skip_list = ' AND u.user_id NOT IN (' . _implode(', ', $user_skip) . ') ';
}
switch ($post_mode) {
case 1:
$sql = 'SELECT u.user_id, u.username
FROM _members u
WHERE u.user_type <> 2
AND u.user_id NOT IN (SELECT ban_userid FROM _banlist)
AND u.user_id <> ?' . $skip_list . '
ORDER BY u.username';
break;
case 2:
$sql = 'SELECT u.user_id, u.username
FROM _members u
WHERE u.user_type = 6
AND u.user_id NOT IN (SELECT ban_userid FROM _banlist)
AND u.user_id <> ' . $skip_list . '
ORDER BY u.username';
break;
case 3:
$sql = 'SELECT u.user_id, u.username
FROM _members_friends b, _members u
WHERE b.buddy_id = ' . $skip_list . '
AND b.user_id = u.user_id
AND u.user_id NOT IN (SELECT ban_userid FROM _banlist)
ORDER BY u.username';
break;
}
$result = sql_rowset(sql_filter($sql, $user->d('user_id')));
foreach ($result as $row) {
$row_message = str_replace('[username]', $row['username'], $post_message);
$insert = array(
'privmsgs_subject' => $post_subject,
'privmsgs_from_userid' => (int) $user->d('user_id'),
'privmsgs_to_userid' => (int) $row['user_id'],
'privmsgs_date' => $user->time,
'msg_ip' => $user->ip,
'msg_can_reply' => (int) $post_reply,
'privmsgs_mass' => 1,
'privmsgs_text' => $row_message
);
$dc_id = sql_insert('dc', $insert);
$sql = 'UPDATE _dc SET parent_id = ?, last_msg_id = ?, msg_deleted = ?
WHERE msg_id = ?';
sql_query(sql_filter($sql, $dc_id, $dc_id, $user->d('user_id'), $dc_id));
$user->save_unread(UH_NOTE, $dc_id, 0, $row['user_id']);
echo $row['username'] . '<br />';
flush();
}
return;
}
示例15: _groups_modify
protected function _groups_modify()
{
gfatal();
global $core;
$v = $this->__(array('el' => 0, 'r_name', 'r_email', 'r_mod', 'r_color'));
foreach ($v as $row) {
if (!f($row)) {
$this->_error('#FIELD_IS_EMPTY');
}
}
$sql = 'SELECT *
FROM _groups
WHERE group_id = ?';
if (!($group = _fieldrow(sql_filter($sql, $v['el'])))) {
$this->_error('#GROUPS_NO_EXISTS');
}
$mod_list = array_map('trim', explode(',', $v['r_mod']));
array_unshift($mod_list, 'addquotes');
$sql = 'SELECT user_id
FROM _members
WHERE user_username IN (??)
ORDER BY user_username';
if (!($mods_list = _rowset(sql_filter($sql, _implode(',', $mod_list)), false, 'user_id'))) {
$this->_error('#USER_UNKNOWN');
}
$sql = 'UPDATE _groups SET group_name = ?, group_email = ?, group_color = ?
WHERE group_id = ?';
_sql(sql_filter($sql, $v['r_name'], $v['r_email'], $v['r_color'], $v['el']));
$sql = 'UPDATE _groups_members SET member_mod = 0
WHERE member_group = ?';
_sql(sql_filter($sql, $v['el']));
foreach ($mods_list as $row) {
$sql = 'SELECT member_id
FROM _groups_members
WHERE member_uid = ?';
if (_field(sql_filter($sql, $row), 'member_id', 0)) {
$sql = 'UPDATE _groups_members SET member_mod = ?
WHERE member_uid = ?';
_sql(sql_filter($sql, 1, $row));
} else {
$sql_insert = array('group' => $group_id, 'uid' => $row, 'mod' => 1);
$sql = 'INSERT INTO _groups_members' . _build_array('INSERT', prefix('member', $sql_insert));
_sql($sql);
}
}
$core->cache_unload();
return $this->e('~OK');
}