|
|
| Author |
Message |
JG Staff Sergeant

Joined: 31 Jul 2003 Posts: 48 Location: Cherry Hill, N.J.
|
Posted: Wed Aug 27, 2003 6:21 pm Post subject: Humpa Chess install? |
|
|
|
Ok, weird, Only nine files with this module. I stuck it in modules, and it's for sure their.
Puppys up on the Modules List, both Humpa Chess and Humpa Chess2
But, when I click on I get a blank screen, and it only says at the top left
Sorry, such file doesn't exist...
Same thing happened with the EN HowTO Book?
http://www.johngaltaisa.com/modules.php?name=Humpa_Chess
The linking is fine as well. Now nothing this simple, can be this ridicules. _________________ Galt |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Wed Aug 27, 2003 10:45 pm Post subject: |
|
|
|
The error
| Code: |
Sorry, such file doesn't exist...
|
comes from mainfile.php. There are exactly three occurences of it in the code. In all three the pattern is the same:
First it is tested if you are a normal user, an administrator, if the module is active etc., depending on the circumstances.
Then, a test is made on the existence of $modpath. Upon its failure, you get that error:
| Code: |
$modpath .= "modules/$name/$file.php";
if (file_exists($modpath)) {
include($modpath);
} else {
die ("Sorry, such file doesn't exist...");
}
|
$modpath, in turn, is the path to the module in question. As you can see in the code snippet yourself, it depends on the value of $name, which is the name of the module, and $file, which is...
...well, for this you have to scroll up to the start of mainfile.php. There, we read
| Code: |
if (!isset($file)) { $file="index"; }
|
which in plain english says "if the variable $file is NOT set, set it to 'index'".
Putting all the puzzle pieces together, we arrive to the conclusion that the file
modules/Humpa_Chess/index.php
is not there.
BTW, that's Chris' Bottom-Up Approach to Teaching Programming (TM).
You have to dive in the docs of that module to see if you are missing anything. Perhaps Humpa says something on his page. I don't know why the index.php file is missing from that module.
As of the PHP-Nuke_HOWTO, you have a different problem here:
http://www.johngaltaisa.com/modules/PHP-Nuke_HOWTO/index.php
returns a 404 (Not Found) error.
Did you really follow the instructions? Did you download the right file? The right file for the PHP-Nuke HOWTO is
http://www.karakas-online.de/EN-Book/EN-Book-Nuke.tar.gz
Did you extract it in the modules folder?
Did that create a PHP-Nuke_HOWTO folder in turn?
Did you see the module "PHP-Nuke_HOWTO" in the list of modules and did you activate it? _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Thu Aug 28, 2003 12:47 am Post subject: |
|
|
|
O.K., I couldn't resist and I downloaded Humpa Chess too.
You have to decide which version you want to install, the one with "frames", or the one without. It's not clear to me what "frames" means in this context - "iframes" perhaps?
Anyway, just edit the configHumpaChess.php file.
There is a problem I encountered though:
I had to set
| Code: |
register_globals = On
|
in the php.ini in order to be able to create a new game. The problem was that otherwise the HumpaChessNewGame.php script would not be able to understand that the $newgame variable was set to "create" through the user's input in the New Game form. Not knowing that $newgame is equal to "create", it would not redirect to the usual "module.php?name=..." address, rather calling the script directly and leading to all possible errors.
Setting register_globals to On can be a security risk though. From the comments in php.ini:
| Quote: | ; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
 |
Is Humpa Chess "very well thought of"? _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
JG Staff Sergeant

Joined: 31 Jul 2003 Posts: 48 Location: Cherry Hill, N.J.
|
Posted: Thu Aug 28, 2003 1:06 am Post subject: What a Schmoo! |
|
|
|
ROFLMAO!
Sometimes my own stupidity amazes me to the point, I can contemplate its origin for hours.
Somewhere in the past I've acquired a stupid neuron, and as my mortality takes on new dimensions, I have discovered he has acquired friends.
They lie in wait, for simplicity to delight my senses, then the first stupid neuron, gathers up the tribe, and attacks.
The more intelligent neurons, whose lives have always resided in the reality of earth, knowing the shortest distance between two objects....is in fact a straight line; upon attack, head to outer space, where the shortest distance is a curve.
When this situation occurs, I roll out the tape, that repeats over and over again while I sleep...Look again, NOTHING is that simple!.....for the first hour, then switches to...You KNOW they can't be trusted, you know they can't be trusted, for the remaining hour.
I awaken refreshed, not giving a crap about mortality, gather up the fools in outer space (the backup tribe) come here and post!
Thus: Simplicity is to be avoided at all costs!
Went to Humpa's, registered, looked at what's left of the forums, with code errors plastered all over the place, got the the chess link, clicked it on, said that's cool, and headed to downloads. No point in posting, there was nothing left to post to.
Found link, read descriptor., just 9 files, put in modules, done. Unpacked, uploaded, and here we are.
Read text links, made perfect sense, went to find the configchess.php file. Nope not there!
Now here is where that neuron attacked. While looking at the files I uploaded, one would have noticed there were no image files, and that should have raised the flag. But, well...you can surmise the rest.
Headed back to Humpa's after getting my code lesson from Chris (all of them saved in teachme folder) looked at the DL's and discovered that the full DL's were listed further down the page. My smart neurons say, file that is newest is on top.
As Andy Capp said, Schmoo's love to be eaten, and the old pipe smoker said, " I shall return!" _________________ Galt |
|
| Back to top |
|
 |
JG Staff Sergeant

Joined: 31 Jul 2003 Posts: 48 Location: Cherry Hill, N.J.
|
Posted: Thu Aug 28, 2003 2:31 am Post subject: Code error |
|
|
|
Ok, I got both versions installed, frames and no frames, typical of html.
I'm getting this error when I create a game, and it DOES create it.
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/site19/web/includes/sql_layer.php on line 286
This ocurs in either version when creating a game. Now you lost me with the global variable, and pulling up phpMyAdmin, didn't show me a thing?? I'm Also getting my site front page, showing up in the game board area.
In fact the graphics seem to go to hell, and I wonder if the theme has anything to do with it.
In any event, you would have to see it, to get a complete picture. _________________ Galt |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Thu Aug 28, 2003 3:31 am Post subject: Re: What a Schmoo! |
|
|
|
| JG wrote: | The more intelligent neurons, whose lives have always resided in the reality of earth, knowing the shortest distance between two objects....is in fact a straight line; upon attack, head to outer space, where the shortest distance is a curve.
 |
Actually, taking into account the curvature of earth's surface and that of the outer space, rather the opposite should to be true - but then I wouldn't claim to be an expert in geodesics...
| Quote: | When this situation occurs, I roll out the tape, that repeats over and over again while I sleep...Look again, NOTHING is that simple!.....for the first hour, then switches to...You KNOW they can't be trusted, you know they can't be trusted, for the remaining hour.
 |
Self-suggestion? I tried this trick with the tape recorder many years ago, expecting to be able to learn a foreign language while asleep, but did not work for me. No matter how low the volume setting, I always woke up, or at least heard it semi- not sub-consciously. It didn't work for me and I abandoned it.
I switched to tape listening during the day, the whole day - and *that* worked!
| Quote: | Thus: Simplicity is to be avoided at all costs!
 |
Absolutely! Never make anything simple and efficient, when a way can be found to make it complex and wonderful!  _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
JG Staff Sergeant

Joined: 31 Jul 2003 Posts: 48 Location: Cherry Hill, N.J.
|
Posted: Thu Aug 28, 2003 3:47 am Post subject: |
|
|
|
| chris wrote: | O.K., I couldn't resist and I downloaded Humpa Chess too.
There is a problem I encountered though:
I had to set
| Code: |
register_globals = On
|
in the php.ini in order to be able to create a new game. The problem was that otherwise the HumpaChessNewGame.php script would not be able to understand that the $newgame variable was set to "create" through the user's input in the New Game form. Not knowing that $newgame is equal to "create", it would not redirect to the usual "module.php?name=..." address, rather calling the script directly and leading to all possible errors.
Setting register_globals to On can be a security risk though. From the comments in php.ini:
| Quote: | ; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
 |
Is Humpa Chess "very well thought of"? |
I did some searching, and php.ini is the actual PHP code yes? Question is, how do I get around this, or set it to create a new game, and withogut the MySQL error I'm getting? Even though it seems to create it, the call it's making brings up, not the chess board but my front page.
If you can't creat a new game, or get to where the code is, then what. Just another good idea gone bad???  _________________ Galt |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Thu Aug 28, 2003 3:55 am Post subject: Re: Code error |
|
|
|
| JG wrote: | I'm getting this error when I create a game, and it DOES create it.
 |
Are you sure? Or it just says that it created it and you believe it?
Your tape did not work if you still trust it.
| Quote: | Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/site19/web/includes/sql_layer.php on line 286
 |
You couldn't connect to the database. Wrong connection parameters in configHumpaChess.php.
| Quote: | Now you lost me with the global variable, and pulling up phpMyAdmin, didn't show me a thing?? I'm Also getting my site front page, showing up in the game board area.
 |
Open php.ini with a decent text editor (search for it, it must be somewhere, perhaps hiding together with those fugitive neurons... ). You will find a line with register_globals in it. You could try changing that to On, but only if it really helps.
If you don't find php.ini, then it is probably hiding even further than outer space: in your ISP's disk!
To test this case, try this file (name it test.php, put it in the same directory as config.php and point your browser to it):
| Code: |
<?php
include("config.php");
mysql_connect("$dbhost", "$dbuname", "$dbpass");
mysql_select_db("$dbname");
echo mysql_error();
phpinfo();
?>
|
If everything is right, you will only see the PHP info. Search for "register_globals" there.
At least you will know if it is On or Off. _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Thu Aug 28, 2003 4:09 am Post subject: |
|
|
|
Another thing to check:
Do you see the three tables that this module creates automatically? Go to your phpMyAdmin and check if these three tables are there:
xxx_humpa_chess
xxx_humpa_chess_comments
xxx_humpa_chess_moves
where xxx is the "humpaprefix" (or nukeprefix) you specified in the configHumpaChess.php file.
If they are not, the module did not create them automatically.
You could try creating them manually, or with phpMyAdmin, but you have to know their exact structure - and the only way to find it out is by studying the index.php file.
For the standalone (NOT PHP-Nuke) version of Humpa Chess, the magic MySQL incantations are:
| Code: |
CREATE TABLE xxx_humpa_chess (gameid INT (15) not null AUTO_INCREMENT, playerw TEXT not null, playerb TEXT not null, epd CHAR(100), epd1back CHAR(100), epd2back CHAR(100), epd3back CHAR(100), whosmove TEXT not null, gamedate INT(15) not null, gameover TEXT, emailw CHAR(50), emailb CHAR(50), gamepass TEXT not null, PRIMARY KEY (gameid), UNIQUE (gameid));
CREATE TABLE xxx_humpa_chess_moves (mid INT (15) not null, gameid INT (15) not null, movecount INT (15) not null, movecountrow INT (15) not null, epd1 CHAR(100), epd2 CHAR(100), epd3 CHAR(100), epd4 CHAR(100), epd5 CHAR(100), epd6 CHAR(100), epd7 CHAR(100), epd8 CHAR(100), epd9 CHAR(100), epd10 CHAR(100), INDEX (gameid));
CREATE TABLE xxx_humpa_chess_comments (cid INT (15) not null AUTO_INCREMENT, commdate INT(15), name TEXT, comment TEXT, gameid INT (15) not null, PRIMARY KEY (cid), INDEX (gameid));
|
where again xxx denotes the prefix you set up in that config file. I am not sure if this is the same for the PHP-Nuke version though. I will have to check it - but probably not immediately. _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
|
|
 |
|
|