https://www.icyphoenix.com/viewtopic.php?f=28&t=6492 ----------------------------------- Lopalong Tue 22 Sep, 2009 13:10 Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- I'm really stuck with this and would like some help from someone who's a [b][i]lot[/i][/b] smarter than I am. ;) I've tried modding bbcode.php with preg_replace and even resorted to trying to add regex. [b]And I've given up![/b] :( This is the original code structure that I would like to be able to parse to the Post. year=2009&month=8&day=24&hour=14&minute=10&second=53 With this or something similar. :) $html='year=$1&month=$2&day=$3&hour=$4&minute=$5&second=$6 etc. As an example phpBB3 uses these vars: {NUMBER1}{NUMBER2}{NUMBER3} {NUMBER4}{NUMBER5}{NUMBER6} And I don't really care what phpBB3 uses, I would only like to be able to do the same thing with Icy Phoenix with whatever vars are programmable. :mryellow: ----------------------------------- DWho Tue 22 Sep, 2009 17:41 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- damn love to help.. but got lost as soon as i saw this.. year=2009&month=8&day=24&hour=14&minute=10&second=53 there must be away to do it... i will have look and see if ican come up with something ----------------------------------- Lopalong Wed 23 Sep, 2009 00:30 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- I'll have another look today too Mike, but if MG is around the place - or anyone else who can provide the solution - then by all means they are more than welcome to post it. ;) ----------------------------------- Lopalong Mon 28 Sep, 2009 12:19 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- [img]http://www.icyphoenix.com/files/images/3531/ban_bump1.gif[/img] To anyone else who's not on holidays away from here? and understands the Icy Phoenix BBCode etc! and why it is such a problem to add multiple vars to bbcode that most forum software cater for as a default process. :shock: Maybe I should use phpBB3 or phpBB*29 - Then I wouldn't have this problem? Probably get MORE support too! :censored: [b]Quote from another support forum that collapsed:[/b] [quote]And while the Admin doesn't make the board, if he or she stops turning up; then so will all the people who give support. [/quote] Food for thought my friend. :? ----------------------------------- Mighty Gorgon Fri 02 Oct, 2009 11:55 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- As you have told so many times... if you need a better support, try vBulletin! :mrgreen: I were (and I'm still) on holiday... I have been away for some days and I'll be away for another couple of days... :beer: Regarding your issue, if you need a control panel where you can add your own customized BBCode, then may be worth trying to integrate phpBB 3 BBCodes... it should not be tough! And I think I will also take a look at that sooner or later. Currently I'm really happy on how Icy Phoenix BBCodes work and even if the class is quite big now, I think I will still use that for a while, unless I will find the time to recode that. The best thing you can do now is lookin at how GRADIENT BBCode work which is one of the tag which natively supports many parameters: [codeblock][gradient cols=#FF8866 cole=#336699 iterations=8]Text[/gradient][/codeblock] This is the part of [b]bbcode.php[/b] which is relevant for parameters parsing: [codeblock] // GRADIENT if($tag === 'gradient') { /* if($this->is_sig && !$board_config['allow_all_bbcode']) { return $error; } */ $default_color1 = '#000080'; $color1 = $this->valid_color((isset($item['params']['param']) ? $item['params']['param'] : (isset($item['params']['cols']) ? $item['params']['cols'] : $default_color1)), true); $color1 = (($color1 === false) ? $default_color1 : $color1); $default_color2 = '#aaccee'; $color2 = $this->valid_color((isset($item['params']['cole']) ? $item['params']['cole'] : $default_color2), true); $color2 = (($color2 === false) ? $default_color2 : $color2); $mode = $this->process_text((isset($item['params']['mode']) ? $item['params']['mode'] : '')); $default_iterations = 10; $iterations = intval(isset($item['params']['iterations']) ? $item['params']['iterations'] : $default_iterations); $iterations = ((($iterations < 10) || ($iterations > 100)) ? $default_iterations : $iterations); $html = $this->gradient($content, $color1, $color2, $mode, $iterations); return array( 'valid' => true, 'html' => $html, 'allow_nested' => false, ); }[/codeblock] As you can see you can pass how many parameters you like to the BBCode parsing function... but only the ones you want to be processed will! Make sure you correctly process text strings, because malicious users may pass "unwanted" scripts and tags using parameters... there was a couple of buggy BBCodes in older versions... luckily almost nobody discovered them. :lol: ----------------------------------- Lopalong Mon 11 Jan, 2010 11:43 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- [quote user="Mighty Gorgon" post="44748"]As you have told so many times... if you need a better support, try vBulletin! :mrgreen: I were (and I'm still) on holiday... I have been away for some days and I'll be away for another couple of days... :beer: Regarding your issue, if you need a control panel where you can add your own customized BBCode, then may be worth trying to integrate phpBB 3 BBCodes... it should not be tough! And I think I will also take a look at that sooner or later. Currently I'm really happy on how Icy Phoenix BBCodes work and even if the class is quite big now, I think I will still use that for a while, unless I will find the time to recode that. The best thing you can do now is lookin at how GRADIENT BBCode work which is one of the tag which natively supports many parameters: [codeblock][gradient cols=#FF8866 cole=#336699 iterations=8]Text[/gradient][/codeblock] This is the part of [b]bbcode.php[/b] which is relevant for parameters parsing: [codeblock] // GRADIENT if($tag === 'gradient') { /* if($this->is_sig && !$board_config['allow_all_bbcode']) { return $error; } */ $default_color1 = '#000080'; $color1 = $this->valid_color((isset($item['params']['param']) ? $item['params']['param'] : (isset($item['params']['cols']) ? $item['params']['cols'] : $default_color1)), true); $color1 = (($color1 === false) ? $default_color1 : $color1); $default_color2 = '#aaccee'; $color2 = $this->valid_color((isset($item['params']['cole']) ? $item['params']['cole'] : $default_color2), true); $color2 = (($color2 === false) ? $default_color2 : $color2); $mode = $this->process_text((isset($item['params']['mode']) ? $item['params']['mode'] : '')); $default_iterations = 10; $iterations = intval(isset($item['params']['iterations']) ? $item['params']['iterations'] : $default_iterations); $iterations = ((($iterations < 10) || ($iterations > 100)) ? $default_iterations : $iterations); $html = $this->gradient($content, $color1, $color2, $mode, $iterations); return array( 'valid' => true, 'html' => $html, 'allow_nested' => false, ); }[/codeblock] As you can see you can pass how many parameters you like to the BBCode parsing function... but only the ones you want to be processed will! Make sure you correctly process text strings, because malicious users may pass "unwanted" scripts and tags using parameters... there was a couple of buggy BBCodes in older versions... luckily almost nobody discovered them. :lol:[/quote] Most other forum software comes with a bbCode script that can be managed simply in one way or another, and most have the ability to handle multiple vars to parse the parameters to the script initiating whatever parameters are required. Because you choose to use this particular bbCode application which is limited in what one would expect from something else that is "Main Stream" then I suggest that you fix it to be more in-line with what people are generally used to. To suggest that others "experiment" with the existing code is nothing short of assuming that everyone is either an expert in coding or would be interested in improving Icy Phoenix to what you eventually expect it to be. Most of us are not! And imo Icy Phoenix is currently anything but "User Friendly". ----------------------------------- Mighty Gorgon Tue 12 Jan, 2010 23:59 Re: Help Wanted - Adding Multiple Vars To Bbcode.php ----------------------------------- I have added Custom BBCodes in new Icy Phoenix version. Newly added BBCodes in ACP won't have their own buttons in Posting Editor though. Try to have a go with SVN package if you have time and report if that is what you where looking for.