Jump to content
MakeWebGames

Djkanna

Members
  • Posts

    3,138
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Djkanna

  1. Aww cute kittens...
  2. Close the brackets. After the $_POST[$thekey] = str_replace( ... ); add }
  3. Well done. :)
  4. I concur, but I use 'new posts' and rarely use the portal so I don't mind either way.
  5. $Data = mysql_query ('SELECT `g`.`ID`, `g`,`SenderID`, `g`.`RecieverID`, `g`.`Comment`, `u`.`userid`, `u`.`username` FROM `gComments` `g` LEFT JOIN `users` `u` ON `g`.`SenderID` = `u`.`userid` WHERE (`g`.`RecieverID` = '.abs(intval($_GET['u'])).') LIMIT 20') or trigger_error(mysql_error());
  6. Thread closed, answer provided in your other topic. :)
  7. Because there is no value for the specific key, try this; $array_gete = array($_GET); while ($tick = current($array_gete)) { $thekey = key($array_gete); if (isset ($_GET[$thekey])) { $_GET[$thekey] = str_replace('=', '', htmlspecialchars($_GET[$thekey])); } next($array_gete); }
  8. It would work surely, okay lets do it this way. if ($stat['strength_extra'] > 0) { $extra = ($stat['strength']/100)*$stat['strength_extra']; $stat['strength'] += $extra; echo number_format ($stat['strength']); //Query to update the new strength should you wish to do so. }
  9. Yes isset() shouldn't be used there, well done for finding the solution yourself. :)
  10. Nope, I did the same thing you're doing now, just teaching myself via tutorials on the web (like w3Schools) and the PHP manual, and help from friends/community members. :) If you grab a script that's been purposely built to fail, it has an error or two somewhere within it, trying to get it working again is a great learning experience for correct usage of things etc. Also gets you familiar with debugging, which is rather common in places.
  11. Yes the users table is unorganized by default.
  12. Is stealth in the database? :P Note: the spelling of stealth also just in-case of a typo in code/database :)
  13. Djkanna

    New Layout

    Okay, topic locked/marked as done, if you need the topic unlocking again please mail a staff member.
  14. Awesome, PHP manual is a handy thing to have. :) php.net/function_name example php.net/isset :)
  15. define ('constantName', 'Value'); :)
  16. Well just in-case, add those required fields in the users table (and/or) users stats table and undo what's been done see if the error remains, I believe that's where the problem lies, as it only grabs from the users table and users stats (sometimes houses and jobs) and uses the returned results in the form of $ir :)
  17. Are those fields actually in your database users table? I don't see why it's coming up for them. But you can do $power = (isset($ir['max_power']) > 0 && isset($ir['power']) > 0) ? (int) ($ir['power']/$ir['max_power']*100) : 0; $minexp = (isset($ir['mine_needed']) > 0 && isset($ir['mine_exp']) > 0) ? (int) ($ir['mine_exp']/$ir['mine_needed']*100) : 0; You wouldn't actually need the > 0 but hey. :P
  18. There's a little star thing at the bottom of peoples posts. The reason it comes up is because the variable usually a _GET within MCCodes isn't actually defined until you define it, so for example you visit say explore and your explore is set up like if ($_GET['shopping']) { // Show shopping centre } else { //Show normal shops } You visit that page you'll get normal shops and a Undefined notice for shopping, but if you visit the shopping centre explore.php?shopping the notice will be removed. To solve this; if (isset ($_GET['shopping']) ) { //Show shopping centre } else { //Show normal.. }
  19. $extra = ($ir['strength']/100)*0.2; // 0.2 % of current strength as a bonus. $newStr = $ir['strength'] + $extra; // Normal strength plus the bonus strength.
  20. Djkanna

    New Layout

    While I share the same opinion, Mafia style is lack of a better term the bread winner. ;) Two people I know of are W3Theory || Peter and ^ Lilith, perhaps Dave but I'm not too sure. :)
  21. Okay scratch that last post seems to already do it, providing you have a fd column in your users database table. if ($ir['fd']==0) { $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); }<br /> if ($ir['fd']==1) { $enperc=(int) ($ir['energy']/$ir['maxenergy']*150); }<br /> To: $enperc = (isset ($ir['fd'])) ? (int) ($ir['energy']/$ir['maxenergy']*150) : (int) ($ir['energy']/$ir['maxenergy']*100); P.S: Welcome. :)
  22. Scratch... Castle or Mansion?
  23. Besides, jail and hospital, there the same (maybe other features missing but that's all I recall.)
  24. mysql_query('INSERT INTO `cxfer` (`from`, `to`,`amount`, `reason`) VALUES ($userid, $toid, $amount, "'.mysql_real_escape_string($reason).'")') or die(mysql_error());
  25. Add fd in your global $ir query in globals.php I believe.
×
×
  • Create New...