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
How to fix "Security Token" Error for vBulletin 4.x.x Details »»
How to fix "Security Token" Error for vBulletin 4.x.x
Version: , by MikalMirkas MikalMirkas is offline
Developer Last Online: Jan 2012 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-24-2009 Last Update: Never Installs: 0
 
No support by the author.

Now PLEASE, stop making threads about it.
This is how to fix it:
Go to your forum's directory, and find the
Code:
index.php
file. Right after the
Code:
<?php
, add this:
PHP Code:
// ibProArcade
if($_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;
    }
}

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

// end of ibProArcade 
Credit to Stangger5, and MrZeroPage.

Edit (LOL, this thread got replies? >_>):
Quote:
Originally Posted by Moey View Post
Thanks

By the way.. you cant really blame a ton of people asking how to fix this..its not like its our responsibility..its the developers..not ours ..
README.txt is there for a reason. I have saw a LOT of these threads pushing out the actual issues on hand. kthx

Show Your Support

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

Comments
  #12  
Old 03-19-2010, 01:18 PM
c.c. c.c. is offline
 
Join Date: Jan 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MikalMirkas View Post
Now PLEASE, stop making threads about it.
This is how to fix it:
Go to your forum's directory, and find the
Code:
index.php
file. Right after the
Code:
<?php
, add this:
PHP Code:
// ibProArcade
if($_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;
    }
}

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

// end of ibProArcade 
Credit to Stangger5, and MrZeroPage.
I did this and I'm still getting the security token error.
Reply With Quote
  #13  
Old 03-21-2010, 07:23 PM
chatzworld chatzworld is offline
 
Join Date: Apr 2007
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks! this has worked fine for me
Reply With Quote
  #14  
Old 03-31-2010, 07:31 AM
TriAxis TriAxis is offline
 
Join Date: Dec 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CrosseyedGamer View Post

Notice: Undefined index: module in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 3

Notice: Use of undefined constant act - assumed 'act' in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 42

Notice: Undefined index: act in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 42

Notice: Use of undefined constant autocom - assumed 'autocom' in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 43

Notice: Undefined index: autocom in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 43

Notice: Use of undefined constant showuser - assumed 'showuser' in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 44

Notice: Undefined index: showuser in /var/www/vhosts/crosseyedgamer.com/httpdocs/index.php on line 44
I have this exact result myself. Any suggestions on what to do to fix this?

I am not using VBAdvanced or any other front end. The index is the original from the install so I am not understanding why I am getting this error unless it has to just be a version 4.0 issue. Also my site is total fresh install. I have run this arcade on two other forums so I know how it works and have not had a problem in the 3.x versions. Only this in 4.

The errors above appear in the root of the site, and when you finish a game and submit the score. I do get the score recorded as it should, only when this code is added to the index.php file, it just shows this text.

Thanks for any suggestions.
Reply With Quote
  #15  
Old 03-31-2010, 11:51 AM
c.c. c.c. is offline
 
Join Date: Jan 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My forum is:

highdefjunkies.com/forum.php

So do I add this in my forum.php?

I'm so confused? Please give me a hand. Thanks!!!

I added this in my forum.php and it still gives me a security token error.

When I add this to my index.php it gives me this error:

Parse error: syntax error, unexpected T_DEC, expecting T_STRING or T_VARIABLE or '$' in /home/highdefj/public_html/index.php on line 58

Any ideas? I really want to get this arcade going because my members love it.

Thanks for any help you can give me!!!!
Reply With Quote
  #16  
Old 04-01-2010, 04:00 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The instructions very clearly say to make the edits to your forum's /index.php.

--------------- Added [DATE]1270141339[/DATE] at [TIME]1270141339[/TIME] ---------------

Quote:
Originally Posted by TriAxis View Post
I have this exact result myself. Any suggestions on what to do to fix this?

I am not using VBAdvanced or any other front end. The index is the original from the install so I am not understanding why I am getting this error unless it has to just be a version 4.0 issue. Also my site is total fresh install. I have run this arcade on two other forums so I know how it works and have not had a problem in the 3.x versions. Only this in 4.

The errors above appear in the root of the site, and when you finish a game and submit the score. I do get the score recorded as it should, only when this code is added to the index.php file, it just shows this text.

Thanks for any suggestions.
Make sure you didn't change, removed or failed to include even a single character in the PHP file.
Reply With Quote
  #17  
Old 04-02-2010, 01:01 AM
c.c. c.c. is offline
 
Join Date: Jan 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
The instructions very clearly say to make the edits to your forum's /index.php.

--------------- Added [DATE]1270141339[/DATE] at [TIME]1270141339[/TIME] ---------------


Make sure you didn't change, removed or failed to include even a single character in the PHP file.
And I clearly said that if I change the index.php I get this error when it trys to save the highscore.

Parse error: syntax error, unexpected T_DEC, expecting T_STRING or T_VARIABLE or '$' in /home/highdefj/public_html/index.php on line 58
Reply With Quote
  #18  
Old 04-02-2010, 04:35 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by c.c. View Post
And I clearly said that if I change the index.php I get this error when it trys to save the highscore.

Parse error: syntax error, unexpected T_DEC, expecting T_STRING or T_VARIABLE or '$' in /home/highdefj/public_html/index.php on line 58
A syntax error means the characters are out of place. You can't forget to include a single comma, nor can you include any unnecessary spaces.
Reply With Quote
  #19  
Old 04-03-2010, 07:49 AM
TriAxis TriAxis is offline
 
Join Date: Dec 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
The instructions very clearly say to make the edits to your forum's /index.php.

--------------- Added [DATE]1270141339[/DATE] at [TIME]1270141339[/TIME] ---------------


Make sure you didn't change, removed or failed to include even a single character in the PHP file.
And not to be argumentative, but I did a copy and paste of the code straight out of the instructions "INFO - vbadvanced or another Portal.txt" file included in the download. It is a very simple thing, just copy and paste it in right below the <?php in the index.php so I am surprised this didn't work first try.

This is a brand new install that is very clean. This hack was the first one I tried to add to my forums since it was one of the favorites on the 3.x sites. I have done nothing else but get vBulletin 4.0 operational, then add ibProArcade. The games run, but as instructed, if you don't add this patch from the portal.txt file the scores will not save. But adding the code puts the nonsense at the top of my index.php landing page.

I don't get the parsing error that c.c. is getting, I am getting the "Undefined index" errors only that CrosseyedGamer is getting.

Thanks for the suggestions.
Reply With Quote
  #20  
Old 04-09-2010, 08:10 AM
microlight microlight is offline
 
Join Date: Dec 2009
Location: Leeds UK
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked for me thanks.
Reply With Quote
  #21  
Old 04-14-2010, 10:25 AM
Baf_Jams Baf_Jams is offline
 
Join Date: Mar 2008
Location: Derby UK
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks had to redo this due to upgrade and index was overwritten
works a treat
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 10:48 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12245 seconds
  • Memory Usage 2,357KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete