Categories > TinyButStrong general (FR) >

Onload

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Scro
Date: 2012-10-25
Time: 22:09

Onload

Bonjour,

Je viens de voir plein d'exemple sur le forum concernant le onload,malheureusement je ne comprend pas trop  comment utilisé .

petite précision j'utilise nuked clan comme base du site et donc je parviens bien à load des templates ex:


global $_render, $language, $user, $nuked, $TBS;
$TBS->LoadTemplate(_GAMEBASE . $_GET["file"] .'/selectFaction.tpl.html');

------------
mon code php

-----------

$TBS->mergeBlock('TblIntro', 'array', '_render[intro]');
$TBS->mergeBlock('TblFact', 'array', '_render[form][faction]');
$TBS->mergeBlock('TblFactDescpt', 'array', '_render[form][faction]');
$TBS->Show();


la page fonctionne très bien.

une autre page


global $_render, $language, $user, $nuked, $TBS;
$TBS->LoadTemplate(_GAMEBASE . $_GET["file"] .'/selectFaction.tpl.html');

------------
mon code php

-----------

        //Chargement des ressources astre
        $TBS->mergeBlock('BlkAstreRess', 'array', '_render[astre_ressources]');

        //Chargement population joueur
        $TBS->mergeBlock('BlkPop', 'array', '_render[user_population]');
       
        //Chargement Money du joueur
        $TBS->mergeBlock('BlkMoney', 'array', '_render[user_money]');

$TBS->Show();

dans la page htlm:
<div id="resrc_block">
[onload;file='block/astre_ress.block.html']
</div>

et dans la tpl
                        <div>
                            <img src="image_game/ressource/[BlkAstreRess.ress_id_ext;block=(div)].gif"
                                    alt="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]" title="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]"    />
                            <h6>
                                [onshow;block=h6;when [BlkAstreRess.ress_id_ext]!=7]
                                [BlkAstreRess.ress_astr_stock;frm='0 000.']<br />
                            </h6>
                            <i>
                                [onshow;block=i;when [BlkAstreRess.ress_id_ext]!=7]
                                [BlkAstreRess.ress_astr_prod;frm='0 000.'] / h
                            </i>
                            <span class="[BlkAstreRess.ress_astr_prod;if [val]-=+0;then 'Bad';else 'Ok']">
                                [onshow;block=span;when [BlkAstreRess.ress_id_ext]==7]
                                [BlkAstreRess.ress_astr_prod;frm='0 000.']
                            </span>
                       
                        </div>
                        <div id="money_block" >
                            <img src="image_game/elements/ressource/8.gif"
                                    alt="[var..cst._RESSOURCE_8]" title="[var..cst._RESSOURCE_8]"    />
                            <h6>
                                [BlkMoney.usr_money;frm='0 000.']
                            </h6>
                           
                        </div>
                        <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>
                       
                        <div>
                            <img src="image_game/elements/population/[BlkPop.pop_id_ext;block=(div)].gif"
                                    alt="[var..cst._POPULATION_[BlkPop.pop_id_ext]]" title="[var..cst._POPULATION_[BlkPop.pop_id_ext]]"/>
                            <span class="[BlkPop.usr_pop_free;if [val]-=+0;then 'Bad';else 'Ok']" >
                                [BlkPop.usr_pop_free;frm='0 000.']<br />
                            </span>
                            <i  href="index.php?page=civil">
                                [BlkPop.usr_pop_max;frm='0 000.'] Total
                            </i>

                        </div>
                        <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>


le problème il m'affiche directement sans charger franchement je ne comprend pas

[onload;block=div;when [var.user.id]+-0][onload;file='block/player.block.html']
[onload;block=astrecourant;when [var._SESSION.astre_select]+-0]
[onload;file='block/astre_img.block.html'] [onload;file='block/astre_info.block.html']
[onload;file='block/astre_ress.block.html']

Par avance merci
By: Skrol29
Date: 2012-10-26
Time: 02:39

Re: Onload

Bonjour Scro,

> le problème il m'affiche directement sans charger franchement je ne comprend pas

Je n'a pas bien compris. Tu as bien le contenu de "astre_ress.block.html" qui s'affiche mais les balises automatiques [onshow] et [var] ne sont pas fusionnées ?

>[onload;block=div;when [var.user.id]+-0][onload;file='block/player.block.html']
>[onload;block=astrecourant;when [var._SESSION.astre_select]+-0]
>[onload;file='block/astre_img.block.html'] [onload;file='block/astre_info.block.html']
>[onload;file='block/astre_ress.block.html'] 

Peux-tu expliquer cette partie ?
By: Scro
Date: 2012-10-26
Time: 07:08

Re: Onload

bonjour,
Effectivement ce n’est pas très clair, quand j’utilise:


$TBS->LoadTemplate(_GAMEBASE . $_GET["file"] .'/selectFaction.tpl.html');
$TBS->mergeBlock('TblIntro', 'array', '_render[intro]');
$TBS->mergeBlock('TblFact', 'array', '_render[form][faction]');
$TBS->mergeBlock('TblFactDescpt', 'array', '_render[form][faction]');

$TBS->Show();

cela s'affiche bien dans la page.

par contre là je souhaite utilisé onload dans une autre page et malheureusement ça ne fonctionne pas il m'affiche dans la page
[onload;block=div;when [var.user.id]+-0][onload;file='block/player.block.html']
[onload;block=astrecourant;when [var._SESSION.astre_select]+-0]
[onload;file='block/astre_img.block.html'] [onload;file='block/astre_info.block.html']
[onload;file='block/astre_ress.block.html']
et non pas les valeurs
By: Scro
Date: 2012-10-26
Time: 17:47

Re: Onload

je ne comprend pas comment fonctionne onload.
Serait il possible d'avoir une explication svp
par avance merci,je vais essayer de tout expliqué pour voir ou sa cloche.

voici la page html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo substr($GLOBALS['language'], 0, 2); ?>">
   
    <head>
        <title><?php echo $GLOBALS['nuked']['name']; ?></title>
       
        <meta name="Keywords" content="<?php echo $GLOBALS['nuked']['keyword']; ?>" />
        <meta name="Description" content="<?php echo $GLOBALS['nuked']['description']; ?>" />
        <meta name="Language" content="<?php echo substr($GLOBALS['language'], 0, 2); ?>" />
        <meta name="Robots" content="index, follow" />
        <meta http-equiv="Pragma" content="no-cache" />

       
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <!-- <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> -->
       
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8; IE=EmulateIE9">
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <link media="screen" type="text/css" href="css/main.css" rel="stylesheet">
</head>
   
    <body>
<?php
   
        if (isset($GLOBALS['user']['astre_select']) AND $GLOBALS['user']['astre_select'] != 0) {

            $block_ressource = new BlockRessource();
            $block_ressource->getBlockRessource($GLOBALS['user']['astre_select']);

        }
?>
                    <div id="resrc_block">
                        [onload;file='block/astre_ress.block.html']
                    </div>
    </body>
</html>





la class  BlockRessource :

<?php
class BlockRessource {

    public function getBlockRessource($astr_id){

       
         global $_render, $language, $user, $nuked, $TBS;


        $astre_ressources = array();
        //Mise à jours des ressource
        $_render['astre_ressources'] = Ressource::updateAstreRessource($astr_id);
       
        //On regarde si l'astre possède assez d'énergie
        if ( Ressource::isPower($astr_id) == false)
            $energie = false;
        else
            $energie = true;
           
        //On fait une boucle qui lit le type de ressource
         foreach($_render['astre_ressources'] as $key => &$ress) {
           
            //On fait une boucle qui lit la valeur si il s'agit d'une prod ou d'une conso
            foreach ($ress as $key2 => &$value) {
                //Si énergie négative on divise par 10 la prod
                if ($energie == false AND $key2 == 'ress_astr_prod' AND $key != 7)
                    $value = $value / 10 ;
                   
                if ($value >= 1000000000)
                {
                    $value =  round ($value / 1000000000,3) ." MM";
                }
                elseif($value >= 1000000) {
                    $value = round ($value / 1000000,3) ." M";
                }
            }
         }
        
        
        //Chargement des ressources astre
        $TBS->mergeBlock('BlkAstreRess', 'array', '_render[astre_ressources]');

        
    }


}

?>

et le tpl astre_ress.block.html
                        <div>
                            <img src="image_game/ressource/[BlkAstreRess.ress_id_ext;block=(div)].gif"
                                    alt="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]" title="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]"    />
                            <h6>
                                [onshow;block=h6;when [BlkAstreRess.ress_id_ext]!=7]
                                [BlkAstreRess.ress_astr_stock;frm='0 000.']<br />
                            </h6>
                            <i>
                                [onshow;block=i;when [BlkAstreRess.ress_id_ext]!=7]
                                [BlkAstreRess.ress_astr_prod;frm='0 000.'] / h
                            </i>
                            <span class="[BlkAstreRess.ress_astr_prod;if [val]-=+0;then 'Bad';else 'Ok']">
                                [onshow;block=span;when [BlkAstreRess.ress_id_ext]==7]
                                [BlkAstreRess.ress_astr_prod;frm='0 000.']
                            </span>
                       
                        </div>
                        <div id="money_block" >
                            <img src="image_game/elements/ressource/8.gif"
                                    alt="[var..cst._RESSOURCE_8]" title="[var..cst._RESSOURCE_8]"    />
                            <h6>
                                [BlkMoney.usr_money;frm='0 000.']
                            </h6>
                           
                        </div>
                        <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>
                       
                        <div>
                            <img src="image_game/elements/population/[BlkPop.pop_id_ext;block=(div)].gif"
                                    alt="[var..cst._POPULATION_[BlkPop.pop_id_ext]]" title="[var..cst._POPULATION_[BlkPop.pop_id_ext]]"/>
                            <span class="[BlkPop.usr_pop_free;if [val]-=+0;then 'Bad';else 'Ok']" >
                                [BlkPop.usr_pop_free;frm='0 000.']<br />
                            </span>
                            <i  href="index.php?page=civil">
                                [BlkPop.usr_pop_max;frm='0 000.'] Total
                            </i>

                        </div>
                        <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>


Pour le moment je souhaite recupérer les ressources ensuite le reste.Si j'y parviens pour 1 le reste sera identique
By: Skrol29
Date: 2012-10-26
Time: 18:42

Re: Onload

Salut Scro,

Le template n'est pas un fichier PHP. Si ta page html donné dans ton message précédent correspond à ton template, alors le code PHP qui y est inclus sera purement et simplement ignoré, il sera même affiché dans la page finale.

> je ne comprend pas comment fonctionne onload.

Les balises [onload] sont automatiquement repérées et fusionnée par TBS pendant le chargement d'un modèle (c'est à dire durant le LoadTemplate()) ou pendant le chargement d'un sous-modèle (paramètre "file" ou "script").

By: Scro
Date: 2012-10-28
Time: 08:53

Re: Onload

merci donc maintenant la page s'affiche par contre une fois le tpl chargé il n'affiche plus le bas de page.
Est ce que le problème vient du chargement du template.
Par avance merci
By: Skrol29
Date: 2012-10-28
Time: 10:24

Re: Onload


Comment est codé ton bas de page ?
By: Scro
Date: 2012-10-28
Time: 14:18

Re: Onload

bonjour je vais essayer d’être clair du 1er coup ^^

Comme je le disais plus haut j'utilise Nuked-klan comme base donc la page par default

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo substr($GLOBALS['language'], 0, 2); ?>">
   
    <head>
        <title><?php echo $GLOBALS['nuked']['name']; ?></title>
       
        <meta name="Keywords" content="<?php echo $GLOBALS['nuked']['keyword']; ?>" />
        <meta name="Description" content="<?php echo $GLOBALS['nuked']['description']; ?>" />
        <meta name="Language" content="<?php echo substr($GLOBALS['language'], 0, 2); ?>" />
        <meta name="Robots" content="index, follow" />
        <meta http-equiv="Pragma" content="no-cache" />

       
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <!-- <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> -->
       
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8; IE=EmulateIE9">
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <link media="screen" type="text/css" href="css/main.css" rel="stylesheet">
        <link href="themes/deus_fullact/skins/nkdeus/styles/style.css" rel="stylesheet" title="deus_fullact" type="text/css" media="screen" />
       
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> 
         <script src="js/gamelib.js" type="text/javascript"></script>
        <!--[if lte IE 6]>
            <style type="text/css">
                div#wrapper, div.wrapper {
                    width: expression(document.body.clientWidth > 1400 ? '1400px' : '90%');
                }
            </style>
        <![endif]-->
       
        <script type="text/javascript" src="themes/deus_fullact/javascript/general.js"></script>
       
    </head>
   
    <body>
   
        <div id="header">
            <h1>Deus_fullact</h1>
           
            <p><?php echo $GLOBALS['nuked']['slogan']; ?></p>
           
            <p><a href="#content">Aller au contenu</a></p>
           
            <script type="text/javascript">
                var header = new FFlash('<?php echo dF_skin_rpath; ?>flash/dF_header.swf', '100%', 267);
                header.assign({
                    home: <?php echo dF_on_index; ?>,
                    fofif_skin: '<?php echo dF_skin_rpath; ?>',
                    defaultTitre: '<?php echo addslashes($GLOBALS['nuked']['name']); ?>',
                    defaultSlogan: '<?php echo addslashes($GLOBALS['nuked']['slogan']); ?>'
                });
                header.write();
            </script>
           
            <noscript>
                <div>
                    <object type="application/x-shockwave-flash" data="flash/dF_header.swf" width="100%" height="267">
                        <param name="movie" value="flash/dF_header.swf" />
                        <param name="quality" value="high" />
                        <param name="wmode" value="transparent" />
                        <param value="best" name="quality" />
                        <param value="exactfit" name="scale" />
                       
                        <p>Installez le plugin Flash pour voir l'animation :
                        <a href="http://www.adobe.com/go/gntray_dl_getflashplayer_fr" title="Lien du plugin">
                            Cliquez ici pour le télécharger</a></p>
                    </object>
                </div>
            </noscript>
        </div>
       
        <div id="login">
            <h2>Login</h2>
           
            <div class="wrapper">
                <div class="box">

                   
                    <?php if (empty($GLOBALS['user'])): // Cas où l'utilisateur n'est pas connecté ?>
                        <form class="top" action="index.php?file=User&amp;nuked_nude=index&amp;op=login" method="post">
                            <div>
                                <input type="text" name="pseudo" value="pseudo" size="14" onfocus="check(this, 'pseudo');" onblur="check(this, 'pseudo');" />
                               
                                <input type="password" name="pass" value="password" size="14" onfocus="check(this, 'password');" onblur="check(this, 'password');" />
                               
                                <?php if (constant('dF_conf_autoLogin')): # Ajout de l'input remember_me ?>
                                    <input type="hidden" name="remember_me" value="ok" />
                                <?php    endif; ?>
                               
                                <input class="submit" type="image" src="<?php echo dF_skin_rpath; ?>images/icones/login-ok.jpg" alt="OK" />
                            </div>
                        </form>

                        <div class="bottom">
                            <a href="index.php?file=User&amp;op=reg_screen"><?php echo _REGISTER; ?></a>
                        </div>
                    <?php else: // Cas où l'utilisateur est connecté ?>
                        <div class="top">
                            <?php echo _WELCOME; ?> <strong><?php echo $GLOBALS['user'][2]; ?></strong>
                             -
                            <a href="index.php?file=User&amp;nuked_nude=index&amp;op=logout">d&eacute;connexion</a>
                             -
                            <a href="index.php?file=Userbox">
                                <strong><?php echo $GLOBALS['user'][5]; ?></strong>
                                 <img class="reset" src="<?php echo dF_skin_rpath; ?>images/icones/login-mp.jpg" alt="messages" />
                            </a>
                        </div>
                       
                        <div class="bottom">
                            <?php    if ($GLOBALS['user'][1] == 1): ?>
                                <a href="index.php?file=User">Mon compte</a>
                            <?php    else: ?>
                                <a href="index.php?file=User"><?php echo _ACCOUNT; ?></a>
                                 -
                                <a href="index.php?file=Admin"><?php echo _ADMIN; ?></a>
                            <?php    endif; ?>
                        </div>
                    <?php endif; ?>
                </div>
               
            </div>
        </div>

        <div id="body"<?php if (defined('dF_large')): ?> class="large"<?php endif; ?>>
            <div id="blocks">
                <div id="gauche">
                    <?php if (!dF_is_SP4): ?>
                        <div id="flash-roster">
                            <script type="text/javascript">
                                var roster = new FFlash('<?php echo dF_skin_rpath; ?>flash/dF_roster.swf', '190px', 1000);
                                roster.assign({
                                    home: <?php echo dF_on_index; ?>,
                                    fofif_skin: '<?php echo dF_skin_rpath; ?>'
                                });
                                roster.write();
                            </script>
                           
                            <noscript>
                                <div>
                                    <object type="application/x-shockwave-flash" data="flash/dF_roster.swf" width="425" height="1000">
                                        <param name="movie" value="flash/dF_roster.swf" />
                                        <param name="quality" value="high" />
                                        <param name="wmode" value="transparent" />
                                        <param value="best" name="quality" />
                                        <param value="exactfit" name="scale" />
                                       
                                        <p>Installez le plugin Flash pour voir l'animation :
                                        <a href="http://www.adobe.com/go/gntray_dl_getflashplayer_fr" title="Lien du plugin">
                                            Cliquez ici pour le télécharger</a></p>
                                    </object>
                                </div>
                            </noscript>
                        </div>
                    <?php endif; ?>
                   
               

                    <?php
                        if (isset($_GET['menu']) ){
                           
                                get_blok('gauche',$_GET['menu']);
                        }
                        else{
                            get_blok('gauche',0);
                        }
                    ?>
                   
                </div>
               

            </div>
           
            <div id="content">
<?php include('block/charge_block_ressources.php'); ?>
                <?php get_blok('centre'); ?>
               

       
                <?php
                  global $user;
                        
                                          
                                         
                      if ($user[0] != ""){
                              $time = time();
                              $sql = ("UPDATE " . USER_TABLE . " SET usr_date_log = " . $time . " WHERE id = '" . $user[0] . "'");
                              mysql_query($sql);
                          if (isset($_GET['action']) ){

                          }
                          else{
                            if ($user['user_tuto'] == 1)    {
                                   $url = "index.php?file=User&op=doAddUser&action=tuto";
                                   redirect($url, 0);
                               }



                          }

                                      
                      }

       ?>

<!-- Content -->
           
                <?php get_blok('bas'); ?>
            </div>
           
            <div class="clear"></div>
        </div>
       
        <div id="footer">
            <div class="wrapper">
                <p class="nk">
                    <a href="http://www.nuked-klan.org" onclick="window.open(this.href); return false;" title="NK">
                        powered by nuked-klan</a>
                </p>
               
                <p class="deus">
                    <a href="http://www.nkdeus.com" onclick="window.open(this.href); return false;" title="NKDEUS">
                        design by deus</a>
                </p>
               
                <div class="clear"></div>
            </div>
        </div>
    </body>
</html>

pour que le template ci-dessus fonctionne j'ai inclu le script suivant:

<?php include('block/charge_block_ressources.php'); ?>

<?php
            global $_render, $language, $user, $nuked, $TBS;

        if (isset($GLOBALS['user']['astre_select']) AND $GLOBALS['user']['astre_select'] != 0) {
            $TBS->LoadTemplate("index_ressources.tpl.html", 'UTF-8');
            $block_player = new BlockPlayer();
            $block_astre = new BlockAstre();

            $block_ressource = new BlockRessource();
            $block_ressource->getBlockRessource($user['astre_select']);

             $TBS->Show();
        }

?>

il charge le tpl suivant (qui me poser problème hier)
<div id="general">
                <div id="topboard">

                <!-- Bloc Utilisateur -->

                    <div id="user_block">[onload;block=div;when [var.GLOBALS.user.id]+-0][onload;file='block/player.block.html']</div>

                    <!-- Bloc Astre -->
                    <astrecourant>
                            [onload;block=astrecourant;when [var.GLOBALS.user.astre_select]+-0]
                        <div id="astr_block">
                            [onload;file='block/astre_img.block.html']
                            [onload;file='block/astre_info.block.html']
                        </div>
                       
                            <div id="resrc_block">
                                    <div>
                                        <img src="image_game/ressource/[BlkAstreRess.ress_id_ext;block=(div)].gif"
                                                alt="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]" title="[var..cst._RESSOURCE_[BlkAstreRess.ress_id_ext]]"    />
                                        <h6>
                                            [onshow;block=h6;when [BlkAstreRess.ress_id_ext]!=7]
                                            [BlkAstreRess.ress_astr_stock;frm='0 000.']<br />
                                        </h6>
                                        <i>
                                            [onshow;block=i;when [BlkAstreRess.ress_id_ext]!=7]
                                            [BlkAstreRess.ress_astr_prod;frm='0 000.'] / h
                                        </i>
                                        <span class="[BlkAstreRess.ress_astr_prod;if [val]-=+0;then 'Bad';else 'Ok']">
                                            [onshow;block=span;when [BlkAstreRess.ress_id_ext]==7]
                                            [BlkAstreRess.ress_astr_prod;frm='0 000.']
                                        </span>
                           
                                    </div>
                                    <div id="money_block" >
                                        <img src="image_game/ressource/8.gif"
                                                alt="[var..cst._RESSOURCE_8]" title="[var..cst._RESSOURCE_8]"    />
                                        <h6>
                                            [BlkMoney.usr_money;frm='0 000.']
                                        </h6>
                                       
                                    </div>
                                    <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>
                           
                                    <div>
                                        <img src="image_game/population/[BlkPop.pop_id_ext;block=(div)].gif"
                                                alt="[var..cst._POPULATION_[BlkPop.pop_id_ext]]" title="[var..cst._POPULATION_[BlkPop.pop_id_ext]]"/>
                                        <span class="[BlkPop.usr_pop_free;if [val]-=+0;then 'Bad';else 'Ok']" >
                                            [BlkPop.usr_pop_free;frm='0 000.']<br />
                                        </span>
                                        <i  href="index.php?page=civil">
                                            [BlkPop.usr_pop_max;frm='0 000.'] Total
                                        </i>

                                    </div>
                                    <div class="clear" style="border:none;margin:0;padding:0;visibility:hidden;height:0;"></div>
                            </div>
                       
                        <div class="clear"></div>
                    </astrecourant>                   
                </div>
</div>

le problème maintenant et que <?php get_blok('centre'); ?>
et la suite ne s'affiche plus.

par contre des que je supprime <?php include('block/charge_block_ressources.php'); ?> la page fonctionne

j'ai l'impression qu' après un show tu ne peux plus continué le html ou le code
By: Skrol29
Date: 2012-10-29
Time: 22:04

Re: Onload

Salut Scro,

Oui effectivement :  La méthode Show() termine le script , c'est son fonctionnement par défaut.

Tu peux le changer en : $TBS->Show(TBS_OUTPUT);

Ou encore, en ajoutant quelque part : $TBS->SetOptions('render', TBS_OUTPUT);
By: Scro
Date: 2012-11-01
Time: 08:20

Re: Onload

merci par contre quand tu dis TBS_OUTPUT cela correspond à quoi?
By: Scro
Date: 2012-11-01
Time: 10:21

Re: Onload

car j'ai essayer

         $TBS->LoadTemplate(_GAMEBASE . $_GET["file"] .'/index.tpl.html');

mon code php

         $TBS->mergeBlock('BlkBuilNivSuivantCout', 'array', '_render[info_ressources][%p1%][cout]');
         $TBS->Show(TBS_OUTPUT);

Cela ne fonctionne pas
By: Skrol29
Date: 2012-11-01
Time: 14:50

Re: Onload

Par défaut, Show() utilise TBS_OUTPUT + TBS_EXIT, c'est à dire qu'il affiche le résultat en sortie, et termine le script.

http://www.tinybutstrong.com/manual.php#php_setoption_render
By: Scro
Date: 2012-11-01
Time: 17:05

Re: Onload

car j'ai essayer

         $TBS->LoadTemplate(_GAMEBASE . $_GET["file"] .'/index.tpl.html');

mon code php

         $TBS->mergeBlock('BlkBuilNivSuivantCout', 'array', '_render[info_ressources][%p1%][cout]');
         $TBS->Show(TBS_OUTPUT);

Cela ne fonctionne pas
By: Skrol29
Date: 2012-11-04
Time: 19:57

Re: Onload

C'est surtout dans le sous-template qu'il faut mettre TBS_OUTPUT, c'est à dire dans "charge_block_ressources.php".