Comments |
Re: Bbcode
|
Can you make the unmodified MOD available in a .zip file, or at least the name of it and a url for where to download it from?
|
Inactive User [ Tue 15 Jul, 2008 01:54 ]
|
|
Re: Bbcode
|
yeah sure ... download url is here mpsmod
|
DWho [ Tue 15 Jul, 2008 10:23 ]
|
|
Re: Bbcode
|
Mate, I've been busy for the last couple of days
Have you gone any further with this before I attempt to see what the problem could be? Not to say that I can actually fix it either.
|
Inactive User [ Thu 17 Jul, 2008 01:14 ]
|
|
Re: Bbcode
|
I am going to have a look today as I have been busy the last couple of days....
If I get anywhere I post my results...
Thanks for taking the time out...
|
DWho [ Thu 17 Jul, 2008 09:59 ]
|
|
Re: Bbcode
|
Some answers are in bbcode.php:
=================
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);
=================
- You need to remove old parsing functions
- You need to include bbcode.php
- You need to declare $bbcode as global if used within a function or a class
- You need to setup vars for bbcodes, html and smileys
- You need to parse the message
How to do that? Use the codes provided above... compare with some other files which parses BBCode to fully understand.
Renaming and moving to docs.
|
Mighty Gorgon [ Thu 17 Jul, 2008 11:13 ]
|
|
Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
|
Well after spending nearly 3 weeks on this I dropped the idea...
it is probably quite simple to incorporate but I have to guess where the code might go as I have no before and after working examples...
I will have another attempt in the future..
|
DWho [ Thu 07 Aug, 2008 10:31 ]
|
|
Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
|
I'm not sure to what extent you need in the way of examples, but here's the old code that MODS use, and the new code that IP uses.
OLD:
$preview_announcement = $new['announcement_text_draft'];
$preview_announcement_uid = make_bbcode_uid();
$preview_announcement = bbencode_first_pass( $preview_announcement, $preview_announcement_uid );
$preview_announcement = bbencode_second_pass ( $preview_announcement, $preview_announcement_uid );
$preview_announcement = smilies_pass($preview_announcement, './../');
$preview_announcement = str_replace("n", "n<br />n", $preview_announcement);
#######
NEW: (Just one line that parses the bbCode to the page.)
$preview_announcement = $bbcode->parse ($new['announcement_text_draft']);
#######
NOTE: That the new "announcement_text_draft" is now encapsulated. ;-)
So this would be the most important line for parsing the code. $bbcode->parse ($new['announcement_text_draft']);
You could also download the modified ACP_Announcement_Center from icythemes.com as it's only about 3-4 pages, and strip the Db queries and anything else that you don't need out of it.
If you need to compare it, then search phpBB customisations for "Announcement" and that should bring up the old version.
Best of Luck!
|
Inactive User [ Fri 08 Aug, 2008 01:39 ]
|
|
Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
|
That is correct... but remember you should make sure that bbcode.php has been correctly included and $bbcode defined as global if using that code within functions or classes.
This is the code that may be used:
- For inclusion:
@include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- To declare var as global where needed:
Plus you may want to decide what to parse or not...
$bbcode->allow_html = false;
$bbcode->allow_bbcode = true;
$bbcode->allow_smilies = true;
Other examples on top of bbcode.php
=================
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);
====================
|
Mighty Gorgon [ Mon 11 Aug, 2008 02:25 ]
|
|
Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
|
thanks for the extra help with this ... I can see it a bit clearer now so I am going to have another play around with it....
|
DWho [ Mon 11 Aug, 2008 11:34 ]
|
|
Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
|
Thanks so much for the help.... omg it was so easy it scares me.... thanks Lopalong for simplifying it...
|
DWho [ Sun 24 Aug, 2008 14:08 ]
|
|
|