Tubby wrote:

hello i tried replacing that code and i still get the same error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fatalgam/public_html/arcade_play.php on line 20

Try this:

Find in arcade_play.php:

if(mysql_num_rows($result) <= 0)
    message($lang_common['Bad request']);
$line = $db->fetch_assoc($result);

and replace with this:

$line = $db->fetch_assoc($result);
if ($line['game_id'] <= 0)
    message($lang_common['Bad request']);
dharmil wrote:

this thing is not working for me for some reson

How many times played: 0 it always says 0

If there is no highscore for a game you can´t see how many times a game was played. I´ll try to fix this ...

Maybe there is a problem with your server. i´ve found this:
"I ve noticed that on some servers one need to put "or die(mysql_error())" when you use mysql_num_rows(), or else it will throw an error. :S"

Just edit arcade_play.php and change line 18 from:
$result = $db->query('SELECT * FROM '.$db->prefix.'arcade_games WHERE game_id = "'.$game_name.'"') or error('Unable to fetch games', __FILE__, __LINE__, $db->error());

to
$result = $db->query('SELECT * FROM '.$db->prefix.'arcade_games WHERE game_id = "'.$game_name.'"') or die ("<p class=err>Error - Query failed: ".mysql_error()."</p>");

maybe this solved your problem. Please read the following link: http://de.php.net/mysql_num_rows , your error is described there

Wich mysql version are you using? Did you use the install_mod.php of the arcade mod?

Maybe you must first delete all old arcade mod tables before you use the install script ...

Tubby,
please go first to the administration panel of the mod and do some settings at "INDEX PAGE SETTING", then save and try again.
I´ve got the same error on my webspace, on my local server there was no error.

For some reason the default setings I´ve made are not taken over.

Btw, I´ve fixed again errors and added new statistics to the main page.

dharmil wrote:

most important

style="padding: 0px 0px 0px 0px; margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; border:none; "

Yep, its working! Thanx ...

How do I remove the nasty lines in the table rows and columns? border=0 is not working

ok, Thanx. So I can make it better on future updates

Well, you know spaghetti code ?  :-)

59

(5 replies, posted in PunBB 1.2 troubleshooting)

Thanx! This fixed my error ...

Ok, I´ve made again some updates.
This version is based on NICO_SOMB´s arcade mod and modifications by PANDARK and DHARMIL. Thanx to all.

I´m not a programmer, so they may be errors. Maybe the programming code could be better...
Anyway, it makes fun and I hope its working for you. :-)

This version fixed some errors.  I didn´t give this a version number, cause I thinks it is still a beta version.
I also added some statistics to the main page and options to the admin panel.
English, german and french language included.

Read the readme.txt for install.

Screenshot of the main page:
http://img48.imageshack.us/img48/4249/screenshotmain6dc.th.jpg

Screenshot of the game page:
http://img157.imageshack.us/img157/6301/screenshotgame8mu.th.jpg

Screenshot of the highscore page:
http://img48.imageshack.us/img48/7600/screenshotscores6fg.jpg

You can download it here and test it on my little forum.

Open in your punbb root folder /include/common.phph and remove the two slashes in front of:

// define('PUN_DEBUG', 1);

This is for a detailed error description.
Try again and post the error ...

Wich mod version do you use? At the moment Dharmil, Pandark and myself are making some improvements of NicoSomb´s first releases arcade mod. Our modifications are different.

62

(5 replies, posted in PunBB 1.2 troubleshooting)

I´ve tried cleaning with phpMyAdmin, the error is still the same.

Yes I´ve migrate the db from 4.1 to 5.0 and followed the migrate instructions. All seems working fine ...

63

(13 replies, posted in Programming)

Yep, thats it. thanx again

64

(5 replies, posted in PunBB 1.2 troubleshooting)

After trying to submit a post with the following character combination o.o or O.O , an error appears:

File: D:\HP\forum\include\search_idx.php
Line: 149

PunBB reported: Unable to insert search index words

Database reported: Duplicate entry 'o.o' for key 1 (Errno: 1062)

The message is stored.

How should I fix this?

Yep you´re right dharmil. Think its better to seperate the query to add a game for better error handling.
I´ve made a smal statistic block wich displays the topscorer and the newest highscores.

Next wich I try is to insert a game-search function ...

You can see it here. User: punbb, PW: test

66

(13 replies, posted in Programming)

I´ve tried the query but the result is not correct. This query collects all highscore entries per user. It counts also the 2., 3., 4. ...place of a user not only topscore (1.place).

67

(13 replies, posted in Programming)

thanx a lot, I´ll try ist.

For the moment I´ve fixed this with an "is_topscore" entry in the highscoretable. Maybe it´s better for later statistics.
You can see it here. User: punbb, PW: test

68

(13 replies, posted in Programming)

Yes, dharmil is right.
Sorry, that I did not clearly expressed what it means.

I´d like to create a small statistic block in front of the arcade game mod.
Not to graphic, just simple layout and easy to administrate like the fundamental idea of punbb.

69

(13 replies, posted in Programming)

I want to grab the top highscores of each game per user.
The output should look like this: First Place USER1 with 30 highscores, Second place USER2 with 20 Highscores and Third place USER3 with 10 highscores

70

(13 replies, posted in Programming)

Whats wrong with this query?

SELECT username, MAX(rank_score) , COUNT(*) as total
FROM arcade_ranking, arcade_games, users
WHERE rank_game = game_filename AND rank_player = id
GROUP BY username ORDER BY total DESC LIMIT 3

This query collects all scores and not only the highscores. It makes no difference of using MAX(rank_score) or only rank_score, the result is always the same ...

71

(13 replies, posted in Programming)

I need a mysql query to count top scores of every user from all games, descending sorted.

I´ve the following tables:

arcade_games
- game_id
- game_name
- game_filename
- game_desc
- game_width
- game_height
- game_cat

and

arcade_ranking
- rank_id
- rank_game
- rank_player
- rank_score
- rank_date

The output should look like this: First Place USER1 with 30 highscores, Second place USER2 with 20 Highscores and Third place USER3 with 10 highscores

I´m not a programmer please help ...

If all games have a white screen , the game path is wrong and not in pun root.

|-[punbb root]
|         |-[img]
|         |-[include]
|         |-[plugins]
|         |-[lang]
|         |-[games]
|         |        |-[xxxxx.swf]
|         |-[arcade.php]
|         |-[arcade_play.php]
|         |-[arcade_ranking.php]
|         |-[newscore.php]

You can enable punbb debugmode to get more error messages. (edit: /iclude/common.php and remove the two slashes of: //define('PUN_DEBUG', 1); )

dharmil wrote:

k i wll test it and where can i get the 100 games (and the mod still doesnt work)

hmm... I´ve tested the mod on a clean install and it works ok.  You can test it here. Wich error do you have?
I´m working on the other games and release the package if all works ok.

Sorry, uploaded wrong file ... link fixed.

I´ve also made some changes again.
- added languages (english/german/french)
- rearranged the naming of all var´s in all .php files into english for future postprocessing
- added date and time to the highscore table
- added tables for game category and date/time for future implementation
- some optical adjustments
- now all games are placed in /games folder, not in img/games
- removed mismatches from games and sql querys
- fixed some errors in the administration plugin

The database structure of this release differ from further releases!
Please use this one for testing.
This mod comes with 10 pre-installed games. Additional games (nearly 100!) come as extension.