Problème de menu et insertion d'une nouvelle page [merged] Résolu, Merci

Started by Mi², December 25, 2004, 11:33:50 PM

Previous topic - Next topic

Mi²

Bonjour,

Je suis en train d'essayer de paramètrer SMF pour mon utilisation, et je rencontre quelques petits problème, qui je pense, ne sont pas insurmontables si l'on sait s'y prendre......or se n'est pas mon cas  :-\ :'(

Je m'explique ;)
Mon Designer préféré a du mal avec le fichier index.template.php, pour réaliser certaines des fonctions que je recherche :-\
http://www.powerkite.net/forumSM/index.php
Vous pourrez constater qu'en cliquant sur le bouton Visus on ouvre la page http://www.powerkite.net/forumSM/Sources/images.htm dans une autre fenêtre
  • -je souhaiterai pouvoir l'ouvrir à la place du Forum, de manière à garder en permance mon header à sa place, et ainsi pouvoir faciliter la navigation entre mon forum, et mon site......
  • -Je souhaiterai en plus, pour certains boutons que je mettrais en place plus tard, qu'ils ne soient visibles que pour les membres loggés 
    Merci de m'indiquer vos solutions  ::)
++
Michel
Sapiens nihil affirmat quad non probet

Meriadoc

#1

index.template.php
recherche pour
template_menu()
voici les boutons.

#2
dans la meme foncitonne, utilise
$context['user']['is_logged']

comme

if($context['user']['is_logged'])
{
      ton code et boutons ici
}


Aussi, j'ai vu que le theme default ne fait pas bien. Et que le copyright ne soit pas là. Pour la theme default etre modifier n'est pas un bonne idée, mais pour le copyright n'etre pas là, c'est interdit!
lien 1
lien 2
lien 3

il faut que le copyright y soit! merci :)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Mi²

Quote from: Meriadoc on December 26, 2004, 12:18:23 AM
lien 1
lien 2
lien 3

Désolé :-[, mais ces thèmes n'étaient pas destinés à être utilisés, je les ai donc supprimé maintenant.

Par contre pour le code..... je n'ai pas compris.... :-\ :-\
Sapiens nihil affirmat quad non probet

Meriadoc

merci :) j'ai pensé que c'étair juste au cause des changes tu fait.

Désolé pour mon mauvais explication. :-/ Ce n'est pas ma langue première
Tu voudrais changer le lien d'un bouton dans le menu, non?

Alors, dans index.template.php, trouve le fonctionne template_menu() vers ligne 420.
quelquepart là est le code tu voudrais changer. Si tu ne sais pas le HTML ou PHP, ou voudrais que je le change pour toi, envoye-moi un MP avec un compte d'administration et FTP. je serrais heureux t'aider.
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

brigitte

Bonjour,

Pouvez-vous m'expliquer comment on doit faire pour insérer une nouvelle page html dans le forum et que celle-ci s'affiche avec le header index.template

Je ne suis pas trsè douée  :-[  :'( donc ayez un peu pitié des débutants  ;) ;) ;D

Merci
Brigitte

Meriadoc

je ne te comprends pas. une nouvelle page html? peux-tu me donner un example? Desole, peut-etre un autre sais quoi tu voudrais
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Alexandre P.

Pour le second problème (c-à-d celui de cacher des boutons à ceux qui ne sont pas connectés):

Dans le index.template.php de ton thème, cherche, vers la ligne 420, le code suivant:
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

Au-dessous de ceci, tu peux ajouter des nouveaux boutons.  Pour cacher les boutons aux non-membres, voici quel code ajouter:

// Nom du Bouton Personnalisé (
if ($context['user']['is_logged']) { // On n'affiche que si l'utilisateur est connecté
echo ' // On imprime un bouton
<a href="#"><img src="bouton.img" alt="" /></a> // Lien hypertexte et source de l'image
', $context['menu_separator']; // Séparateur (s'affichera seulement si activé)
};

Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Alexandre P.

Pour la première question (afficher une page personnalisée à la place du forum), je n'ai aucune idée de la façon de procéder.  C'est tout à fait possible, mais je ne sais pas comment.  (Merry?)
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Alexandre P.

Merry > Brigitte would like to include a personalised HTML page using the forum's theme.  So her page would display the current theme's header, then a personalised content instead of the forum's categories or message index.  I hope it's clear, since I don't know how to do that.  It's probably the same thing MI² would like to do with his personnalised page.

En espérant que tu sois capable de répondre à Brigitte :)
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Mi²

Quote from: Ap2 on December 26, 2004, 04:51:17 PM
It's probably the same thing MI² would like to do with his personnalised page.

;D yeah  ;) i saw i've all understood Ap2, shé's my prefered designer  :) and her question go in the same direction than the mine....
Sapiens nihil affirmat quad non probet

Meriadoc

I merged topics, hopefully clear.

I will look into this HTML question. I understand now. Thank you Ap2. Thinking SSI might do the trick, otherwise a custom ?action=something :-/

désolé pour l'anglais ;)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Meriadoc

Le plus facile pour moi, et le plus vite pour toi, est de procéder comme des 'actions'

Dans /index.php (pas Sources/index.php, mais le premier index.php, celui à la racine du dossier de ton forum)

ajoute un nouvel action au tableau $actionArray (~ ligne 199)
il ressemble à ça

// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
$actionArray = array(
'activate' => array('Register.php', 'Activate'),
'admin' => array('Admin.php', 'Admin'),
'announce' => array('Post.php', 'AnnounceTopic'),


après la dernière action (problement '.xml' => array('News.php', 'ShowXmlFeed'),) mets ton action:

'nomDeAction' => array('NomDeFichier.php','NomDeFonction'),
change juste les noms, et ne prends pas le même que ceux déjà utilisés...
Tu obtiendras probablement ça, à partir de la ligne 297, après avoir fait tes modifications:


'viewquery' => array('ViewQuery.php', 'ViewQuery'),
'who' => array('Who.php', 'Who'),
'.xml' => array('News.php', 'ShowXmlFeed'),
'nomDeAction' => array('NomDeFichier.php','NomDeFonction'),

ou quelque chose comme ça.

Crée un nouveau fichier PHP dans le dossier /Sources, fichier dont le nom correspondra à celui que tu auras spécifié plus tôt dans $actionArray.  Dans ce fichier, mets:
<?php
function NomDeFonction()
{
loadTemplate('NomDeFichier');
}
?>

/!\ Ne mets pas NomDeFichier.php pour l'argument en loadTemplate()!! Juste NomDeFicher! (À remplacer bien sûr par ceux que tu auras plus tôt choisi.)

Fais un nouveau fichier dans le dossier /Themes/default. Dedans, tu insères:

<?php
function template_main()
{
print <<<EOF

***mettre ton HTML ici***

EOF;
};
?>


Sauve-le sous le nom NomDeFichier.template.php.

Si tu préfères, tu peux utiliser la fonction include() de PHP pour inclure ta page HTML:

<?php
function template_main()
{
     include(
'chemin/vers/ton/fichier.html');
}
?>



Demande-moi si tu as des questions!

(Un correcteur est passé...)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Mi²

merci Meriadoc,  :)
j'essaie de tester ça cette semaine, et je te dirais ce que cela donne !!!
Sapiens nihil affirmat quad non probet

Alexandre P.

Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

Merci pour le petit correcteur, et pour l'URL, je l'ai oublié
Quote from: Ap2 on December 27, 2004, 12:54:22 AM
J'ajouterai seulement que l'URL vers la page sera sous la forme
http://www.monsite.com/forum/index.php?action=NomDeAction
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

brigitte

 ;D ;D :D

Ca maaaaaaaaaaaaarche ... merci Meriadoc et Ap² ... vous êtes des génies  :D ;)

Petite remarque pour info : concernant :


Quote from: Meriadoc on December 26, 2004, 09:33:16 PM

Fais un nouveau fichier dans le dossier /Themes/default. Dedans, tu insères:

<?php
function template_main()
{
print <<<EOF

***mettre ton HTML ici***

EOF;
};
?>


Sauve-le sous le nom NomDeFichier.template.php.

Je n'ai pas réussi de cette manière-ci.  Il me mettait un message d'erreur, comme quoi il manquait une ' à cette ligne-ci : EOF;};

J'ai donc essayé l'autre option et ça a marché  ;D

Quote from: Meriadoc on December 26, 2004, 09:33:16 PM
Si tu préfères, tu peux utiliser la fonction include() de PHP pour inclure ta page HTML:

<?php
function template_main()
{
     include('chemin/vers/ton/fichier.html');
}
?>



:-* :-*

Meriadoc

Quote from: brigitte on December 27, 2004, 07:17:25 AM

Je n'ai pas réussi de cette manière-ci.  Il me mettait un message d'erreur, comme quoi il manquait une ' à cette ligne-ci : EOF;};


c'est un petit truc de moi, desole. PHP est tres partiqulaire avec HEREDOC (le method <<<EOF ... EOF; )

c'est comme:

EOF;
}

le } aprew EOF; et sans le ;

Mais c'est plus jolie avec le fonctionne include() je pense :)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

brigitte

Quote from: Meriadoc on December 27, 2004, 02:40:55 PM
c'est un petit truc de moi, desole. PHP est tres partiqulaire avec HEREDOC (le method <<<EOF ... EOF; )

c'est comme:

EOF;
}

le } aprew EOF; et sans le ;

Merci Meriadoc !
Effectivement en enlevant le ; ça fonctionne  :D

Maintenant j'ai une autre petite question :
J'ai donc inséré une page html tout en affichant le header au-dessus (http://www.powerkite.net/forumSM/index.php?action=images [nofollow]).  Sur cette page html, il y a des liens hypertextes.  Or quand je clique sur ces liens, le header ne s'affiche plus.  Comment doit-on faire pour que le header continue à s'afficher ?  ???

Meriadoc

If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Mi²

Quote from: Meriadoc on January 24, 2005, 04:55:57 PM
les liens comme http://www.powerkite.net/site/galery/index.php?spgmGal=2005/Les%20Hemmes ?
les liens ne sont pas à le forum, mais le galery.

Bonsoir Merriadoc,
effectivement, ce n'est pas le forum, mais une galerie ;)
Mais le problème reste le même, si nous insérons des pages html sous le header, grâce à la méthode "include",
nous souhaiterions pouvoir nous servir de ces pages html, comme des "menus" qui nous permettrons de naviguer dans tout le site, en gardant en permanence le header...!!! :o :o :o
Merci
Michel


Effectively, it is not the forum, but a gallery  ;)
But the problem remains the same, if we insert pages html under the header, with " include ",
We would like can use these pages html, as "menus" which shall allow us to navigate in all the site, by keeping permanently the header!!! :o :o :o
Thank you
Michel
Sapiens nihil affirmat quad non probet

Mi²

Ne cherchez plus,
Oups, le code fonctionne, je me suis simplement planté dans mes manipulations :-X :-X :-X
Merci quand même, et à bientôt pour d'autres question tordues  ;)
++
Michel
Sapiens nihil affirmat quad non probet

Meriadoc

If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

brigitte

est-ce que quelqu'un peut me dire comment intégrer un jeu de cadres html (frame) en dessous du header ?
J'ai essayé avec la fonction "include" dans le template mais cela ne fonctionne pas  >:(

merci pour votre aide  :P

Meriadoc

tu veux utilise <iframe>?

<iframe height="###" width="###" frameborder="#" scrolling="yes" src="FICHIER.php" id="NOM" name="NOM"></iframe>
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

brigitte

non non, des frameset du style :

<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
  <frame name="leftFrame" scrolling="NO" noresize src="file:///UntitledFrame-2">
  <frame name="mainFrame" src="/untitled0.htm">
</frameset>

Alexandre P.

C'est pas possible.  Le jeu de cadres doit se trouver sur une page unique.  Il n'est donc pas possible de mélanger jeux de cadres et un quelconque contenu.  Le mieux à utiliser est l'include() de PHP ou l'iframe comme Meriadoc l'a montré.
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

les jeux de cadres (french makes no sense, how do you get frameset from that?? ;)) ne sont pas bons en toute casse ;)

(IMHO)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Alexandre P.

frame > cadre.  Like a frame around a photography.
set > jeu.  But not "jeu" like a game.  "Jeu" could also mean a group of, a collection of some things: a set of keys > un jeu de clés, a set of tools > un jeu d'outils.

Les jeux de cadres sont effectivement à utiliser avec modération.  Ils sont des plaies pour la navigation sur Internet.  Donc, à utiliser intelligemment et de la meilleure façon possible.
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Mi²

Quote from: Meriadoc on January 31, 2005, 01:18:19 PM
tu veux utilise <iframe>?

<iframe height="###" width="###" frameborder="#" scrolling="yes" src="FICHIER.php" id="NOM" name="NOM"></iframe>


Merci Merry,
c'est la solution que nous avons finis pas retenir :), elle fonctionne parfaitement
Sapiens nihil affirmat quad non probet

Advertisement: