Upload System I'm Working On

Started by MeltingIce, February 14, 2007, 04:22:58 am

Previous topic - Next topic

MeltingIce

Alright, the directory listing now has links to the files so I am making good progress.  I reorganized the structure a little bit as well.  All that's left is to add the file manipulation functions to the directory listing and it'll be done!

MeltingIce Network | Wii Number: 3881 9574 8304 0277

Will

Nice, yes it really that easy, hehe. Will the entire project be done or just that portion of code?

regards,

Will
The world is round... so you have to use spherical projection.

MeltingIce

Quote from: Will on February 15, 2007, 06:23:03 am
Nice, yes it really that easy, hehe. Will the entire project be done or just that portion of code?

regards,

Will

I won't release the project until it is completely finished :P  It's been coming along nicely though so it shouldn't be too much longer.

MeltingIce Network | Wii Number: 3881 9574 8304 0277

Will

Neat can't wait, this is off topic but woulnet be nice is Terragen 2 had some type of python or C++ scripting.

regards,

Will
The world is round... so you have to use spherical projection.

Oshyan

Quote from: Will on February 15, 2007, 07:34:21 am
Neat can't wait, this is off topic but woulnet be nice is Terragen 2 had some type of python or C++ scripting.

regards,

Will


A scripting system will be implemented before the final release. It will probably be based on Python due to its increasing popularity for 3D application scripting.

- Oshyan

MeltingIce

I can't seem to get this to work.  This is a function I wrote that checks to make sure the string passed in doesn't have any of the characters in the array $nix in it.  Right now its always returning true.  If anyone knows why, help would be much appreciated  ;D

<?php
function 
isValid($var)
{

$nix = array("#","(",")","<",">","?","/","\\","[","]","|");
$vararray str_split($var);
for($index=0;$index<count($vararray);$index++)
{
if(array_search($vararray[$index], $nix))
{
$valid false;
}
}

if($vararray[0] == " ")
{
$valid false;
}

return $valid;
}
?>

MeltingIce Network | Wii Number: 3881 9574 8304 0277

MeltingIce

February 16, 2007, 12:48:56 am #36 Last Edit: February 16, 2007, 04:55:34 am by MeltingIce
While I'm waiting on the reply for that, I was wondering if I could get some feedback on the index page.  This is a working version of the page, but I disabled the register form so that no one can register a username  :P  Try logging in with a random username and password to see the error message that appears.  All the animations were done with scriptaculous if anyone was wondering.  You can check it out here.
EDIT: I just finished styling the database install page.  I know a lot of people are intimidated by databases, so I made this as easy as possible.  My ultimate goal is to make it so the user doesn't have to edit any php at all.  Here's a screenshot of the install.php script after a successful MySQL table installation:



EDIT AGAIN: Guess I'm kinda talkin to myself here since its so early in the morning.  I just achieved my ultimate goal.  Users no longer have to edit any php files.  When you install the database, a config.php file is written for you containing your database login information so you no longer have to edit that file yourself.

MeltingIce Network | Wii Number: 3881 9574 8304 0277

Will

Nice man, but yea I'm ot even up at that hour.  The error system seems to be working at least for the log in. Is et up an account and got in so it all seems to be working from my end.

Regards,

Will
The world is round... so you have to use spherical projection.

3DGuy

Quote from: MeltingIce on February 15, 2007, 10:49:35 pm
I can't seem to get this to work.  This is a function I wrote that checks to make sure the string passed in doesn't have any of the characters in the array $nix in it.  Right now its always returning true.  If anyone knows why, help would be much appreciated  ;D

You never initialised your $valid. So you always return false. Initialise it by adding

$valid = true;

at the start of the function.

old_blaggard

Good looking page, MeltingIce.  I can't wait to see this when it's done.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

MeltingIce

Quote from: 3DGuy on February 16, 2007, 11:55:44 am
Quote from: MeltingIce on February 15, 2007, 10:49:35 pm
I can't seem to get this to work.  This is a function I wrote that checks to make sure the string passed in doesn't have any of the characters in the array $nix in it.  Right now its always returning true.  If anyone knows why, help would be much appreciated  ;D

You never initialised your $valid. So you always return false. Initialise it by adding

$valid = true;

at the start of the function.

I added that and it didn't change anything unfortunately.

MeltingIce Network | Wii Number: 3881 9574 8304 0277

3DGuy

Hmm ok, I'm looking into that now.. seems to be a problem with the str_split.

MeltingIce

Quote from: 3DGuy on February 16, 2007, 02:58:36 pm
Hmm ok, I'm looking into that now.. seems to be a problem with the str_split.

Thanks a lot man.  If you can come up with a better way to do it than what I'm doing, then please let me know.  I was hoping for a function that returns the character of a word at index x, instead of having to put all the letters into an array.

MeltingIce Network | Wii Number: 3881 9574 8304 0277

3DGuy

February 16, 2007, 03:17:03 pm #43 Last Edit: February 16, 2007, 03:19:09 pm by 3DGuy
Here you go, this should work:

function isValid($varx)
{
$valid = true;
$nix = array("#","(",")","<",">","?","/","\\","[","]","|");
for($index=0;$index<strlen($varx);$index++)
{
if(in_array(substr($varx,$index,1), $nix))
{
$valid = false;
}
}

if(substr($varx, 0, 1) == " ")
{
$valid = false;
}
return $valid;
}


$var seems to be invalid for a variable name hence the use of $varx

MeltingIce

Quote from: 3DGuy on February 16, 2007, 03:17:03 pm
$var seems to be invalid for a variable name hence the use of $varx

Excellent, it does work!  Thanks again, much appreciated  :D

MeltingIce Network | Wii Number: 3881 9574 8304 0277