Jump to content
MakeWebGames

Cronic

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by Cronic

  1. Getting this error once logged in, Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2777 Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2791 Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2777 Warning: Illegal string offset 'link' in [path]/includes/class_bbcode.php on line 2791
  2. ini_set("display_errors",1);   Put that in your database connection file?
  3. Register Important Message Thank you for signing up with Mafias Finest, We have sent an email to verify your account. Redirecting to login page in 5 seconds. Thats the third game name I see now, I lol'd. Definitely a copy of some game.
  4. $row['postid'] is the current forum post id they are trying to delete. :)
  5. Thanks Ian! Haven't thought of that. It does work now, thank you for your help. :D
  6. Hi everyone, I'm trying to get a confirm message to delete a forum post / thread into my game. Here's the code:   if(isset($_POST['delete'])) { if(isset($_POST['deleteconfirm']) != "agree"){ echo Message("<div>You haven't agreed to delete the forum post.</div>"); include 'footer.php'; die(); } $result1 = mysql_query("SELECT * FROM `freplies` WHERE `postid` = '".$_POST['postid']."'"); $worked = mysql_fetch_array($result1); $result = mysql_query("DELETE FROM `freplies` WHERE `postid` = '".$_POST['postid']."'"); echo Message("The selected post was deleted."); StaffLog($user_class->id, "[-_USERID_-] has deleted a post. Post by: [-_USERID2_-]. <a href='viewpost.php?id=".$_GET['id']."' target='_blank'>View Topic</a>.", $worked['playerid']); }   // Display the forum post & delete link: if ($user_class->admin == 1 || $user_class->gm ==1 || $user_class->fm ==1) { ?><form method="post"><input type="hidden" name="postid" value="<?php echo $row['postid']; ?>" /><input type="submit" name="delete" value="Delete Post" /></form><font size="-9px">Confirm Delete</font> <input type="checkbox" name='deleteconfirm' value="agree" /><?php } ?>   But it keeps saying that I haven't confirmed it whilist I have selected it to delete, Does anyone know what i'm doing wrong? Any help is much appreciated.:D
  7. Website is down for me. No downtime huh??
  8. Lmao, well said:rolleyes:
  9. Try this please.   <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: staff.php * Signature: 740ee1855cec0570ee80fddac656162b * Date: Fri, 20 Apr 12 08:50:30 +0000 */ require_once('sglobals.php'); if (!isset($_GET['action'])) { $_GET['action'] = 'index'; } switch ($_GET['action']) { case 'basicset': basicsettings(); break; case 'announce': announcements(); break; case 'staffaps': staffaps(); break; case 'lstaffaps': lstaffaps(); break; default: index(); break; } function basicsettings() { global $db, $ir, $c, $h, $userid, $set; if ($ir['user_level'] != 2) { echo 'You cannot access this area. > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $_POST['game_name'] = (isset($_POST['game_name']) && preg_match( "/^[a-z0-9_.]+([\\s]{1}[a-z0-9_.]|[a-z0-9_.])+$/i", $_POST['game_name'])) ? $db->escape( strip_tags(stripslashes($_POST['game_name']))) : ''; $_POST['game_owner'] = (isset($_POST['game_owner']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['game_owner'])) ? $db->escape( strip_tags(stripslashes($_POST['game_owner']))) : ''; $_POST['game_description'] = (isset($_POST['game_description'])) ? $db->escape( strip_tags( stripslashes($_POST['game_description']))) : ''; $_POST['paypal'] = (isset($_POST['paypal']) && filter_input(INPUT_POST, 'paypal', FILTER_VALIDATE_EMAIL)) ? $db->escape(stripslashes($_POST['paypal'])) : ''; $_POST['ct_refillprice'] = (isset($_POST['ct_refillprice']) && is_numeric($_POST['ct_refillprice'])) ? abs(intval($_POST['ct_refillprice'])) : ''; $_POST['ct_iqpercrys'] = (isset($_POST['ct_iqpercrys']) && is_numeric($_POST['ct_iqpercrys'])) ? abs(intval($_POST['ct_iqpercrys'])) : ''; $_POST['ct_moneypercrys'] = (isset($_POST['ct_moneypercrys']) && is_numeric($_POST['ct_moneypercrys'])) ? abs(intval($_POST['ct_moneypercrys'])) : ''; $_POST['willp_item'] = (isset($_POST['willp_item']) && is_numeric($_POST['willp_item'])) ? abs(intval($_POST['willp_item'])) : ''; $_POST['validate_on'] = (isset($_POST['validate_on']) && in_array($_POST['validate_on'], array('1', '0'), true)) ? $_POST['validate_on'] : FALSE; $_POST['validate_period'] = (isset($_POST['validate_period']) && in_array($_POST['validate_period'], array('5', '15', '60', 'login'), true)) ? $_POST['validate_period'] : FALSE; $_POST['regcap_on'] = (isset($_POST['regcap_on']) && in_array($_POST['regcap_on'], array('1', '0'), true)) ? $_POST['regcap_on'] : FALSE; $_POST['sendcrys_on'] = (isset($_POST['sendcrys_on']) && in_array($_POST['sendcrys_on'], array('1', '0'), true)) ? $_POST['sendcrys_on'] : FALSE; $_POST['sendbank_on'] = (isset($_POST['sendbank_on']) && in_array($_POST['sendbank_on'], array('1', '0'), true)) ? $_POST['sendbank_on'] : FALSE; if (empty($_POST['game_name']) || empty($_POST['game_owner']) || empty($_POST['game_description']) || empty($_POST['paypal']) || empty($_POST['ct_refillprice']) || empty($_POST['ct_iqpercrys']) || empty($_POST['ct_moneypercrys']) || is_bool($_POST['validate_on']) || is_bool($_POST['validate_period']) || is_bool($_POST['regcap_on']) || is_bool($_POST['sendcrys_on']) || is_bool($_POST['sendbank_on'])) { $csrf = request_csrf_html('staff_basicset'); echo " <h3>Basic Settings</h3> <hr /> <form action='staff.php?action=basicset' method='post'> Game Name: <input type='text' name='game_name' value='{$set['game_name']}' /> Game Owner: <input type='text' name='game_owner' value='{$set['game_owner']}' /> Game Description: <textarea rows='7' cols='50' name='game_description'>{$set['game_description']}</textarea> Paypal Address: <input type='text' name='paypal' value='{$set['paypal']}' /> Gym/Crimes Validation: <select name='validate_on' type='dropdown'> "; $opt = array("1" => "On", "0" => "Off"); foreach ($opt as $k => $v) { echo ($k == $set['validate_on']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } echo " </select> Validation Period: <select name='validate_period' type='dropdown'>"; $opt = array("5" => "Every 5 Minutes", "15" => "Every 15 Minutes", "60" => "Every Hour", "login" => "Every Login"); foreach ($opt as $k => $v) { echo ($k == $set['validate_period']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } echo " </select> Registration CAPTCHA: <select name='regcap_on' type='dropdown'>"; $opt = array("1" => "On", "0" => "Off"); foreach ($opt as $k => $v) { echo ($k == $set['regcap_on']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } echo " </select> Send Crystals: <select name='sendcrys_on' type='dropdown'>"; $opt = array("1" => "On", "0" => "Off"); foreach ($opt as $k => $v) { echo ($k == $set['sendcrys_on']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } echo " </select> Bank Transfers: <select name='sendbank_on' type='dropdown'>"; $opt = array("1" => "On", "0" => "Off"); foreach ($opt as $k => $v) { echo ($k == $set['sendbank_on']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } echo " </select> Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per crystal: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> Will Potion Item: " . item_dropdown(NULL, "willp_item", $set['willp_item']) . " {$csrf} <input type='submit' value='Update Settings' /> </form> "; } else { staff_csrf_stdverify('staff_basicset', 'staff.php?action=basicset'); unset($_POST['verf']); if (!empty($_POST['willp_item'])) { $qi = $db->query( 'SELECT `itmid` FROM `items` WHERE `itmid` = ' . $_POST['willp_item']); if ($db->num_rows($qi) == 0) { echo ' The item you tried to input doesn\'t seem to be a real item. > <a href="staff.php?action=basicset">Go Back</a> '; die($h->endpage()); } } else { $_POST['willp_item'] = 0; echo 'Please remember to make a will potion item and set it'; } foreach ($_POST as $k => $v) { $db->query( "UPDATE `settings` SET `conf_value` = '$v' WHERE `conf_name` = '$k'"); } echo ' Settings updated! > <a href="staff.php?action=basicset">Go Back</a> '; stafflog_add("Updated the basic game settings"); } } function announcements() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { echo '<font color="#FF0000>403 - Unauthorized Access</font>'; $h->endpage(); exit; } if($_POST['TITLE']) { if(strlen($_POST['TITLE']) < 5) { echo 'Sorry, the annoucement title is too short. <a href="staff_annouce.php?addannouce">Go Home</a>"; $h->endpage(); exit;'; } $AddAnnouce = sprintf("INSERT INTO mod_announcements (`annouce_NAME`, `annouce_TEXT`, `annouce_TIME`, `annouce_URGENCY`, `annouce_TOPIC`, `annouce_POSTED`)VALUES ('{$_POST['TITLE']}', '{$_POST['TEXT']}', unix_timestamp(), '{$_POST['URGENCY']}', '{$_POST['TOPIC']}', '{$_POST['POSTED']}')"); $db->query ($AddAnnouce); $db->query("UPDATE users SET `new_announcements` = `new_announcements` + 1"); echo 'Announcement added! <a href="announcements.php">Go Home</a>"; stafflog_add("Posted A New Annoucement"); $h->endpage(); exit; } else { echo "<hr width=70%>Adding an announcement...</hr> <hr width=70%>Please try to make sure the announcement is concise and covers everything you want it to. <form action="staff.php?action=announce" method="post"></hr> Announcement Title: <input type="text" name="TITLE"> <hr width=70%>Announcement Text:</hr> <center><hr width=70%><textarea name="TEXT" rows="10" cols="60"></textarea></hr></center> <hr width=70%>Announcement Urgency:</hr> <select name="URGENCY" type="dropdown"> <option value="No Urgency">No Urgency</option> <option value="Low">Low</option> <option value="Medium">Medium</option> <option value="High">High</option> <option value="Urgent">Urgent</option> </select> <hr width=70%>Announcement Topic:</hr> <select name="TOPIC" type="dropdown"> <option value="Updates">Updates</option> <option value="General News">General News</option> <option value="Fun">Fun</option> <option value="Warnings!">Warnings!</option> <option value="Design Info">Design Info</option> <option value="Edits">Edits</option> </select> <input type="hidden" name="POSTED" value="'.$ir['username'].'"> <hr width=70%><input type="submit" value="Add Announcement!" /></hr> </form>'; } } function lstaffaps() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } $_GET['lock'] = abs((int) $_GET['lock']); if($_GET['lock'] == '1') { $db->query("UPDATE `settings` SET conf_value='Locked' WHERE conf_name='stafflock'"); stafflog_add("Locked Staff Applications."); echo "Staff applications are now locked. ><a href='http://staff.php' target='_blank'>Go Back</a>"; $h->endpage(); exit; } else if($_GET['lock'] == '2') { $db->query("UPDATE `settings` SET conf_value='Unlocked' WHERE conf_name='stafflock'"); stafflog_add("Unlocked Staff Applications."); echo "Staff applications are now unlocked. ><a href='http://staff.php' target='_blank'>Go Back</a>"; $h->endpage(); exit; } } function staffaps() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } $_POST['accept'] = abs((int) $_POST['accept']); $_POST['pos'] = abs((int) $_POST['pos']); $_POST['ID'] = abs((int) $_POST['ID']); if($_POST['accept'] == '1') { $sql = sprintf('SELECT `username` FROM `users` WHERE userid = %u', $_POST['ID']); $sql = $db->query($sql); $usr1 = $db->fetch_row($sql); if($_POST['pos'] == '2') { $pos="Admin"; } if($_POST['pos'] == '3') { $pos="Secretary"; } if($_POST['pos'] == '5') { $pos="Assistant"; } echo "{$usr1['username']} Applied for {$pos} You Accepted. <a href='staff.php' >Go Home</a>"; event_add($_POST['ID'],'Your staff application was accepted, Welcome to staff!', $c); stafflog_add("Accepted Staff Application from {$usr1['username']} for {$pos}"); $query = sprintf('UPDATE `users` SET user_level = %u WHERE userid = %u', $_POST['pos'], $_POST['ID']); $db->query($query); $query = sprintf('DELETE FROM `staffaps` WHERE ID = %u', $_POST['ID']); $db->query($query); $h->endpage(); exit; } if($_POST['accept'] == '2') { $sql = sprintf('SELECT `username` FROM `users` WHERE userid = %u', $_POST['ID']); $sql = $db->query($sql); $usr1 = $db->fetch_row($sql); if($_POST['pos'] == '2') { $pos="Admin"; } if($_POST['pos'] == '3') { $pos="Secretary"; } if($_POST['pos'] == '5') { $pos="Assistant"; } echo "{$usr1['username']} Applied for {$pos} You declined. <a href='staff.php' >Go Home</a>"; event_add($_POST['ID'],'Your staff application was declined.', $c); stafflog_add("Declined Staff Application from {$usr1['username']} for {$pos}"); $query = sprintf('DELETE FROM `staffaps` WHERE ID = %u', $_POST['ID']); $db->query($query); $h->endpage(); exit; } else { echo " <table width=100% border=1 class=h><tr><th>Position</th><th>Why</th><th>Experience</th><th>Applicant</th><th>Action</th></tr> "; $gasp = $db->query('SELECT `position`, `ID`, `about`, `exp` FROM `staffaps` WHERE ID > 0 ORDER BY ID DESC'); while($r = $db->fetch_row($gasp)) { if($r['position'] == '2') { $pos="Admin"; } if($r['position'] == '3') { $pos="Secretary"; } if($r['position'] == '5') { $pos="Assistant"; } $ql = sprintf('SELECT `username` FROM `users` WHERE userid = %u', $r['ID']); $ql = $db->query($ql); $usr=$db->fetch_row($ql); echo '<td align="center"><form action="?action=staffaps" method="post"><input type="hidden" name="pos" value="{$r["position"]}"><input type="hidden" name="ID" value="{$r["ID"]}">{$pos}</td><td>{$r["about"]}</td><td>{$r["exp"]}</td><td><a href="viewuser.php?u={$r["" >Go Home</a>"; >{$usr["username"]}</a></td><td>Accept: <input type="radio" name="accept" value="1"> Decline: <input type="radio" name="accept" value="2"> <input type="submit" value="submit"></form></td></tr>'; } echo "</table>"; } } function index() { global $db, $ir, $c, $h, $userid, $set, $_CONFIG; if ($ir['user_level'] == 2) { $versq = $db->query("SELECT VERSION()"); $mv = $db->fetch_single($versq); $db->free_result($versq); $versionno = intval('20503'); $version = '2.0.5b'; echo " <h3>System Info</h3> <hr /> <table width='75%' cellspacing='1' class='table'> <tr> <th>PHP Version:</th> <td>" . phpversion() . "</td> </tr> <tr> <th>MySQL Version:</th> <td>$mv</td> </tr> <tr> <th>MySQL Driver:</th> <td>" . $_CONFIG['driver'] . "</td> </tr> <tr> <th>Codes Version:</th> <td>$version (Build: $versionno)</td> </tr> <tr> <th>Update Status:</th> <td> <iframe src='http://www.mccodes.com/update_check.php?version={$versionno}' width='250' height='30'></iframe> </td> </tr> </table> <hr /> <h3>Last 20 Staff Actions</h3><hr /> <table width='100%' cellspacing='1' class='table'> <tr> <th>Staff</th> <th>Action</th> <th>Time</th> <th>IP</th> </tr> "; $q = $db->query( "SELECT `user`, `action`, `time`, `ip`, `username` FROM `stafflog` AS `s` INNER JOIN `users` AS `u` ON `s`.`user` = `u`.`userid` ORDER BY `s`.`time` DESC LIMIT 20"); while ($r = $db->fetch_row($q)) { echo " <tr> <td>{$r['username']} [{$r['user']}]</td> <td>{$r['action']}</td> <td>" . date('F j Y g:i:s a', $r['time']) . "</td> <td>{$r['ip']}</td> </tr> "; } $db->free_result($q); echo '</table>'; } echo '<h3><hr width=50%>Staff Notepad</h3></hr>'; if (isset($_POST['pad'])) { staff_csrf_stdverify('staff_notepad', 'staff.php'); $pad = $db->escape(stripslashes($_POST['pad'])); $db->query( "UPDATE `settings` SET `conf_value` = '{$pad}' WHERE `conf_name` = 'staff_pad'"); $set['staff_pad'] = stripslashes($_POST['pad']); echo '<b>Staff Notepad Updated!</b><hr />'; } $csrf = request_csrf_html('staff_notepad'); echo " <hr width=50%><form action='staff.php' method='post'></hr> <textarea rows='10' cols='60' name='pad'>" . htmlentities($set['staff_pad'], ENT_QUOTES, 'ISO-8859-1') . "</textarea> {$csrf} <input type='submit' value='Update Notepad' /> </form> "; } $h->endpage();
  10. Are you sure the file is uploaded to the directory?
  11. Nevermind, managed to get it working with the following code, modified a little bits of it.   <?php // +---------------------------------------------+ // | Super Rewards Call back script WITH loging | // +---------------------------------------------+ // | DONOT REMOVE THIS | // +---------------------------------------------+ // | Copyright Rodney Cheney 2011-2015 | // +---------------------------------------------+ include("dbcon.php"); include("classes.php"); $SECRET = "PutYourAPPIDInHere"; ///this is you apps secret key get this from app info $snuid = $_REQUEST['uid']; // this grabs the snuid from the url $currency = $_REQUEST['new']; // this grabs amount of points to award user $total= $_REQUEST['total']; // this grabs total points super rewards has ever sent user $offerwallID = $_REQUEST['oid'];// this grabs the offer walls offer ID $transactionID = $_REQUEST['id'];//this grabs the taransaction id from super rewards $sidverify = $_REQUEST['sig']; // this grabs the hashed info for you to authenticate with // make a hash of our own to verify authenicc transaction $sig = md5($_REQUEST['id'] . ':' . $_REQUEST['new'] . ':' . $_REQUEST['uid'] . ':' . $SECRET); //here we are gonna count the total points loged each time user has recived points $sql = "SELECT SUM(`points`) as `DeadWeight` FROM `sr_log` WHERE `userID`='$snuid'"; if( !($result = mysql_query($sql)) ) { die('Failed to query database. srlogs.'); } $row = mysql_fetch_array($result); $DeadWeight = $row['DeadWeight']; // You may want to add other checks to ensure that the user exists in your system //Check if hashed info is same as hashed info from superrewards if not do nothing. if ($sidverify == $sig) { //Insert Super Rewards transaction info into your database mysql_query("INSERT INTO sr_log SET points=$currency,total=$total,oid=$offerwallID,userID=$snuid, transID=$transactionID"); //Check if the total amount of points awarded to users is less then or the same as total from super rewards //This will make sure you dont give more then you should. if ($DeadWeight <= $total) { //If all is good Update the user with there points from the url request. mysql_query("UPDATE grpgusers SET points = points + ".$currency." WHERE id = '".$snuid."'"); //Send event to the player [silent Mafia Edit] Send_Event($snuid, "You have been credited ".$currency." points for completing a offer"); } echo "1"; }else{ echo "0"; } ?>
  12. So, I'm trying to implement Super Rewards into my game.. Here's the following code: postback.php   <?php include 'dbcon.php'; include 'classes.php'; include 'codeparser.php'; $earn = ($_GET['new']); $userid = ($_GET['uid']); $totaluser = ($_GET['total']); $offerid = ($_GET['oid']); store_lead($_GET['oid'], $_GET['uid'], $_GET['total'], $_GET['new']); echo 1; //ASSIGN VARIABLES TO USER INFO $time = date("M j G:i:s Y"); $ip = getenv('REMOTE_ADDR'); $userAgent = getenv('HTTP_USER_AGENT'); $referrer = getenv('HTTP_REFERER'); $query = getenv('QUERY_STRING'); //COMBINE VARS INTO OUR LOG ENTRY $msg = "IP: " . $ip . " TIME: " . $time . " REFERRER: " . $referrer . " SEARCHSTRING: " . $query . " USERAGENT: " . $userAgent; //CALL OUR LOG FUNCTION writeToLogFile($msg); function writeToLogFile($msg) { $today = date("Y_m_d"); $logfile = $today."_log.txt"; $dir = 'postbacklogs'; $saveLocation=$dir . '/' . $logfile; if (!$handle = @fopen($saveLocation, "a")) { exit; } else { if(@fwrite($handle,"$msg\r\n")===FALSE) { exit; } @fclose($handle); } } ?>   classes.php function store_lead($offerid, $userid, $totaluser, $earn){ $result = mysql_query("SELECT * FROM `sr_log` WHERE `oid`='{$offerid}', `uid`='{$userid}', `total`='{$totaluser}', `new`='{$earn}'"); $result = mysql_query("INSERT INTO `sr_log` (`oid`, `uid`, `total`, `new`) VALUES ('$offerid', '$userid', '$totaluser', '$earn')"); $result = mysql_query("UPDATE `grpgusers` SET points = points+ $earn WHERE userid=$userid"); //give user crystals// Send_Event($userid, "You have been credited ".$earn." points for completing a offer."); } ?>   When I click on [ADMIN USER TEST] Send 100 Points   Its sending a postback, but only the event will be send to the players log, but it isn't giving the points its not even putting a query in database for the logs. Does anyone know what i'm doing wrong? Greetings.
  13. Try it out! :cool:
  14. [ATTACH=CONFIG]526[/ATTACH][ATTACH=CONFIG]527[/ATTACH][ATTACH=CONFIG]528[/ATTACH] A few screenshots of the game, when logged in. :)
  15. Lots has been updated. :) Need feedback please!! ;)
  16. Missions have now been added to the game, Alot of more updates coming soon!
  17. Server 2 has been created :):cool: http://game2.mafiaheros.com
  18. MafiaHeros is a web based mafia-style browser based RPG, which means you don't have to download anything at all, you play it all in your web browser. In MafiaHeros, you choose your own path. Whether you want to train your stats and become the strongest player, or become a gang president and actually effect and change aspects of the game, it is entirely up to you. http://mafiaheros.com/
  19. Hello Everyone, I'm working on adding a email activation function to my engine, so when someone new signs up, they have to activate their account first before they can play. I'm using this code when they register the account: <? include 'notloggedinh.php'; if (isset($_POST['submit'])) { $username = strip_tags($_POST["newname"]); $username = addslashes($username); $loginname = strip_tags($_POST["newname"]); $loginname = addslashes($loginname); $signuptime = time(); $password = strip_tags($_POST["newpass"]); $password = addslashes($password); $password2 = strip_tags($_POST["newpassagain"]); $password2 = addslashes($password2); $email = strip_tags($_POST["email"]); $email = addslashes($email); $email2 = strip_tags($_POST["email2"]); $email2 = addslashes($email2); $checkuser = mysql_query("SELECT * FROM `grpgusers` WHERE `loginame`='$username'"); $gender = $_POST["gender"]; $activate = '1'; $username_exist = mysql_num_rows($checkuser); @session_start(); if ($_SESSION['AntiSpamImage'] != $_REQUEST['anti_spam_code']) { $_SESSION['AntiSpamImage'] = rand(1,9999999); $message .= "<div>The verification code you entered is invalid.</div>"; } if($username_exist > 0){ $message = "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; $_POST['newname'] = ""; } if($_POST['tos'] != "agree"){ $message = "<div>You haven't agreed to the Terms of Service.</div>"; } if(strlen($username) < 4 or strlen($username) > 20){ $message = "<div>The username you chose has " . strlen($username) . " characters. You need to have between 4 and 20 characters.</div>"; $_POST['newname'] = ""; } if(strlen($password) < 6 or strlen($username) > 20){ $message = "<div>The password you chose has " . strlen($password) . " characters. You need to have between 6 and 20 characters.</div>"; } if($password != $password2){ $message = "<div>Your passwords don't match. Please try again.</div>"; } if($email != $email2){ $message = "<div>Your emails don't match. Please try again.</div>"; $_POST['email'] = ""; $_POST['email2'] = ""; } $checkemail = mysql_query("SELECT * FROM `grpgusers` WHERE `email` = '$email'"); $email_exist = mysql_num_rows($checkemail); if($email_exist > 0){ $message = "That email is already being used for an account on MafiaHeros."; $_POST['email'] = ""; } $code = rand(11111111,99999999); //Send activation mail $to = $email; $subject = "Activate Account | MafiaHeros"; $headers = "From: [email protected]"; $body = "Thank you for registering at MafiaHeros.\n\nYour Username: $username\nYour Password: $password\n\nPlease click on the link below to activate your account.\nhttp://mafiaheros.com/activate.php?code=$code\n\n"."\n\nThe MafiaHeros Team."; if (!mail($to,$subject,$body,$headers)) echo Message("We couldn't sign you up at this time. Please try again later."); //insert the values if (!isset($message)){ $result = mysql_query("INSERT INTO `grpgusers` (signupip, username, password, email, signuptime, loginame, gender, code, activate)"."VALUES ('".$_SERVER['REMOTE_ADDR']."', '$username', '$password', '$email', '$signuptime', '$loginname', '$gender', '$code', '$activate')"); echo Message("You have been registered successfully! Please check your email ($email) to activate your account."); include 'notloggedinf.php'; if ($_POST['referer'] != ""){ $result12 = mysql_query("SELECT * FROM `grpgusers` WHERE `loginame`='".$loginname."'"); $worked12 = mysql_fetch_array($result12); $result= mysql_query("INSERT INTO `referrals` (`when`, `referrer`, `referred`)". "VALUES ('$signuptime', '".$_POST['referer']."', '".$worked12['id']."')"); } die(); } } if (isset($message)) { echo Message($message); } ?> <div id="right_c"> <div class="g_content"> <h3> Register</h3> <div class="g_text"> <center>You will need to register with an valid e-mail address, After signing up you have to activate it.</center> <table width='60%' border='0' align='center' cellpadding='0' cellspacing='2'> <form name='register' method='post' action='register.php'> <br /> <tr> <td><b>Username:</b></td> <td> <input type='text' name='newname' value="<?php echo $_POST['newname']; ?>"> </td> </tr> <tr> <td><b>Password:</b></td> <td> <input type='password' name='newpass'> </td> </tr> <tr> <td><b>Confirm Password:</b></td> <td> <input type='password' name='newpassagain'> </td> </tr> <tr> <td><b>Gender:</b></td> <td> <select name="gender"> <option value="Male">Male</option> <option value="Female">Female</option> </select> </td> </tr> <tr> <td><b>Email Address:</b></td> <td> <input type='text' name='email' value="<?php echo $_POST['email']; ?>"> </td> </tr> <tr> <td><b>Confirm Email:</b></td> <td> <input type='text' name='email2' value="<?php echo $_POST['email2']; ?>"> </td> </tr> <tr> <td><b>ToS:</b></td> <td> I have read and i agree to the ToS <input type="checkbox" name='tos' value="agree" /> </td> </tr> <tr> <td><b>Image Verification:</b></td> <td> <img src="antispam.php" /> </td> </tr> <tr> <td><b>Verify Code Above:</b></td> <td> <input type='text' name='anti_spam_code'> </td> </tr> </tr> <tr> <td> </td> <td> <br /> <input type='hidden' name='referer' value='<? echo $_GET['referer'] ?>'> <input type='submit' name='submit' value='Register'> </td> </tr> </form> </form> </table> </div> </div> </div> <? include 'notloggedinf.php'; ?>   So far, all of this does work, then I go to my e-mail to get the activation link and I paste it in url and go to activate it. But the activation table stays on 1 even if I activate it. activation.php <?php include 'global.php'; $code = $_GET['code']; if(!$code) echo "No code supplied"; else { $check = mysql_query("SELECT * FROM `grpgusers` WHERE activate='0'"); if (mysql_num_rows($check)==1) echo "You have already activated your account"; else { $result = mysql_query("UPDATE `grpgusers` SET `activate` = '0' WHERE `activate`='".$code."'"); echo "Your account has been activated!"; } } ?>   Does anyone know the fix on this one? So when users go to the activation link it activates and they can play
  20. Cronic

    Stock images?

    Mostly I look here, http://www.officialpsds.com And some other gfx sites.
  21. Hi there, I'm working on a function that displays the users that are online at the forum page.. That does work so far...   <div id="right_c"> <div class="g_content"> <h3> Mobsters Currently Browsing Forum</h3> <div class="g_text"> <table width="100%"> <tr> <td align="15%"><?php users_browsing_forum() ?></td> </tr> </table> </div> </div> </div>   Now i'm trying to get it when users are over 15 minutes last active, they will be automatic removed from the Users Browsing Forum List This is the function: function users_browsing_forum(){ $result = mysql_query("SELECT userid FROM forum_browsers"); while($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $forum_user = new User($line['userid']); echo "$forum_user->formattedname, "; } if (time() - $forum_user->lastactive > 900) { $result = mysql_query("DELETE FROM `forum_browsers` WHERE `id`='$forum_user->id'"); } }   So I created another test account and changed the last active days through database to: Last Active: 2546d 7h 28m 11s Visit the forums again, and it still looks like this Mobsters Currently Browsing Forum forum test, [MH] ~ Admin, This is how the mysql table looks like CREATE TABLE IF NOT EXISTS `forum_browsers` ( `id` int(200) NOT NULL AUTO_INCREMENT, `userid` int(200) NOT NULL, `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `age` int(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0 ;   Does anyone know what i'm doing wrong?
  22. I hope they do know you will still be able to acces TPB through a proxy.
  23. Happy b-day ;) Have a great one! ;)
  24. Thanks, got it fixed now. ;)
  25. Yeah, its about the <HR> lines i'm talking about. I'm trying to change them for IE so they look exactly how they show up on FireFox.
×
×
  • Create New...