Re: Question PHP | Titre du sujet : Re: Question PHP par Grom sur 28/09/2016 20:47:11
Oui mais non ! Ca je sais faire. Mais la page n'a pas de template correspondant, elle est interne au module. (Pages). C'estpour caqu'il me faut un codage d'affichage compréhensible en php. Je met l'integralité :
<?php function b_pages_list() { global $xoopsDB, $xoopsModule, $myts; $myts =& MyTextSanitizer::getInstance(); $block['content'] =" "; $result2 = $xoopsDB->query("SELECT CID FROM " . $xoopsDB->prefix("pages") . ""); $numrows = $xoopsDB->getRowsNum($result2); $block['content'] .= "<a href='" . XOOPS_URL . "' title='Accueil'>Accueil</a><br />"; if ($numrows > 0) { $sql = "SELECT CID, pagetitle, pageheadline, weight, publishdate FROM " . $xoopsDB->prefix("pages") . " WHERE mainpage <>0 OR defaultpage =1 ORDER BY weight, pagetitle ASC"; $result = $xoopsDB->query($sql) ; while (list($CID, $pagetitle, $pageheadline, $publishdate) = $xoopsDB->fetchrow($result)) { $pagetitle = $myts->htmlSpecialChars($pagetitle); $block['content'] .= "<a href='" . XOOPS_URL . "/modules/pages/index.php?pagenum=$CID' title='" . $pagetitle . "'>" . $pagetitle . "</a><br />"; } } else {$block['content'] = _MD_NOPAGE;} $block['content'] .= "<a href='" . XOOPS_URL . "/modules/contact/' title='contact'>Contact</a><br />"; if ($xoops_isuser){ $block['content'] .= "<a href='" . XOOPS_URL . "/user.php' title='user'>Mes infos</a><br />"; } else{ $block['content'] .= "<a href='" . XOOPS_URL . "/register.php' title='Inscription'>Inscription</a><br />"; $block['content'] .= "<a href='" . XOOPS_URL . "/user.php' title='user'>Connexion</a><br />";} if ($xoops_isadmin){ $block['content'] .= "<a href='" . XOOPS_URL . "/admin.php' title='Administration'>Administration</a><br />"; } return $block; } ?>
en live c'est ferme-de-reculefort.fr
|
|