当前位置: 首页>>代码示例>>PHP>>正文


PHP s_link函数代码示例

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


在下文中一共展示了s_link函数的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'));
	}
开发者ID:nopticon,项目名称:rockr,代码行数:98,代码来源:artist_delete.php

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

示例3: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return;
		}

		$this->id = request_var('msg_id', 0);

		$sql = 'SELECT *
			FROM _forum_topics
			WHERE topic_id = ?';
		if (!$this->object = sql_fieldrow(sql_filter($sql, $this->id))) {
			fatal_error();
		}

		$this->object = (object) $this->object;

		$this->object->new_value = ($this->object->topic_featured) ? 0 : 1;
		topic_feature($this->id, $this->object->new_value);

		$sql_insert = array(
			'bio' => $user->d('user_id'),
			'time' => time(),
			'ip' => $user->ip,
			'action' => 'feature',
			'old' => $this->object->topic_featured,
			'new' => $this->object->new_value
		);
		sql_insert('log_mod', $sql_insert);

		return redirect(s_link('topic', $this->id));
	}
开发者ID:nopticon,项目名称:rockr,代码行数:33,代码来源:forums_topic_feature.php

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

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

示例6: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return false;
		}

		$username1 = request_var('username1', '');
		$username2 = request_var('username2', '');
		if (empty($username1) || empty($username2)) {
			fatal_error();
		}

		$username_base1 = get_username_base($username1);
		$username_base2 = get_username_base($username2);

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if (!$userdata = sql_fieldrow(sql_filter($sql, $username_base1))) {
			_pre('El usuario no existe.', true);
		}

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if ($void = sql_fieldrow(sql_filter($sql, $username_base2))) {
			_pre('El usuario ya existe.', true);
		}

		//
		$sql = 'UPDATE _members SET username = ?, username_base = ?
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $username2, $username_base2, $userdata['user_id']));

		$emailer = new emailer();

		$emailer->from('info');
		$emailer->use_template('username_change', $config['default_lang']);
		$emailer->email_address($userdata['user_email']);

		$emailer->assign_vars(array(
			'USERNAME' => $userdata['username'],
			'NEW_USERNAME' => $username2,
			'U_USERNAME' => s_link('m', $username_base2))
		);
		$emailer->send();
		$emailer->reset();

		redirect(s_link('m', $username_base2));

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

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

示例8: run

	public function run() {
		global $cache, $comments;

		$alias = request_var('alias', '');

		if (!empty($alias)) {
			$sql = 'SELECT *
				FROM _help_cat c, _help_modules m, _help_faq f
				WHERE c.help_module = m.module_id
					AND f.help_id = c.help_id
					AND m.module_name = ?
				ORDER BY f.faq_question_es';
			$module = sql_rowset(sql_filter($sql, $alias));

			foreach ($module as $i => $row) {
				if (!$i) _style('module', array('TITLE' => $row['help_es']));

				_style('module.row', array(
					'QUESTION' => $row['faq_question_es'],
					'ANSWER' => $comments->parse_message($row['faq_answer_es']))
				);
			}
		}

		if (!$help = $cache->get('help')) {
			$sql = 'SELECT *
				FROM _help_cat c, _help_modules m
				WHERE c.help_module = m.module_id
				ORDER BY c.help_order';
			if ($help = sql_rowset($sql)) {
				$cache->save('help', $help);
			}
		}

		foreach ($help as $i => $row) {
			if (!$i) _style('categories');

			_style('categories.row', array(
				'URL' => s_link('help', $row['module_name']),
				'TITLE' => $row['help_es'])
			);
		}

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

示例9: _artists

	function _artists() {
		$sql = 'SELECT name, subdomain, genre, datetime, local, location
			FROM _artists
			ORDER BY datetime DESC
			LIMIT 15';
		$result = sql_rowset($sql);

		foreach ($result as $row) {
			$this->xml[] = array(
				'title' => $row['name'],
				'link' => s_link('a', $row['subdomain']),
				'description' => ($row['genre'] . "<br />" . (($row['local']) ? 'Guatemala' : $row['location'])),
				'pubdate' => $row['datetime']
			);
		}

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

示例10: _home

	public function _home() {
		global $config, $user, $cache, $upload;

		if (_button()) {
			$news_id = request_var('news_id', 0);

			$sql = 'SELECT news_id
				FROM _news
				WHERE news_id = ?';
			if (!sql_field(sql_filter($sql, $news_id), 'news_id', 0)) {
				fatal_error();
			}

			$filepath_1 = $config['news_path'];

			$f = $upload->process($filepath_1, 'add_image', 'jpg');

			if (!sizeof($upload->error) && $f !== false) {
				foreach ($f as $row) {
					$xa = $upload->resize($row, $filepath_1, $filepath_1, $news_id, array(100, 75), false, false, true);
				}

				redirect(s_link());
			}

			_style('error', array(
				'MESSAGE' => parse_error($upload->error))
			);
		}

		$sql = 'SELECT *
			FROM _news
			ORDER BY post_time DESC';
		$result = sql_rowset($sql);

		foreach ($result as $row) {
			_style('news_list', array(
				'NEWS_ID' => $row['news_id'],
				'NEWS_TITLE' => $row['post_subject'])
			);
		}

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

示例11: _home

	public function _home() {
		global $config, $user, $cache;

		$sql = 'SELECT user_id, username, username_base, user_points
			FROM _members
			WHERE user_points <> 0
			ORDER BY user_points DESC, username';
		$result = sql_rowset($sql);

		foreach ($result as $i => $row) {
			if (!$i) _style('members');

			_style('members.row', array(
				'BASE' => s_link('m', $row['username_base']),
				'USERNAME' => $row['username'],
				'POINTS' => $row['user_points'])
			);
		}

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

示例12: _home

	public function _home() {
		global $config, $user, $cache;

		$sql = 'SELECT d.*, m.username, m.username_base
			FROM _radio_dj_log d, _members m
			WHERE d.log_uid = m.user_id
			ORDER BY log_time DESC';
		$result = sql_rowset($sql);

		foreach ($result as $i => $row) {
			if (!$i) _style('report');

			_style('report.row', array(
				'LINK' => s_link('m', $row['username_base']),
				'NAME' => $row['username'],
				'TIME' => $user->format_date($row['log_time']))
			);
		}

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

示例13: _home

	public function _home() {
		global $config, $user, $cache;

		$this->id = request_var('msg_id', 0);

		$sql = 'SELECT *
			FROM _members_posts
			WHERE post_id = ?';
		if (!$this->object = sql_fieldrow(sql_filter($sql, $this->id))) {
			fatal_error();
		}

		$this->object = (object) $this->object;

		if (!$user->is('founder') && $user->d('user_id') != $this->object->userpage_id) {
			fatal_error();
		}

		$sql = 'SELECT username_base
			FROM _members
			WHERE user_id = ?';
		$username_base = sql_field(sql_filter($sql, $this->object->userpage_id), 'username_base', '');

		$sql = 'DELETE FROM _members_posts
			WHERE post_id = ?';
		sql_query(sql_filter($sql, $this->id));

		$sql = 'UPDATE _members
			SET userpage_posts = userpage_posts - 1
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $this->object->userpage_id));

		$user->delete_unread(UH_UPM, $this->id);

		if ($this->object->post_time > points_start_date() && $this->object->post_time < 1203314400) {
			//$user->points_remove(1, $this->object->poster_id);
		}

		return redirect(s_link('m', $username_base));
	}
开发者ID:nopticon,项目名称:rockr,代码行数:40,代码来源:user_post_delete.php

示例14: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return;
		}

		$v = _request(array('event' => 0));

		$sql = 'SELECT *
			FROM _events
			WHERE id = ?';
		if (!$object = sql_fieldrow(sql_filter($sql, $v->event))) {
			fatal_error();
		}

		$sql = 'DELETE FROM _events
			WHERE id = ?';
		sql_query(sql_filter($sql, $v->event));

		return redirect(s_link('events'));
	}
开发者ID:nopticon,项目名称:rockr,代码行数:22,代码来源:event_delete.php

示例15: create

	private function create() {
		$v = _request(array('title' => '', 'author' => '', 'text' => ''));

		if (_empty($v)) {
			return;
		}

		$sql = 'SELECT *
			FROM _artists
			WHERE ub = ?';
		if (!$ad = sql_fieldrow(sql_filter($sql, $this->object['ub']))) {
			return;
		}

		$v->ub = $this->object['ub'];
		sql_insert('artists_lyrics', $v);

		$sql = 'UPDATE _artists SET lirics = lirics + 1
			WHERE ub = ?';
		sql_query(sql_filter($sql, $this->object['ub']));

		return redirect(s_link('a', $ad['subdomain']));
	}
开发者ID:nopticon,项目名称:rockr,代码行数:23,代码来源:artist_lyric_create.php


注:本文中的s_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。