Icy Phoenix

     
 


Tags And Keywordsbbcode, how to, parsing

Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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: [Download] [Hide] [Select]
$text = $bbcode->parse($text, $bbcode_uid);

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

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


However, I get an error:
Code: [Download] [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: [Download] [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.
 



 
moreteavicarSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: [BBcodes]How to use the Bicet / MG customised bbcode.php 
 
Also, I've tried:

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

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


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



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [BBcodes]How to use the Bicet / MG customised bbcode.php 
 
You have some examples on top of bbcode.php:

Code: [Download] [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
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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: [Download] [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...
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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: [Download] [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.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events