Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Help Wanted - Adding Multiple Vars To Bbcode.php 
 
I'm really stuck with this and would like some help from someone who's a lot smarter than I am.

I've tried modding bbcode.php with preg_replace and even resorted to trying to add regex.

And I've given up!

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.
 
 
Edited by Guest, Wed 23 Sep, 2009 00:34: added missing &
 
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: 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
 




____________
Mods and themes for Icy Phoenix 1.3

IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Help Wanted - Adding Multiple Vars To Bbcode.php 
 


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.

Maybe I should use phpBB3 or phpBB*29 - Then I wouldn't have this problem? Probably get MORE support too!

Quote from another support forum that collapsed:

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.


Food for thought my friend.  
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Help Wanted - Adding Multiple Vars To Bbcode.php 
 
As you have told so many times... if you need a better support, try vBulletin!

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...

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:

Code: [Download] [Hide] [Select]
[gradient cols=#FF8866 cole=#336699 iterations=8]Text[/gradient]


This is the part of bbcode.php which is relevant for parameters parsing:
Code: [Download] [Hide] [Select]
        // 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,
            );
        }


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.
 




____________
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: Help Wanted - Adding Multiple Vars To Bbcode.php 
 
Mighty Gorgon wrote: [View Post]
As you have told so many times... if you need a better support, try vBulletin!  

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...

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:

Code: [Download] [Hide] [Select]
[gradient cols=#FF8866 cole=#336699 iterations=8]Text[/gradient]


This is the part of bbcode.php which is relevant for parameters parsing:
Code: [Download] [Hide] [Select]
        // 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,
            );
        }


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.


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".
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 




____________
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


  

 

  cron