BBCODE - How To Use Icy Phoenix Customized bbcode.php »  Show posts from    to     

Icy Phoenix


Documentation And How To - BBCODE - How To Use Icy Phoenix Customized bbcode.php



moreteavicar [ Fri 08 Jun, 2007 14:48 ]
Post subject: BBCODE - How To Use Icy Phoenix Customized bbcode.php
In bbcode.php there are instructions from MG for usage of the re-written bbcode.php file. For instance, when parsing, using:
Code: [Hide] [Select]
$text = $bbcode->parse($text, $bbcode_uid);

When installing a mod which uses:
Code: [Hide] [Select]
bbencode_second_pass($zdesc, $bbcode_uid)

I've tried replacing this with
Code: [Hide] [Select]
$zdesc = $bbcode->parse($zdesc, $bbcode_uid);


However, I get an error:
Code: [Hide] [Select]
Fatal error: Call to undefined method stdClass::parse()


This seems strange as the mg modified bbcode.php is being included, which contains the definition of parse - any ideas anybody?

NB I also added some declarations to 'seed' $bbcode before parsing:
Code: [Hide]
  1. $bbcode->allow_html = $html_on;  
  2. $bbcode->allow_bbcode = true;  
  3. if ( !$lofi )  
  4. {  
  5. $bbcode->allow_smilies = true;  
  6. }  
  7. else  
  8. {  
  9. $bbcode->allow_smilies = false;  
  10. }  
  11.  
  12.  

However, these make no difference, I get the same parse error if I comment them out.


moreteavicar [ Fri 08 Jun, 2007 14:55 ]
Post subject: Re: [BBcodes]How to use the Bicet / MG customised bbcode.php
Also, I've tried:

Code: [Hide]
  1. $zdesc = bbcode_killer_mg($zdesc, $bbcode_uid); 

and
Code: [Hide]
  1. $zdesc = bbcuid_killer_mg($zdesc, $bbcode_uid); 


These do not result in errors, but they also do not parse the bbcode either!


Mighty Gorgon [ Sun 10 Jun, 2007 04:45 ]
Post subject: Re: [BBcodes]How to use the Bicet / MG customised bbcode.php
You have some examples on top of bbcode.php:

Code: [Hide] [Select]
/*

=================
Includes
=================

include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

=================
Globals
=================

global $bbcode;

=================
BBCode Parsing
=================

$text = $bbcode->parse($text, $bbcode_uid);

=================
BBCode Conditions
=================

$bbcode->allow_html = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? true : false;
$bbcode->allow_bbcode = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? true : false;
$bbcode->allow_smilies = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? true : false;

=================

$html_on = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? 1 : 0 ;
$bbcode_on = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? 1 : 0 ;
$smilies_on = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? 1 : 0 ;

$bbcode->allow_html = $html_on;
$bbcode->allow_bbcode = $bbcode_on;
$bbcode->allow_smilies = $smilies_on;

=================

$bbcode->allow_html = ( $board_config['allow_html'] ? $board_config['allow_html'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );

=================

$bbcode->allow_html = $board_config['allow_html'];
$bbcode->allow_bbcode = $board_config['allow_bbcode'];
$bbcode->allow_smilies = $board_config['allow_smilies'];

=================

$bbcode->allow_html = ( ($board_config['allow_html'] && $row['enable_bbcode']) ? true : false );
$bbcode->allow_bbcode = ( ($board_config['allow_bbcode'] && $row['enable_bbcode']) ? true : false );
$bbcode->allow_smilies = ( ($board_config['allow_smilies'] && $row['enable_smilies']) ? true : false );

=================

$bbcode->allow_html = ( $board_config['allow_html'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] ? true : false );

=================

$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
//$bbcode->allow_bbcode = ( $bbcode_uid != '' ? $board_config['allow_bbcode'] : false );
=================

=================================
Acronyms, Autolinks, Word Wrap
=================================

$orig_autolink = array();
$replacement_autolink = array();
obtain_autolink_list($orig_autolink, $replacement_autolink, 99999999);
if( function_exists( 'acronym_pass' ) )
{
$text = acronym_pass( $text );
}
if( count($orig_autolink) )
{
$text = autolink_transform($text, $orig_autolink, $replacement_autolink);
}
$text = kb_word_wrap_pass ($text);
====================


*/


You can eventually try to guess the correct way to use it by inspecting some files where it is used... viewtopic, blocks, shoutbox, news...

Finally a small correction.

The original code was developed by CyberAlien, and then ported by me into XS.

Here are a small adaptation on how to use a basic BBCode parsing function into any php file:

http://www.mightygorgon.com/viewtopic.php?t=2778


moreteavicar [ Sun 10 Jun, 2007 16:06 ]
Post subject: Re: [BBcodes]How to use the Bicet / MG customised bbcode.php
Hi MG, I tried the above, but I get the following:

moreteavicar wrote: [View Post]


Code: [Hide] [Select]
Fatal error: Call to undefined method stdClass::parse()



Which seems strange as bbcode.php is included, which contains the class definition for parse...


Mighty Gorgon [ Wed 20 Jun, 2007 01:19 ]
Post subject: Re: [BBcodes]How to use the Bicet / MG customised bbcode.php
moreteavicar wrote: [View Post]
Hi MG, I tried the above, but I get the following:

moreteavicar wrote: [View Post]


Code: [Hide] [Select]
Fatal error: Call to undefined method stdClass::parse()



Which seems strange as bbcode.php is included, which contains the class definition for parse...

It seems you didn't the integration properly.

Try to send me the file you are trying to modify and I'll have a look.




Powered by Icy Phoenix