vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - v3 Arcade - Professional vBulletin Gaming (vB4) (https://vborg.vbsupport.ru/showthread.php?t=253211)

Gemma 11-06-2010 08:53 PM

Quote:

Originally Posted by GaryT (Post 2118803)
I need instructions for where and how to add games. What I really need is an "Install For Dummies" manual :)

Love this mod a lot better than IPB.

Make sure your forumroot/admincp/games, forumroot/images/arcade and forumroot/games are CHMOD 777

If you want to install v3arcade type games (zip format) or IPB type games (tar format) upload the said files to your admincp/games folder. Then in AdminCP>v3Arcade>Import Games>

Choose the Mass Import option that coincides with what game type you uploaded and click Start.

If you are installing games manually (already converted but not in zip or tar format), go to AdminCP>v3Arcade>Import Games>Manually Add Game and fill in the details

For example-

The .swf gets uploaded to your games folder and the two images (one 20*20px and one 50*50px) get uploaded to your images/arcade folder.

Game Title: simple enough ie Pacman
Description: blah blah blah
Game System: you would need to know what type on conversion they were made for
Shortname: pacman
Game SWF File: ie pacman.swf
Height: varies per game
Width: as above
Standard Thumbnail Image: ie pacman1.jpg
Miniature Mode Thumbnail Image : ie pacman2.jpg
Then fill in the last couple of details.

For Mochi Games read through this post (parts 6 & 7) - http://www.v3arcade.com/forums/showthread.php?t=1934

Once you have set up your Mochi account, you have access to thousands of games and the install process is as easy as clicking a few buttons :)

msorin 11-07-2010 12:44 AM

Quote:

Originally Posted by KW802 (Post 2118690)
Are you sure you downloaded the right version for the vBulletin you're using? The download drop-down has both vB3 & vB4 listed.

I just downloaded the one from here and same error. Any help will be greatly appreciated.

Doctor Death 11-07-2010 01:18 PM

Great mod.

On high score, is it possible to shrink player image to fit within column space?

Some player images are larger and ruin look.

This runs very fast and smooth. Thanks again.

Gemma 11-07-2010 01:29 PM

Quote:

Originally Posted by Doctor Death (Post 2119011)
Great mod.

On high score, is it possible to shrink player image to fit within column space?

Some player images are larger and ruin look.

This runs very fast and smooth. Thanks again.

Open the v3arcade_scorebit template and search for
Code:

<img src="{vb:raw score.useravatar}" align="{vb:stylevar left}" class="v3_gameicon" alt="" {vb:raw score.avdimensions}/>
Replace it with
Code:

<img src="{vb:raw score.useravatar}" align="{vb:stylevar left}" class="v3_gameicon" alt="" height="50"/>
You can change the 50 to whatever you want

Doctor Death 11-07-2010 02:24 PM

Thanks for such amazingly quick response....

One more issue on import of TAR games (from IPB).

I put all the TAR files in the right place and CHMOD'd folders to 777 as specificed.

Upon import, I get this error

Quote:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 6268724 bytes) in /home/xxxhbabh/public_html/forums/includes/v3arcade_class_tar.php on line 150
It does this regardless of how many I try to import (1, 10 or 100).

Thoughts?

Doctor Death 11-07-2010 02:31 PM

Quote:

Originally Posted by Gemma (Post 2119018)
Open the v3arcade_scorebit template and search for
Code:

<img src="{vb:raw score.useravatar}" align="{vb:stylevar left}" class="v3_gameicon" alt="" {vb:raw score.avdimensions}/>
Replace it with
Code:

<img src="{vb:raw score.useravatar}" align="{vb:stylevar left}" class="v3_gameicon" alt="" height="50"/>
You can change the 50 to whatever you want

The avatar/user image under "LOGGED IN AS" is the one that is mis-sized (too large).

Would this be the code that also fixes that? I tried it and it doesnt seem to have an impact.

Thanks!

Doc

Gemma 11-07-2010 05:00 PM

1 Attachment(s)
Sorry I thought you meant on the highscores list :o

Open v3ARCADE_Main and find
Code:

<vb:if condition="$show['avatar']">
                                        <div>
                                                <vb:if condition="!$player['userid']">
                                                        <img class="v3_gameicon" src="{vb:raw player.avatarurl}" alt="" border="0"/>
                                                <vb:else />
                                                        <a href="{vb:link member, {vb:raw bbuserinfo}}<vb:if condition="$vboptions['friendlyurl'] < 3">&amp;<vb:else />?</vb:if>tab=v3arcade_stats"><img class="v3_gameicon" src="{vb:raw player.avatarurl}" alt="" border="0" /></a>
                                                </vb:if>
                                        </div>
                                </vb:if>


Replace it with
Code:

<vb:if condition="$show['avatar']">
                                        <div>
                                                <vb:if condition="!$player['userid']">
                                                        <img class="v3_gameicon" src="{vb:raw player.avatarurl}" height="xxx" alt="" border="0"/>
                                                <vb:else />
                                                        <a href="{vb:link member, {vb:raw bbuserinfo}}<vb:if condition="$vboptions['friendlyurl'] < 3">&amp;<vb:else />?</vb:if>tab=v3arcade_stats"><img class="v3_gameicon" src="{vb:raw player.avatarurl}" height="xxx" alt="" border="0" /></a>
                                                </vb:if>
                                        </div>
                                </vb:if>

Changing the xxx (2 instances) to whatever suits your forums

SSG.D 11-07-2010 05:19 PM

Hi,,,, Running 4.0.8

When the game is over I get this

Quote:

Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.
Need some advise please
thx

Gemma 11-07-2010 05:24 PM

Quote:

Originally Posted by SSG.D (Post 2119123)
Hi,,,, Running 4.0.8

When the game is over I get this



Need some advise please
thx

http://www.v3arcade.com/forums/showthread.php?t=3215

SSG.D 11-07-2010 06:03 PM

Quote:

Originally Posted by Gemma (Post 2119125)

Thank You very Much!;)

K4GAP 11-07-2010 06:06 PM

I dumped all the old games I had that were in .rar format and now have 300 V3 games that are in the .zip format. I put them in the FORUMROOT/admincp/games folder but when I try to import them I get message saying "There are no more games to import".

So, can anyone help?

KW802 11-07-2010 08:49 PM

@GaryT: Two major questions.... are you putting the zip files in that folder or the unzipped files? (See Gemma's post a few post back for game installation steps). The other thing is how old those files. The .php file should be a really small file with just a few variables in it; if it looks like the .php file that was posted earlier that was an actual install script then you'll have issues just like you would have with the .rar files.

Robbed 11-07-2010 09:44 PM

Thanks, import went well.

Doctor Death 11-07-2010 09:57 PM

Quote:

Originally Posted by Gemma (Post 2119112)
Sorry I thought you meant on the highscores list :o

Open v3ARCADE_Main and find
Code:

<vb:if condition="$show['avatar']">
                                        <div>
                                                <vb:if condition="!$player['userid']">
                                                        <img class="v3_gameicon" src="{vb:raw player.avatarurl}" alt="" border="0"/>
                                                <vb:else />
                                                        <a href="{vb:link member, {vb:raw bbuserinfo}}<vb:if condition="$vboptions['friendlyurl'] < 3">&amp;<vb:else />?</vb:if>tab=v3arcade_stats"><img class="v3_gameicon" src="{vb:raw player.avatarurl}" alt="" border="0" /></a>
                                                </vb:if>
                                        </div>
                                </vb:if>


Replace it with
Code:

<vb:if condition="$show['avatar']">
                                        <div>
                                                <vb:if condition="!$player['userid']">
                                                        <img class="v3_gameicon" src="{vb:raw player.avatarurl}" height="xxx" alt="" border="0"/>
                                                <vb:else />
                                                        <a href="{vb:link member, {vb:raw bbuserinfo}}<vb:if condition="$vboptions['friendlyurl'] < 3">&amp;<vb:else />?</vb:if>tab=v3arcade_stats"><img class="v3_gameicon" src="{vb:raw player.avatarurl}" height="xxx" alt="" border="0" /></a>
                                                </vb:if>
                                        </div>
                                </vb:if>

Changing the xxx (2 instances) to whatever suits your forums

that worked great. 175 was the magic number.

Recommend putting that in configuration in next version

Doctor Death 11-07-2010 09:59 PM

Thanks for such amazingly quick response....

One more issue on import of TAR games (from IPB).

I put all the TAR files in the right place and CHMOD'd folders to 777 as specificed.

Upon import, I get this error


Quote:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 6268724 bytes) in /home/xxxhbabh/public_html/forums/includes/v3arcade_class_tar.php on line 150
It does this regardless of how many I try to import (1, 10 or 100).

Thoughts?

Gemma 11-07-2010 10:12 PM

Try editing your php.ini file settings to something like

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (8MB)

Or, if you don't have access to your php.ini file, temporarily up your limits by editing your includes/config.php file and add this lines right under the <?php line:

ini_set('memory_limit', 128 * 1024 * 1024);

You may need to change the 128 to 256 or 512

See if that helps

Doctor Death 11-07-2010 10:42 PM

Quote:

Originally Posted by Gemma (Post 2119247)
Try editing your php.ini file settings to something like

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (8MB)

Or, if you don't have access to your php.ini file, temporarily up your limits by editing your includes/config.php file and add this lines right under the <?php line:

ini_set('memory_limit', 128 * 1024 * 1024);

You may need to change the 128 to 256 or 512

See if that helps

That worked perfectly with the number 512.

I have to say how great it is to get advice from someone who has a clue.

Thanks, great work.

Doctor Death 11-07-2010 11:41 PM

Quote:

Originally Posted by cory_booth (Post 2118656)
And to contribute to everyone here with CMS.
If you would like to add a Widget to your CMS.

Download the CMPS module here:
http://www.v3arcade.com/forums/showthread.php?t=3502

Open the .xml file and manually add the templates to your skin.
Just look for the template name and copy everything between the [CDATA] tags.

Then create a new PHP widget and paste this:

PHP Code:

global $vbulletin$bbcode$parser$path$db;
$g_limit 5;
$g_champs_limit 5;
$g_news_limit 5;
$g_scores_limit 5;

function 
get_games ($as_handle$as_title$limit) {
    global 
$vbulletin;

    switch (
$as_handle) {
        case 
'recent':
            
$orderby "dateadded DESC";
            break;
        case 
'played':
            
$orderby "sessioncount DESC";
            break;
        case 
'popular':
            
$orderby "votepoints DESC";
            break;
        default:
            
$orderby "gameid ASC";
            break;
    }


    
$getgames $vbulletin->db->query("
            SELECT games.* FROM " 
TABLE_PREFIX "v3arcade_games AS games
            ORDER BY " 
$orderby "
            LIMIT 
$limit
    "
);

    while (
$game $vbulletin->db->fetch_array($getgames))
    {
            
$game['gamename'] = fetch_trimmed_title(stripslashes($game['title']),$maxtitlechars);
            
$game['gamedate'] = vbdate($vbulletin->options['dateformat'], $game['dateadded']);
            
$getbgrow exec_switch_bg();

        switch (
$as_handle) {
            case 
'recent':
                
$as_game_data $game['gamedate'];
                break;
            case 
'played':
                
$as_game_data "Played " $game['sessioncount'] . " times";
                break;
            case 
'popular':
                
$as_game_data $game['votepoints'] . " votes";
                break;
            default:
                
$as_game_data "";
                break;
        }

            
//eval('$as_gamebits .= "' . fetch_template('adv_portal_as_gamebits') . '";');
            
$templater vB_Template::create('adv_portal_as_gamebits');
        
$templater->register('as_game_data',$as_game_data);
          
$templater->register('game',$game);
          
$as_gamebits .= $templater->render();

    }
    
$vbulletin->db->free_result($getgames);

     
// eval('$gametable = "' . fetch_template("adv_portal_as_{$as_handle}_gametable") . '";');
    
$templater vB_Template::create('adv_portal_as_' $as_handle '_gametable');
     
$templater->register('as_title',$as_title);
     
$templater->register('as_gamebits',$as_gamebits);
    
$gametable $templater->render();
    return 
$gametable;
}

function 
get_champs ($limit) {
    global 
$vbulletin;

    
$champs $vbulletin->db->query_read("
            SELECT COUNT(games.highscorerid) AS count, user.username, user.userid
        FROM " 
TABLE_PREFIX "v3arcade_games AS games
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON user.userid = games.highscorerid
            WHERE user.userid IS NOT NULL
            GROUP BY user.username, user.userid
        ORDER BY count DESC, user.userid ASC
        LIMIT " 
$limit
    
);

    
$row '0';
    
$awards '0';
    
$leaders '0';
    while (
$champ $vbulletin->db->fetch_array($champs)) {
         
$leaders++;
        if (
$awards != $champ['count']) {
            
$row $leaders;
        }
        
$awards $champ['count'];
        
$getbgrow exec_switch_bg();
        
//eval('$as_champbits .= "' . fetch_template('adv_portal_as_champbits') . '";');
        
$templater vB_Template::create('adv_portal_as_champbits');
        
$templater->register('getbrow',$getbrow);
          
$templater->register('champ',$champ);
          
$as_champbits .= $templater->render();
    }
    
$vbulletin->db->free_result($champs);

    
//eval('$champstable = "' . fetch_template("adv_portal_as_champstable") . '";');
    
$templater vB_Template::create('adv_portal_as_champstable');
     
$templater->register('as_champbits',$as_champbits);
    
$champstable $templater->render();
    return 
$champstable;
}

function 
get_random_game () {
    global 
$vbulletin;

    
$random_game $vbulletin->db->query_first("
        SELECT gameid,title,description,stdimage,highscore,user.userid,user.username
        FROM " 
TABLE_PREFIX "v3arcade_games AS games
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON user.userid = games.highscorerid
        ORDER BY RAND()
        LIMIT 1
    "
);

    
$as_random_gameid $random_game[gameid];
        
$as_random_gametitle $random_game[title];
        
$as_random_stdimage $random_game[stdimage];
        
$as_random_description $random_game[description];
    if(
$random_game[highscore] == 0)
    {
        
$as_random_highscore     "No Score";
        
$as_random_highscorer    "";
        
$as_random_userid    "";
    }
    else
    {
        
$as_random_highscore     intval($random_game[highscore]);
        
$as_random_highscorer    "(" $random_game[username] . ")";
        
$as_random_userid    $random_game[userid];
    }
    
$vbulletin->db->free_result($random_game);
    
//eval('$random_table = "' . fetch_template('adv_portal_as_random') . '";');
    
$templater vB_Template::create('adv_portal_as_random');
     
$templater->register('as_random_gameid',$as_random_gameid);
     
$templater->register('as_random_gametitle',$as_random_gametitle);
     
$templater->register('as_random_highscore',$as_random_highscore);
     
$templater->register('as_random_userid',$as_random_userid);
     
$templater->register('as_random_highscorer',$as_random_highscorer);
     
$templater->register('as_random_stdimage',$as_random_stdimage);
     
$templater->register('as_random_description',$as_random_description);
    
$random_table $templater->render();
    return 
$random_table;
}

function 
get_latest_champs ($limit)
{
    global 
$vbulletin$bbcode_parser;

    
//var_dump($vbulletin);
    //highlight_file('./modules/arcadestats.php');
    //exit;
    
$news_items $vbulletin->db->query_read("
        SELECT *
        FROM " 
TABLE_PREFIX "v3arcade_news
        WHERE newstext LIKE '%is the new%'
        ORDER BY datestamp DESC
        LIMIT 
$limit
    "
);

    while (
$news_item $vbulletin->db->fetch_array($news_items)) {
           
//$as_news_text =  $bbcode_parser->do_parse($news_item['newstext'], 1, 1, 1, 0);
        
$as_news_text $news_item['newstext'];
        
$as_news_text str_replace("arcade.php"$vbulletin->options['bburl'] . "/arcade.php"$as_news_text);

        
$as_news_date vbdate($vbulletin->options['dateformat'],$news_item['datestamp']);
        
$as_news_time vbdate($vbulletin->options['timeformat'],$news_item['datestamp']);
        
$getbgrow exec_switch_bg();
        
//eval('$as_newsbits .= "' . fetch_template('adv_portal_as_newsbits') . '";');
        
$templater vB_Template::create('adv_portal_as_newsbits');
          
$templater->register('getbrow',$getbrow);
          
$templater->register('as_news_text',$as_news_text);
          
$templater->register('as_news_date',$as_news_date);
          
$templater->register('as_news_time',$as_news_time);
          
$as_newsbits .= $templater->render();

    }
    
$vbulletin->db->free_result($news_items);

    
//eval('$news_table = "' . fetch_template('adv_portal_as_newstable') . '";');
    
$templater vB_Template::create('adv_portal_as_newstable');
     
$templater->register('as_newsbits',$as_newsbits);
     
$news_table $templater->render();
    return 
$news_table;
}

function 
get_latest_scores ($limit)
{
    global 
$vbulletin;

    
$latest_scores $vbulletin->db->query_read("
        SELECT sessions.userid, sessions.gamename, sessions.gameid, sessions.score, sessions.start, sessions.finish,
            user.username,
            games.title
        FROM " 
TABLE_PREFIX "v3arcade_sessions as sessions
        LEFT JOIN " 
TABLE_PREFIX "user AS user
            ON (sessions.userid = user.userid)
        LEFT JOIN " 
TABLE_PREFIX "v3arcade_games as games
            on (sessions.gameid = games.gameid)
        WHERE sessions.finish <> 0
        ORDER BY  sessions.sessionid DESC
        LIMIT 
$limit
    "
);

    while (
$latest_score $vbulletin->db->fetch_array($latest_scores)) {
        
$as_score_userid $latest_score['userid'];
        
$as_score_gameid $latest_score['gameid'];
        
$as_score_name $latest_score['username'];
        
$as_score_score intval($latest_score['score']);
        
$as_score_gametitle $latest_score['title'];
        
$as_score_date vbdate($vbulletin->options['dateformat'],$latest_score['finish']);
        
$as_score_time vbdate($vbulletin->options['timeformat'],$latest_score['finish']);
        
//echo "foo: $as_score_gametitle<br>\n";
        
$getbgrow exec_switch_bg();
        
//eval('$as_scorebits .= "' . fetch_template('adv_portal_as_scorebits') . '";');
        
$templater vB_Template::create('adv_portal_as_scorebits');
          
$templater->register('getbrow',$getbrow);
          
$templater->register('as_score_userid',$as_score_userid);
          
$templater->register('as_score_name',$as_score_name);
          
$templater->register('as_score_score',$as_score_score);
          
$templater->register('as_score_gameid',$as_score_gameid);
          
$templater->register('as_score_gametitle',$as_score_gametitle);
          
$templater->register('as_score_date',$as_score_date);
          
$templater->register('as_score_time',$as_score_time);
          
$as_scorebits .= $templater->render();
    }
    
$vbulletin->db->free_result($latest_scores);

    
//eval('$score_table = "' . fetch_template('adv_portal_as_scoretable') . '";');
    
$templater vB_Template::create('adv_portal_as_scoretable');
     
$templater->register('as_scorebits',$as_scorebits);
     
$score_table $templater->render();
    return 
$score_table;
}

$as_score_table get_latest_scores($g_scores_limit);
$as_news_table get_latest_champs($g_news_limit);
$as_random_table get_random_game();
$as_champs_table get_champs($g_champs_limit);
$as_recent_table get_games("recent","Most Recent"$g_limit);
$as_played_table get_games("played","Most Played"$g_limit);
$as_popular_table get_games("popular","Most Popular"$g_limit);

$collapseobj_arcadestats $vbcollapse['collapseobj_arcadestats'];
$collapseimg_arcadestats $vbcollapse['collapseimg_arcadestats'];

//eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_arcadestats') . '";');
$templater vB_Template::create('adv_portal_arcadestats');
$templater->register('as_score_table',$as_score_table);
$templater->register('as_news_table',$as_news_table);
//$templater->register('as_random_table',$as_random_table);
//$templater->register('as_champs_table',$as_champs_table);
//$templater->register('as_recent_table',$as_recent_table);
$templater->register('as_played_table',$as_played_table);
$templater->register('as_popular_table',$as_popular_table);
$output $templater->render(); 

Couple of notes:
1st... This isn't my code...
2nd... I commented out the BB_Code parse for the "news" since I don't know the global call for the do_parse command.
3rd... I did some edits to the templates to make mine fit nicely on the side.

I would like to get this widget working, but the instructions arent that clear.

Can you elaborate about the XML file what to do with it?

Thanks

K4GAP 11-08-2010 12:28 AM

Quote:

Originally Posted by KW802 (Post 2119215)
@GaryT: Two major questions.... are you putting the zip files in that folder or the unzipped files? (See Gemma's post a few post back for game installation steps). The other thing is how old those files. The .php file should be a really small file with just a few variables in it; if it looks like the .php file that was posted earlier that was an actual install script then you'll have issues just like you would have with the .rar files.

Yep that's it. The ,PHP file has basically the same content as the other .PHP file I posted.

Thanks

Gemma 11-08-2010 12:38 AM

Doctor Death you need to go through the xml file you downloaded from v3arcade and extract all the templates below

adv_portal_as_recent_gametable
adv_portal_as_played_gametable
adv_portal_as_popular_gametable
adv_portal_as_champbits
adv_portal_as_champstable
adv_portal_as_random
adv_portal_as_newsbits
adv_portal_as_newstable
adv_portal_as_scorebits
adv_portal_as_scoretable
adv_portal_arcadestats

The information you want for each template is between the [CDATA[ brackets

For example the adv_portal_arcadestats template would be extracted from the xml file by searching for the template

Code:

<adv_portal_arcadestats><![CDATA[<div>

<table align="center" width="100%">
  <tr><td colspan="3">{vb:raw as_score_table}</td></tr>
  <tr><td colspan="3">{vb:raw as_news_table}</td></tr>
  <tr>
    <td colspan="3">
      <table width = "100%">
        <tr>
          <td valign="top" width="60%">{vb:raw as_random_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_champs_table}</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td colspan="3">
      <table width = "100%">
        <tr>
          <td valign="top">{vb:raw as_recent_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_played_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_popular_table}</td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</div>]]></adv_portal_arcadestats>

Taking away the <template name> and CDATA opening and closing brackets it would look like this


Code:

<div>

<table align="center" width="100%">
  <tr><td colspan="3">{vb:raw as_score_table}</td></tr>
  <tr><td colspan="3">{vb:raw as_news_table}</td></tr>
  <tr>
    <td colspan="3">
      <table width = "100%">
        <tr>
          <td valign="top" width="60%">{vb:raw as_random_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_champs_table}</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td colspan="3">
      <table width = "100%">
        <tr>
          <td valign="top">{vb:raw as_recent_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_played_table}</td>
          <td>&nbsp;</td>
          <td valign="top">{vb:raw as_popular_table}</td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</div>

You would do that for all the templates I listed at the beginning, you would then go to you AdminCP>Style Manager and add each of the new templates, keeping the same template names as before

Then go to you AdminCP>vBulletinCMS>Widget Manager and make a new widget ie 'Arcade Stats' and copy the following code

Code:

global $vbulletin, $bbcode, $parser, $path, $db;
$g_limit = 5;
$g_champs_limit = 5;
$g_news_limit = 5;
$g_scores_limit = 5;

function get_games ($as_handle, $as_title, $limit) {
    global $vbulletin;

    switch ($as_handle) {
        case 'recent':
            $orderby = "dateadded DESC";
            break;
        case 'played':
            $orderby = "sessioncount DESC";
            break;
        case 'popular':
            $orderby = "votepoints DESC";
            break;
        default:
            $orderby = "gameid ASC";
            break;
    }


    $getgames = $vbulletin->db->query("
            SELECT games.* FROM " . TABLE_PREFIX . "v3arcade_games AS games
            ORDER BY " . $orderby . "
            LIMIT $limit
    ");

    while ($game = $vbulletin->db->fetch_array($getgames))
    {
            $game['gamename'] = fetch_trimmed_title(stripslashes($game['title']),$maxtitlechars);
            $game['gamedate'] = vbdate($vbulletin->options['dateformat'], $game['dateadded']);
            $getbgrow = exec_switch_bg();

        switch ($as_handle) {
            case 'recent':
                $as_game_data = $game['gamedate'];
                break;
            case 'played':
                $as_game_data = "Played " . $game['sessioncount'] . " times";
                break;
            case 'popular':
                $as_game_data = $game['votepoints'] . " votes";
                break;
            default:
                $as_game_data = "";
                break;
        }

            //eval('$as_gamebits .= "' . fetch_template('adv_portal_as_gamebits') . '";');
            $templater = vB_Template::create('adv_portal_as_gamebits');
        $templater->register('as_game_data',$as_game_data);
          $templater->register('game',$game);
          $as_gamebits .= $templater->render();

    }
    $vbulletin->db->free_result($getgames);

    // eval('$gametable = "' . fetch_template("adv_portal_as_{$as_handle}_gametable") . '";');
    $templater = vB_Template::create('adv_portal_as_' . $as_handle . '_gametable');
    $templater->register('as_title',$as_title);
    $templater->register('as_gamebits',$as_gamebits);
    $gametable = $templater->render();
    return $gametable;
}

function get_champs ($limit) {
    global $vbulletin;

    $champs = $vbulletin->db->query_read("
            SELECT COUNT(games.highscorerid) AS count, user.username, user.userid
        FROM " . TABLE_PREFIX . "v3arcade_games AS games
            LEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = games.highscorerid
            WHERE user.userid IS NOT NULL
            GROUP BY user.username, user.userid
        ORDER BY count DESC, user.userid ASC
        LIMIT " . $limit
    );

    $row = '0';
    $awards = '0';
    $leaders = '0';
    while ($champ = $vbulletin->db->fetch_array($champs)) {
        $leaders++;
        if ($awards != $champ['count']) {
            $row = $leaders;
        }
        $awards = $champ['count'];
        $getbgrow = exec_switch_bg();
        //eval('$as_champbits .= "' . fetch_template('adv_portal_as_champbits') . '";');
        $templater = vB_Template::create('adv_portal_as_champbits');
        $templater->register('getbrow',$getbrow);
          $templater->register('champ',$champ);
          $as_champbits .= $templater->render();
    }
    $vbulletin->db->free_result($champs);

    //eval('$champstable = "' . fetch_template("adv_portal_as_champstable") . '";');
    $templater = vB_Template::create('adv_portal_as_champstable');
    $templater->register('as_champbits',$as_champbits);
    $champstable = $templater->render();
    return $champstable;
}

function get_random_game () {
    global $vbulletin;

    $random_game = $vbulletin->db->query_first("
        SELECT gameid,title,description,stdimage,highscore,user.userid,user.username
        FROM " . TABLE_PREFIX . "v3arcade_games AS games
            LEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = games.highscorerid
        ORDER BY RAND()
        LIMIT 1
    ");

    $as_random_gameid = $random_game[gameid];
        $as_random_gametitle = $random_game[title];
        $as_random_stdimage = $random_game[stdimage];
        $as_random_description = $random_game[description];
    if($random_game[highscore] == 0)
    {
        $as_random_highscore    = "No Score";
        $as_random_highscorer    = "";
        $as_random_userid    = "";
    }
    else
    {
        $as_random_highscore    = intval($random_game[highscore]);
        $as_random_highscorer    = "(" . $random_game[username] . ")";
        $as_random_userid    = $random_game[userid];
    }
    $vbulletin->db->free_result($random_game);
    //eval('$random_table = "' . fetch_template('adv_portal_as_random') . '";');
    $templater = vB_Template::create('adv_portal_as_random');
    $templater->register('as_random_gameid',$as_random_gameid);
    $templater->register('as_random_gametitle',$as_random_gametitle);
    $templater->register('as_random_highscore',$as_random_highscore);
    $templater->register('as_random_userid',$as_random_userid);
    $templater->register('as_random_highscorer',$as_random_highscorer);
    $templater->register('as_random_stdimage',$as_random_stdimage);
    $templater->register('as_random_description',$as_random_description);
    $random_table = $templater->render();
    return $random_table;
}

function get_latest_champs ($limit)
{
    global $vbulletin, $bbcode_parser;

    //var_dump($vbulletin);
    //highlight_file('./modules/arcadestats.php');
    //exit;
    $news_items = $vbulletin->db->query_read("
        SELECT *
        FROM " . TABLE_PREFIX . "v3arcade_news
        WHERE newstext LIKE '%is the new%'
        ORDER BY datestamp DESC
        LIMIT $limit
    ");

    while ($news_item = $vbulletin->db->fetch_array($news_items)) {
          //$as_news_text =  $bbcode_parser->do_parse($news_item['newstext'], 1, 1, 1, 0);
        $as_news_text = $news_item['newstext'];
        $as_news_text = str_replace("arcade.php", $vbulletin->options['bburl'] . "/arcade.php", $as_news_text);

        $as_news_date = vbdate($vbulletin->options['dateformat'],$news_item['datestamp']);
        $as_news_time = vbdate($vbulletin->options['timeformat'],$news_item['datestamp']);
        $getbgrow = exec_switch_bg();
        //eval('$as_newsbits .= "' . fetch_template('adv_portal_as_newsbits') . '";');
        $templater = vB_Template::create('adv_portal_as_newsbits');
          $templater->register('getbrow',$getbrow);
          $templater->register('as_news_text',$as_news_text);
          $templater->register('as_news_date',$as_news_date);
          $templater->register('as_news_time',$as_news_time);
          $as_newsbits .= $templater->render();

    }
    $vbulletin->db->free_result($news_items);

    //eval('$news_table = "' . fetch_template('adv_portal_as_newstable') . '";');
    $templater = vB_Template::create('adv_portal_as_newstable');
    $templater->register('as_newsbits',$as_newsbits);
    $news_table = $templater->render();
    return $news_table;
}

function get_latest_scores ($limit)
{
    global $vbulletin;

    $latest_scores = $vbulletin->db->query_read("
        SELECT sessions.userid, sessions.gamename, sessions.gameid, sessions.score, sessions.start, sessions.finish,
            user.username,
            games.title
        FROM " . TABLE_PREFIX . "v3arcade_sessions as sessions
        LEFT JOIN " . TABLE_PREFIX . "user AS user
            ON (sessions.userid = user.userid)
        LEFT JOIN " . TABLE_PREFIX . "v3arcade_games as games
            on (sessions.gameid = games.gameid)
        WHERE sessions.finish <> 0
        ORDER BY  sessions.sessionid DESC
        LIMIT $limit
    ");

    while ($latest_score = $vbulletin->db->fetch_array($latest_scores)) {
        $as_score_userid = $latest_score['userid'];
        $as_score_gameid = $latest_score['gameid'];
        $as_score_name = $latest_score['username'];
        $as_score_score = intval($latest_score['score']);
        $as_score_gametitle = $latest_score['title'];
        $as_score_date = vbdate($vbulletin->options['dateformat'],$latest_score['finish']);
        $as_score_time = vbdate($vbulletin->options['timeformat'],$latest_score['finish']);
        //echo "foo: $as_score_gametitle<br>\n";
        $getbgrow = exec_switch_bg();
        //eval('$as_scorebits .= "' . fetch_template('adv_portal_as_scorebits') . '";');
        $templater = vB_Template::create('adv_portal_as_scorebits');
          $templater->register('getbrow',$getbrow);
          $templater->register('as_score_userid',$as_score_userid);
          $templater->register('as_score_name',$as_score_name);
          $templater->register('as_score_score',$as_score_score);
          $templater->register('as_score_gameid',$as_score_gameid);
          $templater->register('as_score_gametitle',$as_score_gametitle);
          $templater->register('as_score_date',$as_score_date);
          $templater->register('as_score_time',$as_score_time);
          $as_scorebits .= $templater->render();
    }
    $vbulletin->db->free_result($latest_scores);

    //eval('$score_table = "' . fetch_template('adv_portal_as_scoretable') . '";');
    $templater = vB_Template::create('adv_portal_as_scoretable');
    $templater->register('as_scorebits',$as_scorebits);
    $score_table = $templater->render();
    return $score_table;
}

$as_score_table = get_latest_scores($g_scores_limit);
$as_news_table = get_latest_champs($g_news_limit);
$as_random_table = get_random_game();
$as_champs_table = get_champs($g_champs_limit);
$as_recent_table = get_games("recent","Most Recent", $g_limit);
$as_played_table = get_games("played","Most Played", $g_limit);
$as_popular_table = get_games("popular","Most Popular", $g_limit);

$collapseobj_arcadestats = $vbcollapse['collapseobj_arcadestats'];
$collapseimg_arcadestats = $vbcollapse['collapseimg_arcadestats'];

//eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_arcadestats') . '";');
$templater = vB_Template::create('adv_portal_arcadestats');
$templater->register('as_score_table',$as_score_table);
$templater->register('as_news_table',$as_news_table);
$templater->register('as_random_table',$as_random_table);
$templater->register('as_champs_table',$as_champs_table);
$templater->register('as_recent_table',$as_recent_table);
$templater->register('as_played_table',$as_played_table);
$templater->register('as_popular_table',$as_popular_table);
$output = $templater->render();

Save it, then go to AdminCP>vBulletinCMS>Layout Manager and add your new widget.

You can see the result on my site http://www.forumbanter.com

It took about 10 minutes. I still need to go back and edit the templates to make them fall in line with the changes introduced in vb4.0.8

If you have any problems let me know and I'll post up each individual template over on v3arcade.com but I'm off to bed now.

K4GAP 11-08-2010 04:39 AM

So, anyone have a collection of games yet? I have several hundred but they are out of date. Would it be wrong for members to trade games they have with other members?

I just need games, ever how I can get them :)

Gemma 11-08-2010 08:16 AM

Quote:

Originally Posted by GaryT (Post 2119346)
So, anyone have a collection of games yet? I have several hundred but they are out of date. Would it be wrong for members to trade games they have with other members?

I just need games, ever how I can get them :)

Have you set up an account at MochiMedia? Once set up, there is thousands of games to install via your AdminCP at a few clicks of the mouse button.

Also all iBProArcade v32 converted games will run on the arcade - a simple google search should provide a list of sites

gator777 11-08-2010 02:31 PM

Hey KW802, very nice mod and thanks for all your hard work. :)

I was having two issues. I lost my .tar files, so I am manuually uloading and adding them using the V3Arcade CP.

- The game posts as it should and I can play it, but the images are missing (even though they are the proper folder) .

- When I try to post a score (from the manually added games), I get a "Security token is missing" error.

Xeyn 11-08-2010 03:31 PM

Brilliant..Thats all i can say.........How do i mass delete all agmes installed thoe?got over 400 games installed...and dnt fancy cliking delete 1 by 1......also kw....i sent you a forum pm:-)

8thos 11-08-2010 03:50 PM

My ibproArcade stopped saving games. I tried several fixes and they did not work. It worked during vb4.07 but not after I upgraded to vb4.08.

Will v3 Arcade save games?

8thos 11-08-2010 03:54 PM

How the hell do you earn money from this?

Gemma 11-08-2010 03:59 PM

Quote:

Originally Posted by gator777 (Post 2119489)
- When I try to post a score (from the manually added games), I get a "Security token is missing" error.

If you are using vBulletinCMS - http://www.v3arcade.com/forums/showthread.php?t=3215
If you are using vBAdvanced - http://www.v3arcade.com/forums/showthread.php?t=3407

gator777 11-08-2010 04:17 PM

Quote:

Originally Posted by Gemma (Post 2119527)

Thanks, but I have tried that. Then then I get this...

The file(s) uploaded were too large to process.

Gemma 11-08-2010 04:27 PM

Do you know if modsecurity is enabled on your server?

mmacrypt 11-08-2010 04:53 PM

looks very promising, it's on the list of stuff I will look into. Sadly, that list of tagged items might be about 20 deep but it will get my look and try.

Good job.

Gemma 11-08-2010 06:25 PM

Quote:

Originally Posted by Octavius. (Post 2119519)
My ibproArcade stopped saving games. I tried several fixes and they did not work. It worked during vb4.07 but not after I upgraded to vb4.08.

Will v3 Arcade save games?

Don't see any reason why v3arcade wouldn't save the games, as long as you make any edits to the index.php file if you are using vBAdvanced or vBSuite CMS

gator777 11-08-2010 06:37 PM

Ok, I found some my missing .tar game files and sucessfully imported them, but I am haing a few issues.

- If I beat a high score using one of the imported games, it will only posts the first score. Subsequent high scores do not post.

- Also, when I manually "Add Game," the images do not appear (although I could workaround that by accessing the database), and the scores will not even attempt to post. What could I be doing wrong with the manual update?

Gemma 11-08-2010 06:52 PM

Are those manually installed games IPB v32 games?

If so can you make sure you have a folder called 'arcade' which has a subfolder called 'gamedata', they should have been created when you installed the arcade but the correct files may not be uploaded to these folders, when installing manually.

IPB v32 games need a gamedata folder because of the way the scores are written.

gator777 11-08-2010 07:03 PM

Thanks Gemma, I did have them in tyhe correct folder, but that wasn't the issue.

I have since dicovered that by changing the "isreverse" table in the db from "1" to "0" solved the scoring issue.

All I have left is to figure out why the manually added games will not post scores.

Gemma 11-08-2010 07:05 PM

I'll go and manually add a game on my site and get back to you

Gemma 11-08-2010 07:35 PM

1 Attachment(s)
Ok I've found a problem, hopefully it will solve your score errors for manual installs.

When installing manually there is a box above the game system drop down (iBPro, v3Arcade etc), on my system that box above is blank and doesn't have anything to tell you what should go in it.

It should contain the Gamename Shortname (gname in IPB) which is the swf minus the .swf (see attachment). The shortname will always be the flash filename minus the swf extension.

Can you try adding another game manually and see if it works?

gator777 11-08-2010 07:44 PM

Quote:

Originally Posted by Gemma (Post 2119613)
Ok I've found a problem, hopefully it will solve your score errors for manual installs.

When installing manually there is a box above the game system drop down (iBPro, v3Arcade etc), on my system that box above is blank and doesn't have anything to tell you what should go in it.

It should contain the Gamename Shortname (gname in IPB) which is the swf minus the .swf (see attachment). The shortname will always be the flash filename minus the swf extension.

Can you try adding another game manually and see if it works?

That was it ...that worked like a champ. :D

Thanks for your help...

Sarcoth 11-08-2010 08:46 PM

Hmmm, I am very impressed with what I have read so far. I will have to give this a try this weekend or sooner if possible. One question first, does it already work with any of the currency systems? I'm specifically using [DBTech] vBCredits II Deluxe. I did not notice anything about he current systems in the list of features, but I can be blind occasionally.

Thanks.

gator777 11-09-2010 02:03 AM

I got so caught up in trying to work my issues that I almost forgot the most important thing ...and that was to say THANK YOU! This is a very, very nice mod...

I really like the ability you created to allow the user to increase the resolution of the game ...very nice touch :D

glen290 11-09-2010 11:10 AM

Installed and playing around with it to see if i decide to change ove or not, having a few issues with not saving high scores, and the mochi scores too, but cant get on to v3a.com in work due to filters..


All times are GMT. The time now is 12:54 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.02419 seconds
  • Memory Usage 2,088KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (1)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete