private function create() {
		$v = _request(array('event' => 0));

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

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

		$sql = 'SELECT ub
			FROM _artists_events
			WHERE a_artist = ?
				AND a_event = ?';
		if (sql_field(sql_filter($sql, $this->object['ub'], $v->event))) {
			return;
		}

		$sql_insert = array(
			'a_artist' => $this->object['ub'],
			'a_event' => $event['id']
		);
		sql_insert('artists_events', $sql_insert);

		return redirect(s_link('events', $event['event_alias']));
	}
	private function remove() {
		$v = _request(array('event' => 0));

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

		$sql = 'SELECT *
			FROM _events
			WHERE id = ?';
		if (!$row = sql_fieldrow(sql_filter($sql, $event))) {
			_pre('El evento no existe.', true);
		}

		$e_artist = explode(nr(), $artist);
		foreach ($e_artist as $row) {
			$subdomain = get_subdomain($row);

			$sql = 'SELECT *
				FROM _artists
				WHERE subdomain = ?';
			if ($a_row = sql_fieldrow(sql_filter($sql, $subdomain))) {
				$sql = 'DELETE FROM _artists_events
					WHERE a_artist = ?
						AND a_event = ?';
				sql_query(sql_filter($sql, $a_row['ub'], $event));
			}
		}

		return redirect(s_link('events', $row['event_alias']));
	}
Exemple #3
0
	private function create() {
		$v = _request(array('username' => ''));

		if (_empty($v)) return;

		$v->username = get_username_base($v->username);

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if (!$result = sql_fieldrow(sql_filter($sql, $v->username))) {
			return;
		}

		$sql = 'SELECT *
			FROM _banlist
			WHERE ban_userid = ?';
		if (!$ban = sql_fieldrow(sql_filter($sql, $result['user_id']))) {
			$insert = array(
				'ban_userid' => $result['user_id']
			);
			sql_insert('banlist', $insert);

			$sql = 'DELETE FROM _sessions
				WHERE session_user_id = ?';
			sql_query(sql_filter($sql, $result['user_id']));

			echo 'El usuario ' . $result['username'] . ' fue bloqueado.';
		}

		return true;
	}
Exemple #4
0
function getUrl($params)
{
    $result = array();
    foreach ($params as $getParams => $identifier) {
        if (isset($_GET[$getParams]) && !_empty($_GET[$getParams])) {
            $result[$identifier] = $_GET[$getParams];
        }
    }
    return $result;
}
	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']));
	}
/**
 * Outputs a form hidden field containing the session name and ID if SID is not empty
 *
 * @access public
 */
function draw_hidden_session_id_field()
{
    global $osC_Session;
    if ($osC_Session->hasStarted() && !_empty(SID)) {
        return draw_hidden_field($osC_Session->getName(), $osC_Session->getID());
    }
}
Exemple #7
0
 public function propEmpty($propName)
 {
     return _empty($this->getPropValue($propName));
 }
Exemple #8
0
function ok($var)
{
    $bool = @(isset($var) and _empty($var) === FALSE);
    return $bool;
}