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)

cory_booth 11-06-2010 12:46 PM

1 Attachment(s)
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.

stud 11-06-2010 12:59 PM

Is there a plugin/script to replace the trophy.gif icon in the users postbit with icons for each individual game?

KW802 11-06-2010 02:02 PM

Quote:

Originally Posted by GaryT (Post 2118576)
Php content from another one of the games...

That one is going to a tougher nut to crack. Essentially that is a very old method of manually installing games one at a time (2004! :eek: ). There is no quick answer to that one. I'll try some local tests to see if we can at least get them usable for you somehow since as it is now those games won't install on any version of v3A past 2.0.0 (since the table names have changed).

Quote:

Originally Posted by Veer (Post 2118577)
I have a suggestion, I see user can not see others scores on Tournament page, Is there any possibility to make it viewable for players and tournament creator? In ibproArcade everyone can see.

If you have an account over at v3Arcade.com, mind posting that in the suggestions forum over there? It's easier for me to track suggestions that way.

Quote:

Originally Posted by Gemma (Post 2118642)
Great to see this finally released on vb.org, well done Kevin and the v3arcade team for all your hard work and efforts :)

Actually, thank you, Gemma, for the help & feedback the past few months as we've worked on polishing the vB4 version. The feedback from yourself & others has been great.

Quote:

Originally Posted by Ninjapaul (Post 2118649)
--Edit-- does anyone know if it's possible to remove the ads out of the games from mochi media?

You can't get rid of the ads because it would also means that you would be blocking the communications to the Mochi servers which verifies your scores. The ads from Mochi is the small price to pay for getting access to thousands for free games. :)

Quote:

Originally Posted by cory_booth (Post 2118655)
Yep, that was it... Needed to upload the crossdomain.xml file... Same game I had a problem with now works fine (and quickly I might add).

EXCELLENT! Nice to have such a major mod keep up with the times!

Glad to see you got it sorted! :cool: The next time I edit the first post I will include a pointer to the FAQ over at the v3A forums about getting Mochi integrated.

KW802 11-06-2010 02:05 PM

Quote:

Originally Posted by stud (Post 2118662)
Is there a plugin/script to replace the trophy.gif icon in the users postbit with icons for each individual game?

No need for a manual plugin or other manual edit. ;)

ACP => v3 Arcade => v3 Arcade Settings => v3 Arcade General Settings => Enable Arcade Awards

You'll have your choice of showing either trophies, crowns (all the same color), multi-color crowns (random colored crowns), or the game's mini-icon.

msorin 11-06-2010 02:09 PM

I downloaded the version from v3 website. I get an error when I try to mass import games:

Fatal error: Call to a member function read() on a non-object in /admincp/v3arcade_admin.php on line 1157

KW802 11-06-2010 02:27 PM

Quote:

Originally Posted by msorin (Post 2118685)
I downloaded the version from v3 website. I get an error when I try to mass import games:

Fatal error: Call to a member function read() on a non-object in /admincp/v3arcade_admin.php on line 1157

Are you sure you downloaded the right version for the vBulletin you're using? The download drop-down has both vB3 & vB4 listed.

msorin 11-06-2010 02:34 PM

Yes I downloaded the one for 4.0.X

K4GAP 11-06-2010 08:31 PM

Quote:

Originally Posted by cory_booth (Post 2118655)
Yep, that was it... Needed to upload the crossdomain.xml file... Same game I had a problem with now works fine (and quickly I might add).

EXCELLENT! Nice to have such a major mod keep up with the times!

Where did you upload the crossdomain too? And what does it do? Do you know?

K4GAP 11-06-2010 08:34 PM

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.

Gemma 11-06-2010 08:43 PM

Quote:

Originally Posted by GaryT (Post 2118802)
Where did you upload the crossdomain too? And what does it do? Do you know?

Upload crossdomain.xml to your site root


All times are GMT. The time now is 11:12 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.02274 seconds
  • Memory Usage 1,894KB
  • 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
  • (1)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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