Les FScodes (issues du moteur de FSB2) HTML, PHP et SQL que j'avais adapté pour ce forum ont été légèrement corrigés. Il existe toujours quelques bugs avec les FScode PHP dans certains rare cas de figure mais la majorité des anciens bugs a disparu. Le FScode HTML a été revu de façon a coloré aussi les variables de templates.
FSCODE PHP :
[php] /*
** Méthode inspirée de la classe de FSB2
** Permet de charger un fichier cache, soit depuis le FTP, soit depuis la table cache de la base de donnée
** -----
** $table :: Nom de la table à charger
*/
function load_table($table, $load_type = CACHE_FTP)
{
$fields = 'fields_' . $table;
$count = 'compte_' . $table;
global $bdd, $langue, $$count, $$fields, $$table;
if ($load_type == CACHE_FTP)
{
if (file_exists($this->dir . 'fichier_' . $table . '.php'))
{
include($this->dir . 'fichier_' . $table . '.php');
}
else
{
die('Le fichier ' . $this->dir . 'fichier_' . $table . '.php n\'existe pas');
}
}
else
{
$sql = 'SELECT * FROM ' . CACHE_TABLE . "
WHERE cache_table = '$table'";
$result = $bdd->requete($sql) OR die("$sql<br />" . $bdd->error());
$row = $bdd->tableau($result);
foreach (array('cache_content' => 'table', 'cache_fields' => 'fields') AS $key => $value)
{
$$$value = unserialize(stripslashes($row[$key]));
if (!is_array($$$value))
{
$$$value = array();
}
}
$$count = count($$table);
}
}[/php]
FSCODE HTML :
[html]{PAGINATION_CODE}
<form action="{U_ACTION}" method="post">
<table class="tableau" width="100%" cellpadding="3" cellspacing="0">
<tr>
<td class="td_titre" colspan="4" align="center">{L_LISTE_MEMBRE}</td>
</tr>
<tr>
<td class="td_titre2" align="left" colspan="2">{ORDRE_LISTE} {ORDRE_TYPE} <input type="text" class="texte" name="periode" size="2" maxlength="6" value="{V_PERIODE}" /> <input type="submit" name="soumettre" value="{L_SOUMETTRE}" class="boutton" /></td>
<td class="td_titre2" align="right" colspan="2"> {PAGINATION}</td>
</tr>
<tr>
<td class="td_liste_membres3" align="center"><span class="b">{L_ID}</span></td>
<td class="td_liste_membres4" align="center"><span class="b">{L_PSEUDO}</span></td>
<td class="td_liste_membres3" align="center"><span class="b">{L_DATE}</span></td>
<td class="td_liste_membres6" align="center"><span class="b">{L_NB_MESSAGE}</span></td>
</tr>
<!-- BEGIN liste -->
<tr>
<td class="td_liste_membres1" align="center">{liste.ID}</td>
<td class="td_liste_membres2" align="center"><a href="{liste.U_PSEUDO}" class="{liste.CLASSE_AUT}">{liste.PSEUDO}</a></td>
<td class="td_liste_membres1" align="center">{liste.DATE}</td>
<td class="td_liste_membres5" align="center">{liste.NB_MESSAGE}</td>
</tr>
<!-- END liste -->
<tr>
<td class="td_titre2" align="right" colspan="4"> {PAGINATION}</td>
</tr>
</table>
</form>[/html]
FSCODE SQL :
[sql]SELECT m.* FROM fsb_membres m
LEFT JOIN fsb_sujets s
ON m.membre_id = s.membre_id
WHERE membre_id = 10
ORDER BY membre_login ;[/sql]
FSCODE PHP :
[php] /*
** Méthode inspirée de la classe de FSB2
** Permet de charger un fichier cache, soit depuis le FTP, soit depuis la table cache de la base de donnée
** -----
** $table :: Nom de la table à charger
*/
function load_table($table, $load_type = CACHE_FTP)
{
$fields = 'fields_' . $table;
$count = 'compte_' . $table;
global $bdd, $langue, $$count, $$fields, $$table;
if ($load_type == CACHE_FTP)
{
if (file_exists($this->dir . 'fichier_' . $table . '.php'))
{
include($this->dir . 'fichier_' . $table . '.php');
}
else
{
die('Le fichier ' . $this->dir . 'fichier_' . $table . '.php n\'existe pas');
}
}
else
{
$sql = 'SELECT * FROM ' . CACHE_TABLE . "
WHERE cache_table = '$table'";
$result = $bdd->requete($sql) OR die("$sql<br />" . $bdd->error());
$row = $bdd->tableau($result);
foreach (array('cache_content' => 'table', 'cache_fields' => 'fields') AS $key => $value)
{
$$$value = unserialize(stripslashes($row[$key]));
if (!is_array($$$value))
{
$$$value = array();
}
}
$$count = count($$table);
}
}[/php]
FSCODE HTML :
[html]{PAGINATION_CODE}
<form action="{U_ACTION}" method="post">
<table class="tableau" width="100%" cellpadding="3" cellspacing="0">
<tr>
<td class="td_titre" colspan="4" align="center">{L_LISTE_MEMBRE}</td>
</tr>
<tr>
<td class="td_titre2" align="left" colspan="2">{ORDRE_LISTE} {ORDRE_TYPE} <input type="text" class="texte" name="periode" size="2" maxlength="6" value="{V_PERIODE}" /> <input type="submit" name="soumettre" value="{L_SOUMETTRE}" class="boutton" /></td>
<td class="td_titre2" align="right" colspan="2"> {PAGINATION}</td>
</tr>
<tr>
<td class="td_liste_membres3" align="center"><span class="b">{L_ID}</span></td>
<td class="td_liste_membres4" align="center"><span class="b">{L_PSEUDO}</span></td>
<td class="td_liste_membres3" align="center"><span class="b">{L_DATE}</span></td>
<td class="td_liste_membres6" align="center"><span class="b">{L_NB_MESSAGE}</span></td>
</tr>
<!-- BEGIN liste -->
<tr>
<td class="td_liste_membres1" align="center">{liste.ID}</td>
<td class="td_liste_membres2" align="center"><a href="{liste.U_PSEUDO}" class="{liste.CLASSE_AUT}">{liste.PSEUDO}</a></td>
<td class="td_liste_membres1" align="center">{liste.DATE}</td>
<td class="td_liste_membres5" align="center">{liste.NB_MESSAGE}</td>
</tr>
<!-- END liste -->
<tr>
<td class="td_titre2" align="right" colspan="4"> {PAGINATION}</td>
</tr>
</table>
</form>[/html]
FSCODE SQL :
[sql]SELECT m.* FROM fsb_membres m
LEFT JOIN fsb_sujets s
ON m.membre_id = s.membre_id
WHERE membre_id = 10
ORDER BY membre_login ;[/sql]
Cause Im as free as a bird now, And this bird you can not change. - Freebird - Lynyrd Skynyrd
There's someone in my head but it's not me. - Brain damage - Pink Floyd
I said baby, you know Im gonna leave you. - Babe I'm gonna leave you - Led Zeppelin
Father ? yes son, I want to kill you - The end - The Doors
There's someone in my head but it's not me. - Brain damage - Pink Floyd
I said baby, you know Im gonna leave you. - Babe I'm gonna leave you - Led Zeppelin
Father ? yes son, I want to kill you - The end - The Doors






