Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1523 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Besoin d'aide sur un forum phpBB - ajout d'une page

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Besoin d'aide sur un forum phpBB - ajout d'une page

n°1515313
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 02:20:45  profilanswer
 

Bonsoir,
 
Voici clairement ce que je cherche à faire : je voudrai ajouter un bouton à mon forum phpBB qui donne accès à une page que je peux personnaliser, mais qui conserve le menu, le logo, et le skin de mon forum.
 
Ajouter le bouton fut très simple, mais reste le problème de la page en elle-même.
J'ai tenté une adaptation de la page de portail, mais sans succès.
 
Voila, j'espére avoir éxpliqué clairement ce que je voulais.
 
Merci d'avance pour vos réponses.

mood
Publicité
Posté le 16-02-2007 à 02:20:45  profilanswer
 

n°1515316
lkolrn
<comment ça marche?>
Posté le 16-02-2007 à 06:14:12  profilanswer
 

Pour le logo et le skin : tu crées une page dans laquelle tu insères ton template tout fait ou alors tu le recrées, et tu fais le lien avec ton bouton sur l'autre page.
Pour le menu tu dois appeller une fonction, utiliser une classe ou insérer un fichier propre à phpBB, c'est selon.
 
Maintenant que j'ai dis ça, j'ajoute : je n'ai rien dis... :sweat: Et toi pas beaucoupe cherché :whistle: "sans succès", c'est-à-dire ?
 
Tu as essayé de regarder le code de ta page sur laquelle tu crées le lien ? il a quelle tête ?
Sinon va du côté des forums phpBB ou aut' fofos pour tuner son phpBB, il doit y avoir des précédents... :hello:

n°1515328
Mxtrem
Posté le 16-02-2007 à 08:57:52  profilanswer
 

si tu n'y arrive pas c'est que tu ne sais même pas coder l'HTML, revoit donc tout ;)

n°1515515
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 14:19:27  profilanswer
 

Droles de remarques ^^. Le soucis, c'est qu'en fesant appel au template, c'est la que sa coince ^^.


---------------
Un homme politique a dit : "Je suis ni pour, ni contre. Bien au contraire..." Allez savoir ce qu'il pense, celui la...
n°1515538
lkolrn
<comment ça marche?>
Posté le 16-02-2007 à 14:28:46  profilanswer
 

Pour les remarques : c'est rien, c'est le métier qui rentre... ;)  
 
Sinon explique un peu plus que "ça coince" ! Balance du code voir... Et va chercher du côté des fofos consacrés à phpBB, tu dois avoir des tutoriels ou aut' là dessus, c'est obligé.

n°1515548
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 14:33:46  profilanswer
 

Les forum phpBB traite de forum. Alors que moi, ce que je cherche à faire, c'est +, un site basé sur la template de mon forum ^^.
Ces pages ne ressemblent en rien à l'html.
 
Si je te passe la page, tu saurai me détailler à quoi peut correspondre chaque partie du code ?


---------------
Un homme politique a dit : "Je suis ni pour, ni contre. Bien au contraire..." Allez savoir ce qu'il pense, celui la...
n°1515553
-ThX-
Not here anymore
Posté le 16-02-2007 à 14:38:52  profilanswer
 

envoie toujours, on verra bien

n°1515560
lkolrn
<comment ça marche?>
Posté le 16-02-2007 à 14:43:02  profilanswer
 

lkolrn a écrit :

Tu as essayé de regarder le code de ta page sur laquelle tu crées le lien ? il a quelle tête ?

lkolrn a écrit :

Balance du code voir...

Nan, ça m'intéresse pas ton code... :sweat:  
 
PS : sinon, sommes-nous bien dans la bonne section...? S'il s'agit uniquement de rendu graphique, alors tu déplaces ça dans css et tu te fais éventuellement aider pour réaliser ton template à la mano, nan ? :whistle:

n°1515565
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 14:46:42  profilanswer
 

Citation :

<?php
$CFG['number_of_news'] = '5';
$CFG['news_length'] = '200';
$CFG['news_forum'] = '1';
$CFG['poll_forum'] = '1';
$CFG['number_recent_topics'] = '10';
$CFG['exceptional_forums'] = '';
 
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
 
 
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
 
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
 
if( $total_posts == 0 )
{
 $l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
 $l_total_post_s = $lang['Posted_article_total'];
}
else
{
 $l_total_post_s = $lang['Posted_articles_total'];
}
 
if( $total_users == 0 )
{
 $l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
 $l_total_user_s = $lang['Registered_user_total'];
}
else
{
 $l_total_user_s = $lang['Registered_users_total'];
}
 
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
 message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
 $forum_data[] = $row;
}
 
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
 
if( $CFG['exceptional_forums'] == '' )
{
 $except_forum_id = '\'start\'';
}
else
{
 $except_forum_id = $CFG['exceptional_forums'];
}
 
for ($i = 0; $i < count($forum_data); $i++)
{
 if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
 {
  if ($except_forum_id == '\'start\'')
  {
   $except_forum_id = $forum_data[$i]['forum_id'];
  }
  else
  {
   $except_forum_id .= ',' . $forum_data[$i]['forum_id'];
  }
 }
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
  FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
  WHERE t.forum_id NOT IN (" . $except_forum_id . " )
   AND t.topic_status <> 2
   AND p.post_id = t.topic_last_post_id
   AND p.poster_id = u.user_id
  ORDER BY p.post_id DESC
  LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
 message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$recent_topic_row = array();
while ($row = $db->sql_fetchrow($result))
{
 $recent_topic_row[] = $row;
}
for ($i = 0; $i < $number_recent_topics; $i++)
{
 $template->assign_block_vars('recent_topic_row', array(
  'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
  'L_TITLE' => $recent_topic_row[$i]['topic_title'],
  'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),
  'S_POSTER' => $recent_topic_row[$i]['username'],
  'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
  )
 );
}
 
 
if( $userdata['session_logged_in'] )
{
 $sql = "SELECT COUNT(post_id) as total
   FROM " . POSTS_TABLE . "
   WHERE post_time >= " . $userdata['user_lastvisit'];
 $result = $db->sql_query($sql);
 if( $result )
 {
  $row = $db->sql_fetchrow($result);
  $lang['Search_new'] = $lang['Search_new'] . "&nbsp;(" . $row['total'] . " )";
 }
}
 
 
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
 
$template->set_filenames(array(
 'body' => 'portal_body.tpl')
);
 
 
$avatar_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
 switch( $userdata['user_avatar_type'] )
 {
  case USER_AVATAR_UPLOAD:
   $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
   break;
  case USER_AVATAR_REMOTE:
   $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
   break;
  case USER_AVATAR_GALLERY:
   $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
   break;
 }
}
 
if ($userdata['user_id'] != '-1')
{
 $name_link = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&amp;" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>';
}
else
{
 $name_link = $lang['Guest'];
}
//
// END: Avatar On Index MOD
//
 
 
$template->assign_vars(array(
 'WELCOME_TEXT' => $CFG['welcome_text'],
 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
 'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid" ) . '">', $newest_user, '</a>'),
 'L_FORUM' => $lang['Forum'],
 'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
 'L_STATISTICS' => $lang['Statistics'],  
 'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
 'L_POSTED' => $lang['Posted'],
 'L_COMMENTS' => $lang['Comments'],
 'L_VIEW_COMMENTS' => $lang['View_comments'],
 'L_POST_COMMENT' => $lang['Post_your_comment'],
 'L_SEND_PASSWORD' => $lang['Forgotten_password'],
 'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword" ),
 'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid("profile.$phpEx?mode=register" ) . '">', '</a>'),
 'L_REMEMBER_ME' => $lang['Remember_me'],
 'L_VIEW_COMPLETE_LIST' => $lang['View_complete_list'],
 'L_POLL' => $lang['Poll'],
 'L_VOTE_BUTTON' => $lang['Vote'],
  // Recent Topics
 'L_RECENT_TOPICS' => $lang['Recent_topics'],
 
 // Search
 'L_SEARCH_AT' => $lang['Search_at'],
 'L_ADVANCED_SEARCH' => $lang['Advanced_search'],
 
 // Welcome Avatar
 'L_NAME_WELCOME' => $lang['Welcome'],
 'U_NAME_LINK' => $name_link,
 'AVATAR_IMG' => $avatar_img)
);
 
if(!isset($HTTP_GET_VARS['article']))
{
 $template->assign_block_vars('welcome_text', array());
 
 $fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);
 
 for ($i = 0; $i < count($fetchposts); $i++)
 {
  if( $fetchposts[$i]['striped'] == 1 )
  {
   $open_bracket = '[ ';
   $close_bracket = ' ]';
   $read_full = $lang['Read_Full'];
  }
  else
  {
   $open_bracket = '';
   $close_bracket = '';
   $read_full = '';
  }
 
  $template->assign_block_vars('fetchpost_row', array(
   'TITLE' => $fetchposts[$i]['topic_title'],
   'POSTER' => $fetchposts[$i]['username'],
   'TIME' => $fetchposts[$i]['topic_time'],
   'TEXT' => $fetchposts[$i]['post_text'],
   'REPLIES' => $fetchposts[$i]['topic_replies'],
   'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
   'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&amp;t=' . $fetchposts[$i]['topic_id']),
   'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
   'L_READ_FULL' => $read_full,
   'OPEN' => $open_bracket,
   'CLOSE' => $close_bracket)
  );
 }
}
else
{
 $fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
 
 $i = intval($HTTP_GET_VARS['article']);
 
 $template->assign_block_vars('fetchpost_row', array(
  'TITLE' => $fetchposts[$i]['topic_title'],
  'POSTER' => $fetchposts[$i]['username'],
  'TIME' => $fetchposts[$i]['topic_time'],
  'TEXT' => $fetchposts[$i]['post_text'],
  'REPLIES' => $fetchposts[$i]['topic_replies'],
  'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
  'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&amp;t=' . $fetchposts[$i]['topic_id'])
  )
 );
}
 
$fetchpoll = phpbb_fetch_poll($CFG['poll_forum']);
 
if (!empty($fetchpoll))
{
 $template->assign_vars(array(  
  'S_POLL_QUESTION' => $fetchpoll['vote_text'],
  'S_POLL_ACTION' => append_sid('posting.'.$phpEx.'?'.POST_TOPIC_URL.'='.$fetchpoll['topic_id']),
  'S_TOPIC_ID' => $fetchpoll['topic_id'],
  'L_SUBMIT_VOTE' => $lang['Submit_vote'],
  'L_LOGIN_TO_VOTE' => $lang['Login_to_vote']  
  )
 );
 
 for ($i = 0; $i < count($fetchpoll['options']); $i++)
 {
  $template->assign_block_vars('poll_option_row', array(
   'OPTION_ID' => $fetchpoll['options'][$i]['vote_option_id'],
   'OPTION_TEXT' => $fetchpoll['options'][$i]['vote_option_text'],
   'VOTE_RESULT' => $fetchpoll['options'][$i]['vote_result'],
   )
  );
 }  
}
else
{
 $template->assign_vars(array(  
  'S_POLL_QUESTION' => $lang['No_poll'],
  'DISABLED' => 'disabled="disabled"'
  )
 );
}
 
 
$template->pparse('body');
 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
 
?>


 
Voila, cela correspond à la page "portail.php" de mon forum, celle qui se raproche le plus de ce que je veux faire.
 
Note : la fin ($template et include) est intéressante, je pense, mais je n'ai aucune idée de à quoi cela fait référence.

n°1515623
Mxtrem
Posté le 16-02-2007 à 15:49:37  profilanswer
 

comme le dit cette classe :
$template->pparse('body');  
 
va voir dans le dossier template ;-)

mood
Publicité
Posté le 16-02-2007 à 15:49:37  profilanswer
 

n°1515631
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 15:59:05  profilanswer
 

Cela serait donc ça qui ajoute le template a la page. Merci.
La balise "include" qui suit va avec ?


---------------
Un homme politique a dit : "Je suis ni pour, ni contre. Bien au contraire..." Allez savoir ce qu'il pense, celui la...
n°1515640
Mxtrem
Posté le 16-02-2007 à 16:08:27  profilanswer
 

Ben je sais pas à quoi correspond cet include, j'imagine que oui mais n'en suis pas sûr...
 
tu dois avoir un fichier dans le dossier template intitulé : portail.tpl ou body.tpl un truc du stayle quoi :)

n°1515664
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 16:24:47  profilanswer
 

Oui, "portail.tpl" contient un beau tableau avec tout les encadrés (news, stats, etc...). Jvais voir ce que dit "body".
Merci du coup de main ^^.


---------------
Un homme politique a dit : "Je suis ni pour, ni contre. Bien au contraire..." Allez savoir ce qu'il pense, celui la...
n°1515750
7-1-3
Pas sommeil...
Posté le 16-02-2007 à 19:33:44  profilanswer
 

Toujours soucis. Cette page me donne 3 erreurs.

Citation :


<?php
 
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
 
$template->set_filenames(array(
 'body' => 'portal_body.tpl')
);
 
 
//
// Generate the page
//
$template->pparse('body');
 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
 
?>


---------------
Un homme politique a dit : "Je suis ni pour, ni contre. Bien au contraire..." Allez savoir ce qu'il pense, celui la...
n°2299362
galixte
https://www.galixte.com
Posté le 19-04-2017 à 06:48:36  profilanswer
 

Salut,
 
maintenant c’est plus accessible grasse au système des extensions apparut depuis la branche 3.1.x puis 3.2.x de phpBB. Vous en trouverez bon nombre sur ce forum : http://www.ezcom-fr.com.


---------------
Communauté EzCom : « Traductions d’extensions & styles pour phpBB 3.2.x & 3.3.x | Tu as un forum et tu veux aussi un site web ? Regarde par ici

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Besoin d'aide sur un forum phpBB - ajout d'une page

 

Sujets relatifs
PHPBB configurationUne page d'auto-inscription?!
VB6 La fonction PUT me gonfle... A l'aideaide vba sous access
Aide moi faire les MCD suivants SVP!!!!!!elements en chargement dans une page ?
problème d'alignement menu/page(html)Fonction javascript adapter écran/page
recuperer une partie d'une page webEggrop & phpbb
Plus de sujets relatifs à : Besoin d'aide sur un forum phpBB - ajout d'une page


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR