Fork me on GitHub






image aléatoire dans le header au chargement
Régulier
Inscrit: 15/09/2010 21:20
De picardie France
Messages: 101
bonjour,
cela fait une semaine que je cherche la solution pour mettre dans le header des images qui changeraient lors du chargement de la page. j'ai bien essayé des codes script mais je ne sais pas s'ils sont au bon endroit, du coups rien ne fonctionne.
je suis en version 2.5.1 et les thèmes que j'utilise pour mon site sont Suico et darkforest.
merci d'avance.

Posté le : 26/09/2011 21:05
Partager Twitter Partagez cette article sur GG+
Re: image aléatoire dans le header au chargement
Supporter Xoops
Inscrit: 09/01/2005 13:37
De Breizh
Messages: 16972

Posté le : 26/09/2011 23:47

La connaissance s'accroît quand on la partage ...
Partager Twitter Partagez cette article sur GG+
Re: image aléatoire dans le header au chargement
Régulier
Inscrit: 15/09/2010 21:20
De picardie France
Messages: 101
Merci Kris pour ta réponse.

je suis allez sur google (mon ami) bien entendu après avoir visualisé les sujets sur xoops. J'ai bien aussi essayé pas mal de combinaisons (sans résultat).
mon réel problème n'est pas de chercher des codes sur internet mais plutôt de savoir ou les placer...

dans le fichier header.html :
<div id="xo-banner" class="<{$xoops_dirname}><{if $xoops_banner and $xoops_banner != '&nbsp;'}> commercial<{/if}>">
    <!-- 
logo and link homepage -->
    <
div id="xo-headerlogo"><a href="<{xoAppUrl /}>" title="<{$xoops_sitename}> - <{$xoops_slogan}>"><img src="<{xoImgUrl img/logo.png}>" alt="<{$xoops_sitename}>" /></a></div>
    <!-- 
rss feed link -->
    <{if 
$theme_view_rssheader}><{includeq file="$theme_name/xo_rssheader.html"}><{/if}>
    <!-- 
banner -->
    <{if 
$xoops_banner and $xoops_banner != '&nbsp;'}>
        <
div id="xo-headerbanner"><{$xoops_banner|smarty:nodefaults}></div>
    <{/if}>
</
div>


je ne vois pas quoi changer, ni ou rajouter...
dans le fichier théme.html idem:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<
head>
<!-- 
Theme name -->
    <{
assign var=theme_name value=$xoTheme->folderName}>
<!-- 
Directory html blocks files or additional html files by include -->
    <{
assign var=theme_name value=$xoTheme->folderName|cat:'/xotpl'}>
<!-- 
Directory html plugins files -->
    <{
assign var=theme_plugin value=$xoTheme->folderName|cat:'/xoplugins'}>
<!-- 
Directory html javascript files -->
    <{
assign var=theme_js value=$xoTheme->folderName|cat:'/js'}>

<{
php}>
/** If a module defines its own canvas template (located themes/themename/modules/dirname/xo_canvas.html), take it; otherwise the default canvas (themes/themename/xotpl/xo_canvas.html) is used. */
    
if(file_exists(XOOPS_ROOT_PATH."/themes/".$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/xo_canvas.html")) {
        
$this->assign("canvas_template"$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/xo_canvas.html");
    }else{
        
$this->assign("canvas_template"$this->_tpl_vars["xoops_theme"]."/xotpl/xo_canvas.html");
    }
/** Defined an extra SMARTY variable $xoops_themeurl, which is identical to $xoops_imageurl, for literal consistence only */
    
$this->assign("xoops_themeurl"$this->_tpl_vars["xoops_url"]."/themes/".$this->_tpl_vars["xoops_theme"]);
/** Defined an extra SMARTY variable $xoops_module_theme */
    
$this->assign("xoops_module_theme"$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]);
/** If a module has its own css (located themes/themename/modules/dirname/style.css), append it to $xoops_module_header */
    
if(file_exists(XOOPS_ROOT_PATH."/themes/".$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/style.css")) {
        
$this->assign("xoops_module_header"
        
$this->_tpl_vars["xoops_module_header"]."n".
        
"<link rel="stylesheet" type="text/css" media="screen,projection" href="".$this->_tpl_vars["xoops_themeurl"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/style.css"/>n");
    }
/** Defined an extra SMARTY variable $modulename for display current module name defined by webmaster in xoops administration */
    
GLOBAL $xoopsModule
    
$modulename = (isset($xoopsModule) ? $xoopsModule->getVar('name') :'system');
    
$GLOBALS['xoopsTpl']->assign('modulename'$modulename); 
<{/
php}>
    
<{
includeq file="$canvas_template"}>


partout on parle de mettre des code dans un BODY et nul part sur Xoops on en vois un...

il y a bien ça aussi:
http://www.jscs.org/scripts30-JS.htm

mais ou le positionner???
dans mon style.css j'ai bien trouvé mon image:

#xo-banner { width:1000px; height:291px; margin:0;background:url(../img/header2.jpg) top no-repeat;}


mais ça résolu pas mon PB

Posté le : 27/09/2011 21:18
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

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

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