Results 1 to 4 of 4

Thread: adv_portal_ibparcade

  1. #1

    Default adv_portal_ibparcade

    finally i decide to upgrade from vb3.8 to vb4 but i get many work to do
    searching the new or similar version of my old hack and trying to do the transation

    i get some error on an old module based on an ibproracade (random not ajax)

    Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: adv_portal_ibparcade in [path]/includes/functions.php on line 4591
    any body knoiw the chnage we have to do to let this work with the new vb 4 ( template and variable)

    it use 1 template and 1 file

    template adv_portal_ibparcade

    PHP Code:
    <tr><td class="alt1" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td>$out</td></tr></table></td></tr

    file ibparcade_game.php
    PHP Code:
    <?php
    /* -----------------10/24/2005 5:38PM----------------
     » IbPro Game Block 1.0 - CMPS 2.0 (VB 3.5)
      Zachariah - http://www.gzhq.net
       Tested on:
       - vBulletin 3.5.0
       - ibProArcade v2.5.1 (vB 3.5)
       - vBadvanced CMPS v2.0.0 (vB 3.5)
    --------------------------------------------------*/
    /* ### EDIT OPTIONS #########################################################*/
    /* Set number of games to show */
    $gamecount 1;

    // Enter 1 newest, 2 most played, 3 highest rated, 4 random.
    $gameorder 4;

    /* Path to arcade images */
    $path "/vb/arcade/images/"//---> Do not forget the '/' --->

    /* ################################################# NO EDIT NEEDED BELOW ###*/

    /* Reset Array's */
    $game_info_gid     = array();
    $game_info_gname    = array();
    $game_info_gtitle    = array();
    $game_info_gwords    = array();

    switch (
    $gameorder)
    {
        case 
    2:
            
    $gorderby 'gcount DESC';
            break;
        case 
    3:
            
    $gorderby 'g_rating DESC';
            break;
        case 
    4:
            
    $gorderby 'RAND()';
            break;
        default:
            
    $gorderby 'gid DESC';
    }

    /* Get game info by game title */
    for ($x $x $gamecount $x++)
    {
        
    $game $db->query(
                
    "SELECT gid, gname, gcount, gtitle, g_rating, gwords, added FROM
                " 
    TABLE_PREFIX "games_list WHERE active='1' ORDER BY $gorderby LIMIT ".$gamecount
        
    );
        while(
    $print_row $db->fetch_array($game))
        {
            
    /* Add to game info array */
            
    array_push($game_info_gid$print_row['gid']);
            
    array_push($game_info_gname$print_row['gname']);
            
    array_push($game_info_gtitle,    $print_row['gtitle']);
            
    array_push($game_info_gwords,    $print_row['gwords']);

        }
    }

    /* Clean up */
    $db->free_result($game);

    /* Build Output */
    $out "";
    for (
    $x $x $gamecount $x++)
    {
        
    $out .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";
        
    $out .= "      <tr>\n";
            
    $out .= "            <td><div align=\"center\">Play this game now!</div></td>\n";
            
    $out .= "          </tr>\n";
        
    $out .= "      <tr>\n";    
                
    $out .= "      <tr>\n";
    $out .= "            <td><br></td>\n";
            
    $out .= "          </tr>\n";

        
    $out .= "      <td width=\"1%\" valign=\"top\" class=\"alt1\"><div align=\"center\"><img src=\"".$path.$game_info_gname[$x]."1.gif\" border=\"0\"></div></td>\n";
        
    $out .= "      </tr>\n";
    $out .= "      <tr>\n";
    $out .= "            <td><br></td>\n";
            
    $out .= "          </tr>\n";
        
    $out .= "          <tr>\n";
    $out .= "        <td><div align=\"center\"><a href=\"".$vbulletin->options['bburl']."/arcade.php?act=Arcade&do=play&gameid=".$game_info_gid[$x]."\" target=\"_self\"><strong>".$game_info_gtitle[$x]."</strong></a></div></td>\n";
        
    $out .= "          </tr>\n";
        
    $out .= "\n";
        
    $out .= "</table>\n";
        if(
    $x $gamecount -1) { $out .= "<hr>\n"; }
    }

    /* Do Template */
    eval('$home["$mods[modid]"][\'content\'] = "' fetch_template('adv_portal_ibparcade') . '";');

    /* Clean up */
    $out NULL;
    ?>

  2. #2

    Default

    i found the probleme but not the solution :
    PHP Code:
    eval('$home["$mods[modid]"][\'content\'] = "' fetch_template('adv_portal_ibparcade') . '";'); 
    we have to replace the fetch one by template class
    i was nice in vb 3 code
    but on vb4 it is very new for me
    any help ?

  3. #3

    Default

    no one can help me ??

  4. #4
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    The PHP code would need to look something more like this, though you'll likely need to modify the HTML code as well to match vB4.
    Code:
    $templater = vB_Template::create('adv_portal_ibparcade');
    $templater->register('out', $out);
    $home["$mods[modid]"]['content'] = $templater->render();
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •