par
bobmorane » 23 janv. 2018, 09:11
J'essaye d'adapter à mes besoins un script trouvé ici
http://forum.danielchalseche.fr.cr/viewtopic.php?t=53#
Voici le code PHP que j'utilise:
Code : Tout sélectionner
<?php
/**
*
* @author Daniel Chalsèche (Dakin Quelia) http://www.danielchalseche.be/
*
* @package Post
* @version $Id: post.php 2009-08-12 02:31:25 Dakin Quelia $
* @copyright (c) 2009 Daniel Chalsèche
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
//echo $user;
$sql = 'SELECT post_text, bbcode_uid, bbcode_bitfield, enable_bbcode, enable_smilies, enable_magic_url
FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$post['bbcode_options'] = (($post['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) +
(($post['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) +
(($post['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);
$text = generate_text_for_display($post['rules_text'], $post['bbcode_uid'], $post['bbcode_bitfield'], $post['bbcode_options']);
$template->assign_vars(array(
'POST_CONTENT' => $text,
));
// Output page
$site->page_header($user->lang['POST_PAGE']);
$template->set_filenames(array(
'body' => 'mypost_body.html',
));
$site->page_footer();
?>
et le contenu mypost_body.html:
Code : Tout sélectionner
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div id="main">
<h2><strong>{L_TITLE}</strong></h2>
<p>{POST_CONTENT}</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
Mais, quand j’exécute le php (en local sous WAMP64), j'obtiens cette erreur:

Quelqu'un peut-il m'aider à la résoudre ?
Merci d'avance.
J'essaye d'adapter à mes besoins un script trouvé ici [url]http://forum.danielchalseche.fr.cr/viewtopic.php?t=53#[/url]
Voici le code PHP que j'utilise:
[code]<?php
/**
*
* @author Daniel Chalsèche (Dakin Quelia) http://www.danielchalseche.be/
*
* @package Post
* @version $Id: post.php 2009-08-12 02:31:25 Dakin Quelia $
* @copyright (c) 2009 Daniel Chalsèche
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
//echo $user;
$sql = 'SELECT post_text, bbcode_uid, bbcode_bitfield, enable_bbcode, enable_smilies, enable_magic_url
FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$post['bbcode_options'] = (($post['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) +
(($post['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) +
(($post['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);
$text = generate_text_for_display($post['rules_text'], $post['bbcode_uid'], $post['bbcode_bitfield'], $post['bbcode_options']);
$template->assign_vars(array(
'POST_CONTENT' => $text,
));
// Output page
$site->page_header($user->lang['POST_PAGE']);
$template->set_filenames(array(
'body' => 'mypost_body.html',
));
$site->page_footer();
?>[/code]
et le contenu mypost_body.html:
[code]<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div id="main">
<h2><strong>{L_TITLE}</strong></h2>
<p>{POST_CONTENT}</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>[/code]
Mais, quand j’exécute le php (en local sous WAMP64), j'obtiens cette erreur:
[url=https://postimg.org/image/5uv0sftpn/][img]https://s17.postimg.org/5uv0sftpn/Capture.jpg[/img][/url]
:roll: :shock: Quelqu'un peut-il m'aider à la résoudre ?
Merci d'avance.