Fork me on GitHub

Rapport de message :*
 

Re: bloc customisé. Inserer un script PHP

Titre du sujet : Re: bloc customisé. Inserer un script PHP
par crazy85 sur 30/03/2010 11:47:23

Bon en utilisant le module Ghost j'arrive à afficher un bloc
ICI seul bémol, le résultat ne s'affiche pas comme il devrait le faire => voir le script qui fonctionne

Voici le code source de la page appelée:

<?php
if (file_exists("mainfile.php")) {
include(
"mainfile.php");
} elseif (
file_exists("../mainfile.php")) {
include(
"../mainfile.php");
} else { 
include(
"../../mainfile.php");
}
include(
XOOPS_ROOT_PATH."/header.php");
if(isset(
$xoTheme) && is_object($xoTheme)) {
   
$xoopsTpl->assign('xoops_sitename','Put here the page title, visible at the top of the browser');
   
$xoopsTpl->assign('xoops_pagetitle''Put here your page title');
   
$xoTheme->addMeta'meta''keywords''Put here keyword, keyword1, keyword2, keyword3, etc.');
   
$xoTheme->addMeta'meta''description''Put here the page description line that often appears in search results.');
}


if (
$submit == 'Calculer') { 
    if (
$compute == 'sub') { 
        
$day $day 63
    } elseif (
$compute == 'add') { 
        
$day $day 70
    } 
    
$echo date($outputmktime (0,0,0,$month,$day,$year)); //ceci est la date calculée 


echo 

<form action="" method=post> 
<table border=0 cellspacing=1 cellpadding=2 bgcolor=blue width=300> 
<tr> 
<td bgcolor=blue><font color=white face=arial><B>Date Calculée"
; if (!empty($echo)) {echo " - Résultat: $echo";} echo "</B></font></td> 
</tr> 
<tr> 
<td bgcolor=white> 
    <table border=0 cellpadding=3 cellspacing=0> 
    <tr> 
        <td aligin=left><font color=blue face=arial>Choisir date:  </font></td><td aligin=left><select name=day>"

        
getoption(131date("d")); 
        echo 
"</select><select name=month>"
        
getoption(112date("m")); 
        echo 
"</select><select name=year>"
        
getoption(19702020date("Y")); 
        echo 
"</select></td> 
    </tr> 
    <tr> 
        <td aligin=left><font color=blue face=arial>Sélectionner</font></td><td aligin=left><select name=compute><option value=add>Date Maximum<option value=sub>Date Minimum</select> 
    </tr> 
     <tr> 
            <tr> 
        <td aligin=left><font color=blue face=arial>Format de sortie:  </font></td><td aligin=left><select name=output><option value="
j-m-Y">jj-mm-YYYY</select></td> 
    </tr> 
    </tr>   
    <tr> 
        <td aligin=left colspan=2><input type=submit name=submit value=Calculer></td> 
    </tr> 
     </table> 
     
     
</td></tr></table></form>"


function 
getoption($start$end$if) { 
    for (
$i=$start;$i<=$end;$i++) { 
        echo 
"<option value=$i"; if ($i == $if) { echo " selected";} echo ">$i"
    } 


?>

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

38 Personne(s) en ligne (28 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 38 | Plus ...