Spacer Bbcode »  Show posts from    to     

Icy Phoenix


Old Support Topics - Spacer Bbcode



DWho [ Tue 11 Mar, 2008 18:13 ]
Post subject: Spacer Bbcode
Hi

Is mod possible to add to icy... I have spent some time looking at the code but cannot find anything similar in the files....

Spoiler: [ Show ]


thank you for any help...


DWho [ Sat 15 Mar, 2008 17:51 ]
Post subject: Re: Spacer Bbcode
ok after spending a few hours studying bbcode parsing and through trial and error I have managed to get part of this to work....

Basically to enable to add spaces between words using [spacer] bbcode.... I have not managed to get the extra part working as yet whee a user can add a number up to 100 for the amount of spaces they require...

well this is the first bit if there are any errors please let me know....

This does not come with an image you have to type the bbcode into the text box...

OPEN includes/bbcode.php
FIND
Code: [Hide] [Select]
var $self_closing_tags

INLINE FIND
Code: [Hide] [Select]
'[url=docs/readme_english.html#license]Readme[/url]',

INLINE AFTER ADD
Code: [Hide] [Select]
'[spacer]',

FIND
Code: [Hide] [Select]
'ipstaff' => array(
'nested' => true,
'inurl' => true,
'allow_empty' => true,
)

AFTER ADD
Code: [Hide] [Select]
'spacer' => array(
'nested' => true,
'inurl' => true,
'allow_empty' => true,
),

FIND
Code: [Hide] [Select]
// Easter Eggs - START
// Single tags: xs or ipstaff
if( ($tag === 'xs') || ($tag === 'ipstaff') )
{
$html = $lang['BBC_IP_Credits'];
return array(
'valid' => true,
'html' => $html
);
}

BEFORE ADD
Code: [Hide] [Select]
if($tag == 'spacer')
{
$html = ' ';
return array(
'valid' => true,
'html' => $html
);
}

FIND
Code: [Hide] [Select]
$tag_ok = false;
if( ($tag === '*') || ($tag === '[*]') || ($tag === '[hr]') || ($tag === '[url=docs/readme_english.html#license]Readme[/url]') || ($tag === '[url=docs/readme_english.html#license]Readme[/url]') || ($tag === '[url=docs/readme_english.html#license]Readme[/url]') || ($tag === '[url=docs/readme_english.html#overview]Readme[/url]') || ($tag === '[url=docs/readme_english.html#license]Readme[/url]') || ($tag === '[url=docs/readme_english.html#requirements]Readme[/url]') || ($tag === '[url=docs/readme_english.html#fresh_installation]Readme[/url]') || ($tag === '[url=docs/readme_english.html#upgrade_phpbb]Readme[/url]') || ($tag === '[url=docs/readme_english.html#upgrade_phpbb]Readme[/url]') || ($tag === '[url=docs/readme_english.html#upgrade_xs]Readme[/url]') || ($tag === '[url=docs/readme_english.html#upgrade_ip]Readme[/url]') )

INLINE FIND
Code: [Hide] [Select]
($tag === '[url=docs/readme_english.html#license]Readme[/url]') ||

INLINE AFTER ADD
Code: [Hide] [Select]
($tag === '[spacer]') ||


Thats it

if you need to add extra spaces just use [spacer]

if anyone could help with the other part I will be very grateful...


ThE KuKa [ Sat 15 Mar, 2008 23:40 ]
Post subject: Re: Spacer Bbcode
Thanks DWho, this MODification working in IP 1.2.0.27?

Greets


KasLimon [ Sun 16 Mar, 2008 10:45 ]
Post subject: Re: Spacer Bbcode
DWho wrote: [View Post]
Code: [Hide] [Select]
if($tag == 'spacer')
{
$html = ' ';
return array(
'valid' => true,
'html' => $html
);
}

Replace this code with:
Code: [Hide] [Select]
// SPACER
if($tag === 'spacer')
{
$html = '';
if(isset($item['params']['param']))
{
for ($i=0; ($i < intval($item['params']['param'])); $i++)
{
$html .= '&nbsp;';
}
}
else
{
$html = '&nbsp;';
}
return array(
'valid' => true,
'html' => $html
);
}


It seems it is a bug and you can't set [spacer=5] or [hr=#FF0000] (the second one should be working)...

This code I've posted will not work until the bug is fixed.

Greets!


DWho [ Sun 16 Mar, 2008 15:58 ]
Post subject: Re: Spacer Bbcode
Hi

So as soon as the bug is fixed it should work as discribed? Does that mean you can add a number after space=? and that many spaces will appear in the text box...?

thanks for looking and correctly correcting my code....



KasLimon [ Sun 16 Mar, 2008 16:31 ]
Post subject: Re: Spacer Bbcode
Yes, nut only if the bug is corrected.

Greetings


DWho [ Sun 16 Mar, 2008 16:52 ]
Post subject: Re: Spacer Bbcode
Excellant....

So how do we fix the bug or is that for the main developers of the site to look at..?

Do I need to post a bug report..?



KasLimon [ Mon 17 Mar, 2008 21:39 ]
Post subject: Re: Spacer Bbcode
I've already reported the bug, but we have to wait until Luca reads it


DWho [ Mon 17 Mar, 2008 22:17 ]
Post subject: Re: Spacer Bbcode
ok cool

Thank you





Powered by Icy Phoenix