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); }
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; }
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); }
private function create() { $code = request_var('code', ''); $vname = request_var('vname', ''); if (!empty($code)) { $sql = 'SELECT * FROM _artists_video WHERE video_a = ? AND video_code = ?'; if (sql_fieldrow(sql_filter($sql, $this->object['ub'], $code))) { $code = ''; } } if (!empty($code)) { $code = get_yt_code($code); } if (!empty($code)) { $insert = array( 'video_a' => $this->object['ub'], 'video_name' => $vname, 'video_code' => $code, 'video_added' => time() ); sql_insert('artists_video', $insert); $sql = 'UPDATE _artists SET a_video = a_video + 1 WHERE ub = ?'; sql_query(sql_filter($sql, $this->object['ub'])); } return redirect(_page()); }
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'])); }
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)); }
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ña de ' . $userdata['username'] . ' fue actualizada.', true); }
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); }
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'])); }
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); }
public function _home() { global $config, $user, $cache; if ($submit) { return false; } $bot_name = request_var('bot_name', ''); $bot_agent = request_var('bot_agent', ''); $bot_ip = request_var('bot_ip', ''); $bot_base = get_username_base($bot_name); $sql = 'SELECT * FROM _bots WHERE bot_name = ?'; $insert = true; if ($row = sql_fieldrow(sql_filter($sql, $bot_name))) { $insert = false; if ($row['bot_ip'] != $bot_ip) { $sql = 'UPDATE _bots SET bot_ip = ? WHERE bot_id = ?'; sql_query(sql_filter($sql, $row['bot_ip'] . ',' . $bot_ip, $row['bot_id'])); } } if ($insert) { $insert_member = array( 'user_type' => 2, 'user_active' => 1, 'username' => $bot_name, 'username_base' => $bot_base, 'user_timezone' => -6.00, 'user_lang' => 'spanish' ); $bot_id = sql_insert('members', $insert_member); $insert_bot = array( 'bot_active' => 1, 'bot_name' => $bot_name, 'user_id' => $bot_id, 'bot_agent' => $bot_agent, 'bot_ip' => $bot_ip, ); sql_insert('bots', $insert_bot); } $sql = "DELETE FROM _sessions WHERE session_browser LIKE '%??%'"; sql_query(sql_filter($sql, $bot_name)); $cache->delete('bots'); return; }
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; }
function search_topic($topic_id) { $result = false; $sql = 'SELECT * FROM _forum_topics WHERE topic_id = ?'; if ($row = sql_fieldrow(sql_filter($sql, $topic_id))) { $result = $row; } return $result; }
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; }
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)); }
public function _home() { global $config, $user, $cache; $sql = 'SELECT * FROM _forum_posts WHERE post_id = 125750'; if ($row = sql_fieldrow($sql)) { $a_post = str_replace("\r", '', $row['post_text']); $sql = 'UPDATE _forum_posts SET post_text = ? WHERE post_id = ?'; sql_query(sql_filter($sql, $a_post, $row['post_id'])); } return; }
public function run() { $alias = request_var('alias', ''); if (empty($alias)) { return $this->elements(); } $sql = 'SELECT * FROM _win WHERE win_alias = ?'; if (!$this->object = sql_fieldrow(sql_filter($sql, $alias))) { fatal_error(); } return $this->run_object(); }
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); }
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; }
public function dl_setup() { $download_id = request_var('download_id', 0); if (!$download_id) { fatal_error(); } $sql = 'SELECT d.* FROM _dl d LEFT JOIN _artists a ON d.ub = a.ub WHERE d.id = ? AND d.ub = ?'; if (!$this->dl_data = sql_fieldrow(sql_filter($sql, $download_id, $this->data['ub']))) { fatal_error(); } $this->dl_data += $this->dl_type($this->dl_data['ud']); return; }
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); }
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; }
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)); }
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')); }
private function update() { global $config, $upload; $v = _request(array('event_id' => 0)); $sql = 'SELECT * FROM _events WHERE id = ?'; if (!$event_data = sql_fieldrow(sql_filter($sql, $v->event_id))) { return; } $filepath_1 = $config['events_path'] . 'future/'; $filepath_2 = $config['events_path'] . 'future/thumbnails/'; $f = $upload->process($filepath_1, 'event_image', 'jpg'); if ($upload->error) { _style('error', array( 'MESSAGE' => parse_error($upload->error)) ); return; } foreach ($f as $row) { $xa = $upload->resize($row, $filepath_1, $filepath_1, $v->event_id, array(600, 400), false, false, true); if ($xa === false) { continue; } $xb = $upload->resize($row, $filepath_1, $filepath_2, $v->event_id, array(100, 75), false, false); } $sql = 'UPDATE _events SET event_update = ? WHERE id = ?'; sql_query(sql_filter($sql, time(), $v->event_id)); return redirect(s_link('events', $event_data['event_alias'])); }
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'])); }
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.'); }
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_sig = ? WHERE user_id = ?'; sql_query(sql_filter($sql, '', $userdata['user_id'])); return _pre('La firma de ' . $userdata['username'] . ' ha sido borrada.', true); }
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); }
public function _home() { global $config, $user, $cache; if (!_button()) { return false; } $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_locked = ? WHERE topic_id = ?'; sql_query(sql_filter($sql, !$topicdata['topic_locked'], $topic)); _pre('El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido ' . (($topicdata['topic_locked']) ? 'abierto' : 'cerrado'), true); return; }