Jump to content
MakeWebGames

ossukoss

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by ossukoss

  1. Login and register wont work.
  2. But do you have sql file?
  3. Can you give me install.php?
  4. Fixed.Its was host problem!
  5. <?php define('BASEPATH', true); require_once('system/config.php'); $orign = empty($_GET['orign']) ? '/game/?side=startside' : $_GET['orign']; if (IS_ONLINE) { header("Location: " . $orign); exit; } $sider = array( 'logginn' => 'logginn', 'registrer' => 'registrer', 'glemt_pass' => 'glemt_pass' ); $side = $sider[$_GET['side']]; if (!$side) { $side = $sider['logginn']; } $open_time = strtotime('8/27/2010 19:30:00'); define('FACEBOOK_APP_ID', '105386132860118'); define('FACEBOOK_SECRET', 'x'); /*$facebook_cookie = false; $facebook_user = false; if ($side == 'registrer' && isset($_GET['fb'])) { function get_facebook_cookie($app_id, $application_secret) { $args = array(); parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args); ksort($args); $payload = ''; foreach ($args as $key => $value) { if ($key != 'sig') { $payload .= $key . '=' . $value; } } if (md5($payload . $application_secret) != $args['sig']) { return null; } return $args; } $facebook_cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET); if ($facebook_cookie) { $facebook_user = json_decode(file_get_contents('https://graph.facebook.com/me?access_token=' . $facebook_cookie['access_token'])); } }*/ if (isset($_GET['setLang']) && $languages_supported[$_GET['setLang']]) { $lang = $languages_supported[$_GET['setLang']]; setcookie('MZ_Language', $lang[0]); header('Location: /'); exit; } ?> <!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" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="<?=$config['meta_keywords']?>" /> <meta name="description" content="<?=$config['meta_description']?>" /> <title>Mafiazone | Norsk Mafia Spill</title> <link rel="shortcut icon" href="<?=$config['base_url']?>favicon.ico" /> <link href="<?=$config['base_url']?>css.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="<?=$config['base_url']?>game/js/mootools.js"></script> <script type="text/javascript" src="js.js"></script> <?php if($side == 'logginn') echo '<script type="text/javascript">window.addEvent(\'domready\', function(){$(\'login\').focus()});;</script>' . "\n";?> </head> <body> <div id="default_langSelector"> <ul> <?php foreach ($languages_supported as $lang) { echo '<li' . ($lang[0] == $langBase->language ? ' class="active"' : '') . '><a href="' . $config['base_url'] . '?setLang=' . $lang[0] . '" title="' . $lang[2] . '"><img src="' . $config['base_url'] . 'game/images/flags/' . $lang[0] . '.png" alt="' . $lang[2] . '" /></a></li>'; } ?> </ul> </div> <div class="default_wrap"> <div class="default_header" style="position: relative;"> <div style="position: absolute; left: 10px; top: 10px; width: 568px; height: 60px; overflow: hidden;"> </div> </div> <div class="default_content_wrap"> <div class="default_content left"> <div class="content <?=$side?>"> <?php if ($side == 'logginn') { if (isset($_POST['do_login'])) { $login = $db->EscapeString($_POST['login']); $sql = "SELECT `id`,`pass` FROM `[users]` WHERE "; if (is_numeric($login)) { // Logg inn med bruker-id $sql .= "`id`='$login'"; } elseif (strstr($login, '@')) { // Logg inn med epost adresse $sql .= "`email`='$login'"; } else { // Logg inn med spillernavn $q = $db->Query("SELECT userid FROM `[players]` WHERE `name`='$login'"); $player = $db->FetchArray($q); $sql .= "`id`='".$player['userid']."'"; } $sql = $db->Query($sql); $user = $db->FetchArray($sql); $pass = View::DoubleSalt($db->EscapeString($_POST['password']), $user['id']); if ($user['pass'] === $pass) { $userid = $user['id']; $sql = $db->Query("SELECT id FROM `[sessions]` WHERE `Userid`='" . $user['id'] . "' AND `IP`='" . $_SERVER['REMOTE_ADDR'] . "' AND `Active`='1'"); while ($sess = $db->FetchArray($sql)) { $db->Query("INSERT INTO `" . $config['sql_logdb'] . "`.`[sessions_logg]` SELECT * FROM `[sessions_logg]` WHERE `id`='" . $sess['id'] . "'"); $db->Query("UPDATE `" . $config['sql_logdb'] . "`.`[sessions_logg]` SET `Active`='0' WHERE `id`='".$sess['id']."'"); $db->Query("DELETE FROM `[sessions]` WHERE `id`='" . $sess['id'] . "'"); } mysql_query("INSERT INTO `[sessions]` (`Userid`, `Time_start`, `Last_updated`, `IP`, `User_agent`)VALUES('".$user['id']."', '".time()."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_USER_AGENT']."')") or die(mysql_error()); $sid = mysql_insert_id(); $db->Query("UPDATE `[users]` SET `online`='".time()."', `last_active`='".time()."', `IP_last`='".$_SERVER['REMOTE_ADDR']."' WHERE `id`='$userid'"); $db->Query("UPDATE `[players]` SET `last_active`='".time()."', `online`='".time()."', `status`='1' WHERE `userid`='".$user['id']."' AND `health`>'0' AND `level`>'0'"); $_SESSION['MZ_LoginData'] = array( 'sid' => $sid, 'userid' => $user['id'], 'password' => $user['pass'] ); header("Location: $orign" . '&sid=' . $sid); exit; } else { $errorMsg = 'Feil innlogging / passord (<a href="'.$config['base_url'].'?side=glemt_pass">glemt passord</a>)'; } } elseif (isset($_POST['do_reg'])) { header('Location: /?side=registrer'); exit; } ?> <div class="logginn_left"></div> <div class="logginn_right"> <?php if ($errorMsg) echo '<p class="error">' . $errorMsg . '</p>';?> <form method="post" action=""> <p class="form_item"> <span class="title">Spillernavn / Epost / Bruker-ID</span><br /> <input type="text" name="login" id="login" value="<?=$_POST['login']?>" /> </p> <p class="form_item"> <span class="title">Passord</span><br /> <input type="password" name="password" value="" /> </p> <div class="hr"></div> <p class="buttons"> <input type="submit" class="first" name="do_login" value="Logg inn" /> <input type="submit" name="do_reg" value="Registrer deg" /> </p> </form> </div> <div class="clear"></div> <?php } elseif ($side == 'registrer') { if (isset($_GET['fb']) && false) { ?> <h1>Registrer deg med Facebook<span style="float: right; margin-right: 20px;"><a href="<?=$config['base_url']?>?side=logginn">Logg inn</a></span></h1> <div class="hr"></div> <?php if ($facebook_cookie && !empty($facebook_user->email)) { if (isset($_POST['reg_name'])) { $name = trim($db->EscapeString($_POST['reg_name'])); $name_validated = Accessories::ValidatePlayername($name); $pass = $db->EscapeString($_POST['reg_pass']); $pass_re = $db->EscapeString($_POST['reg_pass_re']); $mail = $db->EscapeString($facebook_user->email); if (!preg_match("/^[a-zA-Z_\\-][\\w\\.\\-_]*[a-zA-Z0-9_\\-]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/i", $mail)) { $errorMsg = 'Ugyldig e-post adresse. ' . $mail; } elseif ($pass !== $pass_re) { $errorMsg = 'Passordene var ikke like'; } elseif (!View::ValidPassword($pass)) { $errorMsg = 'Ugyldig passord'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `[users]` WHERE `email`='".$mail."'")) > 0) { $errorMsg = 'E-posten er allerede i bruk'; } elseif ($name_validated == false) { $errorMsg = 'Ugyldig spillernavn'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `[players]` WHERE `name`='".$name."'")) > 0) { $errorMsg = 'Spillernavnet er opptatt'; } elseif (!isset($_POST['betingelser'])) { $errorMsg = 'Du må godta regelverket'; } else { $db->Query("UPDATE `temporary` SET `active`='0' WHERE `id`='".$last_temp['id']."'"); $db->Query("INSERT INTO `[users]` (`email`, `reg_time`, `IP_regged_with`, `hasPlayer`, `enlisted_by`, `online`, `last_active`, `IP_last`, `register_source`)VALUES('".$mail."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '1', '".($extra['enlist'])."', '".time()."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', 'facebook:".$db->EscapeString($facebook_user->name)."')"); $userID = mysql_insert_id(); $saltPass = View::DoubleSalt($pass, $userID); $db->Query("UPDATE `[users]` SET `pass`='".$saltPass."' WHERE `id`='".$userID."'"); $db->Query("INSERT INTO `[players]` (`userid`, `name`, `IP_created_with`, `created`, `cash`, `bank`, `live`, `profileimage`, `online`, `last_active`, `status`)VALUES('".$userID."', '".$name_validated."', '".$_SERVER['REMOTE_ADDR']."', '".time()."', '".$config['player_default_money']['cash']."', '".$config['player_default_money']['bank']."', '".array_rand($config['places'])."', '".$config['default_profileimage']."', '".time()."', '".time()."', '1')"); $db->Query("INSERT INTO `[sessions]` (`Userid`, `Time_start`, `Last_updated`, `IP`, `User_agent`)VALUES('".$userID."', '".time()."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_USER_AGENT']."')"); $sid = mysql_insert_id(); $_SESSION['MZ_LoginData'] = array( 'userid' => $userID, 'sid' => $sid, 'password' => $saltPass ); View::Message('Gratulerer! Du har fått en bruker på Mafiazone!<br /><br />Trenger du hjelp for å komme i gang?<br />Sjekk <a href="/game/?side=faq">FAQ-en</a>, finner du ikke hjelp der, kan du spørre på <a href="/game/?side=support">support</a>.<br /><br />Lykke til!', 1, true, '/game/?side=faq'); } } ?> <form method="post" action="" style="width: 300px;"> <?php if($successMsg) echo '<p class="yellow" style="margin: 0; font-size: 12px;">' . $successMsg . '</p>';?> <?php if($errorMsg) echo '<p class="red" style="margin: 0; font-size: 12px;">' . $errorMsg . '</p>';?> <dl class="dd_right" style="margin: 5px 0 0 0;"> <dt>Spillernavn</dt> <dd><input type="text" name="reg_name" value="<?=trim($_POST['reg_name'])?>" /></dd> <dt>Passord</dt> <dd><input type="password" name="reg_pass" value="" /></dd> <dt>Gjenta passord</dt> <dd><input type="password" name="reg_pass_re" value="" /></dd> </dl> <div class="clear"></div> <input type="checkbox" name="betingelser" id="betingelser" /><label for="betingelser">Jeg har lest og godtar <a href="<?=$config['base_url']?>regelverk.php" target="_blank">regelverket</a>.</label> <p style="margin: 0; padding-top: 10px; text-align: center;"> <input type="submit" value="Fullfør registrering" /> </p> </form> <?php } else { echo '<div style="margin: 20px; font-size: 14px;"><p>Logg inn for å registrere deg med Facebook:</p> <p><fb:login-button perms="email"></fb:login-button></p></div>'; } ?> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({appId: '<?= FACEBOOK_APP_ID ?>', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.login', function(response) { window.location.href = window.location.href; }); </script> <?php } else { $steps = array( 1, 2 ); $step = $_GET['steg']; if (!in_array($step, $steps)) { $step = $steps[0]; } if ($step == 2 && !empty($_GET['v'])) { $last_temp = $db->EscapeString($_GET['v']); $sql = $db->Query("SELECT id,time_added,expires,extra FROM `temporary` WHERE `id`='".$last_temp."' AND `active`='1' AND `area`='register'"); $last_temp = $db->FetchArray($sql); $lt_expire = $last_temp['time_added']+$last_temp['expires'] - time(); if ($lt_expire <= 0) { $db->Query("UPDATE `temporary` SET `active`='0' WHERE `id`='".$last_temp['id']."'"); unset($last_temp); } if ($last_temp['id'] == '') { header('Location: /?side=registrer&steg=1'); exit; } $extra = unserialize($last_temp['extra']); if (isset($_POST['reg_name'])) { $name = trim($db->EscapeString($_POST['reg_name'])); $name_validated = Accessories::ValidatePlayername($name); $pass = $db->EscapeString($_POST['reg_pass']); $pass_re = $db->EscapeString($_POST['reg_pass_re']); if ($pass !== $pass_re) { $errorMsg = 'Passordene var ikke like'; } elseif (!View::ValidPassword($pass)) { $errorMsg = 'Ugyldig passord'; } elseif ($name_validated == false) { $errorMsg = 'Ugyldig spillernavn'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `[players]` WHERE `name`='".$name."'")) > 0) { $errorMsg = 'Spillernavnet er opptatt'; } elseif (!isset($_POST['betingelser'])) { $errorMsg = 'Du må godta regelverket'; } else { $db->Query("UPDATE `temporary` SET `active`='0' WHERE `id`='".$last_temp['id']."'"); $db->Query("INSERT INTO `[users]` (`email`, `reg_time`, `IP_regged_with`, `hasPlayer`, `enlisted_by`, `online`, `last_active`, `IP_last`, `register_source`)VALUES('".$extra['mail']."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '1', '".($extra['enlist'])."', '".time()."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', 'default')"); $userID = mysql_insert_id(); $saltPass = View::DoubleSalt($pass, $userID); $db->Query("UPDATE `[users]` SET `pass`='".$saltPass."' WHERE `id`='".$userID."'"); $db->Query("INSERT INTO `[players]` (`userid`, `name`, `IP_created_with`, `created`, `cash`, `bank`, `live`, `profileimage`, `online`, `last_active`, `status`)VALUES('".$userID."', '".$name_validated."', '".$_SERVER['REMOTE_ADDR']."', '".time()."', '".$config['player_default_money']['cash']."', '".$config['player_default_money']['bank']."', '".array_rand($config['places'])."', '".$config['default_profileimage']."', '".time()."', '".time()."', '1')"); $db->Query("INSERT INTO `[sessions]` (`Userid`, `Time_start`, `Last_updated`, `IP`, `User_agent`)VALUES('".$userID."', '".time()."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_USER_AGENT']."')"); $sid = mysql_insert_id(); $_SESSION['MZ_LoginData'] = array( 'userid' => $userID, 'sid' => $sid, 'password' => $saltPass ); View::Message('Gratulerer! Du har fått en bruker på Mafiazone!<br /><br />Trenger du hjelp for å komme i gang?<br />Sjekk <a href="/game/?side=faq">FAQ-en</a>, finner du ikke hjelp der, kan du spørre på <a href="/game/?side=support">support</a>.<br /><br />Lykke til!', 1, true, '/game/?side=faq'); } } ?> <form method="post" action="" style="width: 300px;"> <?php if($successMsg) echo '<p class="yellow" style="margin: 0; font-size: 12px;">' . $successMsg . '</p>';?> <?php if($errorMsg) echo '<p class="red" style="margin: 0; font-size: 12px;">' . $errorMsg . '</p>';?> <dl class="dd_right" style="margin: 5px 0 0 0;"> <dt>Spillernavn</dt> <dd><input type="text" name="reg_name" value="<?=trim($_POST['reg_name'])?>" /></dd> <dt>Passord</dt> <dd><input type="password" name="reg_pass" value="" /></dd> <dt>Gjenta passord</dt> <dd><input type="password" name="reg_pass_re" value="" /></dd> </dl> <div class="clear"></div> <input type="checkbox" name="betingelser" id="betingelser" /><label for="betingelser">Jeg har lest og godtar <a href="<?=$config['base_url']?>regelverk.php" target="_blank">regelverket</a>.</label> <p style="margin: 0; padding-top: 10px; text-align: center;"> <input type="submit" value="Fullfør registrering" /> </p> </form> <?php } else { if (isset($_POST['reg_mail'])) { $mail = trim($db->EscapeString($_POST['reg_mail'])); $mail_re = trim($db->EscapeString($_POST['reg_mail_re'])); if (!preg_match("/^[a-zA-Z_\\-][\\w\\.\\-_]*[a-zA-Z0-9_\\-]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/i", $mail)) { $errorMsg = 'Ugyldig epost-adresse'; } elseif ($mail !== $mail_re) { $errorMsg = 'Epost-adressene var ikke like'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `[users]` WHERE `email`='".$mail."' LIMIT 1")) > 0) { $errorMsg = 'Epost-adressen er opptatt'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `temporary` WHERE `playerid`='".$mail."' AND `active`='1' AND `area`='register' AND `time_added`+`expires`>'".time()."' LIMIT 1")) > 0) { $errorMsg = 'Det har allerede blitt sendt en verifiseringskode'; } else { $extra = array( 'mail' => $mail, 'enlist' => isset($_GET['e']) ? $db->EscapeString($_GET['e']) : 0 ); $tempID = substr(sha1(uniqid(rand())), 0, 6); $db->Query("INSERT INTO `temporary` (`id`, `playerid`, `area`, `expires`, `time_added`, `extra`)VALUES('".$tempID."', '".$mail."', 'register', '3600', '".time()."', '".serialize($extra)."')"); mail($mail, 'Mafiazone » Registrering', '<html> <body style="font-family: Verdana; color: #333333; font-size: 12px;"> <table style="width: 300px; margin: 0px auto;"> <tr style="text-align: center;"> <td style="border-bottom: solid 1px #cccccc;"><h1 style="margin: 0; font-size: 20px;"><a href="'.$config['base_url'].'">Mafiazone.biz</a></h1><h2 style="text-align: right; font-size: 14px; margin: 7px 0 10px 0;">« Registrering</h2></td> </tr> <tr style="text-align: justify;"> <td style="padding-top: 15px; padding-bottom: 15px;"> Hei, <br /> <br /> For å få en bruker på Mafiazone, åpne følgende lenke i nettleseren din:<br /> <a href="'.$config['base_url'].'?side=registrer&steg=2&v='.$tempID.'">'.$config['base_url'].'?side=registrer&steg=2&v='.$tempID.'</a> <br /> Linken er aktiv til <b>'.View::Time(time()+3600, true).'</b>. Du må bruke linken før denne tiden! </td> </tr> <tr style="text-align: right; color: #777777;"> <td style="padding-top: 10px; border-top: solid 1px #cccccc;"> Med vennlig hilsen <br> <span style="color: #222222;">Mafiazone ledelsen</span> </td> </tr> </table> </body> </html>', "Reply-To: Mafiazone <[email protected]>\r\n" . "Return-Path: Mafiazone <[email protected]>\r\n" . "To: ".$mail." <".$mail.">\r\n" . "From: Mafiazone <[email protected]>\r\n" . "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=iso-8859-1"); $successMsg = 'Det har blitt sendt en epost til epost-adressen'; } } ?> <h1>Registrer deg på Mafiazone<!-- (<a href="/?side=registrer&fb">bruk <img src="/img/facebook_reg.png" style="margin-bottom: -5px;" alt="Facebook" /></a>)--><span style="float: right; margin-right: 20px;"><a href="<?=$config['base_url']?>?side=logginn">Logg inn</a></span></h1> <div class="hr"></div> <form method="post" action=""> <?php if($successMsg) echo '<p class="yellow" style="margin: 0; font-size: 12px;">' . $successMsg . '</p>';?> <?php if($errorMsg) echo '<p class="red" style="margin: 0; font-size: 12px;">' . $errorMsg . '</p>';?> <dl class="dd_right"> <dt>Epost-adresse</dt> <dd><input type="text" name="reg_mail" value="<?=$_POST['reg_mail']?>" /></dd> <dt>Gjenta epost-adresse</dt> <dd><input type="text" name="reg_mail_re" value="" /></dd> </dl> <p style="clear: both; margin: 0; padding-top: 15px; text-align: center;"> <input type="submit" value="Neste steg" /> </p> </form> <?php } } } elseif ($side == 'glemt_pass') { echo '<h1>Glemt passord<span style="float: right; margin-right: 20px;"><a href="'.$config['base_url'].'?side=logginn">Logg inn</a></span></h1>'; $last_temp = $db->EscapeString($_GET['v']); $sql = $db->Query("SELECT id,time_added,expires,extra FROM `temporary` WHERE `id`='".$last_temp."' AND `active`='1' AND `area`='forgot_pass'"); $last_temp = $db->FetchArray($sql); $lt_expire = $last_temp['time_added']+$last_temp['expires'] - time(); if ($lt_expire <= 0) { $db->Query("UPDATE `temporary` SET `active`='0' WHERE `id`='".$last_temp['id']."'"); unset($last_temp); } if ($last_temp['id'] == '') { if (isset($_POST['fp_mail'])) { $mail = $db->EscapeString(trim($_POST['fp_mail'])); $sql = $db->Query("SELECT id,email FROM `[users]` WHERE `email`='".$mail."'"); $user = $db->FetchArray($sql); if ($user['id'] == '') { $errorMsg = 'Fant ingen brukere med den epost-adressen'; } elseif ($db->GetNumRows($db->Query("SELECT id FROM `temporary` WHERE `playerid`='".$mail."' AND `active`='1' AND `area`='forgot_pass' AND `time_added`+`expires`>'".time()."' LIMIT 1")) > 0) { $errorMsg = 'Det har allerede blitt sendt en verifiseringskode'; } else { $extra = array( 'mail' => $user['email'] ); $tempID = substr(sha1(uniqid(rand())), 0, 6); $db->Query("INSERT INTO `temporary` (`id`, `playerid`, `area`, `expires`, `time_added`, `extra`)VALUES('".$tempID."', '".$user['email']."', 'forgot_pass', '3600', '".time()."', '".serialize($extra)."')"); mail($user['email'], 'Mafiazone » Glemt passord', '<html> <body style="font-family: Verdana; color: #333333; font-size: 12px;"> <table style="width: 300px; margin: 0px auto;"> <tr style="text-align: center;"> <td style="border-bottom: solid 1px #cccccc;"><h1 style="margin: 0; font-size: 20px;"><a href="'.$config['base_url'].'">Mafiazone.biz</a></h1><h2 style="text-align: right; font-size: 14px; margin: 7px 0 10px 0;">« Registrering</h2></td> </tr> <tr style="text-align: justify;"> <td style="padding-top: 15px; padding-bottom: 15px;"> Hei, <br /> <br /> En person fra IP-adressen '.$_SERVER['REMOTE_ADDR'].' har bedt om nytt passord til brukeren din på Mafiazone.no <br /> <br /> Åpne denne linken for å få et nytt passord:<br /> <a href="'.$config['base_url'].'?side=glemt_pass&v='.$tempID.'">'.$config['base_url'].'?side=glemt_pass&v='.$tempID.'</a><br /> <br /> Linken er aktiv til <b>'.View::Time(time()+3600, true).'</b>. Du må bruke linken før denne tiden! </td> </tr> <tr style="text-align: right; color: #777777;"> <td style="padding-top: 10px; border-top: solid 1px #cccccc;"> Med vennlig hilsen <br /> <span style="color: #222222;">Mafiazone ledelsen</span> </td> </tr> </table> </body> </html>', "Reply-To: Mafiazone <[email protected]>\r\n" . "Return-Path: Mafiazone <[email protected]>\r\n" . "To: ".$user['email']." <".$user['email'].">\r\n" . "From: Mafiazone <[email protected]>\r\n" . "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=iso-8859-1"); $successMsg = 'Det har blitt sendt en epost til epost-adressen'; } } ?> <div class="hr"></div> <form method="post" action=""> <?php if($successMsg) echo '<p class="yellow" style="margin: 0; font-size: 12px;">' . $successMsg . '</p>';?> <?php if($errorMsg) echo '<p class="red" style="margin: 0; font-size: 12px;">' . $errorMsg . '</p>';?> <dl class="dd_right"> <dt>Epost-adresse</dt> <dd><input type="text" name="fp_mail" value="<?=$_POST['fp_mail']?>" /></dd> </dl> <p style="clear: both; margin: 0; padding-top: 15px; text-align: center;"> <input type="submit" value="Neste steg" /> </p> </form> <?php } else { $extra = unserialize($last_temp['extra']); if (isset($_POST['new_pass'])) { $sql = $db->Query("SELECT id FROM `[users]` WHERE `email`='".$extra['mail']."'"); $user = $db->FetchArray($sql); $pass = View::DoubleSalt($db->EscapeString($_POST['new_pass']), $user['id']); $pass_re = View::DoubleSalt($db->EscapeString($_POST['new_pass_re']), $user['id']); if ($pass !== $pass_re) { $errorMsg = 'Passordene var ikke like'; } elseif (!View::ValidPassword($_POST['new_pass'])) { $errorMsg = 'Ugyldig passord'; } else { $db->Query("UPDATE `temporary` SET `active`='0' WHERE `id`='".$last_temp['id']."'"); $db->Query("UPDATE `[users]` SET `pass`='".$pass."' WHERE `id`='".$user['id']."'"); $successMsg = 'Du har lagret passordet'; } } ?> <div class="hr"></div> <form method="post" action=""> <?php if($successMsg) echo '<p class="yellow" style="margin: 0; font-size: 12px;">' . $successMsg . '</p>';?> <?php if($errorMsg) echo '<p class="red" style="margin: 0; font-size: 12px;">' . $errorMsg . '</p>';?> <dl class="dd_right"> <dt>Nytt passord</dt> <dd><input type="password" name="new_pass" value="" /></dd> <dt>Gjenta passord</dt> <dd><input type="password" name="new_pass_re" value="" /></dd> </dl> <p style="clear: both; margin: 0; padding-top: 15px; text-align: center;"> <input type="submit" value="Lagre passord" /> </p> </form> <?php } } ?> </div> </div> <div class="default_content"> <div id="preview"> <div class="nav"> <a href="#" class="prev"></a> <a href="#" class="next"></a> </div> </div> </div> <div class="clear"></div> </div> <div style="background: #1c1c1c; border: solid 2px #131313; margin: 15px auto; padding: 10px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; opacity: 0.7; filter: alpha(opacity=70);"> <div style="margin: 0px auto; width: 820px;"> <div style="width: 200px; float: left;"> <ul class="mz_menulinks"> <li><a href="<?=$config['base_url']?>">« Logg inn</a></li> <li><a href="<?=$config['base_url']?>?side=registrer">« Registrer deg</a></li> <li><a href="<?=$config['base_url']?>?side=glemt_pass">« Glemt passord</a></li> </ul> </div> <div style="width: 380px; margin-left: 20px; float: left;"> <h3 style="text-align: justify;"><?=$config['meta_description']?></h3> </div> <div style="width: 200px; margin-left: 20px; float: left; text-align: center;"> <!--<h3>Registrer deg med <a href="/?side=registrer&fb"><img src="/img/facebook_reg.png" alt="Facebook" style="margin-bottom: -5px;" /></a></h3> <p><a href="/?side=registrer&fb">Klikk her</a></p>--> </div> <div class="clear"></div> </div> <div style="margin: 15px auto 15px; width: 728px;"> </div> <h3 style="text-align: center;">Internet Explorer kan ødelegge spillopplevelsen, derfor anbefaler vi at du bruker f. eks. <a href="http://www.opera.com/">Opera</a> eller <a href="http://www.google.com/chrome/">Chrome</a>.</h3> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-12469117-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
  6. Parse error: syntax error, unexpected T_VARIABLE in /home/a5245387/public_html/files/leaderboard.php on line 20
  7. Any help are allowed thanks for helping!
  8. I wanna make game with gangs/clans, turns, attack and defence, traveling and much more.
  9. I need how to start and how i can make it.
  10. Ezrpg or Mccodes.
  11. Hello! I am new in php but i wanna make clan/gang script for my game. It must consist a things like a Clan/gang creating.php clan/gang list.php clan/gang manage.php clan/gang join.php Clan/gang joining must be with password. If u create gang u can choice a password.         Sorry for very bad English!:(
  12. I use ezrpg script, i want to do attack and defense. If player set statpoint strength he will get 5 attack and if he set 1 aglity point he will get 5 defense point.
  13. ossukoss

    Little problem

    Thx for helping guys!I try !!!!!
  14. ossukoss

    Little problem

    ok!But where i put this code #Upload max filesize adjustments ini_set('upload_max_filesize', 2097152); #2MB ?
  15. ossukoss

    Little problem

    Where i can find php.ini?
  16. ossukoss

    Little problem

    Im newbie! How i can declare it?
  17. ossukoss

    Little problem

    You may only upload jpg, gif or png files with a 0 bit Maximum.How i can cnahe maximum bit and max characters limit? <?php require_once("lib.php"); define("PAGENAME", "Player Customization"); $player = check_user($secret_key, $db); //from settings table switch($_GET['custom']) { case "avatar": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Avatar Upload</legend>"; $error = 0; //create avatars folder and place this file in it function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } function do_upload($upload_dir, $upload_url,$user) { $temp_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $extension = getExtension($file_name); $extension2 = strtolower($extension); $newfile_name = $user.'.'.$extension2; $file_type = $_FILES['userfile']['type']; $file_size = $_FILES['userfile']['size']; $result = $_FILES['userfile']['error']; $file_url = $upload_url.$newfile_name; $file_path = $upload_dir.$newfile_name; //File Name Check if ( $file_name =="") { $message = "Invalid File Name Specified"; return $message; } //File Type Check if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { echo '<h1>Unknown extension!</h1>'; $errors=1; } //File Size Check else if ( $file_size > $maxavatar) { $message = "The file size is over ".number_format($maxavatar)." bits."; return $message; } $result = move_uploaded_file($temp_name, $file_path); $message = ($result)?"Avatar changed." : "Something is wrong with uploading a file."; return $message; } $site_name = $_SERVER['HTTP_HOST']; $url_dir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); $url_this = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; $upload_dir = "images/avatars/"; $upload_url = $url_dir."images/avatars/"; $message =""; $extension = getExtension($file_name); $extension = strtolower($extension); if ($_FILES['userfile']) { $message = do_upload($upload_dir, $upload_url,$player->id); $query = $db->execute("update `players` set `image`=? where `id`=?", array($player->id.'.'.getExtension($_FILES['userfile']['name']), $player->id)); } else { $message = "<br><center>You may only upload jpg, gif or png files with a ".number_format($maxavatar)." bit Maximum.</center><br>"; } print $message; ?> <form name="upload" id="upload" method="post" ENCTYPE="multipart/form-data" > <p> <p><label for='browse'>Upload Image</label><input type="file" style="width: 300px;" id="userfile" name="userfile"> <p class='submit'><label for='kludge'></label><input type="submit" name="upload" value="Upload"> </form> </p> </fieldset> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; case "namechange": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Name Change</legend>"; $msg1 = "<font color=\"red\">"; //Username error? $error = 0; //Check if username has already been used if ($_POST['newname']) { $query = $db->execute("select username from `players` where `username`=?", array($_POST['newname'])); //Check username if (!$_POST['newname']) { //If username isn't filled in... $msg1 .= "You need to fill in your new username!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newname']) < $minname) { //If username is too short... $msg1 .= "Your username must be longer than ".$minname." characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newname']) > $maxname) { //If username is too short... $msg1 .= "Your username must be shorter than ".$maxname." characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (!preg_match("/^[-_a-zA-Z0-9]+$/", $_POST['newname'])) { //If username contains illegal characters... $msg1 .= "Your username may contain only alphanumerical characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if ($query->recordcount() > 0) { $msg1 .= "That username has already been used.<br />\n"; $error = 1; //Set error check } if ($error == 0) { $query = $db->execute("update `players` set `username`=? where id=?", array($_POST['newname'], $player->id)); if (!$query) { $could_not_change = "Sorry, you could not change your name! Please contact the admin!<br /><br />"; } else { echo "Congratulations, you have changed your name!"; exit; } } } $msg1 .= "</font>"; //Username error? ?> <?=$msg1?> <?=$could_not_change?> <form method="post" action="custom.php?custom=namechange"> <p><label for='newname'>Name</label><input type="text" name="newname" value="<?=$player->username?>" /> <p class='submit'><label for='kludge'></label><input type="submit" value="Change it!"> </form> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; case "sigchange": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Signature Change</legend>"; $msg1 = "<font color=\"red\">"; //Username error? $error = 0; if ($_POST['newsig']) { //Check sig if (!$_POST['newsig']) { //If signature isn't filled in... $msg1 .= "You need to fill in your new signature!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newsig']) < $minsig) { //If signature is too short... $msg1 .= "Your signature must be longer than ".$minsig." characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newsig']) > $maxsig) { //If signature is too short... $msg1 .= "Your signature must be less than ".$maxsig." characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (!preg_match("/^[-_a-zA-Z\s*0-9.?!]+$/", $_POST['newsig'])) { //If signature contains illegal characters... $msg1 .= "Your signature may contains only alphanumerical characters!<br />\n"; //Add to error message $error = 1; //Set error check } if ($error == 0) { $query = $db->execute("update `players` set `sig`=? where id=?", array($_POST['newsig'], $player->id)); if (!$query) { $could_not_change = "Sorry, you could not change your signature! Please contact the admin!<br /><br />"; } else { echo "Congratulations, you have changed your signature!"; exit; } } } $msg1 .= "</font>"; //Username error? ?> <?=$msg1?> <?=$could_not_change?> <form method="post" action="custom.php?custom=sigchange"> <p><label for='newsig'>Signature</label> <textarea name="newsig" cols="40" rows="7" id="newsig"><?=$player->sig?></textarea></p> <p class='submit'><label for='kludge'></label><input type="submit" value="Change it!"> </form> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; case "emailchange": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Email Change</legend>"; $msg1 = "<font color=\"red\">"; //Username error? $error = 0; if ($_POST['newemail']) { //Check if email has already been used $query = $db->execute("select email from `players` where `email`=?", array($_POST['newemail'])); //Check username $regexp="/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; if (!$_POST['newemail']) { //If email isn't filled in... $msg1 .= "You need to fill in your new email!<br />\n"; //Add to error message $error = 1; //Set error check } elseif ( !preg_match($regexp, $_POST['newemail']) ) { $msg1 .= "Your email contains illegal characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newemail']) < 9) { //If username is too short... $msg1 .= "Your email must be longer than 9 characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if ($query->recordcount() > 0) { $msg1 .= "That email has already been used.<br />\n"; $error = 1; //Set error check } if ($error == 0) { $query = $db->execute("update `players` set `email`=? where id=?", array($_POST['newemail'], $player->id)); if (!$query) { $could_not_change = "Sorry, you could not change your email! Please contact the admin!<br /><br />"; } else { echo "Congratulations, you have changed your email!"; exit; } } } $msg1 .= "</font>"; //email error? ?> <?=$msg1?> <?=$could_not_change?> <form method="post" action="custom.php?custom=emailchange"> <p><label for='newname'>Your Email</label><input type="text" style="width:250px;" name="newemail" value="<?=$player->email?>" /> <p class='submit'><label for='kludge'></label><input type="submit" value="Change it!"> </form> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; case "genderchange": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Gender Change</legend>"; if ($_POST['newgender']) { $query = $db->execute("update `players` set `gender`=? where id=?", array($_POST['newgender'], $player->id)); if (!$query) { $could_not_change = "Sorry, you could not change your gender! Please contact the admin!<br /><br />"; } else { echo "Congratulations, you have changed your gender!"; exit; } } ?> <?=$msg1?> <?=$could_not_change?> <form method="post" action="custom.php?custom=genderchange"> <?php echo "<label for='newgender'>Your Gender</label>"; echo "<select name=\"newgender\"><option value=\"Male\""; echo ($player->gender == 'Male')?" selected=\"selected\"":""; echo ">Male</option>"; echo "<option value=\"Female\""; echo ($player->gender == 'Female')?" selected=\"selected\"":""; echo ">Female</option>"; echo "<option value=\"?\""; echo ($player->gender == '?')?" selected=\"selected\"":""; echo ">?</option>"; echo "</select>"; ?> <p class='submit'><label for='kludge'></label><input type="submit" value="Change it!"> </form> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; case "passchange": $player = check_user($secret_key, $db); include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; echo "<fieldset>"; echo "<legend>Password Change</legend>"; $msg1 = "<font color=\"red\">"; //Username error? $error = 0; if ($_POST['newpass']) { if (!$_POST['newpass']) { //If pass isn't filled in... $msg1 .= "You need to fill in your new Password!<br />\n"; //Add to error message $error = 1; //Set error check } else if (strlen($_POST['newpass']) < 6) { //If username is too short... $msg1 .= "Your Password must be longer than 3 characters!<br />\n"; //Add to error message $error = 1; //Set error check } else if (!preg_match("/^[-_a-zA-Z0-9]+$/", $_POST['newpass'])) { //If username contains illegal characters... $msg1 .= "Your Password may contain only alphanumerical characters!<br />\n"; //Add to error message $error = 1; //Set error check } if ($error == 0) { $newpass=sha1($_POST['newpass']); $query = $db->execute("update `players` set `password`=? where id=?", array($newpass, $player->id)); if (!$query) { echo "Sorry, you could not change your name! Please contact the admin!<br /><br />"; exit; } else { echo "Congratulations, you have changed your Password!"; exit; } } } $msg1 .= "</font>"; //Username error? ?> <?=$msg1?> <?=$could_not_change?> <form method="post" action="custom.php?custom=passchange"> <p><label for='newname'>New Password</label><input type="password" name="newpass" value="" /> <p class='submit'><label for='kludge'></label><input type="submit" value="Change it!"> </form> <?php include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; default: include_once("templates/themes/" . $setting->theme . "/private_header.php"); echo "<fieldset>"; echo "<legend><b>Player Customization</b></legend>"; echo "<center><br /><input type='button' VALUE='Change Avatar' ONCLICK=\"window.location.href='custom.php?custom=avatar'\">"; echo "<input type='button' VALUE='Change Name' ONCLICK=\"window.location.href='custom.php?custom=namechange'\">"; echo "<input type='button' VALUE='Change Password' ONCLICK=\"window.location.href='custom.php?custom=passchange'\"><br /><br />"; echo "<input type='button' VALUE='Change Email' ONCLICK=\"window.location.href='custom.php?custom=emailchange'\">"; echo "<input type='button' VALUE='Change Signature' ONCLICK=\"window.location.href='custom.php?custom=sigchange'\">"; echo "<input type='button' VALUE='Change Gender' ONCLICK=\"window.location.href='custom.php?custom=genderchange'\"></center>"; echo "<br>"; echo "</fieldset><br /><br />"; include_once("templates/themes/" . $setting->theme . "/private_footer.php"); break; } ?>
  18. ossukoss

    Need help!

      i tryed this but it isint work :(
  19. ossukoss

    Need help!

    Thanks!Im newbie, but i try :D
  20. ossukoss

    Need help!

    Fatal error: Call to a member function fetchrow() on a non-object in /home/a1448143/public_html/market.php on line 89     <?php /****************************************/ /* ezRPG script */ /* Written by Zeggy */ /* http://code.google.com/p/ezrpg */ /* http://www.bbgamezone.com/ */ /* Mod: market.php */ /* Written by MasterTester */ /* http://www.yourcounty4sale.com/king/ */ /****************************************/ include("lib.php"); define("PAGENAME", "Turg"); $player = check_user($secret_key, $db); $limit = (!$_GET['limit'])?30:intval($_GET['limit']); //Use user-selected limit of players to list $begin = (!$_GET['begin'])?$player->id-intval($limit / 2):intval($_GET['begin']); //List players with the current player in the middle of the list $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $total_items = $db->getone("select count(market_id) as `count` from `market`"); $begin = ($begin >= $total_items)?$total_items - $limit:$begin; //Can't list players don't don't exist yet either $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $lastpage = (($total_items - $limit) < 0)?0:$total_items - $limit; //Get the starting point if the user has browsed to the last page $order=$_GET['order']; $abc=$_GET['abc']; if($order=="item"){$orderby="item_name";} elseif($order=="price"){$orderby="price";} elseif($order=="qty"){$orderby="qty";} elseif($order=="cost"){$orderby="total_cost";} elseif($order=="seller"){$orderby="seller";} else{$orderby="item_id"; $abc="asc";} switch($_GET['act']) { case "remove": { $market_id=$_GET['item']; include("templates/private_header.php"); echo "Oled sa kindel? Sa tahad võtta ära oma asjad.<br /><br />"; echo "<a href=\"market.php?act=confirm&item=" . $market_id . "\"><b>Jah</b></a> <a href=\"market.php\"><b>EI</b></a>"; include("templates/private_footer.php"); break; } case "confirm": { $market_id=$_GET['item']; //marks item as sold instead of deleting it all together. $query_sold=$db->execute("update `market` set `sold`=? where `market_id`=?", array(t, $market_id)); include("templates/private_header.php"); echo "Sinu asjad eemaldati.<br /><br />"; echo "<a href=\"market.php\"><b>Tagasi turule</b></a>"; include("templates/private_footer.php"); break; } Default: include("templates/private_header.php"); ?> <a href="market.php?begin=<?=($begin - $limit)?>&limit=<?=$limit?>">Previous Page</a> | <a href="market.php?begin=<?=($begin + $limit)?>&limit=<?=$limit?>">Next Page</a> <br /><br /> Näita <a href="market.php?begin=<?=$begin?>&limit=5">5</a> | <a href="market.php?begin=<?=$begin?>&limit=10">10</a> | <a href="market.php?begin=<?=$begin?>&limit=20">20</a> | <a href="market.php?begin=<?=$begin?>&limit=30">30</a> | <a href="market.php?begin=<?=$begin?>&limit=40">40</a> | <a href="market.php?begin=<?=$begin?>&limit=50">50</a> | <a href="market.php?begin=<?=$begin?>&limit=100">100</a> asja lehel. <br /><br /> <a href="market_sell.php">Müü oma asju.</a> <br /><br /> <table width="100%" border="0"> <tr> <th><b><a href="market.php?order=item&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Asi</a></b></td> <th><b><a href="market.php?order=price&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Ühe hind</a></b></td> <th><b><a href="market.php?order=qty&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Tk</a></b></td> <th><b><a href="market.php?order=cost&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Hind kokku</a></b></td> <th><b><a href="market.php?order=seller&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Müüja</a></b></td> <th><b>Tegevused</b></td> </tr> <?php //Query the market db $query_market = $db->execute("select `market_id`, `item_id`, `item_name`, `qty`, `price`, `total_cost`,`seller_id`,`seller`, `sold` from `market` where `sold`='f' order by $orderby $abc limit ?,?", array($begin, $limit)); while($market = $query_market->fetchrow()) { echo "<tr>\n"; echo "<td>" . $market['item_name'] . "</td>"; echo "<td>" . $market['price'] . "</td>"; echo "<td>" . $market['qty'] . "</td>"; echo "<td>" . $market['total_cost'] . "</td>"; echo "<td>" . $market['seller'] . "</td>"; if($market['seller']==$player->username){ echo "</td><td><a href=\"market.php?act=remove&item=" . $market['market_id'] . "\">Eemalda</a></td>\n"; }else{ echo "</td><td><a href=\"market_buy.php?act=buy&item=" . $market['market_id'] . "\">Osta</a></td>\n"; } } ?> </table> <?php include("templates/private_footer.php"); } ?>
  21. ossukoss

    Need help!

    Thx guys!It was helpful!
  22. ossukoss

    Need help!

    <?php if(file_exist("config.php")) { include("config.php"); } else { ### UPDATE IF USING v1 ### $_CONFIG['username'] = ""; $_CONFIG['password'] = ""; $_CONFIG['database'] = ""; } mysql_connect('',$_CONFIG['username'],$_CONFIG['password']); mysql_select_db($_CONFIG['database']); if($_POST['email']) { $_POST['email'] = htmlentities($_POST['email']); $_POST['username'] = htmlentities($_POST['username']); if($_GET['username']) { $search_users = mysql_query("SELECT * FROM users WHERE login_name='".$_POST['username']."'") or die(mysql_error()); if(mysql_num_rows($search_users) == 0) { echo 'There is no user\'s with that login name.'; exit; } } $search_email = mysql_query("SELECT * FROM users WHERE email='".$_POST['email']."'") or die(mysql_error()); if(mysql_num_rows($search_email) == 0) { echo 'No user\'s with this email.'; exit; } $password = rand(10000,20000); $fetch_data = mysql_fetch_assoc($search_email); $username = $fetch_data['username']; $body = "Welcome to Rapid - Riot automated email.\n\nYour password is: ".$password."\nYour login name is: ".$fetch_data['login_name']."\n\nPlease login at <a href="http://www.rapid-riot.com" target="_blank">"; $subject = "Your Forgotten Password"; $email = $fetch_data['email']; $from = "From: Rapid - Riot Automated Email <[email protected]>"; mail($email, $subject, $body, $from); mysql_query("UPDATE users SET userpass='".md5($password)."' WHERE login_name='".$_POST['username']."' AND email='".$_POST['email']."'") or die(mysql_error()); echo 'Mail has been sent. Please check your spam box also.'; exit; } echo '<form action="?act=FPass" method="post"> Email: <input type="text" name="email"> Login Name: <input type="text" name="username"> <input type="submit" value="Submit"> </form>'; ?>   Parse error: syntax error, unexpected T_STRING in /home/a1448143/public_html/forgot.php on line 38
  23. Lol! i deleted footer.php file :D Thx for help guys!
  24. I have both scripts!
  25. Lol how? Please help!
×
×
  • Create New...