PHP-Nuke Titanium HQ
     
Lonestar Nuke-Evolution Modules
PHP-Nuke Titanium v4.0.4 / PHP v8.2.17
Sponsor Tron for PHP-Nuke Titanium
::: There is so much more here to see, it takes 30 seconds to register an account and we don't even verify with e-mail! Just register we promise you won't be sorry... ::: Login or Register
IPHub is an IP lookup website featuring Proxy/VPN detection. A free API is available, so you can perform fraud checks on online stores, detect malicious players on online games and much more! Look at this! Click here Look at this! to sign up for FREE today at ipHub ::: Country Music: The Soul Circus Cowboys ::: Sponsor: Brandon Maintenance Management, LLC Phone: 813-846-2865 ::: Sponsor: Big Country Radio - The EJ Morning Show :::

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 276

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 276

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 268

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/includes/auth.php on line 328

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/modules/Forums/viewtopic.php on line 406

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/modules/Forums/viewtopic.php on line 536

Warning: Undefined array key "session_logged_in" in /home/dev4/public_html/modules/Forums/viewtopic.php on line 788

Warning: Undefined array key "session_id" in /home/dev4/public_html/includes/functions.php on line 1015

 
Recent Topics   Next 5 >>  
Forum Replies Last Post
Oh yes ! Now here is some Northern fried wierd shit! 💩
Started by RECTOR
PHP-Nuke Titanium - Modules (Root) 13 Thu Oct 26, 2023 5:33 pm
by Technocrat
What year is it!?
Started by Technocrat
PHP-Nuke Titanium - Community 0 Thu Oct 26, 2023 5:05 pm
by Technocrat
Dragonfly
Started by Critical
PHP-Nuke Titanium - Community 2 Thu Apr 20, 2023 6:50 am
by Critical
Can you PM me the private link to the PHP 9 Repo
Started by YuckFou
PHP-Nuke Titanium - PHP 1 Tue Apr 18, 2023 11:08 am
by CodeBuzzard
Your_Account Module question?
Started by CyBorg
PHP-Nuke Titanium - Modules (Root) 1 Thu Apr 06, 2023 7:39 am
by Negan

modules/Forums/games.php (Patched) 8.x
Post new topic Reply to topic printer-friendly view List users that have viewed this topic Thank Post   Forum Index phpBB Titanium - General
View previous topic View next topic
RECTOR Reply with quote
Developer
Joined Dec 12, 2022
Reputation: 8.9
votes: 2
online
modules/Forums/games.php (Patched) 8.x
by RECTOR Thu Dec 29, 2022 9:55 am

PHP:  [ Select all ]

if (!defined('MODULE_FILE')) {
 die(
'You can\'t access this file directly...');
}

if (!isset(
$popup)){
  
$module_name basename(dirname(__FILE__));
  require(
"modules/".$module_name."/nukebb.php");
}
else
{
  
$phpbb_root_path NUKE_FORUMS_DIR;
}

define('IN_PHPBB'true);

include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);

require_once(
'includes/bbcode.'$phpEx);

# Start session management
global $userdata$boardconfig;

$userdata session_pagestart($user_ipPAGE_GAME);
init_userprefs($userdata);
# End session management

include('includes/functions_arcade.' $phpEx);

# Start auth check
if (!$userdata['session_logged_in']) {
   
$header_location = (preg_match("#Microsoft|WebSTAR|Xitami#"getenv("SERVER_SOFTWARE"))) ? "Refresh: 0; URL=" "Location: ";
   
header($header_location "modules.php?name=Your_Account");
   exit;
 }
# End of auth check

$arcade_config = array();
$arcade_config read_arcade_config();

if(
$arcade_config['limit_by_posts'] && $userdata['user_level'] != ADMIN){
$secs 86400;
$uid $userdata['user_id'];

$days $arcade_config['days_limit'];
$posts $arcade_config['posts_needed'];

$current_time time();
$old_time $current_time - ($secs $days);

# Begin Limit Play mod
if($arcade_config['limit_type'] == 'posts')
{
  
$sql "SELECT * FROM " POSTS_TABLE " WHERE poster_id = ".$uid;
}
else
{
   
$sql "SELECT * FROM " POSTS_TABLE " WHERE poster_id = ".$uid." and post_time BETWEEN ".$old_time." AND ".$current_time;
}

if(!(
$result $db->sql_query($sql)))
{
  
message_die(GENERAL_ERROR'Could not obtain forums information'''__LINE____FILE__$sql);
}

    
$Amount_Of_Posts $db->sql_numrows$result );

    if(
$Amount_Of_Posts <posts>sql_query($sql))):
         
message_die(GENERAL_ERROR"Could not read games table"''__LINE____FILE__$sql);
        endif;

        if(!(
$row $db->sql_fetchrow($game))):
         
message_die(GENERAL_ERROR"This game does not exist");
        endif;

    else: 
        
message_die(GENERAL_ERROR"No game is specified");
    endif;

$liste_cat_auth_play get_arcade_categories($userdata['user_id'], $userdata['user_level'],'play');
$tbauth_play = array();
$tbauth_play explode(',',$liste_cat_auth_play);

if (!
in_array($row['arcade_catid'],$tbauth_play))
{
   
message_die(GENERAL_MESSAGE$lang['game_forbidden']);
}

$template->set_filenames(array(
        
'body' => 'games_body.tpl')
);

$sql "DELETE FROM " GAMEHASH_TABLE " WHERE hash_date <time>sql_query($sql))
{
   message_die(GENERAL_ERROR, "
Could not delete from game hash table", '', __LINE__, __FILE__, $sql);
}

# Type V2 Game Else Type V1
if (
$row['game_type'] == 3) 
{
        
  
$type_v2 = true;
        
  
$template->assign_block_vars('game_type_V2',array());
        
  
$gamehash_id = md5(uniqid($user_ip));
        
  
$sql = "INSERT INTO " . GAMEHASH_TABLE . " (gamehash_id game_id user_id hash_dateVALUES ('$gamehash_id' '$gid' '" . $userdata['user_id'] . "' '" . time() . "')";

  if (!(
$result = $db->sql_query($sql)))
  {
    message_die(GENERAL_ERROR, "
Could not delete from game hash table", '', __LINE__, __FILE__, $sql);
  }
}
elseif (
$row['game_type'] == 4 or $row['game_type'] == 5) {
  
  if (
$row['game_type'] == 5) {
    
$template->assign_block_vars('game_type_V5',array());
  }
  else
  {
    
$template->assign_block_vars('game_type_V2',array());
  }
  
  setcookie('gidstarted', '', ['expires' => time() - 3600]);
  setcookie('gidstarted',(string) 
$gid);
  setcookie('timestarted', '', ['expires' => time() - 3600]);
  setcookie('timestarted', time());
   
  
$gamehash_id = md5($user_ip);
  
  
$sql = "INSERT INTO " . GAMEHASH_TABLE . " (gamehash_id game_id user_id hash_dateVALUES ('$gamehash_id' '$gid' '" . $userdata['user_id'] . "' '" . time() . "')";

  if (!(
$result = $db->sql_query($sql)))
  {
     message_die(GENERAL_ERROR, "
Couldn't update hashtable", '', __LINE__, __FILE__, $sql);
  }

}
else
   {
     message_die(GENERAL_ERROR, "Game Type no longer supported, please contact the admin and have him/her delete it.");
   }

   setcookie('
arcadepopup', '', ['expires' => time() - 3600]);
   setcookie('
arcadepopup', '0');

global $prefix;

$sql = "SELECT arcade_cattitle FROM `".$prefix."_bbarcade_categories` WHERE arcade_catid = " . $row['
arcade_catid'];

$result = $db->sql_query($sql);

$ourrow = $db->sql_fetchrow($result);

$cat_title = $ourrow['
arcade_cattitle'];

if(!isset($row['
highscore']))
$row['
highscore'] = 0;

$template->assign_vars(['
MAXSIZE_AVATAR' => (int) $arcade_config['maxsize_avatar'], 
                        '
CAT_TITLE' => '<class="arcadeTitleLink" href="&#039; . append_sid(" cid=").$row&#91;&#039;arcade_catid&#039;&#93;.&#039;">'.$cat_title.'</a', 
                        '
NAV_DESC' => '<a href="&#039;.append_sid(">'.$lang['arcade'].'</a', 
                        '
SWF_GAME' => $row['game_swf'], 
                        '
GAME_WIDTH' => $row['game_width'], 
                        '
GAME_HEIGHT' => $row['game_height'], 
                        '
L_GAME' => $row['game_name'], 
                        '
GAMEHASH' => $gamehash_id, 
                        '
L_TOP' => $lang['best_scores_game'], 
                        '
HIGHSCORE' => number_format($row['highscore']), 
                        '
URL_ARCADE' => '<nobr><class="arcadeTitleLink" href="&#039;.append_sid(">&nbsp;'.$lang['lib_arcade'].'&nbsp;</a></nobr', 
                        '
MANAGE_COMMENTS' => '<nobr><class="arcadeTitleLink" href="&#039;.append_sid(">&nbsp;'.$lang['comments'].'&nbsp;</a></nobr', 
                        '
URL_BESTSCORES' => '<nobr><class="arcadeTitleLink" href="&#039;.append_sid(">&nbsp;'.$lang['best_scores'].'&nbsp;</a></nobr', 
                        '
URL_SCOREBOARD' => '<nobr><class="arcadeTitleLink" href="&#039;.append_sid(">&nbsp;'.$lang['scoreboard'].'&nbsp;</a></nobr']
 );

$sql = "SELECT s.* , 
         u.username, 
 u.user_avatar_type, 
 u.user_allowavatar, 
      u.user_avatar FROM ".SCORES_TABLE." s LEFT JOIN ".USERS_TABLE." u ON s.user_id = u.user_id WHERE game_id = $gid ORDER BY s.score_game DESC, s.score_date ASC LIMIT 0,15 ";

if (!($result = $db->sql_query($sql)))
{
  message_die(GENERAL_ERROR, "Could not read from scores table", '', __LINE__, __FILE__, $sql);
}

$sql = "SELECT comments_value FROM " . COMMENTS_TABLE . " WHERE game_id = $gid";

if( !($result_comment = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, "Error retrieving comment from comment table", '', __LINE__, __FILE__, $sql);
}

$row_comment = $db->sql_fetchrow($result_comment);

# Define censored word matches
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

if(!empty($row_comment['
comments_value'])) {
 
  if ( count($orig_word) > 0 ) {
     $row_comment['
comments_value'] = preg_replace($orig_word, (string) $replacement_word, (string) $row_comment['comments_value']);
   }
  
  $comment = '
<marquee>' .$row_comment['comments_value'] .'</marquee>';
}
else
{
  $comment='';
}

$pos = 0;
$posreelle = 0;
$lastscore = 0;

while ($row = $db->sql_fetchrow($result)) {

        $posreelle++;

        if($posreelle == 11)
        break;

        if ($posreelle == 1) {
                $user_avatar_type = $row['
user_avatar_type'];
                $user_allowavatar = $row['
user_allowavatar'];
                $user_avatar = $row['
user_avatar'];
                $best_user = UsernameColor($row['
username']);
                $best_date = create_date( $board_config['
default_dateformat'] , $row['score_date'] , $board_config['board_timezone'] );
                $games_played = $row['
score_set'];
                $best_time = sec2hms($row['
score_time']);
        }

        if ($lastscore!=$row['
score_game']) {
                $pos = $posreelle;
        }

        $row['
trophy'] = '';

        # Ordinal Number Suffix - TheGhost 11:05 pm Saturday 10/22/2022
        $last = substr($posreelle,-1);

        if($last > 3 or $last == 0 or ($posreelle >= 11 and $posreelle </span>assign_block_vars('
scorerow', 
        ['
POS' => $pos, 'USERNAME' => '<span>'.UsernameColor($row['username']).'</span>', 
         '
URL_STATS' => '<nobr><class="module" href="&#039;.append_sid(" uid=".$row&#91;&#039;user_id&#039;&#93;).&#039;">'."<span><i class='bi bi-award'></i></span>".'</a></nobr>', 
         '
GAMEDESC' => $row['game_desc'], 
         '
SCORE' => '<strong>'.number_format($row['score_game']).'</strong>', 
         '
TROPHY' => $row['trophy'], 
         '
DATEHIGH' => create_date($board_config['default_dateformat'] , $row['score_date'] , $board_config['board_timezone'])]
         );
}

$avatar_img = '';

if (isset($user_avatar_type) && $user_allowavatar) {
        switch($user_avatar_type) {
                case USER_AVATAR_UPLOAD:
                        $avatar_img = ($board_config['
allow_avatar_upload']) ? '<img class="rounded-corners-user-info" src="&#039; . $board_config&#91;&#039;avatar_path&#039;&#93; . &#039;/&#039; . $user_avatar . &#039;" alt="" hspace="20" align="center" valign="center">' : '';
                        break;

                case USER_AVATAR_REMOTE:
                        $avatar_img = ($board_config['
allow_avatar_remote']) ? '<img class="rounded-corners-user-info" src="&#039; . $user_avatar . &#039;" alt="" hspace="20" align="center" valign="center">' : '';
                        break;

                case USER_AVATAR_GALLERY:
                        $avatar_img = ($board_config['
allow_avatar_local']) ? '<img class="rounded-corners-user-info" src="&#039; . $board_config&#91;&#039;avatar_gallery_path&#039;&#93; . &#039;/&#039; . $user_avatar . &#039;" alt="" hspace="20" align="center" valign="center">' : '';
                        break;
        }
}

if ($arcade_config['
display_winner_avatar']) 
{
        if ($arcade_config['
winner_avatar_position']=='right') {
                $template->assign_block_vars('
avatar_best_player_right',array());
        } else {
                $template->assign_block_vars('
avatar_best_player_left',array());
        }

        if(empty($best_user))
        $best_user = '
NO CHAMPION YET';

        if(empty($best_time))
        $best_time = '
0';

        if(empty($games_played))
        $games_played = '
0';

        if(empty($best_date))
        $best_date = '
The 1st of Never';
        
        $template->assign_vars(['
L_ACTUAL_WINNER' => $lang['Actual_winner'], 
                                '
BEST_USER_NAME' => $best_user, 
                                '
BEST_USER_DATE' => sprintf($lang['hi_score_on'], '<span>&nbsp;&nbsp;'.$best_date.'&nbsp;&nbsp;</span>'), 
                                '
BEST_TIME' => sprintf($lang['played_time_total'], '&nbsp;<span>&nbsp;&nbsp;'.$best_time.'&nbsp;&nbsp;</span>'), 
                                '
COMMENTS' => smilies_pass($comment), 
                                '
GAMES_PLAYED' => sprintf($lang['played_times'], '<span>&nbsp;&nbsp;'.$games_played.'&nbsp;&nbsp;</span>'), 
                                '
FIRST_AVATAR' => $avatar_img]
        );
}

include($phpbb_root_path . '
whoisplaying.'.$phpEx);

# Output page header
$page_title = $lang['
arcade_game'];
include('
includes/page_header.'.$phpEx);
$template->pparse('
body');
include('
includes/page_tail.'.$phpEx); 



Back to top
View user's profile Send RECTOR a private message
Thankful People
1 user(s) is/are thankful for this post.
Display posts from previous:

Post new topic Reply to topic printer-friendly view List users that have viewed this topic Thank Post   Forum Index phpBB Titanium - General All times are UTC - 5 Hours

Page 1 of 1


 
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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Admin Area Menu Option Bugs 0 fabpot 640 Tue Jan 17, 2023 9:35 am
fabpot View latest post
No new posts New Ideas for the Forums Area 💡 1 CodeBuzzard 947 Wed Jan 11, 2023 7:07 pm
TheGhost View latest post
No new posts modules/Forums/arcade.php (Patched) 8.x 0 RECTOR 892 Thu Dec 29, 2022 1:17 pm
RECTOR View latest post
No new posts modules/Forums/common.php (Patched) 8.x 0 RECTOR 808 Wed Dec 28, 2022 9:51 pm
RECTOR View latest post
No new posts cPanel admin login is broken! 1 NukeSheriff 967 Sat Aug 27, 2022 8:46 pm
TheGhost View latest post