arcade points not working correctly

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   arcade points not working correctly
jennifer
CZ Newbie
jennifer has been a member for over 20 year's 20 Year Member
usa.gif
Gender: Female
Status: Offline
Joined: Aug 04, 2004
0.00 posts per day
Posts: 7
Points: 5,065
   
I have been using the arcade for months now. It all works fine. I have just installed your points mod for it. I have double and tripple checked the installation. It appears to be correct. It is taking the proper amount of points away from players and giving points for the highest scores. but it wont give any points for top 10. Would you be able to help with this. I dont even know where to begin. Any help would be appreciated. icon_wink.gif I am using arcade version v 1.0.1 . Can this be modified to give out points for the "top 5" scores for each game that are listed on the high scores page?????????



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
It gives for the top 10 placed and the first place. Attach your proarcade.php. Your using Nuke yes?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: arcade points not working correctly
jennifer
CZ Newbie
jennifer has been a member for over 20 year's 20 Year Member
usa.gif
Gender: Female
Status: Offline
Joined: Aug 04, 2004
0.00 posts per day
Posts: 7
Points: 5,065
   
yes, nuke 7.0
here is the file
<?php

/***************************************************************************
*                                proarcade.php
*                            -------------------
*   fait le                : Mercredi,19 Mai, 2003
*   Par : giefca - http://www.gf-phpbb.com
*
***************************************************************************/
/*
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}*/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
//include($phpbb_root_path . 'common.'.php);

include('../../config.php');
include('db/db.php');
include('includes/functions.php');
include('includes/constants.php');
include('includes/sessions.php');
include('common_arcade.php');

while( list($var, $param) = @each($HTTP_POST_VARS) )
{
   $$var = $param ;
}

while( list($var, $param) = @each($HTTP_GET_VARS) )
{
   $$var = $param ;
}


//$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

//
// Start session management
//

$userdata = session_pagestart($user_ip, PAGE_GAME, $nukeuser);
init_userprefs($userdata);

//
// End session management
//
// Start auth check
//

$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

$sql = "SELECT * FROM " . GAMES_TABLE . " WHERE game_id = '$gid'";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la table des jeux", '', __LINE__, __FILE__, $sql);
}
if ( !( $row = $db->sql_fetchrow($result) ) )
{// Si l'utilisateur n'a encore aucun score pour ce jeu'
   message_die(GENERAL_ERROR, "Aucun jeu ne correspond.") ;
}

if ( $row['game_type'] == 0 )
{
   $deb = 32 - $hashoffset ;
   $gamehash_id = substr( $newhash , $deb , $hashoffset ) . substr( $newhash , 0 , $deb ) ;
}

if ( $row['game_type'] == 1 )
{
$gamehash_id = $gamehash ;
}

if ( $row['game_type'] == 2 )
{
if ( $vpaver == "100B" )
{
$gamehash_id = $gamehash ;
$vpaver = "100B2" ;
}
}
$vscore = $row['game_scorevar'] ;
$score = $$vscore ;

if (  !$userdata['session_logged_in']  && !isset($valid) )
{
   header("Location: http://" . $board_config['server_name']."/modules/Forums/proarcade.php?$vscore=$score&gid=$gid&valid=X&newhash=$newhash&gamehash_id=$gamehash_id&gamehash=$gamehash&hashoffset=$hashoffset&settime=$settime&sid=$sid&vpaver=$vpaver&sid=$sid");
      exit;
}

if ( !$userdata['session_logged_in'] )
{
   header("Refresh: 0; url= http://" . $board_config['server_name']."/modules.php?name=Your_Account");
   exit;
}

$sql = "SELECT * FROM " . GAMEHASH_TABLE . " WHERE gamehash_id = '$gamehash_id' and game_id = '$gid' and user_id = '" . $userdata['user_id'] . "'";

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des hash game", '', __LINE__, __FILE__, $sql);
}

// Tentative de hack ?
if ( !( $row = $db->sql_fetchrow($result) ) or ($vpaver != "100B2") or (!isset($$vscore)) )
{
   $sql = "INSERT INTO " . HACKGAME_TABLE . " ( user_id , game_id , date_hack ) VALUES ( '" . $userdata['user_id'] . "' , '$gid' , '" . time() . "')" ;
   $db->sql_query($sql) ;

   header("Location: http://" . $board_config['server_name']."/modules.php?name=Forums&file=arcade&sid=$sid");
   exit;
}

$sql = "DELETE FROM " . GAMEHASH_TABLE . " WHERE gamehash_id = '$gamehash_id' and game_id = $gid and user_id = " . $userdata['user_id'] ;

$db->sql_query($sql) ;



//
// End of auth check
//
      //Arcade Points Addon Telli
   $aconf = array();
   $sql = "SELECT * FROM ".$prefix."_arcade_config";
   $result = $db->sql_query($sql);
   while(list($config_name, $config_value) = $db->sql_fetchrow($result)){
      $aconf[$config_name] = $config_value;
   }
      $highscore = $aconf['highscore'];
      $topscore = $aconf['topscore'];
      $pergame = $aconf['pergame'];
      $pname = $aconf['pname'];
      if ($pergame > 0) {
   $db->sql_query("UPDATE ".$prefix."_users SET $pname=$pname - $pergame WHERE username='$userdata[username]'");
      //End Arcade Points Addon
}


$sql = "SELECT * FROM " . SCORES_TABLE . " WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des scores", '', __LINE__, __FILE__, $sql);
}

$datenow = time();
$ecart = $datenow - $settime ;

if ( !( $row = $db->sql_fetchrow($result) ) )
{// Si l'utilisateur n'a encore aucun score pour ce jeu'
   $sql = "INSERT INTO " . SCORES_TABLE . " (game_id , user_id , score_game , score_date , score_time , score_set )
   VALUES ( $gid , " . $userdata['user_id'] . " , $score , $datenow , $ecart , 1 ) ";
   $result = $db->sql_query($sql) ;
}
else
{
  if ( $row['score_game'] < $score )
  {
  $sql = "UPDATE " . SCORES_TABLE . " set score_game = $score , score_set = score_set + 1 , score_date = $datenow , score_time = score_time + $ecart 
   WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;
  $result = $db->sql_query($sql) ;
                //Arcade Points Addon Telli
   $db->sql_query("UPDATE ".$prefix."_users SET $pname=$pname + $topscore WHERE username='$userdata[username]'");
                //End Arcade Points Addon
  }   
  else
  {
    $sql = "UPDATE " . SCORES_TABLE . " set score_set = score_set + 1  , score_time = score_time + $ecart
   WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;
    $result = $db->sql_query($sql) ;
  }
}


$sql = "SELECT * FROM " . GAMES_TABLE . " WHERE game_id = " . $gid ;
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des jeux", '', __LINE__, __FILE__, $sql);
}

if ( ( $row = $db->sql_fetchrow($result) ) && ( $row['game_highscore']< $score) )
{
   $sql = "UPDATE " . GAMES_TABLE . " set game_highscore = $score , game_highuser = "
   . $userdata['user_id'] . " , game_highdate = " . time() . " WHERE game_id = $gid" ;
   $result = $db->sql_query($sql);
                //Arcade Points Addon Telli
   $db->sql_query("UPDATE ".$prefix."_users SET $pname=$pname + $highscore WHERE username='$userdata[username]'");
                //End Arcade Points Addon
}

   header("Location: http://" . $board_config['server_name']."/modules.php?name=Forums&file=games&gid=$gid&sid=$sid");
   exit;

?>>



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum