Jump to content

arcade and cronjob


chery

Recommended Posts

arcade and cronjob

 

I have absolutely no idea on how to do this but I need a cronjob for the arcade that will rewrite the Score per point reward based on the highest AT score.

 

i.e.

phpbb_ina_at_scores has the field: score

phpbb_ina_games has the field: game_reward

 

So if the phpbb_ina_at_scores/score is 100

I want the phpbb_ina_games/game_reward to be 100

 

and if the if the phpbb_ina_at_scores/score is 10050

I want the phpbb_ina_games/game_reward to be 10000

 

Does anyone have any idea on the php involved with this? I have over 4200 games and checking them manually is draining the joy out of life!

Link to comment
Share on other sites

What you need to do is put a PHP script together which runs on each row running the checks you've specified. Then you will need to make a Cron job to run that file every x minutes.

 

It's not a hard job, if nobody else has I'll do it later on but I have to go out now!

Link to comment
Share on other sites

Please tell me exactly what you need - I only want to run the cron once per day to cut doen on server queries.

 

PHP version 4.4.4

MySQL version 4.1.21-standard

 

Server: localhost  Database: worldwid_worldwide

 

Table: phpbb_ina_games

Field Type Collation Attributes Null Default

game_reward int(11)  UNSIGNED No 100

 

Table: phpbb_ina_at_scores

Field Type Collation Attributes Null Default

score double(14,4)  No 0.0000

Link to comment
Share on other sites

SQL result

Host: localhost

Database: worldwid_worldwide

Generation Time: May 13, 2007 at 02:24 PM

Generated by: phpMyAdmin 2.9.0.2 / MySQL 4.1.21-standard

SQL query: SELECT * FROM `phpbb_ina_at_scores` WHERE `game_name` LIKE CONVERT( _utf8 'ninjaturtles1' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0, 30 ;

Rows: 3

 

game_name  ninjaturtles1 ninjaturtles1 ninjaturtles1

player  NULL NULL NULL

player_id  346 295 2

player_name  DerringDo DerringDo DerringDo

score  930.0000 770.0000 660.0000

date  1171454231 1170996621 1170818411

player_ip  124.120.182.153 laddis chery

time_taken  118 155 119

 

Link to comment
Share on other sites

SQL result

Host: localhost

Database: worldwid_worldwide

Generation Time: May 13, 2007 at 02:24 PM

Generated by: phpMyAdmin 2.9.0.2 / MySQL 4.1.21-standard

SQL query: SELECT * FROM `phpbb_ina_games` WHERE `game_name` LIKE CONVERT( _utf8 'ninjaturtles1' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0, 30 ;

Rows: 1

 

game_id  799

game_name  ninjaturtles1

game_path  games/ninjaturtles1/

game_desc  Ninja Turtles

game_charge  1

game_reward  100

game_bonus  1000

game_use_gl  0

game_flash  1

game_show_score  1

win_width  800

win_height  400

highscore_limit  5

reverse_list  0

played  8

instructions   

game_avail  1

allow_guest  0

image_path  games/ninjaturtles1/ninjaturtles11.gif

cat_id  6

at_highscore_limit  5

at_game_bonus  1000

score_type  2

game_autosize  0

date_added  1170757468

rank_required  0

level_required  0

group_required  0

game_control  1

highscore_id  346

at_highscore_id  346

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.