Code PHP:
$name = $db->query_read_slave("SELECT name FROM country");
while ($country = $db->fetch_array($name))
{
$vbphrase['name'] = $country['name'];
eval('$pays = "' . fetch_template('TEST_PAYS') . '";');
}
Tu remplaces TEST_PAYS par le template qui doit afficher le pays et tu modifies $pays pour être inséré dans le template TEST.
Voilà ce à quoi tu devrais arriver au final :
Template TEST :
Code HTML:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
$headinclude
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
</head>
<body>
$header
$navbar
<br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" style="border-bottom: 0" width="100%" align="center">
<tr>
<td class="cat-top">TEST</td>
</tr>
</table>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td colspan="2">TEST</td>
</tr>
</thead>
<tbody>
$pays
</tbody>
</table>
<br />
$footer
</body>
</html>
Template TEST_PAYS :
Code HTML:
<tr>
<td class="alt2">$vbphrase[name]</td>
</tr>
Code de ta page :
Code PHP:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('TEST');
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
$name = $db->query_read_slave("SELECT name FROM country");
while ($country = $db->fetch_array($name))
{
$vbphrase['name'] = $country['name'];
eval('$pays = "' . fetch_template('TEST_PAYS') . '";');
}
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
?>
Je te conseille quand même de ne pas utiliser les variables $vbphrase comme ça, si tu as une expression sur le forum qui s'appelle $vbphrase[name] ailleurs, ça peut ne rien afficher.