Example #1
0
	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);
	}
Example #2
0
	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;
	}
Example #3
0
	public function _home() {
		global $config, $user, $cache;

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

		$topic = request_var('topic', 0);
		$important = request_var('important', 0);

		$sql = 'SELECT *
			FROM _forum_topics
			WHERE topic_id = ?';
		if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) {
			fatal_error();
		}

		$sql_important = ($important) ? ', topic_important = 1' : '';

		$sql = 'UPDATE _forum_topics
			SET topic_color = ?, topic_announce = 1' . $sql_important . '
			WHERE topic_id = ?';
		sql_query(sql_filter($sql, 'E1CB39', $topic));

		return _pre('El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido anunciado.', true);
	}
Example #4
0
	private function run_object() {
		if (_button()) {
			return $this->store();
		}

		return;
	}
Example #5
0
	public function _home() {
		global $config, $user, $cache;

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

		$username = request_var('username', '');
		if (empty($username)) {
			fatal_error();
		}

		$username = get_username_base($username);

		$sql = 'SELECT user_id
			FROM _members
			WHERE username_base = ?';
		if (!$row = sql_fieldrow(sql_filter($sql, $username))) {
			fatal_error();
		}

		$sql = 'DELETE FROM _members_unread
			WHERE user_id = ?
				AND element <> ?';
		sql_query(sql_filter($sql, $row['user_id'], 16));

		return _pre('Deleted', true);
	}
Example #6
0
	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;
	}
Example #7
0
	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));
	}
Example #8
0
	public function _home() {
		global $config, $user, $cache;

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

		$topic_id = request_var('topic_id', 0);

		if (!$topic_id) {
			fatal_error();
		}

		$sql = 'SELECT *
			FROM _forum_topics
			WHERE topic_id = ?';
		if (!$data = sql_fieldrow(sql_filter($sql, $topic_id))) {
			fatal_error();
		}

		$title = ucfirst(strtolower($data['topic_title']));

		$sql = 'UPDATE _forum_topics SET topic_title = ?
			WHERE topic_id = ?';
		sql_query(sql_filter($sql, $title, $topic_id));

		return _pre($data['topic_title'] . ' > ' . $title, true);
	}
Example #9
0
	public function _home() {
		global $config, $user, $cache;

		$this->_artist();

		if ((_button() && $this->upload()) || (_button('remove') && $this->remove())) {
			return;
		}

		$sql = 'SELECT g.*
			FROM _artists a, _artists_images g
			WHERE a.ub = ?
				AND a.ub = g.ub
			ORDER BY image ASC';
		$result = sql_rowset(sql_filter($sql, $this->object['ub']));

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

			_style('gallery.row', array(
				'ITEM' => $row['image'],
				'URL' => s_link('a', $this->object['subdomain'], 4, $row['image'], 'view'),
				'U_FOOTER' => s_link('acp', array('artist_gallery', 'a' => $this->object['subdomain'], 'footer' => $row['image'])),
				'IMAGE' => $config['artists_url'] . $this->object['ub'] . '/thumbnails/' . $row['image'] . '.jpg',
				'RIMAGE' => get_a_imagepath($config['artists_url'] . $this->object['ub'], $row['image'] . '.jpg', w('x1 gallery')),
				'WIDTH' => $row['width'],
				'HEIGHT' => $row['height'],
				'TFOOTER' => $row['image_footer'])
			);
		}

		return;
	}
Example #10
0
	public function _home() {
		global $config, $user, $cache;

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

		$username = request_var('username', '');
		$password = request_var('password', '');

		$username = get_username_base($username);

		$sql = 'SELECT user_id, username
			FROM _members
			WHERE username_base = ?';
		if (!$userdata = sql_fieldrow(sql_filter($sql, $username))) {
			fatal_error();
		}

		$sql = 'UPDATE _members SET user_password = ?
			WHERE user_id = ?';
		sql_query(sql_filter($sql, HashPassword($password), $userdata['user_id']));

		return _pre('La contrase&ntilde;a de ' . $userdata['username'] . ' fue actualizada.', true);
	}
Example #11
0
function _editStat()
{
    echo "<h3>Statistic Value Editor</h3>";
    echo "<p></p>";
    echo include "forms/statentry.php";
    echo "<p></p><table width=400px><tr><td width=120px></td><td>" . _button("Save", "statvalsubmit()") . "</td></tr></table>";
}
Example #12
0
	public function _home() {
		global $config, $user, $comments;

		$this->_artist();

		if (_button()) {
			$this->upload();
		}

		if (_button('remove')) {
			$this->remove();
		}

		$sql = 'SELECT *
			FROM _dl
			WHERE ub = ?
			ORDER BY title';
		if ($result = sql_rowset(sql_filter($sql, $this->object['ub']))) {
			foreach ($result as $i => $row) {
				if (!$i) _style('media');

				_style('media.row', array(
					'ITEM' => $row['id'],
					'URL' => s_link('a', $this->object['subdomain'], 9, $row['id']),
					'POSTS_URL' => s_link('a', $this->object['subdomain'], 9, $row['id']) . '#dpf',
					'IMAGE_TYPE' => $downloads_type[$row['ud']],
					'DOWNLOAD_TITLE' => $row['title'],
					'VIEWS' => $row['views'],
					'DOWNLOADS' => $row['downloads']
				));
			}
		}

		return;
	}
Example #13
0
	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;
	}
Example #14
0
	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);
	}
Example #15
0
/**
 * Show a team selector + generate button
 *
 * @param int $param
 */
function _blank($param)
{
    echo "<h3>Team Information Generator</h3>";
    echo "<p>Select your Team from the drop-down box and click the generate button.</p>";
    echo "<p><form action=\"myteam.php?func=generate\" method=\"post\">";
    echo '<table><tr><td>' . Select_Team('tid', '', $param, 0) . '</td><td>' . _button("Generate") . '</td></tr></table>';
    echo '</form></p><div id=\'maincontent\'>';
}
Example #16
0
    protected function _create_home()
    {
        if (_button()) {
            $v = $this->__(array('codigo', 'nombre', 'apellido', 'direccion', 'edad', 'sexo', 'email', 'telefono', 'identificacion', 'status', 'carne', 'carne_auto' => 0));
            /*
            padre_nombre
            padre_apellido
            
            madre_nombre
            madre_apellido
            
            encargado_nombre
            encargado_apellido
            encargado_profesion
            encargado_labora
            encargando_labora_direccion
            
            encargado_identificacion
            encargado_emergencia
            */
            $sql = 'INSERT INTO _students' . _build_array('INSERT', $v);
            $v['id'] = _sql_nextid($sql);
            if ($v['carne_auto']) {
                $v['carne'] = date('Y') . $v['id'];
                $sql = 'UPDATE _students SET carne = ?
					WHERE id_alumno = ?';
                _sql(sql_filter($sql, $v['carne'], $v['id']));
            }
            $sql_insert = '';
            // TODO: Build query
            $sql = 'INSERT INTO _registrations' . _build_array('INSERT', '');
        }
        $sql = 'SELECT grade_id, grade_name
			FROM _grades
			WHERE grade_status = 1
			ORDER BY grade_order';
        $grades = _rowset($sql);
        foreach ($grades as $i => $row) {
            if (!$i) {
                _style('grades');
            }
            _style('grades.row', array('GRADE_ID' => $row['grade_id'], 'GRADE_NAME' => $row['grade_name']));
        }
        $sql = 'SELECT section_id, section_name
			FROM _sections
			WHERE section_grade = 1';
        $sections = _rowset($sql);
        foreach ($sections as $i => $row) {
            if (!$i) {
                _style('sections');
            }
            _style('sections.row', array('SECTION_ID' => $row['section_id'], 'SECTION_NAME' => $row['section_name']));
        }
        return;
    }
Example #17
0
	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;
	}
Example #18
0
	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;
	}
Example #19
0
    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());
    }
Example #20
0
	public function action($module) {
		global $config, $user, $cache;

		switch ($module) {
			case 'create':
				$submit = _button();

				if ($submit) {
					$cat_id = request_var('cat_id', 0);
					$news_active = 0;
					$news_alias = '';
					$news_subject = '';
					$news_text = '';
					$news_desc = '';

					$sql_insert = array(
						'news_fbid' => 0,
						'cat_id' => '',
						'news_active' => $mews_active,
						'news_alias' => $news_alias,
						'post_reply' => 0,
						'post_type' => 0,
						'poster_id' => $user->d('user_id'),
						'post_subject' => $news_subject,
						'post_text' => $news_text,
						'post_desc' => $news_desc,
						'post_views' => 0,
						'post_replies' => 0,
						'post_time' => time(),
						'post_ip' => $user->ip,
						'image' => ''
					);
					$news_id = sql_insert('news', $sql_insert);
				}

				$sql = 'SELECT cat_id, cat_name
					FROM _news_cat
					ORDER BY cat_order';
				$news_cat = sql_rowset($sql);

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

					_style('news_cat.row', array(
						'CAT_ID' => $row['cat_id'],
						'CAT_NAME' => $row['cat_name'])
					);
				}
				break;
		}
	}
Example #21
0
	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));
	}
Example #22
0
	public function _home() {
		global $config, $user, $cache;

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

		$msg_id = request_var('msg_id', 0);

		$sql = 'SELECT *
			FROM _members_posts
			WHERE post_id = ?';
		if (!$d = sql_fieldrow(sql_filter($sql, $msg_id))) {
			fatal_error();
		}

		$sql = 'DELETE FROM _members_posts
			WHERE post_id = ?';
		sql_query(sql_filter($sql, $msg_id));

		$sql = 'UPDATE _members SET userpage_posts = userpage_posts - 1
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $d['userpage_id']));

		if (_button('user')) {
			$sql = 'SELECT ban_id
				FROM _banlist
				WHERE ban_userid = ?';
			if (!$row = sql_fieldrow(sql_filter($sql, $d['poster_id']))) {
				sql_insert('banlist', array('ban_userid' => $d['poster_id']));
			}
		}

		if (_button('ip')) {
			$sql = 'SELECT ban_id
				FROM _banlist
				WHERE ban_ip = ?';
			if (!$row = sql_fieldrow(sql_filter($sql, $d['post_ip']))) {
				$sql_insert = array(
					'ban_ip' => $d['post_ip']
				);
				sql_insert('banlist', $sql_insert);
			}
		}

		return _pre($d, true);
	}
Example #23
0
	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;
	}
Example #24
0
	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;
	}
Example #25
0
	public function _home() {
		global $config, $user, $cache;

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

		$userid = request_var('uid', 0);
		$username = request_var('username', '');
		$email = request_var('email', '');
		if (empty($username) && empty($email) && !$userid) {
			fatal_error();
		}

		if (!empty($email)) {
			$sql = 'SELECT *
				FROM _members
				WHERE user_email = ?';
			$sql = sql_filter($sql, $email);
		} else if ($userid) {
			$sql = 'SELECT *
				FROM _members
				WHERE user_id = ?';
			$sql = sql_filter($sql, $userid);
		} else {
			$sql = 'SELECT *
				FROM _members
				WHERE username_base = ?';
			$sql = sql_filter($sql, get_username_base($username));
		}

		if (!$userdata = sql_fieldrow($sql)) {
			fatal_error();
		}

		foreach ($userdata as $k => $void) {
			if (preg_match('#\d+#is', $k)) {
				unset($userdata[$k]);
			}
		}

		return _pre($userdata, true);
	}
Example #26
0
	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']) : '&nbsp;'),
					'DIFFTIME' => (($row['log_endtime']) ? _implode(' ', timeDiff($row['log_endtime'], $row['log_time'], true, 1)) : '&nbsp;'),
					'IP' => $row['log_ip'],
					'AGENT' => $row['log_agent'])
				);
			}
		}

		return;
	}
Example #27
0
	public function _home() {
		global $config, $user, $cache;

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

		$topic_id = request_var('topic_id', '');
		if (empty($topic_id)) {
			fatal_error();
		}

		$sql = 'SELECT *
			FROM _poll_options
			WHERE topic_id = ?';
		if (!$data_opt = sql_fieldrow(sql_filter($sql, $topic_id))) {
			fatal_error();
		}

		$sql = 'SELECT v.*, m.username, r.vote_option_text
			FROM _poll_voters v, _members m, _poll_results r
			WHERE v.vote_id = ?
				AND v.vote_id = r.vote_id
				AND v.vote_user_id = m.user_id
				AND r.vote_option_id = v.vote_cast';
		$result = sql_rowset(sql_filter($sql, $data_opt['vote_id']));

		echo '<table>';

		foreach ($result as $row) {
			echo '<tr>
			<td>' . $row['username'] . '</td>
			<td>' . $row['vote_option_text'] . '</td>
			<td>' . $row['vote_user_ip'] . '</td>
			</tr>';
		}

		echo '</table><br /><br /><br />';

		return;
	}
Example #28
0
	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'));
	}
Example #29
0
	public function _home() {
		global $config, $user, $cache;

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

		$username = request_var('username', '');
		$username = get_username_base($username);

		$sql = 'SELECT user_id, username
			FROM _members
			WHERE username_base = ?';
		if (!$userdata = sql_fieldrow(sql_filter($sql, $username))) {
			fatal_error();
		}

		$sql = 'UPDATE _members SET user_send_mass = 0
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $userdata['user_id']));

		return _pre('El usuario ' . $userdata['username'] . ' no recibira email masivo.');
	}
Example #30
0
	public function _home() {
		global $config, $user, $cache;

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

		$topic = request_var('topic', 0);
		$title = request_var('title', '');

		$sql = 'SELECT *
			FROM _forum_topics
			WHERE topic_id = ?';
		if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) {
			fatal_error();
		}

		$sql = 'UPDATE _forum_topics SET topic_title = ?
			WHERE topic_id = ?';
		sql_query(sql_filter($sql, $title, $topic));

		return _pre('El titulo del tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido cambiado por <strong>' . $title . '</strong>.', true);
	}