BB Code

Hulp nodig bij je installatie of kom je ergens niet uit? Probeer phpBB3! Problemen lossen we samen met je op.
phpBB 3.0 is End of support per 1 januari 2017. Dit forum is hier enkel ter archief. Het wordt aangeraden te upgraden naar phpBB 3.2
Forumregels
phpBB 3.0 is End of support per 1 januari 2017. Dit forum is hier enkel ter archief. Het wordt aangeraden te upgraden naar phpBB 3.2
Gesloten
Gebruikersavatar
tbsites
Berichten: 49
Lid geworden op: 26 mei 2007, 11:13

BB Code

Bericht door tbsites » 24 jan 2008, 14:39

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
Laatst gewijzigd door tbsites op 24 jan 2008, 16:27, 1 keer totaal gewijzigd.

Gebruikersavatar
tbsites
Berichten: 49
Lid geworden op: 26 mei 2007, 11:13

Re: BB Code

Bericht door tbsites » 24 jan 2008, 16:14

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>';
	}
?>
Laatst gewijzigd door tbsites op 24 jan 2008, 16:26, 1 keer totaal gewijzigd.

BetaDevil
Berichten: 2810
Lid geworden op: 28 mei 2006, 15:27

Re: BB Code

Bericht door BetaDevil » 24 jan 2008, 16:23

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

Gebruikersavatar
tbsites
Berichten: 49
Lid geworden op: 26 mei 2007, 11:13

Re: BB Code

Bericht door tbsites » 24 jan 2008, 16:26

nee, dat werkt ook niet...

BetaDevil
Berichten: 2810
Lid geworden op: 28 mei 2006, 15:27

Re: BB Code

Bericht door BetaDevil » 24 jan 2008, 16:28

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.

Gebruikersavatar
tbsites
Berichten: 49
Lid geworden op: 26 mei 2007, 11:13

Re: BB Code

Bericht door tbsites » 24 jan 2008, 16:30

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>';
	}
?>

Gesloten