/** * Layout Page Logic * @return * @param $db Object */ function __construct(database $db, user $user) { $this->db =& $db; $this->user =& $user; $this->sub_page = Kit::GetParam('sp', _GET, _WORD, 'view'); $this->layoutid = Kit::GetParam('layoutid', _REQUEST, _INT); // If we have modify selected then we need to get some info if ($this->layoutid != '') { // get the permissions Debug::LogEntry('audit', 'Loading permissions for layoutid ' . $this->layoutid); $this->auth = $user->LayoutAuth($this->layoutid, true); if (!$this->auth->edit) { trigger_error(__("You do not have permissions to edit this layout"), E_USER_ERROR); } $this->sub_page = "edit"; $sql = " SELECT layout, description, userid, retired, xml FROM layout "; $sql .= sprintf(" WHERE layoutID = %d ", $this->layoutid); if (!($results = $db->query($sql))) { trigger_error($db->error()); trigger_error(__("Cannot retrieve the Information relating to this layout. The layout may be corrupt."), E_USER_ERROR); } if ($db->num_rows($results) == 0) { $this->has_permissions = false; } while ($aRow = $db->get_row($results)) { $this->layout = Kit::ValidateParam($aRow[0], _STRING); $this->description = Kit::ValidateParam($aRow[1], _STRING); $this->retired = Kit::ValidateParam($aRow[3], _INT); $this->xml = $aRow[4]; } } }
define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); while ($r = $db->fetch_row($settq)) { $set[$r['conf_name']] = $r['conf_value']; } if ($_POST['username'] == "" || $_POST['password'] == "") { die("<h3>{$set['game_name']} Error</h3>\r\n{$nofill}<br>\r\n<a href=login.php>> Back</a>"); } $uq = $db->query("SELECT userid FROM users WHERE login_name='{$_POST['username']}' AND `userpass`=md5('{$_POST['password']}')"); if ($db->num_rows($uq) == 0) { die("<h3>{$set['game_name']} Error</h3>\r\n{$invalid}<br>\r\n<a href=login.php>> {$lerrortry}</a>"); } else { $_SESSION['loggedin'] = 1; $mem = $db->fetch_row($uq); $_SESSION['userid'] = $mem['userid']; $IP = $_SERVER['REMOTE_ADDR']; $IP = addslashes($IP); $IP = mysql_real_escape_string($IP); $IP = strip_tags($IP); $db->query("UPDATE users SET lastip_login='******',last_login=unix_timestamp() WHERE userid={$mem['userid']}"); $db->query("UPDATE users SET active=1 WHERE userid={$mem['userid']}"); if ($set['validate_period'] == "login" && $set['validate_on']) { $db->query("UPDATE users SET verified=0 WHERE userid={$mem['userid']}"); } header("Location: index.php");
<?php require "libraries/database.php"; require "phpMailer/class.phpmailer.php"; require "phpMailer/PHPMailerAutoload.php"; $maXacNhan = md5(uniqid(rand())); $email = $_REQUEST['email']; $tenHienThi = $_REQUEST['tenHienThi']; $matKhau = $_REQUEST['matKhau']; $data = new database("timphongtro"); $sql1 = "SELECT * FROM taikhoan WHERE email='{$email}'"; $data->query($sql1); if ($data->num_rows() == 0) { $sql = "INSERT INTO dangkytaikhoan (`MaXacNhan`, `email`, `TenHienThi`, `MatKhau`) VALUES ('{$maXacNhan}','{$email}','{$tenHienThi}','{$matKhau}')"; $result = $data->query($sql); if ($result) { $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 0; $mail->Debugoutput = "html"; // Lỗi trả về hiển thị với cấu trúc HTML $mail->Host = "smtp.gmail.com"; //host smtp để gửi mail $mail->Port = 587; // cổng để gửi mail $mail->SMTPSecure = "tls"; //Phương thức mã hóa thư - ssl hoặc tls $mail->SMTPAuth = true; //Xác thực SMTP $mail->Username = "******"; // Tên đăng nhập tài khoản Gmail
function startheaders() { global $ir, $set; global $_CONFIG; define("MONO_ON", 1); $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); while ($r = $db->fetch_row($settq)) { $set[$r['conf_name']] = $r['conf_value']; } $q = $db->query("SELECT userid FROM users"); $membs = $db->num_rows($q); $q = $db->query("SELECT userid FROM users WHERE bankmoney>-1"); $banks = $db->num_rows($q); $q = $db->query("SELECT userid FROM users WHERE gender='Male'"); $male = $db->num_rows($q); $q = $db->query("SELECT userid FROM users WHERE gender='Female'"); $fem = $db->num_rows($q); $money = money_formatter($ir['money']); $crystals = money_formatter($ir['crystals'], ''); $cn = 0; // Users Online , Counts Users Online In Last 15 minutes $q = $db->query("SELECT * FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY laston DESC"); $online = $db->num_rows($q); $ec = $ir['new_events']; $mc = $ir['new_mail']; $ids_checkpost = urldecode($_SERVER['QUERY_STRING']); if (eregi("[\\'|'/'\\''<'>'*'~'`']", $ids_checkpost) || strstr($ids_checkpost, 'union') || strstr($ids_checkpost, 'java') || strstr($ids_checkpost, 'script') || strstr($ids_checkpost, 'substring(') || strstr($ids_checkpost, 'ord()')) { $passed = 0; echo "<center> <font color=red> Hack attempt <br/>!!! WARNING !!! <br/>\n\nMalicious Code Detected! The staff has been notified.</font></center>"; event_add(1, " <a href='viewuser.php?u={$ir['userid']}'> <font color=red> " . $ir['username'] . "</font> </a> <b> Tried to use [" . $_SERVER['SCRIPT_NAME'] . "{$ids_checkpost}].. ", $c); $h->endpage(); exit; } echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']} - Massive Multiplayer Online Role Playing Game </title> <meta name="keywords" content="RPG, Online Games, Online Mafia Game" /> <meta name="description" content=" {$set['game_name']} - Online Mafia Game " /> <meta name="author" content="Mafia Game Scripts " /> <meta name="copyright" content="Copyright {$_SERVER['HTTP_HOST']} " /> <link rel="SHORTCUT ICON" href="favicon.ico" /> <script src="js/jquery-1.js" type="text/javascript"></script> <link rel="stylesheet" href="css/styleold.css" type="text/css" /> <link rel="stylesheet" href="css/stylenew.css" type="text/css" /> <script type="text/javascript" src="js/header.js"></script> <style type="text/css"> .boston a{ background:url(images/boston.jpg) no-repeat; } .boston a:hover{ background:url(images/boston_hover.jpg) no-repeat; } </style> <!--<script type="text/javascript"> \$(document).ready(function(){ \$.get("userstatajax.php",function(res){ if(res) { var resarray = res.split('||||||'); \$('.profile_mid').html(resarray[0]); \$('#points_money').html(resarray[1]); } }); }); </script>--> </head> <body id="sub" class="yui-skin-sam"> <div id="pagecontainer"> <!-- Header Part Starts --> <div class="headerpart"> <div class="onlinegame"></div> <div class="toplist"> </div> </div> <!-- //Header Part End --> <!-- Inner Page Top Starts --> <div class="innertopbg"> <div class="toprow1"> <div class="toprow1_col1"> <div class="logo"><a href="index.php"><img src="images/logo.jpg" alt="Logo"/></a></div> <div class="needbtn"></div> <div class="top_leftbtn"> <div class="leftbtn1"> </div> <div class="leftbtn2"> </div> </div> </div> <div class="toprow1_col2"> <div class="tot_txt">Total Mobsters: <span>{$membs}</span> Online Now: <span>{$online}</span></div> <div class="messagepart"> <div class="message_txt"><a href="mailbox.php" style="color:#fff;"><span>({$mc})</span> Messages</a></div> <div class="event_txt"><a href="events.php" style="color:#fff;"><span>({$ec})</span> Events</a></div> </div> <br/> <div class="messagepart" id="points_money"> <div class="point_txt">Crystals: <span> {$crystals} </span><br/></div> <div class="gold_txt">Money: <span>{$money}</span></div> </div> </div> </div> <!-- Menu Part Starts --> <div class="toprow2"> <div><img src="images/menu_left.jpg" alt="" /></div> <div class="menu_md"> <ul> <li class="ihome_active"><a href="index.php"></a></li> <li class="gym"><a href="gym.php"> </a></li> <li class="news"><a href="newspaper.php"> </a></li> <li class="forum"><a href="forums.php"> </a></li> <li class="boston"><a href="explore.php"> </a></li> <li class="protect"><a href="bodyguard.php"> </a></li> <li class="logout"><a href="logout.php"> </a></li> </ul> </div> <div><img src="images/menu_right.jpg" alt="" /></div> </div> <!-- //Menu Part End --> </div> <!-- //Inner Page Top End --> <div class="toprow2"> <div><img src="images/menu_left.jpg" alt="" /></div> <div class="menu_md"> <br/> <h2 class="headerpart1a"><span class='text2 title4'>Support {$set['game_name']} <a href='voting.php'>Vote</a> | <a href='donator.php'>Donate</a> | <a href='willpotion.php'>Will Potion</a></span></h2> </div><div><img src="images/menu_right.jpg" alt="" /></div> </div> </div><br/> <br/> <br/><br/> <div class="gymbg"> <div id="centercontainer"> <div id="centermaincontainer"> <!-- Center Part Starts --> <div class="icenterpart"><div class="icolumn1"> EOF; }
public static function confirm_command($nick, $ircdata = array()) { $code = $ircdata[0]; if (trim($code) == '') { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_SYNTAX_RE, array('help' => 'CONFIRM')); return false; } // wrong syntax if (!($user = services::user_exists($nick, false, array('display', 'id')))) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_UNREGISTERED); return false; } // unregistered $code_array = database::select('validation_codes', array('nick', 'code'), array('nick', '=', $nick, 'AND', 'code', '=', $code)); if (database::num_rows($code_array) == 0) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_PASSCODE); } else { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_VALIDATED); // let them know. database::update('users', array('validated' => 1), array('id', '=', $user->id)); // user is now validated. database::delete('validation_codes', array('nick', '=', $nick, 'AND', 'code', '=', $code)); // delete the code now that we've validated them core::alog(core::$config->nickserv->nick . ': ' . $nick . ' activated'); // logchan } // no passcode found }
<?php function __autoload($class_name) { include_once $class_name . ".class.php"; } $numq = "SELECT * FROM `test`"; $db = new database(); $res = $db->execute($numq); //总数据条数 $nums = $db->num_rows($res); $pagesize = 3; if (!empty($_GET['pagesize'])) { $pagesize = $_GET['pagesize']; } $page = new page($pagesize, $nums); //$page->show_page_way_1(); $page->show_page_way_3(); $page->show_page_result();
| Software Name : Mafia Game Scripts Online Mafia Game | Software Author : Mafia Game Scripts | Software Version : Version 2.3.1 Build 2301 | Website : http://www.mafiagamescript.net/ | E-mail : support@mafiagamescript.net |************************************************************************************************** | The source files are subject to the Mafia Game Script End-User License Agreement included in License Agreement.html | The files in the package must not be distributed in whole or significant part. | All code is copyrighted unless otherwise advised. | Do Not Remove Powered By Mafia Game Scripts without permission . |************************************************************************************************** | Copyright (c) 2010 Mafia Game Script . All rights reserved. |**************************************************************************************************/ include "config.php"; include "language.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0"); $db->query("UPDATE `users` SET jail=jail-1 WHERE `jail` > 0"); $db->query("UPDATE users SET traveltime=traveltime-1 WHERE traveltime > 0"); $db->query("UPDATE users SET bguard=bguard-1 WHERE bguard>0"); $db->query("UPDATE users SET bguard=0 WHERE bguard<0"); $hc = $db->num_rows($db->query("SELECT * FROM users WHERE hospital > 0")); $jc = $db->num_rows($db->query("SELECT * FROM users WHERE jail > 0")); $db->query("UPDATE settings SET conf_value='{$hc}' WHERE conf_name='hospital_count'"); $db->query("UPDATE settings SET conf_value='{$jc}' WHERE conf_name='jail_count'");
$db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); while ($r = $db->fetch_row($settq)) { $set[$r['conf_name']] = $r['conf_value']; } $domain = $set['domain']; if ($_SESSION['userid']) { if ($guest) { $gutxt = " AND guest=1"; } $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'{$gutxt}"); $useex = $db->num_rows($is); if ($useex > 0) { $ir = $db->fetch_row($is); $namenospaces = str_replace(" ", "_", $ir['username']); $_SESSION['username'] = $namenospaces; } else { if (!$userid) { die('error'); } else { if ($guest == 1) { header('Location: login.php'); } else { $name = $user->fbc_name; $db->query("INSERT INTO users (userid, username, money) VALUES('{$userid}', '{$name}', 1000)"); $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'"); $ir = $db->fetch_row($is);
public static function identify_command($nick, $ircdata = array()) { $password = $ircdata[0]; if (trim($password) == '') { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_SYNTAX_RE, array('help' => 'IDENTIFY')); return false; } // wrong syntax damit! if ($user = services::user_exists($nick, false, array('display', 'pass', 'identified', 'validated', 'salt', 'vhost'))) { if ($user->validated == 0) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_AWAITING_VALIDATION); return false; } elseif ($user->identified == 1) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ALREADY_IDENTIFIED); return false; } else { if ($user->pass == sha1($password . $user->salt)) { timer::remove(array('ns_identify', 'secured_callback', array($nick))); // remove the secured timer. if there is one ircd::on_user_login($nick); // registered mode database::update('users', array('identified' => 1, 'last_hostmask' => core::get_full_hostname($nick), 'last_timestamp' => 0), array('display', '=', $nick)); services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_IDENTIFIED); // right, standard identify crap core::alog(core::$config->nickserv->nick . ': ' . core::get_full_hostname($nick) . ' identified for nick ' . core::$nicks[$nick]['nick']); // logchan if ($user->vhost != '' && isset(modules::$list['os_vhost'])) { if (substr_count($user->vhost, '@') == 1) { $new_host = explode('@', $user->vhost); $ident = $new_host[0]; $host = $new_host[1]; ircd::setident(core::$config->operserv->nick, $user->display, $ident); ircd::sethost(core::$config->operserv->nick, $user->display, $host); } else { ircd::sethost(core::$config->operserv->nick, $user->display, $user->vhost); } } // first thing we do, check if they have a vhost, if they do, apply it. $failed_attempts = database::select('failed_attempts', array('nick', 'mask', 'time'), array('nick', '=', $nick)); if (database::num_rows($failed_attempts) > 0) { services::communicate(core::$config->nickserv->nick, $nick, '' . database::num_rows($failed_attempts) . ' failed login(s) since last login.'); while ($row = database::fetch($failed_attempts)) { services::communicate(core::$config->nickserv->nick, $nick, 'Failed login from: ' . $row->mask . ' on ' . date("F j, Y, g:i a", $row->time) . ''); } // loop through the failed attempts messaging them to the user database::delete('failed_attempts', array('nick', '=', $nick)); // clear them now that they've been seen } // we got any failed attempts? HUMM $hostname = core::get_full_hostname($nick); // generate a hostname. if (core::$config->settings->mode_on_id == 'yes' && isset(modules::$list['cs_levels'])) { foreach (core::$chans as $chan => $cdata) { $access_array = cs_levels::get_access($chan); // get the access array if ($nick == core::$config->chanserv->nick) { continue; } // skip us :D $hostname = core::get_full_hostname($nick); // get the hostname ready. foreach ($access_array as $target => $access) { if ($target == $nick) { $remove_access = false; // don't remove access cs_levels::give_access($chan, $nick, $access, chanserv::check_flags($chan, array('S'))); // give them access continue 2; // continue to next loop cause we've found a match } elseif (strpos($target, '@') !== false && services::match($hostname, $target)) { $remove_access = false; // don't remove access cs_levels::give_access($chan, $nick, $access, chanserv::check_flags($chan, array('S'))); // give them access continue 2; // continue to next loop cause we've found a match } elseif (strpos(core::$chans[$chan]['users'][$nick], 'o') !== false) { $remove_access = true; // set remove access to true continue 1; // continue to next loop to check other access records } else { continue 1; // continue to next loop to check other access records } // we check if the user has access, if they do break; // we also check if they dont have access and have op, if they do remove it. } // loop through the access records } // loop through channels, check if they are in any } // check if mode_on_id is set, also cs_access is enabled, and lets do a remote access gain :D } else { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_PASSWORD); core::alog(core::$config->nickserv->nick . ': Invalid password from ' . core::get_full_hostname($nick)); // some logging stuff database::insert('failed_attempts', array('nick' => $nick, 'mask' => core::get_full_hostname($nick), 'time' => core::$network_time)); core::$nicks[$nick]['failed_attempts']++; // ooh, we have something to log :) if (core::$nicks[$nick]['failed_attempts'] == 5) { ircd::kill(core::$config->nickserv->nick, $nick, 'Maxmium FAILED login attempts reached.'); } // have they reached the failed attempts limit? we gonna f*****g KILL mwhaha } // invalid password? HAX!! } // are they already identifed? } else { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_UNREGISTERED); return false; // doesn't even exist.. } // right now we need to check if the user exists, and password matches }
if ($coud['crIQ'] > 0) { $upd .= ",us.IQ=us.IQ+{$coud['crIQ']}"; $ev .= ", {$coud['crIQ']} IQ"; } $ev = substr($ev, 1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid {$upd} WHERE u.userid={$userid}"); } $db->query("INSERT INTO events VALUES('',{$userid},unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained {$ev}!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $db->query("UPDATE `businesses` SET `brank` = '100000' WHERE `brank` > '100000'"); $select_businesses = $db->query("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) ORDER BY `busId` ASC"); while ($bs = $db->fetch_row($select_businesses)) { $amount = $db->num_rows($db->query(sprintf("SELECT * FROM `businesses_members` WHERE `bmembBusiness` = '%u'", $bs['busId']))); $active = $db->num_rows($db->query(sprintf("SELECT * FROM `users` WHERE `business` = '%u' AND active='%d'", $bs['busId'], 1))); $new_customers = $bs['brank'] * $active + rand(10, 20) * $bs['classCost'] / 200; $new_profit = $new_customers + rand(110, 990); $new_rank = $bs['classId'] * $active / 2; $db->query(sprintf("UPDATE `businesses` SET `busYCust` = `busCust`, `busYProfit` = `busProfit`, `busCust` = '%d', `busProfit` = '%d', `busCash` = '%d' WHERE `busId` = '%u'", $new_customers, $new_profit, $new_profit + $bs['busCash'], $bs['busId'])); $db->query(sprintf("UPDATE `businesses` SET `busDays` = `busDays` + '1'")); $db->query(sprintf("UPDATE `users` SET `activedays` = `activedays` + '1' WHERE `active` = '1'")); $db->query(sprintf("UPDATE `users` SET `active` = '0' WHERE `active` = '1'")); $db->query(sprintf("UPDATE `businesses` SET `brank` = `brank` + '%d' WHERE `busId` = '%u'", $new_rank, $bs['busId'])); $fetch_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) LEFT JOIN `businesses_ranks` ON (`rankId` = `bmembRank`) WHERE `bmembBusiness` = '%u'", $bs['busId'])) or die('Cron not run'); $db->query("UPDATE userstats SET labour = labour + 50, IQ = IQ + 50, strength = strength + 50 WHERE userid = {$bs['busDirector']}"); $db->query("UPDATE users SET comppoints = comppoints + 1 WHERE userid = {$bs['busDirector']}"); while ($fm = $db->fetch_row($fetch_members)) { $db->query(sprintf("UPDATE `userstats` SET `{$fm['rankPrim']}` = `{$fm['rankPrim']}` + '%.6f', `{$fm['rankSec']}` = `{$fm['rankSec']}` + '%.6f' WHERE (`userid` = '%u')", $fm['rankPGain'], $fm['rankSGain'], $fm['userid'])) or die('Cron not run'); $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $fm['bmembCash'], $fm['userid'])) or die('Cron not run');
$user = User::fbc_getLoggedIn(); $user ? $fb_active_session = $user->fbc_is_session_active() : ($fb_active_session = FALSE); if ($user) { //header redirect to a logged in page header('Location: index.php'); } else { include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_mysql.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $randnum = rand(1, 1000000); while ($db->num_rows($db->query("SELECT userid FROM users WHERE userid={$randnum}")) > 0) { $randnum = rand(1, 1000000); } $db->query("INSERT INTO users (username, userid, guest, money) VALUES('Guest #{$randnum}', '{$randnum}', 1, 100)"); $_SESSION['loggedin'] = 1; $_SESSION['loggedin'] = 1; $_SESSION['userid'] = $randnum; $thirtyma = time() - 60 * 15; //thirty minutes ago $dgaatl = $db->query("SELECT * FROM users WHERE guest=1 AND laston<{$thirtyma} AND userid!={$randnum} LIMIT 3"); while ($dga = $db->fetch_row($dgaatl)) { $db->query("DELETE FROM arcadepbest WHERE userid={$dga['userid']}"); $db->query("DELETE FROM arcadetrophy WHERE userid={$dga['userid']}"); $db->query("DELETE FROM users WHERE userid={$dga['userid']}"); $db->query("DELETE FROM highscores WHERE userid={$dga['userid']}"); $db->query("DELETE FROM flashscores WHERE userid={$dga['userid']}");
public static function check_expire() { if (core::$config->nickserv->expire == 0) { return false; } // skip nicknames if config is set to no expire. $expiry_time = core::$config->nickserv->expire * 86400; $check_time = core::$network_time - $expiry_time; // set up our times. $nick_q = database::select('users', array('id', 'display', 'last_timestamp'), array('last_timestamp', '!=', '0', 'AND', 'last_timestamp', '<', $check_time)); if (database::num_rows($nick_q) == 0) { return false; } // no expiring nicknames while ($nick = database::fetch($nick_q)) { // Mikeh gets most of the credit for helping // me code this function database::delete('users', array('display', '=', $nick->display)); database::delete('users_flags', array('nickname', '=', $user->display)); // delete the users record database::delete('chans_levels', array('target', '=', $nick->display)); // also delete this users channel access. core::alog(core::$config->nickserv->nick . ': ' . $nick->display . ' has expired. Last used on ' . date('F j, Y, g:i a', $nick->last_timestamp)); // logchan it if (isset(core::$nicks[$nick->display])) { ircd::on_user_logout($nick->display); } // if the nick is being used unregister it, even though it shouldn't be, just to be safe. } // loop through all expiring nicks. }
public static function list_command($nick, $ircdata = array()) { $term = $ircdata[0]; $limit = $ircdata[1]; $mode = isset($ircdata[2]) ? strtolower($ircdata[2]) : ''; if (!core::$nicks[$nick]['ircop'] || services::user_exists($nick, true, array('display', 'identified')) === false) { services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED); return false; } // they've gotta be identified and opered.. if (trim($term) == '' || trim($limit) == '' || isset($mode) && !in_array($mode, array('', 'suspended'))) { services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_INVALID_SYNTAX_RE, array('help' => 'INFO')); return false; } // invalid syntax if (!preg_match('/([0-9]+)\\-([0-9]+)/i', $limit)) { services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_INVALID_SYNTAX_RE, array('help' => 'LIST')); return false; } // invalid syntax $total = database::select('chans', array('id')); $total = database::num_rows($total); $chans = self::_find_match($term, $mode, $limit); // try and find a match if (database::num_rows($chans) == 0) { services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LIST_BOTTOM, array('num' => 0, 'total' => $total)); return false; } // no channels? services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LIST_TOP); services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LIST_TOP2); // top of the list while ($channel = database::fetch($chans)) { $false_chan = $channel->channel; if (!isset($channel->channel[18])) { $y = strlen($channel->channel); for ($i = $y; $i <= 17; $i++) { $false_chan .= ' '; } } // this is just a bit of fancy fancy, so everything displays neat if ($channel->suspended == 0) { $info = chanserv::get_flags($channel->channel, 'd'); } else { $info = $channel->suspend_reason; } // suspend reason, or description? services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LIST_ROW, array('chan' => $false_chan, 'info' => $info)); } // loop through the channels services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LIST_BOTTOM, array('num' => database::num_rows($chans) == 0 ? 0 : database::num_rows($chans), 'total' => $total)); }
*/ include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_mysql.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $value = abs((int) $_GET['v']); $query = 'SELECT username,user_level,totmoney,signedup,totads,totref,donatordays FROM users WHERE userid = ' . $value; $e = $db->query($query); $x = $db->fetch_row($e); $query2 = 'SELECT totmoney FROM users WHERE totmoney>' . $x['totmoney']; $en = $db->query($query2); $rank = $db->num_rows($en); $rank += 1; $x['totref'] = number_format($x['totmoney'], 2); $x['totref'] = " \$" . $x['totref']; $x['totads'] = number_format($x['totads']); // Check cache $cache = 'psigs/' . $value . '.png'; if (file_exists($cache)) { $delold = unlink($cache); } // Load image thing $im = imagecreatefrompng('images/sig.png'); $font = 'fonts/franklin.ttf'; $color = imagecolorallocate($im, 188, 222, 255); // Blueish or so // Write
$c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); $IP = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); while ($r = $db->fetch_row($settq)) { $set[$r['conf_name']] = $r['conf_value']; } if ($_POST['email'] == "" || $_POST['password'] == "") { die("<h3>{$set['game_name']} Error</h3>\nYou did not fill in the login form!<br>\n<a href=login.php>> Back</a>"); } $_POST['email'] = mysql_real_escape_string($_POST['email']); $encpass = $crypt->encrypt($_POST['email'], $_POST['password']); $encpass = addslashes($encpass); $uq = $db->query("SELECT userid FROM users WHERE email='{$_POST['email']}' AND `userpass`='{$encpass}'"); $la = $db->fetch_row($db->query("SELECT * FROM loginattempts WHERE ip='{$IP}'")); if ($db->num_rows($uq) == 0 && $la['times'] < 10) { $lat = $db->num_rows($db->query("SELECT * FROM loginattempts WHERE ip='{$IP}'")); if (!$lat) { $db->query("INSERT INTO loginattempts VALUES('','{$IP}',1)"); } else { $db->query("UPDATE loginattempts SET times=times+1 WHERE ip='{$IP}'"); } die("<h3>{$set['game_name']} Error</h3>\nInvalid email or password!<br>\n<a href=login.php>> Back</a>"); } else { if ($la['times'] > 9) { die("<h3>{$set['game_name']} Error</h3>\nYou have tried to login the maximum number of times for this hour. Please wait 1 hour and try again.<br>\n<a href=login.php>> Back</a>"); } else { $_SESSION['loggedin'] = 1; $mem = $db->fetch_row($uq); $_SESSION['userid'] = $mem['userid']; $db->query("UPDATE users SET lastip_login='******',last_login=unix_timestamp() WHERE userid={$mem['userid']}");
public static function check_expire() { if (core::$config->chanserv->expire == 0) { return false; } // skip channels if config is set to no expire. $expiry_time = core::$config->chanserv->expire * 86400; $check_time = core::$network_time - $expiry_time; // set up our times $channel_q = database::select('chans', array('channel', 'last_timestamp'), array('last_timestamp', '<', $check_time)); if (database::num_rows($channel_q) == 0) { return false; } // no registered channels while ($channel = database::fetch($channel_q)) { database::delete('chans', array('channel', '=', $channel->channel)); database::delete('chans_levels', array('channel', '=', $channel->channel)); core::alog(core::$config->chanserv->nick . ': ' . $channel->channel . ' has expired. Last used on ' . date('F j, Y, g:i a', $channel->last_timestamp)); // logchan it if (isset(core::$chans[$channel->channel])) { ircd::part_chan(core::$config->chanserv->nick, $channel->channel); // now lets leave the channel if we're in it } // unset some modes, leave the channel if its in use.. i know this shouldn't // be even thought about.. but maybe somebody idled in it and never even did // anything for the whole expiry period? :P } // channel is old i'm afraid, expire it }
session_start(); require_once "config.php"; require_once "global_func.php"; global $_CONFIG; define("MONO_ON", 1); require_once "class/class_db_mysql.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $is = $db->query("SELECT * FROM users WHERE userid={$_SESSION['userid']}"); $ir = $db->fetch_row($is); $userid = $ir['userid']; include "s_{$gpre}func.php"; $pp = $db->query("SELECT * FROM {$gpre}game WHERE gameover=0 AND userid={$userid}"); $pany = $db->num_rows($pp); $move = abs((int) $_POST['move']); $select = abs((int) $_POST['select']); print "<center>"; //This code is essentially the code that executes in the if($pany && $_GET['act']=='play') statement within s_pp_game.php if ($pany) { $p = $db->fetch_row($pp); print "<h2>Poker Patience</h2><a href='s_pp_game.php?act=highscores'><b><font color=green>View Highscores</font></b></a> | \n\t<b>How to play:</b><br /><font size=1> Get the best 5 card hand possible on each row, column, and the two diagonals. <br />\n\tYour final score is the total points you earned from all 12 of those hands.<br />\n\tClick one of the two decks at top to select a card to play, and click an open square to play it.</font><br /><br />\n\t<div id = \"gamediv\">"; $gameid = $p['id']; $boardtxt = draw_board($userid, $gameid); if ($move != 0 && $p['gameover'] == 0) { make_move($move, $userid); $points = check_win($userid); if ($points > 0) { $ins = $db->query("SELECT * FROM pp_scores WHERE userid={$userid} AND {$points}<score"); $insn = $db->num_rows($ins);
$c = $db->connection_id; include_once 'lib/config.php'; $user = User::fbc_getLoggedIn(); $user ? $fb_active_session = $user->fbc_is_session_active() : ($fb_active_session = FALSE); include "sb_func.php"; include $gpre . "func.php"; $currenttime = time(); $is = $db->query("SELECT * FROM users WHERE userid={$_SESSION['userid']}"); $ir = $db->fetch_row($is); $userid = $ir['userid']; $roomid = abs((int) $_POST['id']); if (!$roomid) { $roomid = abs((int) $_GET['id']); } if ($roomid) { $goodroom = $db->num_rows($db->query("SELECT id FROM {$gpre}room WHERE (p1={$userid} OR p2={$userid}) AND id={$roomid}")); if (!$goodroom) { die('Error. Bad room ID.'); } } else { $roomid = $ir["{$gpre}room"]; } $move = abs((int) $_POST['move']); $begin = abs((int) $_POST['begin']); $setup = abs((int) $_POST['setup']); $endturn = abs((int) $_POST['endturn']); $game = $db->query("SELECT * FROM {$gpre}room WHERE id={$roomid}", $c) or die("1"); if ($db->num_rows($game) == 0) { die("You are not currently in a room... <a href=sb_rooms.php?g={$gpre}>Click here to pick a room</a><meta http-equiv=\"refresh\" content=\"0;url=sb_rooms.php?g={$gpre}\" />"); } $ga = $db->fetch_row($game);
public static function list_command($nick, $ircdata = array()) { $term = $ircdata[0]; $limit = $ircdata[1]; $mode = isset($ircdata[2]) ? strtolower($ircdata[2]) : ''; if (!core::$nicks[$nick]['ircop'] || services::user_exists($nick, true, array('display', 'identified')) === false) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ACCESS_DENIED); return false; } // they've gotta be identified and opered.. if (trim($term) == '' || trim($limit) == '' || isset($mode) && !in_array($mode, array('', 'suspended'))) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_SYNTAX_RE, array('help' => 'LIST')); return false; } // invalid syntax if (!preg_match('/([0-9]+)\\-([0-9]+)/i', $limit)) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_INVALID_SYNTAX_RE, array('help' => 'LIST')); return false; } // invalid syntax $total = database::select('users', array('id')); $total = database::num_rows($total); $nicks = self::_find_match($term, $mode, $limit); // try and find a match if (database::num_rows($nicks) == 0) { services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_LIST_BOTTOM, array('num' => 0, 'total' => $total)); return false; } // no nicks? services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_LIST_TOP); services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_LIST_TOP2); // top of list. while ($user = database::fetch($nicks)) { $false_nick = $user->display; if (!isset($user->display[18])) { $y = strlen($user->display); for ($i = $y; $i <= 17; $i++) { $false_nick .= ' '; } } // this is just a bit of fancy fancy, so everything displays neat if ($user->suspended == 0) { $hostmask = explode('!', $user->last_hostmask); $info = $hostmask[1]; } else { $info = $user->suspend_reason; } services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_LIST_ROW, array('nick' => $false_nick, 'info' => $info)); } // loop through the nicks services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_LIST_BOTTOM, array('num' => database::num_rows($nicks) == 0 ? 0 : database::num_rows($nicks), 'total' => $total)); }
tep_redirect(tep_href_link(FILENAME_DEFAULT)); } // Make a connection to the database... $database = new database(); $database->connect(DB_TICKET_SERVER_NAME, DB_TICKET_SERVER_USERNAME, DB_TICKET_SERVER_PASSWORD, DB_TICKET_DATABASE_NAME) or die('Unable to connect to database server!'); $ticket_sql = DB_TICKET_DATABASE_QUERY; $ticket_sql = str_replace('%TICKET_CUSTOMER%', $database->input(rawurldecode($_REQUEST['activityCustomer'])), $ticket_sql); $ticket_sql = str_replace('%TICKET_DATE%', $database->input(rawurldecode($_REQUEST['activityDate'])), $ticket_sql); // header // require DIR_WS_INCLUDES . 'header_dialog.php'; ?> <!-- body //--> <table border="0" width="100%" cellspacing="0" cellpadding="2" class="entryListing"> <?php $ticket_query = $database->query($ticket_sql); if ($database->num_rows($ticket_query) > 0) { $headerRow = true; $columnNames = array(); $odd_or_even = "odd"; while ($ticket_result = $database->fetch_array($ticket_query, MYSQL_ASSOC)) { if ($headerRow) { ?> <tr> <?php foreach ($ticket_result as $columnName => $columnValue) { array_push($columnNames, $columnName); ?> <td class="entryListing-heading"><?php echo str_replace('_', ' ', $columnName); ?> </td>
$ir = $db->fetch_row($is); if ($ir['force_logout']) { $db->query("UPDATE users SET force_logout=0 WHERE userid={$userid}"); session_unset(); session_destroy(); header("Location: login.php"); exit; } $_GET['ID'] = abs((int) $_GET['ID']); $q = mysql_query("SELECT * FROM votes WHERE userid={$userid} AND site='{$_GET['ID']}'", $c); if (mysql_num_rows($q) > 0) { print "You have already voted on this site today!"; die(""); } else { $blak = mysql_query("SELECT * FROM votingsites WHERE id={$_GET['ID']}", $c); if ($db->num_rows($blak) == 0) { print "<center>This voting site does not exist!</center>"; die(""); } else { $r = mysql_fetch_array($blak); } $id = $_GET['ID']; $reward = $r['reward']; if ($r['rewardtype'] == 1) { $muneh = money_formatter($reward); mysql_query("INSERT INTO votes values ({$userid},{$id})", $c); event_add($userid, "Thank you for voting! You have receieved {$muneh}!", $c); mysql_query("UPDATE users SET money=money+{$reward} WHERE userid={$userid}", $c); } if ($r['rewardtype'] == 2) { mysql_query("INSERT INTO votes values ({$userid},{$id})", $c);
static function check_mask_ignore($nick) { $ignored_user = database::select('ignored_users', array('who')); $hostname = core::get_full_hostname($nick); // we generate the hostname if (database::num_rows($ignored_user) > 0) { while ($ignore = database::fetch($ignored_user)) { if ($nick == $ignore->who) { return true; } elseif (strpos($ignore->who, '@') && self::match($hostname, $ignore->who)) { return true; } // we've found a match! } // loop through records, on the first match we instantly break the loop. } else { return false; } // there are records }
return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))\$", $domain_array[$i])) { return false; } } } return true; } include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db = new database(); $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; if (!$_GET['password']) { die("<font color='red'>Invalid - Blank</font>"); } if (!valid_email($_GET['password'])) { die("<font color='red'>Invalid - Bad Format</font>"); } $un = $_GET['password']; $q = $db->query("SELECT * FROM users WHERE email='{$un}'"); if ($db->num_rows($q)) { die("<font color='red'>Invalid - Already In Use</font>"); } print "<font color='green'>Valid</font>";
<?php session_start(); require_once "../libraries/database.php"; $database = new database(); require_once "../libraries/form.php"; $form = new form(); $username = $form->input('username'); $password = $form->input('password'); if (!empty($username) && !empty($password)) { $sql = "SELECT * FROM user_login WHERE username='******' AND password=PASSWORD('{$password}')"; $count = $database->num_rows($sql); if ($count > 0) { $item = $database->fetch_data($sql); if ($item['aktif'] == '1') { $today = date('Y-m-d'); if ($item['tgl_awal'] <= $today && $item['tgl_akhir'] >= $today) { $_SESSION['username'] = $username; $_SESSION['nama'] = $item['nama']; $_SESSION['id'] = $item['id']; $_SESSION['user_level_id'] = $item['user_level_id']; $_SESSION['start'] = time(); $_SESSION['expire'] = $_SESSION['start'] + 30 * 60; header("Location: ../dashboard.php"); exit; } else { $_SESSION['info'] = "Masa Aktif Login Sudah Lewat. Silahkan hubungi Admin"; header("Location: ../index.php"); exit; } } else {
private function sql_insertround($array) { // we dont want any entries like the id if (isset($array['id'])) { unset($array['id']); } // do we have the required entries for auth? if (isset($array['player'])) { // then try to find this user $query = "SELECT * FROM users WHERE name='" . database::esc($array['player']) . "' AND status>='1' LIMIT 0,1"; $sql = database::query($query); // if we found him insert the round if (database::num_rows($sql) == 1) { $row = database::fetch_object($sql); // init vars $tmp1 = ''; $tmp2 = ''; // set uid $array['uid'] = $row->id; // build sql insert statement foreach ($array as $key => $value) { $tmp1 .= database::esc($key) . ','; $tmp2 .= '\'' . database::esc($value) . '\','; } // insert played round $query = "INSERT INTO stats_rounds (" . substr($tmp1, 0, -1) . ")VALUES(" . substr($tmp2, 0, -1) . ")"; $sql = database::query($query); // update player ranking $sql = "UPDATE users SET" . " stats_finishes=stats_finishes+'" . database::esc($array['finishes'], 'int') . "'," . " stats_deaths=stats_deaths+'" . database::esc($array['deaths'], 'int') . "'," . " stats_kills=stats_kills+'" . database::esc($array['kills'], 'int') . "'," . " stats_playerpoints=stats_playerpoints+'" . database::esc($array['playerpoints'], 'int') . "'," . " stats_timePlayed=stats_timePlayed+'" . database::esc($array['timePlayed'], 'int') . "'," . " stats_ctime=stats_ctime+'" . database::esc($array['ctime'], 'int') . "'," . " stats_starts=stats_starts+'" . database::esc($array['starts'], 'int') . "'," . " stats_heropoints=stats_heropoints+'" . database::esc($array['heropoints'], 'int') . "'," . " stats_livingStreak=stats_livingStreak+'" . database::esc($array['livingStreak'], 'int') . "'," . " stats_rating=stats_rating+'" . database::esc($array['rating'], 'int') . "'," . " stats_gameComplete=stats_gameComplete+'" . database::esc($array['gameComplete'], 'int') . "'," . " stats_winningCnt=stats_winningCnt+'" . database::esc($array['winningCnt'], 'int') . "'," . " stats_losingCnt=stats_losingCnt+'" . database::esc($array['losingCnt'], 'int') . "'," . " stats_roundsplayed=stats_roundsplayed+1," . " stats_lastPlayed='" . database::esc(time(), 'int') . "'" . " WHERE id='" . database::esc($row->id, 'int') . "'"; database::query($sql); } } }
<?php include_once '../../classes/tools.php'; include_once '../../classes/database.php'; // initialize database database::construct('localhost', 'root', 'technik,01', 'master'); // Get Top 100 users // order by rating: // prating = (playerpoints+heropoints)*(kills/deaths) // prating = (250+100) * (210 / 250) // 294 = 350 * 0,84 // higher prating = better ranking $query = "SELECT " . "name," . "stats_starts," . "stats_finishes," . "stats_kills," . "stats_deaths," . "stats_playerpoints," . "stats_heropoints," . "stats_lastPlayed," . "(stats_kills/stats_deaths) as pkd," . "((stats_playerpoints+stats_heropoints)*(stats_kills/stats_deaths)) as prating" . " FROM `users` WHERE " . "stats_timePlayed > 0 AND " . "stats_kills > 0 AND " . "stats_deaths > 0" . " ORDER BY " . "prating DESC" . " LIMIT 0,100"; $sql = database::query($query); // if we found him insert the round if (database::num_rows($sql) > 1) { $rank = 1; echo '//GamerTag,..Rank, Rating, Starts, Finishes, Kills, Deaths, HeroPoints, TotalTimePlayed,.. LastGamePlayed, LongestLiving,' . "\r\n"; while ($row = database::fetch_object($sql)) { echo strip_tags($row->name) . ',' . $rank . ',' . $row->stats_playerpoints . ',' . $row->stats_starts . ',' . $row->stats_finishes . ',' . $row->stats_kills . ',' . $row->stats_deaths . ',' . $row->stats_heropoints . ',' . 'Unknown,' . date("d.m.Y H:i:s", $row->stats_lastPlayed) . ',' . 'Unknown,' . "\r\n"; $rank++; } }
$txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { // HTTP ERROR } else { fputs($fp, $header . $req); while (!feof($fp)) { $res = fgets($fp, 1024); if (strcmp($res, "VERIFIED") == 0) { // check the payment_status is Completed if ($payment_status != "Completed") { fclose($fp); die(""); } if ($db->num_rows($db->query("SELECT * FROM dps_accepted WHERE dpTXN='{$txn_id}'")) > 0) { fclose($fp); die(""); } // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email if ($receiver_email != $set['paypal']) { fclose($fp); die(""); } // check that payment_amount/payment_currency are correct if ($payment_currency != "USD") { fclose($fp); die(""); } // parse for pack
public static function set_flag($nick, $chan, $target, $flag, $param = '') { $mode = $flag[0]; $r_flag = $flag[1]; // get the real flag, eg. V, v and mode if (chanserv::check_levels($target, $chan, array($r_flag), false, false, false, false)) { $user_flag_q = database::select('chans_levels', array('id', 'channel', 'target', 'flags'), array('channel', '=', $chan, 'AND', 'target', '=', $target)); if ($mode == '-') { if ($nick == $target && $r_flag == 'F') { services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LEVELS_BAD_FLAG, array('flag' => $flag)); return false; } // someone is trying to de-founder themselves? if (strpos(self::$set[$target], '-') === false) { self::$set[$target] .= '-'; } // ok, no - ? $user_flag = database::fetch($user_flag_q); // get the flag record $new_user_flags = str_replace($r_flag, '', $user_flag->flags); if ($new_user_flags == '') { database::delete('chans_levels', array('channel', '=', $chan, 'AND', 'target', '=', $target)); } else { database::update('chans_levels', array('flags' => $new_user_flags), array('channel', '=', $chan, 'AND', 'target', '=', $target)); } // check if it's empty, if it is just delete the row self::$set[$target] .= $r_flag; // some magic :O return true; } else { self::$already_set[$target] .= $r_flag; // some magic :O return false; } // the user has the flag, so, if it's - remove it, if it is + // we send a message back. } else { $user_flag_q = database::select('chans_levels', array('id', 'channel', 'target', 'flags'), array('channel', '=', $chan, 'AND', 'target', '=', $target)); if ($mode == '+') { if (strpos(self::$set[$target], '+') === false) { self::$set[$target] .= '+'; } // ok, no + ? if (database::num_rows($user_flag_q) > 0) { $user_flag = database::fetch($user_flag_q); $new_user_flags = $user_flag->flags . $r_flag; if ($r_flag == 'b' && $mode == '+') { database::update('chans_levels', array('flags' => $new_user_flags, 'reason' => $param), array('channel', '=', $chan, 'AND', 'target', '=', $target)); } else { database::update('chans_levels', array('flags' => $new_user_flags), array('channel', '=', $chan, 'AND', 'target', '=', $target)); } // update. self::$set[$target] .= $r_flag; // some magic :O return true; } else { if ($r_flag == 'b' && $mode == '+') { database::insert('chans_levels', array('channel' => $chan, 'target' => $target, 'flags' => $r_flag, 'reason' => $param)); } else { database::insert('chans_levels', array('channel' => $chan, 'target' => $target, 'flags' => $r_flag)); } // insert. self::$set[$target] .= $r_flag; // some magic :O return true; } } else { self::$not_set[$target] .= $r_flag; // some magic :O return false; } // the user doesn't have the flag, so if it's + add it, if it is - // we send a message back, basically the opposite of above. } }
<?php require 'libraries/database.php'; $idN = $_REQUEST['idN']; $data = new database("timphongtro"); $sql1 = "select * from taikhoan_o_phongtro where IDTaiKhoan='{$idN}'"; $data->query($sql1); if ($data->num_rows() != 0) { $result1 = $data->fetch(); $idP = $result1['IDPhongTro']; $sql2 = "select * from phongtro where IDPhongTro='{$idP}'"; $data->query($sql2); $result2 = $data->fetch(); $sql3 = "select * from taikhoan_o_phongtro, taikhoan where taikhoan_o_phongtro.IDTaiKhoan=taikhoan.IDTaiKhoan and IDPhongTro='{$idP}'"; $data->query($sql3); $result3 = $data->fetchAll('user'); header('Content-type: text/xml'); echo "<result>"; echo "<idP>" . $idP . "</idP>"; echo "<dienTich>" . $result2['DienTich'] . "</dienTich>"; echo "<gia>" . $result2['GiaPhong'] . "</gia>"; echo "<khuVuc>" . $result2['KhuVuc'] . "</khuVuc>"; echo "<diaChi>" . $result2['DiaChi'] . "</diaChi>"; echo "<boSung>" . $result2['ThongTinBoSung'] . "</boSung>"; echo "<tinhTrang>" . $result2['TinhTrang'] . "</tinhTrang>"; echo "<soNguoiO>" . $result2['SoNguoiTrongPhong'] . "</soNguoiO>"; echo "<danhSachNguoiO>"; foreach ($result3 as $index => $user) { if (is_array($user)) { foreach ($user as $key => $value) { echo "<" . $key . ">";
public static function _clear_users($nick) { database::delete('ignored_users'); services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_IGNORE_CLEARED, array('users' => database::num_rows($nicks_q))); // list cleared. }