Pagina 1 van 1

BB Code

Geplaatst: 24 jan 2008, 14:39
door tbsites
hoe kan ik de tekst laten parsen in de BB-Code van phpBB3?

M'n Code is nu:
Spoiler: bekijk

Code: Selecteer alles

<?php
     
	error_reporting(E_ALL);
	ini_set("display_errors", "on");
	define('IN_PHPBB', true);
	$phpbb_root_path = '../../forum/';
	$phpEx = substr(strrchr(__FILE__, '.'), 1);
	include($phpbb_root_path . 'common.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
	include($phpbb_root_path . 'includes/constants.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
	include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
	include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_apache.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_db.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_ldap.' . $phpEx);
	include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/diff.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/engine.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/renderer.' . $phpEx);
	include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
	include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);
	mysql_connect("localhost", "", "");
	mysql_select_db("tbsites_forum");
	$max = 10;
	$forum_id = 14;
	$prefix = 'phpbb_';
	$sql = mysql_query("
	SELECT * 
	FROM ".$prefix."posts 
	WHERE forum_id = ".$forum_id." 
	LIMIT 0,".$max) 
	OR DIE ("
	Er is een mysql-fout opgetreden in sql:<br />
	<font color=\"red\">".mysql_error()."</font>");
	while($row = mysql_fetch_assoc($sql)) {
		echo '<h1>';
		echo $row['post_subject'];
		echo '</h1>';
		echo '<p>';
		echo $row['post_text'];
		echo '</p>';
		echo '<hr>';
	}
?>
Wijziging: voor de duidenlijkhijd:

ik wil dus $row['post_text'] laten parsen door de phpbb ubb de output van deze code kun je vinden op: http://tbsites.nl/includes/php/nieuws.php

Re: BB Code

Geplaatst: 24 jan 2008, 16:14
door tbsites
ik heb wat geprobeerd maar als je nu op: http://tbsites.nl/includes/php/nieuws.php kijkt zie je een general error... ik gebruik deze code:
Spoiler: bekijk

Code: Selecteer alles

<?php
     
	error_reporting(E_ALL);
	ini_set("display_errors", "on");
	define('IN_PHPBB', true);
	$phpbb_root_path = '../../forum/';
	$phpEx = substr(strrchr(__FILE__, '.'), 1);
	include($phpbb_root_path . 'common.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
	include($phpbb_root_path . 'includes/constants.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
	include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
	include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_apache.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_db.' . $phpEx);
	include($phpbb_root_path . 'includes/auth/auth_ldap.' . $phpEx);
	include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/diff.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/engine.' . $phpEx);
	include($phpbb_root_path . 'includes/diff/renderer.' . $phpEx);
	include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
	include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);

	$max = 10;
	$forum_id = 14;
	$prefix = 'phpbb_';
	$sql = mysql_query("
	SELECT * 
	FROM ".$prefix."posts
	WHERE forum_id = ".$forum_id." 
	LIMIT 0,".$max) 
	OR DIE ("
	Er is een mysql-fout opgetreden in sql:<br />
	<font color=\"red\">".mysql_error()."</font>");
	while($row = mysql_fetch_assoc($sql)) {
		echo '<h1>';
		echo $row['post_subject'];
		echo '</h1>';
		echo '<p>';
		$options = OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS;
		$text = generate_text_for_display(
		$row['post_text'], 
		$row['bbcode_uid'], 
		$row['bbcode_bitfield'], 
		$options);
		echo $text;
		echo '</p>';
		echo '<hr>';
	}
?>

Re: BB Code

Geplaatst: 24 jan 2008, 16:23
door BetaDevil
Als je van

Code: Selecteer alles

   error_reporting(E_ALL);
   ini_set("display_errors", "on");
   define('IN_PHPBB', true);
   $phpbb_root_path = '../../forum/';
   $phpEx = substr(strrchr(__FILE__, '.'), 1);
   include($phpbb_root_path . 'common.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
   include($phpbb_root_path . 'includes/constants.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
   include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
   include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
   include($phpbb_root_path . 'includes/auth/auth_apache.' . $phpEx);
   include($phpbb_root_path . 'includes/auth/auth_db.' . $phpEx);
   include($phpbb_root_path . 'includes/auth/auth_ldap.' . $phpEx);
   include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
   include($phpbb_root_path . 'includes/diff/diff.' . $phpEx);
   include($phpbb_root_path . 'includes/diff/engine.' . $phpEx);
   include($phpbb_root_path . 'includes/diff/renderer.' . $phpEx);
   include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
   include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx); 
nu gewoon dit maakt

Code: Selecteer alles

define('IN_PHPBB', true);
$phpbb_root_path = '../../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data); 
werkt het waarschijnlijk

Re: BB Code

Geplaatst: 24 jan 2008, 16:26
door tbsites
nee, dat werkt ook niet...

Re: BB Code

Geplaatst: 24 jan 2008, 16:28
door BetaDevil
Hij geeft aan dat er geen template gevonden kan worden, en door mijn code kan hij die wel vinden, dus plaats de code dan eens die je nu hebt.

Re: BB Code

Geplaatst: 24 jan 2008, 16:30
door tbsites
Spoiler: bekijk

Code: Selecteer alles

<?php
     
	error_reporting(E_ALL);
	ini_set("display_errors", "on");
	define('IN_PHPBB', true);
$phpbb_root_path = '../../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data); 

	$max = 10;
	$forum_id = 14;
	$prefix = 'phpbb_';
	$sql = mysql_query("
	SELECT * 
	FROM ".$prefix."posts
	WHERE forum_id = ".$forum_id." 
	LIMIT 0,".$max) 
	OR DIE ("
	Er is een mysql-fout opgetreden in sql:<br />
	<font color=\"red\">".mysql_error()."</font>");
	while($row = mysql_fetch_assoc($sql)) {
		echo '<h1>';
		echo $row['post_subject'];
		echo '</h1>';
		echo '<p>';
		$options = OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS;
		$text = generate_text_for_display(
		$row['post_text'], 
		$row['bbcode_uid'], 
		$row['bbcode_bitfield'], 
		$options);
		echo $text;
		echo '</p>';
		echo '<hr>';
	}
?>