Coucou, merci a Titam pour ce script qu'il m'a passé
Code
//Avant le <doctype ...>
<?
define ('IN_PHPBB', true);
// Le path vers ton forum
$phpbb_root_path = 'forum/';
if (!file_exists($phpbb_root_path . 'extension.inc'))
{
die ('<tt><b>phpBB Fetch All:</b>
$phpbb_root_path is wrong and does not point to your forum.</tt>');
}
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/users.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/polls.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/forums.' . $phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
init_userprefs($userdata);
//
// End session management
//
if (isset($HTTP_GET_VARS['start']) or isset($HTTP_POST_VARS['start'])) {
$CFG['posts_span_pages_offset'] = isset($HTTP_GET_VARS['start']) ? $HTTP_GET_VARS['start'] : $HTTP_POST_VARS['start'];
}
// fetch new posts since last visit
$new_posts = phpbb_fetch_new_posts();
// fetch user online, total posts, etc
$stats = phpbb_fetch_stats();
// fetch online users
$online = phpbb_fetch_online_users();
// fetch five users by total posts
$top_poster = phpbb_fetch_top_poster();
// fetch a random user
$random_user = phpbb_fetch_random_user();
// fetch forum structure
$forums = phpbb_fetch_forums();
// fetch user of a specific group
// this function is disabled because fetching without a specific
// user group can produces a lot of results (all registered users)
// and this may result in an internal server error. If you want to
// use this feature please specify the group id.
# $member = phpbb_fetch_users();
// fetch a poll
$poll = phpbb_fetch_poll();
// fetch a single topic by topic id
$download = phpbb_fetch_topics(1);
// fetch latest postings
$CFG['posts_trim_topic_number'] = 15;
$recent = phpbb_fetch_posts(null, POSTS_FETCH_LAST);
// fetch postings
$CFG['posts_trim_topic_number'] = 0;
$CFG['posts_span_pages'] = true;
$news = phpbb_fetch_posts();
//
// disconnect from the database
//
phpbb_disconnect();
?>
// Ensuite là ou tu veux mettre le truc identification :
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#7692A0">
<tr>
<td><table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<?php if ($userdata) { ?>
<br>
<?php if ($userdata['session_logged_in']) { ?>
</div>
<div align="center">
<table width="106" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="106" valign="top"><div align="center"><?php echo phpbb_avatar_image($userdata['user_avatar_type'], $userdata['user_avatar']); ?></div></td>
</tr>
<tr>
<td valign="top"><div align="center"><span class="gensmall"><?php echo $userdata['username']; ?></span></div></td>
</tr>
</table>
<br>
<table width="106" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><a href="<?php echo append_sid($phpbb_root_path . 'privmsg.php?folder=inbox'); ?>">
<?php if ($userdata['user_new_privmsg']) { echo $userdata['user_new_privmsg']; } else { echo 'Aucun'; } ?>
MP</a></td>
</tr>
</table>
<?php } else { ?>
<strong>Bienvenue ! </strong>______________<br>
<br>
<a href="<?php
echo append_sid($phpbb_root_path . 'profile.php?mode=register'); ?>" class="lien1">Inscription</a>
<?php } ?>
<?php } ?>
<?php if (!$userdata or !$userdata['session_logged_in']) { ?>
<br>
______________
<? {
// La le lien vers login.php
echo('<form action="../forum/login.php" method="post">');
echo('<center>Login :</center><input name="username" type="text" size="12"><br><br>');
echo('<center>Mot de passe :</center><input name="password" type="password" size="12"><br><br>');
echo('<center><input type="submit" name="login" value="Connexion"></center>');
echo('</form>');
}
?>
<? } ?>
si t'épluches ça tu peux reconstituer le formulaire tranquillou et avoir le même cookie
( avant, Aidoforum utilisait deux cookies différents, si tu veux tu peux aussi le faire, il suffit d'appeller la table phpbb_users
et de créer un cookie à partir d'elle
, là tu auras les mêmes utilisateurs mais qui devront se loguer deux fois ! )
PS : Bienviendu ici :banane: