Jump to content
MakeWebGames

Recommended Posts

Posted

Re: Something other than male/female?

Anywhere is has 'Male' or 'Female' change it to what you want. You could still have Male and Female stored in the users table, because users aren't going to see that :-)

So;

Male could become Human

And

Female could become Alien (not suggesting anything towards females here :lol:)

Or visa versa

Just find the file it's in and change the name. Ofcourse don't change It in the

$db->query

unless you have added Human and Alien into the DB If that makes sense....

Posted

Re: Something other than male/female?

Couldnt you do something in a file mccodes uses on everypage load replacing the text "male" & "female" with your chosen options. str_replace or something not sure :S

Posted

Re: Something other than male/female?

You could use something like this...I guess?

 

function doesntmatterwhatitscalled($blah)
{
return (str_replace("Male", "Human", $blah));
}
ob_start("doesntmatterwhatitscalled");

 

But if two people were mailing each other and someone says "So are you Male or Female?" The other person would get "So are you Human or Female?"

lol

Posted

Re: Something other than male/female?

 

function buffer_output($buffer)	{
return str_ireplace(array('male','female'), array('human','alien'), $buffer);
}
ob_start('buffer_output');

 

Edited: Error

Posted

Re: Something other than male/female?

 

function buffer_output($buffer)	{
return str_ireplace(array('male','female'), array('human','alien', $buffer);
}
ob_start('buffer_output');

 

Or that, I was waiting to get asked how to add both, then I'd use an array :-P.

This way is better, Go with this. :lol:

Posted

Re: Something other than male/female?

instead of writing a stupid function for it, just modify it in the database. leave the column called gender and than replace male and female with human and alien and than edit the preferences page to reflect the change.

Posted

Re: Something other than male/female?

 

instead of writing a stupid function for it, just modify it in the database. leave the column called gender and than replace male and female with human and alien and than edit the preferences page to reflect the change.

Writing a stupid function is the best way if you still want a compatible db to use other mods, otherwise you would need to keep recoding every single change you apply on a game!

Posted

Re: Something other than male/female?

 

instead of writing a stupid function for it, just modify it in the database. leave the column called gender and than replace male and female with human and alien and than edit the preferences page to reflect the change.

Writing a stupid function is the best way if you still want a compatible db to use other mods, otherwise you would need to keep recoding every single change you apply on a game!

I'm all for using function to make tedious tasks easier, but when they're not needed there's no point. Even if a function is used a script modification will be required to incorporate the function into it a database modification is the easiest way in my mind as modification is required either way.

Posted

Re: Something other than male/female?

yea, going through and replacing $ir['male']/$r['male'] and $ir['female']/$r['female'] to $ir['human']/$r['human'] and $ir['alien']/$r['alien'] isn't really that hard.

Posted

Re: Something other than male/female?

if you havent installed it yet look in dbdata.sql i think and on line 980 it says

  `gender` enum('Male','Female') NOT NULL default 'Male',

you could change that to it says

    `type` enum('Human','Alien') NOT NULL default 'Human',

then instead of gender you have type

Posted

Re: Something other than male/female?

 

if you havent installed it yet look in dbdata.sql i think and on line 980 it says

  `gender` enum('Male','Female') NOT NULL default 'Male',

you could change that to it says

    `type` enum('Human','Alien') NOT NULL default 'Human',

then instead of gender you have type

You still need to edit other files "Gender : Alien" Doesn't really work.

Posted

Re: Something other than male/female?

 

Any other help? I haven't made the game yet, and this is very important.

I'd go with Haunted's function, add it to globals :)

Posted

Re: Something other than male/female?

When I put it in globals.php, it gave me an error. Here is the globals.php

 

<?php
/*---------------------------------
--   MCCodes 2.0
--   By Dabomstew
---------------------------------*/
session_start();
ob_start();
if(get_magic_quotes_gpc() == 0)
{
 foreach($_POST as $k => $v)
 {
   $_POST[$k]=addslashes($v);
 }
 foreach($_GET as $k => $v)
 {
   $_GET[$k]=addslashes($v);
 }
}

require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";

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;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}
$domain=$_SERVER['HTTP_HOST'];

global $jobquery, $housequery;
if($jobquery)
{
$is=$db->query("SELECT u.*,us.*,j.*,jr.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON jr.jrID=u.jobrank WHERE u.userid=$userid");
}
else if($housequery)
{
$is=$db->query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid");
}
else
{
$is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid");
}
$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;
}
global $macropage;
if($macropage && !$ir['verified'] && $set['validate_on']==1)
{
header("Location: macro1.php?refer=$macropage");
exit;
} 
check_level();
$h = new headers;
$h->startheaders();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
global $atkpage;
if($atkpage)
{
$h->userdata($ir,$lv,$fm,$cm,0);
}
else
{
$h->userdata($ir,$lv,$fm,$cm);
}
global $menuhide;
if(!$menuhide)
{
$h->menuarea();
}
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...