Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > ibProArcade Archive
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Get rid of "Notice" messages after changing index.php Details »»
Get rid of "Notice" messages after changing index.php
Version: , by jonty jonty is offline
Developer Last Online: Nov 2021 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-25-2010 Last Update: Never Installs: 0
 
No support by the author.

After altering index.php to enable scores to be saved, we had an issue with 'notice' messages appearing at the top of the index.php page.
From what i can make out, this is just a warning that variables havent been set or don't exist.
The reason some sites get it and others dont, is that you can turn this off in php.ini if you have access.

I didn't really want to mess about with the .ini file, so I've set a few checks in the script for index.php.

Works for us, hope it works for you too.
This is replacement code for the code in the "INFO - vbadvanced or another Portal.txt" document

PHP Code:
// ibProArcade
if(isset($POST['module']) && $_POST['module'] == "pnFlashGames")
{
    require_once(
'./global.php');

    switch(
$_POST['func'])
    {
        case 
"storeScore":
        
$_GET['act'] = "Arcade";
        
$_GET['module'] = "arcade";
        
$_GET['do'] = "pnFStoreScore";
        break;

        case 
"saveGame":
        
$_GET['do'] = "pnFSaveGame";
        break;

        case 
"loadGame":
        
$_GET['do'] = "pnFLoadGame";
        break;

        case 
"loadGameScores":
        
$gid $vbulletin->input->clean_gpc('p''gid'TYPE_INT);
        
$uid$vbulletin->userinfo['userid'];
        
$game $db->query_first("SELECT * FROM " TABLE_PREFIX "games_scores WHERE mid=$uid AND gid = $gid ORDER BY score DESC LIMIT 0,1");
        
$scores $game[score];

        if(
$scores != false)
        {
            
//Return true
            
print "&opSuccess=true&gameScores=$scores&endvar=1"//send endvar to keep opSuccess separate from all other output from PostNuke
        
}
        else
        {
            print 
"&opSuccess=false&error=Error&endvar=1";
        }
        break;
    }
}

if(isset(
$_GET['act']))
{
        
$act $_GET['act'];
}
if(isset(
$_GET['act']) && isset($_GET['autocom']))
{
        
$autocom $_GET['autocom'];
}
if(isset(
$_GET['act']) && isset($_GET['showuser']))
{
        
$showuser$_GET['showuser'];
}

if((isset(
$act) && $act == "Arcade") || (isset($autocom) && $autocom=="arcade")) {  
        include 
"arcade.php";
        exit();
    }
    if(!empty(
$showuser) && $showuser >= 1) {
        
$u $showuser;
        
$_GET[u] = $showuser;
        include 
"member.php";
    exit();
    }

// end of ibProArcade 
There's probably a neater way of doing it, but it works for us

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-25-2010, 10:37 PM
TriAxis TriAxis is offline
 
Join Date: Dec 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well this helped quite a bit. I am getting this same situation.

Once I put your code in place only one "Notice: Undefined variable:" remained.

It is the one referencing this line.

Code:
if($act == "Arcade" || $autocom=="arcade") {
Otherwise this is the best fix so far for the notification at the top of the index file and the score posting page.

Any ideas about that one line?

Thank you for your efforts!
Reply With Quote
  #3  
Old 05-26-2010, 06:39 AM
jonty jonty is offline
 
Join Date: Dec 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TriAxis View Post
Well this helped quite a bit. I am getting this same situation.

Once I put your code in place only one "Notice: Undefined variable:" remained.

It is the one referencing this line.

Code:
if($act == "Arcade" || $autocom=="arcade") {
Otherwise this is the best fix so far for the notification at the top of the index file and the score posting page.

Any ideas about that one line?

Thank you for your efforts!
You're welcome :up:
I cant replicate that error on our test system, but changing the line to
PHP Code:
if((isset($act) && $act == "Arcade") || (isset($autocom) && $autocom=="arcade")) { 
might do the trick
(I'm not sure if php processes the whole conditional (in which case it might fail) or if it just process the first part (in which case it should work).

Alternatively changing the 3 if statement before
PHP Code:
if(isset($_GET['act'])) 

        
$act $_GET['act']; 

if(isset(
$_GET['act']) && isset($_GET['autocom'])) 

        
$autocom $_GET['autocom']; 

if(isset(
$_GET['act']) && isset($_GET['showuser'])) 

        
$showuser$_GET['showuser']; 

to
PHP Code:
if(isset($_GET['act'])) {$act $_GET['act'];} else {$act="";}
if(isset(
$_GET['act']) && isset($_GET['autocom'])) {$autocom $_GET['autocom'];} else {$autocom="";}
if(isset(
$_GET['act']) && isset($_GET['showuser'])) {$showuser$_GET['showuser'];} else {$showuser="";} 
Reply With Quote
  #4  
Old 05-27-2010, 03:55 AM
TriAxis TriAxis is offline
 
Join Date: Dec 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jonty View Post
You're welcome :up:
I cant replicate that error on our test system, but changing the line to
PHP Code:
if((isset($act) && $act == "Arcade") || (isset($autocom) && $autocom=="arcade")) { 
might do the trick
Yes! This worked! You are a gentleman and a scholar!


Quote:
Originally Posted by jonty View Post
PHP Code:
if(isset($_GET['act'])) {$act $_GET['act'];} else {$act="";}
if(isset(
$_GET['act']) && isset($_GET['autocom'])) {$autocom $_GET['autocom'];} else {$autocom="";}
if(isset(
$_GET['act']) && isset($_GET['showuser'])) {$showuser$_GET['showuser'];} else {$showuser="";} 
I did do this code replacement trying to fix the problem below with no luck.

What is interesting is that the error messages have disappeared and I don't get the security token error...but... the only games on my arcade that save their score are the ones that come with the mod. Every other game I have loaded... 52 at the moment... will play and seem to work, but when you finish the game and submit the score, the screen just stays blank and the screen never changes.

I will investigate this new issue and see what I can find.

But again... thank you very much for your work. :up:
Reply With Quote
  #5  
Old 05-27-2010, 04:28 AM
jonty jonty is offline
 
Join Date: Dec 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TriAxis View Post
Yes! This worked! You are a gentleman and a scholar!




I did do this code replacement trying to fix the problem below with no luck.

What is interesting is that the error messages have disappeared and I don't get the security token error...but... the only games on my arcade that save their score are the ones that come with the mod. Every other game I have loaded... 52 at the moment... will play and seem to work, but when you finish the game and submit the score, the screen just stays blank and the screen never changes.

I will investigate this new issue and see what I can find.

But again... thank you very much for your work. :up:
i got that and discovered it was the v32 versions of the games that froze, but the v2 games were ok.

I'll amend the first script with the changes that worked. :up:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04222 seconds
  • Memory Usage 2,289KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete