Changement de page d'accueil

Started by Mi², January 23, 2005, 03:10:12 PM

Previous topic - Next topic

Mi²

Bonjour,

Dans un post précédent, vous m'avez donné une solution qui fonctionne à merveille :)

ce qui me pousse tout naturellement à vous poser un autre petit problème technique ;)

actuellement, lorsque l'on clique sur http://www.powerkite.net/forumSM/index.php tout le monde arrive directement sur le forum,
or, je voudrais que seul les membres loggués arrivent directement sur le forum.....
pour les membres non loggués, je souhaiterais qu'il arrivent sur http://www.powerkite.net/forumSM/index.php?action=AcceuilMessage .... :-\ :-\ :-\  après avoir cliqué sur http://www.powerkite.net/forumSM/index.php :o :o :o vous voyez ce que je veux dire  ;)
ce serait sympa de m'indiquer comment je peux arriver à ce résultat

Merci et à +
Mi²
Sapiens nihil affirmat quad non probet

evolus

C'est tout à fait possible sauf que tu n'as pas besoin de deux pages mais d'une commande qui affiche tel texte si c'est un invité, je te le ferai demain après-midi là je vais dodoter ;)

Mi²

Sapiens nihil affirmat quad non probet

Xtreme66

Salut Mi²,

Il existe une possibilité en modifiant les droits d'accés aux invités, ceux-ci ne pouront pas accéder aux forums sans se logguer.  ;)


Admin >> Configuration des caractéristiques et options >> décocher : Permettre aux invités de visiter le forum.


Reste plus qu'à modifier ou rajouter ce que tu souhaites dans login.template et login.french si besoin est ....


A+




NB: Brigitte bon courage ....  :-*







Mi²

Quote from: Xtreme66 on January 24, 2005, 08:17:40 AM
Salut Mi²,

Il existe une possibilité en modifiant les droits d'accés aux invités, ceux-ci ne pouront pas accéder aux forums sans se logguer.  ;)


Admin >> Configuration des caractéristiques et options >> décocher : Permettre aux invités de visiter le forum.


Reste plus qu'à modifier ou rajouter ce que tu souhaites dans login.template et login.french si besoin est ....


A+

Nan Nan Nan je ne veux pas interdire l'accès aux forum, pour les visiteurs... simplement que les personnes non logguées arrivent d'abord sur une page d'accueil..... ;)
Sapiens nihil affirmat quad non probet

Alexandre P.

Je vois que la première étape (avoir une URL avec une action personalisée, qu'il te faudra d'abord ajouter à index.php; procédure décrite ici: http://www.simplemachines.org/community/index.php?topic=22362.msg178466#msg178466) a déjà été effectuée ;D

Ensuite, une fois la procédure précédente appliquée, à vue de nez, je tenterais cette méthode:

Dans /index.php, rechercher (~ ligne 171)
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', '.xml'))))
{
require_once($sourcedir . '/Subs-Auth.php');
return 'KickGuest';
}

Ajouter après:
// Si un invité arrive sur le forum ET qu'il n'a défini aucune ?action= , alors on lui affiche une page d'accueil personnalisée.
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action']))
{
require_one($sourcedir . '/NomDeFichier.php');
return 'NomDeAction';
}
où, pour reprendre les mêmes noms que dans la procédure précédente, NomDeFichier.php est la page personnalisée que tu as précédemment placé dans le répertoire /Sources, et NomDeAction est le nom que tu as donné à la fonction dans /Sources/NomDeFichier.php.
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Mi²

Bonsoir Alexandre,
j'ai testé la modification du code comme indiqué

// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', '.xml'))))
{
require_once($sourcedir . '/Subs-Auth.php');
return 'KickGuest';
}
// Si un invité arrive sur le forum ET qu'il n'a défini aucune ?action= , alors on lui affiche une page d'accueil personnalisée.
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action']))
{
require_one($sourcedir . '/Accueil.php');
return 'AccueilMessage';
}
elseif (empty($_REQUEST['action']))
{
// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}

Mais lorsque je le teste, j'obtiens ce message d'erreur : Parse error: parse error, unexpected '{' in /home/.sites/109/site198/web/forumSM/index.php on line 179 ::)
or la ligne 179 est la ligne contenant l'accolade, juste sous
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])) ::) :-[
là je suis vraiment paumé,  :'( :'( :'(
Merci d'avance ;)
++
Michel
Sapiens nihil affirmat quad non probet

Meriadoc

remplace
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action']))
avec
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
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 28, 2005, 03:11:37 PM
remplace
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action']))
avec
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))

Merci Meriadoc  :)
je suis en train de tester, mais je rencontre encore quelques petits problèmes ::), je les liste dès que j'en aurais fait le tour ;)



Thank you merry :)
I am testing, but I still meet some small problems ::), I list them as soon as I would have finished ;)
Sapiens nihil affirmat quad non probet

Mi²

je disais donc,
cela fonctionne effectivement mieux :)
// Si un invité arrive sur le forum ET qu'il n'a défini aucune ?action= , alors on lui affiche une page d'accueil personnalisée.
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
require_one($sourcedir . '/PKaccueil.php');
return 'PKaccueil';
}


j'arrive en invité, et je suis directement sur la page d'accueil, jusque là OK ;) http://www.powerkite.net/forumSM/index.php
je me loggue, sans problème OK ;)
je poursuis mes test..... et j'essaie de me déconnecter ::) et là----->
Fatal error: Call to undefined function: require_one() in /home/.sites/109/site198/web/forumSM/index.php on line 180 :'( :'( :'(
Sapiens nihil affirmat quad non probet

Meriadoc

juste un tres petit erreur :)

remplace
require_one($sourcedir . '/PKaccueil.php');
avec
require_once($sourcedir . '/PKaccueil.php');
ou avec
include_once($sourcedir . '/PKaccueil.php');

include() et require() sont la même (et require_once() include_once() )

le "_once" include la fichier seulement si il n'est pas déjà includé

(includé?? ;) )
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.

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

Mi²

Oki  :)

When I test
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
require_once($sourcedir . '/PKaccueil.php');
return 'PKaccueil';
}

or
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
include_once($sourcedir . '/PKaccueil.php');
return 'PKaccueil';
}

I guet...... an over kind of error :-\ :-\

Une erreur s'est produite!
call_user_func(PKaccueil): First argument is expected to be a valid callback 
  :'( :'(
++
Michel
Sapiens nihil affirmat quad non probet

Alexandre P.

Ton action, si tu ne l'as pas changée depuis ton premier message, est AcceuilMessage. (En passant, c'est "accueil" ;) )

Donc, ça devrait être
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
require_once($sourcedir . '/PKaccueil.php');
return 'AcceuilMessage';
}
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Mi²

Quote from: Alexandre P. on January 30, 2005, 01:33:21 PM
Ton action, si tu ne l'as pas changée depuis ton premier message, est AcceuilMessage. (En passant, c'est "accueil" ;) )

Donc, ça devrait être
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
require_once($sourcedir . '/PKaccueil.php');
return 'AcceuilMessage';
}

Merci Alexandre, j'ai bien rectifié "accueil" ;D et c'est une des raisons qui m'ont poussé à modifier le nom de l'action, du fichier, et de la fonction ;)
   'PKaccueil' => array('PKaccueil.php','ViewPKaccueil'),
elseif ($user_info['is_guest'] && (!isset($_REQUEST['action'])))
{
require_once($sourcedir . '/PKaccueil.php');
return 'PKaccueil';
}

donc mon problème reste entier  :'( :'( :'(
Sapiens nihil affirmat quad non probet

Meriadoc

je dois voir ton fichier PKaccueil.php
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 31, 2005, 01:26:41 PM
je dois voir ton fichier PKaccueil.php

no problem
PKaccueil.php
<?php
function ViewPKaccueil()
{
loadTemplate('PKaccueil');
}
?>

PKaccueil.template.php
<?php
function template_main()
{
     include('Site/PKaccueil.htm');
}
?>
Sapiens nihil affirmat quad non probet

Meriadoc

function ViewPKaccueil() et return 'PKaccueil'; doient etre la meme.
alors, change PKaccueil.php:


<?php
function PKaccueil()
{
loadTemplate('PKaccueil');
}
?>

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²

#18
Merci Meriadoc :) cela fonctionne mais  :o :o
les simples visiteurs ne peuvent plus accéder au forum :-[ :(
Quote from: Mi² on January 24, 2005, 09:23:04 AM
Nan Nan Nan je ne veux pas interdire l'accès aux forum, pour les visiteurs... simplement que les personnes non logguées arrivent d'abord sur une page d'accueil..... ;)
Sapiens nihil affirmat quad non probet

Meriadoc

uh, qu'est que c'est le probleme? j'ai pense que tu as voulu ta propre page pour les visiteurs - et maintenant je vois....
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²

#20
Bonsoir Meriadoc,

je voulais simplement que les visiteurs non-loggés arrivent sur cette page d'accueil, après, je souhaite qu'il puissent visiter tout le site et le forum, sans les obliger à s'enregistrer


I wanted simply that the visitors not - logged arrive on this homepage, after, I wish than they can visit all the site and the forum, without obliging them to enregister


Pour les membres enregistrés et loggés, arrivée directement sur le forum


For the registered members who are logged, arrived directly on the forum

Sapiens nihil affirmat quad non probet

Alexandre P.

Arf, effectivement: quand on clique sur le bouton "Index", on se rend compte qu'on ne peut pas accéder au forum :-\
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

i think i am not understanding. To me the problem is solved. Alexandre, could you describe in English what he wants?
Do you want guests to _always_ go to that note you wrote whether on your websites main home page OR on the forum? And that they must register and log in before they can even access any of the website?

But those who are logged in (if always logged in) are sent directly to the forum?

help?
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.

What Mi² wants, is that guests who arrive directly to his forum index (http://hissite.com/forum/) get redirected to PKaccueil.  Then, after they read the note on PKaccueil, guests can access the forum.

Already logged members don't have / must not read the note on PKaccueil.
Guests who access his forum with a specific action or else (ex: http://hissite.com/forum/index.php?topic=25527) don't get redirected to PKaccueil.
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

Quote from: Alexandre P. on February 03, 2005, 11:53:32 PM
What Mi² wants, is that guests who arrive directly to his forum index (http://hissite.com/forum/) get redirected to PKaccueil. Then, after they read the note on PKaccueil, guests can access the forum.
that doesn't really sound fun/easy to do :P
session stuff, maybe database stuff...
desole pour l'anglais

and thanks Alexandre
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

evolus


Alexandre P.

errr, it sounds harder to put this in place than I thought :-\

Non, le problème n'a pas été réglé...
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Mi²

Bonjour,

bon et bien à notre niveau nous abandonnons cette option, mais merci tout de même pour vôtre aide, j'espère que cela pourra servir à d'autres ;D
++
Mi²
Sapiens nihil affirmat quad non probet

jpdc91

#28
Bonjour,
je viens de creer mon forum,j'ai également le texte d'aceuil en anglais :(,je ne comprend pas comment et ou il faut modifier pour l'avoir en français ::),savez-vous m'expliqué svp? :)

Alexandre P.

Texte d'accueil ?  Tu veux parler de l'accord d'enregistrement des membres ?
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Advertisement: