• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP v_style函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中v_style函数的典型用法代码示例。如果您正苦于以下问题:PHP v_style函数的具体用法?PHP v_style怎么用?PHP v_style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了v_style函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _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;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:27,代码来源:artist_biography.php


示例2: run

	public function run() {
		global $config, $user;

		$this->founders();
		$this->team();
		$this->recent_members();
		$this->birthdays();

		v_style(array(
			'MEMBERS_COUNT' => number_format($config['max_users']))
		);

		//
		// Online
		//
		$sql = 'SELECT u.user_id, u.username, u.username_base, u.user_type, u.user_hideuser, s.session_ip
			FROM _members u, _sessions s
			WHERE s.session_time >= ?
				AND u.user_id = s.session_user_id
			ORDER BY u.username ASC, s.session_ip ASC';
		$this->online(sql_filter($sql, ($user->time - (5 * 60))), 'online', 'MEMBERS_ONLINE');

		//
		// Today Online
		//
		$minutes = date('is', time());
		$timetoday = (time() - (60 * intval($minutes[0].$minutes[1])) - intval($minutes[2].$minutes[3])) - (3600 * $user->format_date(time(), 'H'));

		$sql = 'SELECT user_id, username, username_base, user_hideuser, user_type
			FROM _members
			WHERE user_type NOT IN (??)
				AND user_lastvisit >= ?
				AND user_lastvisit < ?
			ORDER BY username';
		$this->online(sql_filter($sql, USER_INACTIVE, $timetoday, ($timetoday + 86399)), 'online', 'MEMBERS_TODAY', 'MEMBERS_VISIBLE');

		return true;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:38,代码来源:community.php


示例3: run

    public function run($mod = false)
    {
        global $bio, $core, $file, $warning;
        if (!($rewrite = enable_rewrite())) {
            $warning->now('Enable mod_rewrite on Apache.');
        }
        require_once XFS . XCOR . 'modules.php';
        if ($mod === false) {
            $mod = request_var('module', '');
        }
        $mod = !empty($mod) ? $mod : 'home';
        if (!($_module = $core->cache->load('module_' . str_replace('/', '_', $mod)))) {
            $sql = 'SELECT *
				FROM _modules
				WHERE module_alias = ?';
            if (!($_module = $core->cache->store(sql_fieldrow(sql_filter($sql, $mod))))) {
                $warning->now('no_module');
            }
        }
        $_module->module_path = XFS . XMOD . $_module->module_path . $_module->module_basename;
        if (!@file_exists($_module->module_path)) {
            $warning->now('no_path: ' . $_module->module_path);
        }
        @(require_once $_module->module_path);
        $_object = '__' . $mod;
        if (!class_exists($_object)) {
            $warning->now();
        }
        $module = new $_object();
        $module->m($mod);
        if (@method_exists($module, 'install')) {
            $module->_install();
        }
        if (!defined('ULIB')) {
            define('ULIB', _link() . str_replace(w('../ ./'), '', LIB));
        }
        if (empty($this->input)) {
            $_input = array();
            if ($arg = request_var('args', '')) {
                foreach (explode('.', $arg) as $str_pair) {
                    $pair = explode(':', $str_pair);
                    if (isset($pair[0]) && isset($pair[1]) && !empty($pair[0])) {
                        $this->input[$pair[0]] = $pair[1];
                    }
                }
            }
            if (isset($_POST) && count($_POST)) {
                $_POST = _utf8($_POST);
                $this->input = array_merge($this->input, $_POST);
            }
        }
        $module->levels($this->input);
        if (!method_exists($module, $module->x(1))) {
            $warning->now();
        }
        if ($module->auth() && (!$module->x(1) || !in_array($module->x(1), $module->exclude))) {
            $module->signin();
        }
        //
        // All verifications passed, so start session for the request
        $bio->start(true);
        $bio->setup();
        if (!$module->auth_access() && $module->auth()) {
            $warning->now();
        }
        $module->navigation('home', '', '');
        $module->navigation($module->m(), '');
        if ($module->x(1) != 'home' && @method_exists($module, 'init')) {
            $module->init();
        }
        hook(array($module, $module->x(1)));
        if (!$module->_template()) {
            $module->_template($mod);
        }
        //
        // Output template
        $page_module = 'MODULE_' . $mod;
        if ($bio->is_lang($page_module)) {
            $module->page_title($page_module);
        }
        $browser_upgrade = false;
        if (!$core->v('skip_browser_detect') && ($list_browser = $file->read(XFS . XCOR . 'store/need_browser'))) {
            $browser_list = w();
            foreach ($list_browser as $row) {
                $e = explode(' :: ', $row);
                $browser_list[$e[0]] = $e[1];
            }
            foreach ($browser_list as $browser => $version) {
                if (_browser($browser) && _browser($browser, $version)) {
                    v_style(array('visual' => ULIB . LIB_VISUAL));
                    $module->_template('browsers');
                    $browser_upgrade = true;
                }
            }
        }
        $sv = array('X1' => $module->x(1), 'X2' => $module->x(2), 'NAVIGATION' => $module->get_navigation(), 'BROWSER_UPGRADE' => $browser_upgrade);
        _layout($module->_template(), $module->page_title(), $sv);
    }
开发者ID:nopticon,项目名称:mag,代码行数:98,代码来源:core.php


示例4: _help_add


//.........这里部分代码省略.........
						$error[] = 'CONTROL_COMMENTS_HELP_EMPTY';
					}
					
					if (!sizeof($error)) {
						$sql_insert = array(
							'help_id' => $help_id,
							'faq_question_es' => $question_es,
							'faq_question_en' => $question_en,
							'faq_answer_es' => $answer_es,
							'faq_answer_en' => $answer_en
						);
						$sql = 'INSERT INTO _help_faq' . sql_build('INSERT', $sql_insert);
					}
					break;
				case 'module':
					$module_name = $this->control->get_var('module_name', '');
					
					if (empty($module_name)) {
						$error[] = 'CONTROL_COMMENTS_HELP_EMPTY';
					}
					
					if (!sizeof($error)) {
						$sql_insert = array(
							'module_name' => $module_name
						);
						$sql = 'INSERT INTO _help_modules' . sql_build('INSERT', $sql_insert);
					}
					break;
			}
			
			if (!sizeof($error)) {
				sql_query($sql);
				
				$cache->delete('help_cat help_faq help_modules');
				
				redirect(s_link_control('comments', array('mode' => $this->mode)));
			} else {
				_style('error', array(
					'MESSAGE' => parse_error($error))
				);
			}
		}
		
		$this->nav();
		$this->control->set_nav(array('mode' => $this->mode, 'manage' => $this->manage), 'CONTROL_ADD');
		$this->control->set_nav(array('mode' => $this->mode, 'manage' => $this->manage, 'sub' => $sub), (isset($user->lang[$menu[$sub]])) ? $user->lang[$menu[$sub]] : $menu[$sub]);
		
		$layout_vars = array(
			'SUB' => $sub,
			'S_HIDDEN' => s_hidden(array('module' => $this->control->module, 'mode' => $this->mode, 'manage' => $this->manage, 'sub' => $sub))
		);
		
		switch ($sub) {
			case 'cat':
				$sql = 'SELECT *
					FROM _help_modules
					ORDER BY module_id';
				$result = sql_rowset($sql);
				
				$select_mod = '';
				foreach ($result as $row) {
					$selected = ($row['module_id'] == $module_id);
					$select_mod .= '<option' . (($selected) ? ' class="bold"' : '') . ' value="' . $row['module_id'] . '"' . (($selected) ? ' selected' : '') . '>' . $row['module_name'] . '</option>';
				}
				
				$layout_vars += array(
					'MODULE' => $select_mod,
					'HELP_ES' => $help_es,
					'HELP_EN' => $help_en
				);
				break;
			case 'faq':
				$sql = 'SELECT *
					FROM _help_cat
					ORDER BY help_id';
				$result = sql_rowset($sql);
				
				$select_cat = '';
				foreach ($result as $row) {
					$selected = ($row['help_id'] == $help_id);
					$select_cat .= '<option' . (($selected) ? ' class="bold"' : '') . ' value="' . $row['help_id'] . '"' . (($selected) ? ' selected' : '') . '>' . $row['help_es'] . ' | ' . $row['help_en'] . '</option>';
				}
				
				$layout_vars += array(
					'CATEGORY' => $select_cat,
					'QUESTION_ES' => $question_es,
					'QUESTION_EN' => $question_en,
					'ANSWER_ES' => $answer_es,
					'ANSWER_EN' => $answer_en
				);
				break;
			case 'module':
				$layout_vars += array(
					'MODULE_NAME' => $module_name
				);
				break;
		}
		
		return v_style($layout_vars);
	}
开发者ID:nopticon,项目名称:rockr,代码行数:101,代码来源:m_comments.php


示例5: home


//.........这里部分代码省略.........
            }
        }
        //
        if ($tree['tree_form']) {
            $sql = 'SELECT *
				FROM _form_fields
				WHERE form_tree = ?
				ORDER BY form_order';
            $form = _rowset(sql_filter($sql, $tree['tree_id']), 'form_alias');
            if (!count($form)) {
                $sql = 'SELECT *
					FROM _form_fields
					WHERE form_tree = 0
					ORDER BY form_order';
                $form = _rowset($sql, 'form_alias');
            }
            $form['secure'] = array('form_required' => 1, 'form_regex' => '^([a-zA-Z]+)$', 'form_alias' => 'secure', 'form_type' => 'text', 'form_legend' => 'Imagen de seguridad');
            _style('form', array('URL' => _link(_rewrite($tree))));
            foreach ($form as $row) {
                _style('form.row', array('ALIAS' => $row['form_alias'], 'REQUIRED' => $row['form_required'], 'LEGEND' => _lang($row['form_legend']), 'TYPE' => $row['form_type'], 'PAGE' => $tree['tree_alias']));
                foreach ($row as $row_k => $row_v) {
                    if (preg_match('#^form_(alias|type)$#is', $row_k)) {
                        if ($row_k == 'form_alias') {
                            $row_k = 'name';
                        }
                        _style('form.row.attrib', array('ATTRIB' => str_replace('form_', '', $row_k), 'VALUE' => $row_v));
                    }
                }
            }
        }
        $s_css_page = '';
        if (@file_exists('./style/css/_tree_' . _rewrite($tree) . '.css')) {
            $s_css_page = _rewrite($tree) . '/';
        } elseif ($this->css_parent($tree)) {
            if (!f($tree['tree_css_var'])) {
                $tree['tree_css_var'] = 'parent';
            }
            $ary_css_var = false;
            switch ($tree['tree_css_var']) {
                case 'parent':
                case 'subparent':
                case 'node':
                    $ary_css_var = ${$tree['tree_css_var']};
                    break;
                default:
                    if (is_numb($tree['tree_css_var'])) {
                        $sql = 'SELECT *
							FROM _tree
							WHERE tree_id = ?';
                        if ($css_var_row = _fieldrow(sql_filter($sql, $tree['tree_css_var']))) {
                            $ary_css_var = $css_var_row;
                        }
                    }
                    break;
            }
            if ($ary_css_var !== false) {
                $s_css_page = _rewrite($ary_css_var) . '/';
            }
        }
        v_style(array('S_IMAGES' => $core->v('address') . 'container/images/a_' . ($this->css_parent($tree) ? $this->css_var($tree) : $tree['tree_id']) . '/', 'V_TREE' => $tree['tree_id'], 'V_CSS' => $s_css_page, 'V_SUBJECT' => $tree['tree_subject'], 'V_CONTENT' => _message($tree['tree_content']), 'V_COMMENTS' => $tree['tree_comments'], 'V_ALLOW_COMMENTS' => $tree['tree_allow_comments'], 'V_ALLOW_FORM' => $tree['tree_form'], 'U_COMMENTS' => _link(_rewrite($tree)), 'U_XCF' => _link(_rewrite($tree) . '-xs.jpg', false, false)));
        $tree['tree_subject'] = strip_tags($tree['tree_subject']);
        //
        if ($tree['tree_alias'] != 'home') {
            if ($node['tree_id'] != $parent['tree_id']) {
                $this->navigation($node['tree_subject'], _rewrite($node));
            }
            if ($tree['tree_level'] > 2) {
                if ($parent['tree_id'] && $node['tree_id'] && $tree['tree_level'] > 3) {
                    $this->navigation('...');
                }
                $this->navigation($subparent['tree_subject'], _rewrite($subparent));
            }
            if ($parent['tree_id']) {
                $this->navigation($parent['tree_subject'], _rewrite($parent));
            }
            $this->navigation($tree['tree_subject'], _rewrite($tree));
        }
        if ($user->v('is_member')) {
            $tree['tree_cp'] = 1;
            $i = 0;
            $auth_tree = array('create', 'modify', 'remove');
            foreach ($auth_tree as $row) {
                if (_auth_get('cp_' . $row)) {
                    if (!$i) {
                        _style('auth');
                    }
                    _style('auth.row', array('U_AUTH' => _link('cp', array($row, _rewrite($tree))), 'V_NAME' => _lang('CP_AUTH_' . $row)));
                    $i++;
                }
            }
        }
        //
        $this->_template('tree');
        if (f($tree['tree_template']) && @file_exists('./style/custom/' . $tree['tree_template'] . '.htm')) {
            $this->_template('custom/' . $tree['tree_template']);
        }
        // TODO: 304 header response
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $tree['tree_edited']) . ' GMT');
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:101,代码来源:_tree.php


示例6: run

	public function run() {
		$this->module = request_var('module', '');

		if (empty($this->module)) {
			return $this->rights();
		}

		if (!preg_match('#[a-z\_]+#i', $this->module)) {
			fatal_error();
		}

		$this->filepath = ROOT . 'acp/' . $this->module . '.php';

		if (!@file_exists($this->filepath)) {
			fatal_error();
		}

		require_once($this->filepath);

		$_object = '__' . $this->module;
		if (!class_exists($_object)) {
			fatal_error();
		}

		$module = new $_object();

		$module->url = s_link() . substr(v_server('REQUEST_URI'), 1);
		$module->alias = $this->module;

		$module->_home();

		if (!isset($module->template)) {
			$module->template = 'acp/' . $this->module;
		}

		$local_tv = array(
			'MODULE_URL' => $module->url
		);

		if (isset($module->tv)) {
			$local_tv = array_merge($local_tv, $module->tv);
		}

		$this->_title = $this->module;
		$this->_template = $module->template;

		return v_style($local_tv);
	}
开发者ID:nopticon,项目名称:rockr,代码行数:48,代码来源:acp.php


示例7: object

	public function object() {
		global $user, $config, $comments;

		$offset = request_var('ps', 0);

		if ($this->data['poster_id'] != $user->d('user_id') && !$offset) {
			$sql = 'UPDATE _news SET post_views = post_views + 1
				WHERE news_id = ?';
			sql_query(sql_filter($sql, $this->data['news_id']));
		}

		$news_main = array(
			'MESSAGE' => $comments->parse_message($this->data['post_text']),
			'POST_TIME' => $user->format_date($this->data['post_time'])
		);

		$sql = 'SELECT user_id, username, username_base, user_avatar, user_posts, user_gender, user_rank
			FROM _members
			WHERE user_id = ?';
		$result = sql_fieldrow(sql_filter($sql, $this->data['poster_id']));

		$user_profile = $comments->user_profile($result);
		$news_main = array_merge($news_main, _style_uv($user_profile));

		_style('mainpost', $news_main);

		$comments_ref = s_link('news', $this->data['news_alias']);

		if ($this->data['post_replies']) {
			$comments->reset();
			$comments->ref = $comments_ref;

			$sql = 'SELECT p.*, m.user_id, m.username, m.username_base, m.user_avatar, m.user_rank, m.user_posts, m.user_gender, m.user_sig
				FROM _news_posts p, _members m
				WHERE p.news_id = ?
					AND p.post_active = 1
					AND p.poster_id = m.user_id
				ORDER BY p.post_time DESC
				LIMIT ??, ??';

			$comments->data = array(
				'SQL' => sql_filter($sql, $this->data['news_id'], $offset, $config['posts_per_page'])
			);

			$comments->view($offset, 'ps', $this->data['post_replies'], $config['posts_per_page'], '', '', 'TOPIC_');
		}

		v_style(array(
			'CAT_URL' => s_link('news', $this->data['cat_url']),
			'CAT_NAME' => $this->data['cat_name'],
			'POST_SUBJECT' => $this->data['post_subject'],
			'POST_REPLIES' => number_format($this->data['post_replies']))
		);

		//
		// Posting box
		//
		if ($user->is('member')) {
			_style('publish', array(
				'REF' => $comments_ref)
			);
		}

		$this->_template = 'news.view';
		$this->_title = $this->data['post_subject'];

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:68,代码来源:news.php


示例8: userpage


//.........这里部分代码省略.........
		}

		$profile_fields = $comments->user_profile($this->data);

		switch ($mode) {
			case 'friend':
				$this->friend_add();
			break;
			case 'ban':
				$this->user_ban();
			break;
			case 'favs':
			break;
			case 'friends':
				$this->friend_list();
			break;
			case 'stats':
				$this->user_stats();
			break;
			case 'main':
			default:
				$this->user_main();
			break;
		}

		$panel_selection = array(
			'main' => array('L' => 'MAIN', 'U' => false)
		);

		if ($user->d('user_id') != $this->data['user_id']) {
			$panel_selection['start'] = array('L' => 'DCONV_START', 'U' => s_link('my dc start', $this->data['username_base']));
		} else {
			$panel_selection['dc'] = array('L' => 'DC', 'U' => s_link('my dc'));
		}

		$panel_selection += array(
			'friends' => array('L' => 'FRIENDS', 'U' => false)
		);

		foreach ($panel_selection as $link => $data) {
			_style('selected_panel', array(
				'LANG' => lang('userpage_' . $data['L']))
			);

			if ($mode == $link) {
				_style('selected_panel.strong');
				continue;
			}

			_style('selected_panel.a', array(
				'URL' => ($data['U'] !== false) ? $data['U'] : s_link('m', $this->data['username_base'], (($link != 'main') ? $link : '')))
			);
		}

		//
		// Check if friends
		//
		if ($user->d('user_id') != $this->data['user_id']) {
			$friend_add_lang = true;

			if ($user->is('member')) {
				$friend_add_lang = $this->is_friend($user->d('user_id'), $this->data['user_id']);
			}

			$friend_add_lang = ($friend_add_lang) ? 'friends_add' : 'friends_del';

			_style('friend', array(
				'U_FRIEND' => s_link('m', $this->data['username_base'], 'friend'),
				'L_FRIENDS_ADD' => lang($friend_add_lang))
			);
		}

		$online = false;

		//
		// Generate page
		//
		v_style(array(
			'USERNAME' => $this->data['username'],
			'POSTER_RANK' => $profile_fields['user_rank'],
			'AVATAR_IMG' => $profile_fields['user_avatar'],
			'USER_ONLINE' => $online,

			'PM' => s_link('my dc start', $this->data['username_base']),
			'WEBSITE' => $this->data['user_website'],
			'MSN' => $this->data['user_msnm']
		));

		$layout_file = 'userpage';

		$use_m_template = 'custom/profile_' . $this->data['username_base'];
		if (@file_exists(ROOT . 'template/' . $use_m_template . '.htm')) {
			$layout_file = $use_m_template;
		}

		$this->_title = $this->data['username'];
		$this->_template = $layout_file;

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:101,代码来源:userpage.php


示例9: username_search

function username_search($search_match)
{
	global $config, $template, $lang, $images, $themeset, $starttime, $gen_simple_header, $admin_level, $level_prior;

	$gen_simple_header = true;

	$username_list = '';
	if (!empty($search_match)) {
		$username_search = preg_replace('/\*/', '%', get_username_base($search_match));

		$sql = 'SELECT username
			FROM _members
			WHERE username LIKE ?
				AND user_id <> ?
			ORDER BY username';
		if (!$result = sql_rowset(sql_filter($sql, $username_search, GUEST))) {
			$username_list .= '<option>' . $lang['No_match']. '</option>';
		}

		foreach ($result as $row) {
			$username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>';
		}
	}

	$template->set_filenames(array(
		'body' => 'search_username.htm')
	);

	v_style(array(
		'USERNAME' => (!empty($search_match)) ? get_username_base($search_match) : '',

		'L_CLOSE_WINDOW' => $lang['Close_window'],
		'L_SEARCH_USERNAME' => $lang['Find_username'],
		'L_UPDATE_USERNAME' => $lang['Select_username'],
		'L_SELECT' => $lang['Select'],
		'L_SEARCH' => $lang['Search'],
		'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'],
		'L_CLOSE_WINDOW' => $lang['Close_window'],

		'S_USERNAME_OPTIONS' => $username_list,
		'S_SEARCH_ACTION' => "search.php?mode=searchuser")
	);

	if ($username_list != '') {
		_style('switch_select_name');
	}

	return page_footer();
}
开发者ID:nopticon,项目名称:rockr,代码行数:49,代码来源:functions_post.php


示例10: _help_edit


//.........这里部分代码省略.........
                $question_es = $faq_data['faq_question_es'];
                $question_en = $faq_data['faq_question_en'];
                $answer_es = $faq_data['faq_answer_es'];
                $answer_en = $faq_data['faq_answer_en'];
                $help_id = $faq_data['help_id'];
                break;
            default:
                redirect(_link_control('comments', array('mode' => $this->mode)));
                break;
        }
        // IF submit
        if ($submit) {
            switch ($sub) {
                case 'cat':
                    $module_id = $this->control->get_var('module_id', 0);
                    $help_es = $this->control->get_var('help_es', '');
                    $help_en = $this->control->get_var('help_en', '');
                    if (empty($help_es) || empty($help_en)) {
                        $error[] = 'CONTROL_COMMENTS_HELP_EMPTY';
                    }
                    // Update
                    if (!sizeof($error)) {
                        $sql_update = array('help_es' => $help_es, 'help_en' => $help_en, 'help_module' => (int) $module_id);
                        $sql = 'UPDATE _help_cat
							SET ' . $db->sql_build_array('UPDATE', $sql_update) . '
							WHERE help_id = ' . (int) $id;
                        $db->sql_query($sql);
                        $cache->unload('help_cat');
                        redirect(_link_control('comments', array('mode' => $this->mode)));
                    }
                    break;
                case 'faq':
                    $question_es = $this->control->get_var('question_es', '');
                    $question_en = $this->control->get_var('question_en', '');
                    $answer_es = $this->control->get_var('answer_es', '');
                    $answer_en = $this->control->get_var('answer_en', '');
                    $help_id = $this->control->get_var('help_id', 0);
                    if (empty($question_es) || empty($question_en) || empty($answer_es) || empty($answer_en)) {
                        $error[] = 'CONTROL_COMMENTS_HELP_EMPTY';
                    }
                    if (!sizeof($error)) {
                        $sql = 'SELECT *
							FROM _help_cat
							WHERE help_id = ' . (int) $help_id;
                        $result = $db->sql_query($sql);
                        if (!($cat_data = $db->sql_fetchrow($result))) {
                            $error[] = 'CONTROL_COMMENTS_HELP_NOCAT';
                        }
                    }
                    // Update
                    if (!sizeof($error)) {
                        $sql_update = array('help_id' => (int) $help_id, 'faq_question_es' => $question_es, 'faq_question_en' => $question_en, 'faq_answer_es' => $answer_es, 'faq_answer_en' => $answer_en);
                        $sql = 'UPDATE _help_faq
							SET ' . $db->sql_build_array('UPDATE', $sql_update) . '
							WHERE faq_id = ' . (int) $id;
                        $db->sql_query($sql);
                        $cache->unload('help_faq');
                        redirect(_link_control('comments', array('mode' => $this->mode)));
                    }
                    break;
            }
            // switch
            if (sizeof($error)) {
                _style('error', array('MESSAGE' => parse_error($error)));
            }
        }
        $this->nav();
        $this->control->set_nav(array('mode' => $this->mode, 'manage' => $this->manage, 'sub' => $sub, 'id' => $id), 'CONTROL_EDIT');
        $template_vars = array('SUB' => $sub, 'S_HIDDEN' => _hidden(array('module' => $this->control->module, 'mode' => $this->mode, 'manage' => $this->manage, 'sub' => $sub, 'id' => $id)));
        switch ($sub) {
            case 'cat':
                $sql = 'SELECT *
					FROM _help_modules
					ORDER BY module_id';
                $result = $db->sql_query($sql);
                $select_mod = '';
                while ($row = $db->sql_fetchrow($result)) {
                    $selected = $row['module_id'] == $module_id;
                    $select_mod .= '<option' . ($selected ? ' class="bold"' : '') . ' value="' . $row['module_id'] . '"' . ($selected ? ' selected' : '') . '>' . $row['module_name'] . '</option>';
                }
                $db->sql_freeresult($result);
                $sv += array('MODULE' => $select_mod, 'HELP_ES' => $help_es, 'HELP_EN' => $help_en);
                break;
            case 'faq':
                $sql = 'SELECT *
					FROM _help_cat
					ORDER BY help_id';
                $result = $db->sql_query($sql);
                $select_cat = '';
                while ($row = $db->sql_fetchrow($result)) {
                    $selected = $row['help_id'] == $help_id;
                    $select_cat .= '<option' . ($selected ? ' class="bold"' : '') . ' value="' . $row['help_id'] . '"' . ($selected ? ' selected' : '') . '>' . $row['help_es'] . ' | ' . $row['help_en'] . '</option>';
                }
                $db->sql_freeresult($result);
                $sv += array('CATEGORY' => $select_cat, 'QUESTION_ES' => $question_es, 'QUESTION_EN' => $question_en, 'ANSWER_ES' => $answer_es, 'ANSWER_EN' => $answer_en);
                break;
        }
        v_style($sv);
        return;
    }
开发者ID:nopticon,项目名称:mag,代码行数:101,代码来源:_comments.php


示例11: gmdate

if (strstr($user->browser, 'compatible') || $is_firefox) {
	ob_start('ob_gzhandler');
}

// Headers
#header('Cache-Control: private, no-cache="set-cookie", pre-check=0, post-check=0');
#header('Pragma: no-cache');
#header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60) . ' GMT');
header('Content-type: text/css; charset=utf-8');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (60 * 60 * 24 * 30)) . ' GMT');

//sql_report(false);
$template->replace_vars = false;

v_style(array(
	'FF' => $is_firefox,
	'IE' => $is_ie)
);

$template->set_filenames(array('body' => 'js/' . $filename . '.js'));
$template->assign_var_from_handle('EXT', 'body');
//$template->pparse('body');

sql_close();

$code = JSMin::minify($template->vars['EXT']);

echo $code;
exit;
开发者ID:nopticon,项目名称:rockr,代码行数:29,代码来源:js.php


示例12: _create_home


//.........这里部分代码省略.........
                unset($v['move']);
            }
            //
            $u_tree = _rewrite($tree);
            if (count($v)) {
                if (isset($v['content']) && $v['content']) {
                    $v['content'] = str_replace(w('&lt; &gt;'), w('< >'), $v['content']);
                }
                if ($z['zmode'] == 'create') {
                    $sql = 'INSERT INTO _tree' . _build_array('INSERT', prefix('tree', $v));
                } else {
                    $sql = 'UPDATE _tree SET ' . _build_array('UPDATE', prefix('tree', $v)) . sql_filter('
						WHERE tree_id = ?', $tree['tree_id']);
                }
                _sql($sql);
                if ($z['zmode'] == 'create') {
                    $u_tree = f($v['alias']) ? $v['alias'] : _nextid();
                    $sql = 'UPDATE _tree
						SET tree_childs = tree_childs + 1
						WHERE tree_id = ?';
                    _sql(sql_filter($sql, $tree['tree_id']));
                }
            }
            redirect(_link($u_tree));
        }
        //
        // Show fieldset
        /*$v_fieldset = array(
        			'subject',
        			'content',
        			'description',
        			'alias',
        			'child_hide' => 0,
        			'child_order',
        			'nav' => 0,
        			'nav_hide' => 0,
        			'css_parent',
        			'css_var',
        			'quickload' => 0,
        			'dynamic' => 0,
        			'tags',
        			'template',
        			'redirect',
        			'allow_comments' => 0,
        			'approve_comments' => 0,
        			'form' => 0,
        			'form_email',
        			'published'
        		);
        		*/
        $v_fieldset = array('subject', 'content');
        if ($user->v('is_founder')) {
            $v_fieldset = array_merge($v_fieldset, array('description', 'alias', 'child_hide' => 0, 'child_order', 'nav' => 0, 'nav_hide' => 0, 'css_parent', 'css_var', 'quickload' => 0, 'dynamic' => 0, 'tags', 'template', 'redirect', 'allow_comments' => 0, 'approve_comments' => 0, 'form' => 0, 'form_email', 'published'));
        }
        $is_modify = $z['zmode'] == 'modify';
        foreach (_array_keys($v_fieldset, '') as $k => $row) {
            $name = 'tree_' . $k;
            $cp_lang = _lang('CP_' . $k);
            $value = $is_modify ? isset($v[$k]) ? $v[$k] : (isset($tree[$name]) ? $tree[$name] : '') : '';
            $checked = is_numb($row) && $is_modify && $tree[$name] ? ' checked="checked"' : '';
            if (f($value)) {
                switch ($k) {
                    case 'published':
                        $value = date('d m Y', $value);
                        break;
                }
            }
            $type = 'text';
            if (is_numb($row)) {
                $value = 1;
                $type = 'checkbox';
            }
            $tag = 'input';
            if ($k == 'content') {
                $tag = 'textarea';
            }
            _style('field', array('NAME' => $k, 'ID' => $k, 'TAG' => $tag, 'TYPE' => $type, 'VALUE' => $value, 'LANG' => $cp_lang, 'CHECKED' => $checked));
            if ($k == 'template') {
                $i = 0;
                $fp = @opendir('./style/custom/');
                while ($row_d = @readdir($fp)) {
                    if (_extension($row_d) != 'htm') {
                        continue;
                    }
                    if (!$i) {
                        _style('field.templated');
                        _style('field.templated.row', array('V' => '', 'FILE' => _lang('NONE')));
                    }
                    $v_file = str_replace('.htm', '', $row_d);
                    _style('field.templated.row', array('V' => $v_file, 'FILE' => $v_file));
                    $i++;
                }
                @closedir($fp);
            }
            //
        }
        $cp_format = !$is_modify ? 'CREATE' : 'MODIFY';
        v_style(array('CP_PAGE' => sprintf(_lang('CP_PAGE_' . $cp_format), $tree['tree_subject'])));
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:101,代码来源:_cp.php


示例13: object


//.........这里部分代码省略.........

						_style('event_flyer.thumbnail', array(
							'ACTION' => $u_event_alias,
							'SCALE' => ($config['events_thumb_height'] / $config['events_thumb_width']),
							'THUMB_WIDTH' => $config['events_thumb_width'],
							'THUMB_HEIGHT' => $config['events_thumb_height'],
							'LARGE_WIDTH' => $upload->getWidth($large_filepath),
							'LARGE_HEIGHT' => $upload->getHeight($large_filepath)
						));
					}
				}

				list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $user->timezone + $user->dst));
				$midnight = gmmktime(0, 0, 0, $m, $d, $y) - $user->timezone - $user->dst;

				$event_date = $user->format_date($this->v('date'), 'j F Y \a \l\a\s H:i') . ' horas.';

				if ($this->v('date') >= $midnight) {
					if ($this->v('date') >= $midnight && $this->v('date') < $midnight + 86400) {
						$event_date_format = lang('event_today');
					} else if ($this->v('date') >= $midnight + 86400 && $this->v('date') < $midnight + (86400 * 2)) {
						$event_date_format = lang('event_tomorrow');
					} else {
						$event_date_format = sprintf(lang('event_after'), $event_date);
					}
				} else {
					if ($this->v('date') >= ($midnight - 86400)) {
						$event_date_format = lang('event_yesterday');
					} else {
						$event_date_format = sprintf(lang('event_before'), $event_date);
					}
				}

				v_style(array(
					'EVENT_NAME' => $this->v('title'),
					'EVENT_DATE' => $event_date_format,
					'EVENT_URL' => $u_event_alias,
					'EVENT_PUBLISH' => $u_event_publish)
				);

				$posts_offset = request_var('ps', 0);
				$topic_id = $this->v('event_topic');

				// START RSVP
				if ($topic_id) {
					$sql = 'SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result
						FROM _poll_options vd, _poll_results vr
						WHERE vd.topic_id = ?
							AND vr.vote_id = vd.vote_id
						ORDER BY vr.vote_option_order, vr.vote_option_id ASC';
					if ($vote_info = sql_rowset(sql_filter($sql, $topic_id))) {
						$sql = 'SELECT vote_id
							FROM _poll_voters
							WHERE vote_id = ?
								AND vote_user_id = ?';
						$user_voted = sql_field(sql_filter($sql, $vote_info[0]['vote_id'], $user->d('user_id')), 'vote_id', 0);
						$poll_expired = ($vote_info[0]['vote_length']) ? (($vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time()) ? true : false) : false;

						_style('poll', array(
							'POLL_TITLE' => $vote_info[0]['vote_text'])
						);

						if ($user_voted || $poll_expired) {
							_style('poll.results');

							foreach ($vote_info as $row) {
开发者ID:nopticon,项目名称:rockr,代码行数:67,代码来源:events.php


示例14: _panel


//.........这里部分代码省略.........
					$results = sql_rowset(sql_filter($sql, $this->data['ub']), 'option_id', 'vote_result');

					_style('ub_poll.results');

					foreach ($this->voting['ub'] as $item) {
						$vote_result = (isset($results[$item])) ? intval($results[$item]) : 0;
						$vote_percent = ($this->data['votes'] > 0) ? $vote_result / $this->data['votes'] : 0;

						_style('ub_poll.results.item', array(
							'CAPTION' => lang('ub_vc' . $item),
							'RESULT' => $vote_result,
							'PERCENT' => sprintf("%.1d", ($vote_percent * 100)))
						);
					}
				} else {
					_style('ub_poll.options', array(
						'S_VOTE_ACTION' => s_link('a', $this->data['subdomain'], 'vote'))
					);

					foreach ($this->voting['ub'] as $item) {
						_style('ub_poll.options.item', array(
							'ID' => $item,
							'CAPTION' => lang('ub_vc' . $item))
						);
					}
				}

				//
				// Downloads
				//
				if ($this->data['um'] || $this->data['uv']) {
					$sql = 'SELECT *
						FROM _dl
						WHERE ub = ?
						ORDER BY ud, title';
					$this->ud_song = sql_rowset(sql_filter($sql, $this->data['ub']), 'ud', false, true);

					foreach ($this->ud_song as $key => $data) {
						$download_type = $this->dl_type($key);
						_style('ud_block', array('LANG' => $download_type['lang']));

						foreach ($data as $song) {
							_style('ud_block.item', array(
								'TITLE' => $song['title'])
							);

							if (isset($this->dl_data['id']) && ($song['id'] == $this->dl_data['id'])) {
								_style('ud_block.item.strong');
								continue;
							}

							_style('ud_block.item.a', array(
								'URL' => s_link('a', $this->data['subdomain'], 'downloads', $song['id']))
							);
						}
					}
				}

				//
				// Fan count
				//
				$sql = 'SELECT COUNT(user_id) AS fan_count
					FROM _artists_fav
					WHERE ub = ?
					ORDER BY joined DESC';
				$fan_count = sql_field(sql_filter($sql, $this->data['ub']), 'fan_count', 0);

				//
				// Make fans
				//
				if (!$this->auth['mod'] && !$this->auth['smod']) {
					_style('make_fans', array(
						'FAV_URL' => s_link('a', $this->data['subdomain'], 'favorites'),
						'FAV_LANG' => ($this->auth['fav']) ? '' : lang('ub_fav_add'))
					);
				}

				//
				// Set template
				//
				v_style(array(
					'INACTIVE' => !$this->data['a_active'],
					'UNAME' => $this->data['name'],
					'GENRE' => $this->data['genre'],
					'POSTS' => number_format($this->data['posts']),
					'VOTES' => number_format($this->data['votes']),
					'FANS' => $fan_count,
					'L_FANS' => ($fan_count == 1) ? lang('fan') : lang('fans'),
					'LOCATION' => ($this->data['local']) ? (($this->data['location'] != '') ? $this->data['location'] . ', ' : '') . 'Guatemala' : $this->data['location'])
				);

				$template->set_filenames(array(
					'a_body' => 'artists.' . $this->data['template'] . '.htm')
				);
				$template->assign_var_from_handle('UB_BODY', 'a_body');
				break;
		}

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:101,代码来源:artists.php


示例15: run


//.........这里部分代码省略.........
			$mod_topic = w();
			foreach ($mod as $item) {
				if ($auth->option(array('forum', 'topics', $item))) {
					$mod_topic[strtoupper($item)] = s_link('acp', array('topic', topic' => $topic_id, 'mode' => $item));
				}
			}

			if (sizeof($mod_topic)) {
				_style('auth');

				foreach ($mod_topic as $k => $v) {
					_style('auth.item', array(
						'URL' => $v,
						'LANG' => lang($k . '_topic'))
					);
				}
			}
		}
		*/
		build_num_pagination($topic_url . 's%d/', ($topic_data['topic_replies'] + 1), $config['posts_per_page'], $start, '', 'TOPIC_');

		//
		// Posting box
		if (sizeof($error)) {
			_style('post_error', array(
				'MESSAGE' => parse_error($error))
			);
		}

		$can_reply_closed = $auth->option(array('forum', 'topics', 'delete'));

		if ((!$topic_data['forum_locked'] && !$topic_data['topic_locked']) || $can_reply_closed) {
			if ($user->is('member')) {
				if ($is_auth['auth_reply']) {
					$s_post_action = (($reply) ? s_link('post', $post_id, 'reply') : $topic_url) . '#e';

					_style('post_box', array(
						'MESSAGE' => $post_message,
						'NP' => $post_np,
						'S_POST_ACTION' => $s_post_action)
					);

					if ($reply) {
						if (empty($post_reply_message)) {
							$post_reply_message = $comments->remove_quotes($topic_data['post_text']);
						}

						if (!empty($post_reply_message)) {
							$rx = array('#(^|[\n ]|\()(http|https|ftp)://([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)(gif|jpg|jpeg|png)#is', '#\[yt:[0-9a-zA-Z\-\=\_]+\]#is', '#\[sb\]#is', '#\[\/sb\]#is');
							$post_reply_message = preg_replace($rx, '', $post_reply_message);
						}

						if (empty($post_reply_message)) {
							$post_reply_message = '...';
						}

						_style('post_box.reply', array(
							'MESSAGE' => $post_reply_message)
						);
					}
				}
			}
		}

		// MOD: Featured topic
		if ($user->is('mod')) {
			$v_lang = ($topic_data['topic_featured']) ? 'REM' : 'ADD';

			_style('feature', array(
				'U_FEAT' => s_link('acp', array('forums_topic_feature', 'msg_id', $topic_data['topic_id'])),
				'V_LANG' => lang('topic_featured_' . $v_lang))
			);
		}

		//
		// Send vars to template
		//
		v_style(array(
			'FORUM_NAME' => $topic_data['forum_name'],
			'TOPIC_TITLE' => $topic_data['topic_title'],
			'TOPIC_REPLIES' => $topic_data['topic_replies'],

			'S_TOPIC_ACTION' => $topic_url . (($start) ? 's' . $start . '/' : ''),
			'U_VIEW_FORUM' => s_link('forum', $topic_data['forum_alias']))
		);

		$layout_file = 'topic';
		if (@file_exists('./template/custom/topics_' . $forum_id . '.htm')) {
			$layout_file = 'custom/topics_' . $forum_id;
		}

		if (@file_exists('./template/custom/topic_' . $topic_id . '.htm')) {
			$layout_file = 'custom/topic_' . $topic_id;
		}

		$this->_title = $topic_data['topic_title'];
		$this->_template = $layout_file;

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:101,代码来源:topic.php


示例16: _view_home


//.........这里部分代码省略.........
                $sql = 'SELECT type_id, type_name
					FROM _events_star_type
					ORDER BY type_order';
                $types = $core->cache_store('star_type', _rowset($sql, 'type_id', 'type_name'));
            }
            $i = 0;
            foreach ($types as $type_id => $type_name) {
                if (!$i) {
                    _style('star_type');
                }
                _style('star_type.row', array('TYPE_ID' => $type_id, 'TYPE_NAME' => $type_name));
                $i++;
            }
        } else {
            $sql = 'SELECT *
				FROM _events_reviews r, _bio b
				WHERE r.review_event = ?
					AND r.review_uid = b.bio_id
				ORDER BY r.review_avg
				LIMIT 0, 5';
            $reviews = _rowset(sql_filter($sql, $event['event_id']), 'review_id');
            $sql = 'SELECT *
				FROM _events_reviews_rate r, _events_reviews_fields f
				WHERE r.rate_review IN (??)
					AND r.rate_field = f.field_id
				ORDER BY f.field_order';
            $reviews_rate = _rowset(sql_filter($sql, _implode(',', array_keys($reviews))), 'rate_review', false, true);
            $i = 0;
            foreach ($reviews as $row) {
                if (!$i) {
                    _style('reviews');
                }
                _style('reviews.row', array('REVIEW_CONTENT' => $row['review_content'], 'REVIEW_' => $row['review_']));
                if (isset($reviews_rate[$row['review_id']])) {
                    foreach ($reviews_rate[$row['review_id']] as $j => $rate) {
                        if (!$j) {
                            _style('reviews.row.rate');
                        }
                        _style('reviews.row.rate.field', array('FIELD' => $rate['field_name'], 'RATE' => $rate['rate_value']));
                    }
                }
                $i++;
            }
        }
        // Who attend
        $sql = 'SELECT at.type_id, at.type_name_next, at.type_name_prev, b.bio_al 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP va函数代码示例发布时间:2022-05-23
下一篇:
PHP v_num函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap