Spacer Bbcode


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

Last edited by DWho on Fri 28 Mar, 2008 10:15; edited 1 time in total
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: [Download] [Hide] [Select]
var $self_closing_tags

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

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

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

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

FIND
Code: [Download] [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: [Download] [Hide] [Select]
if($tag == 'spacer')
{
$html = ' ';
return array(
'valid' => true,
'html' => $html
);
}

FIND
Code: [Download] [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: [Download] [Hide] [Select]
($tag === '[url=docs/readme_english.html#license]Readme[/url]') ||

INLINE AFTER ADD
Code: [Download] [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...

Subject: Re: Spacer Bbcode
Thanks DWho, this MODification working in IP 1.2.0.27?

Greets

Subject: Re: Spacer Bbcode
DWho wrote: [View Post]
Code: [Download] [Hide] [Select]
if($tag == 'spacer')
{
$html = ' ';
return array(
'valid' => true,
'html' => $html
);
}

Replace this code with:
Code: [Download] [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!

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

:mrgreen: :mrgreen:

Subject: Re: Spacer Bbcode
Yes, nut only if the bug is corrected.

Greetings :mricy:

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

:mrgreen: :mrgreen:

Subject: Re: Spacer Bbcode
I've already reported the bug, but we have to wait until Luca reads it :oops:

Subject: Re: Spacer Bbcode
ok cool

Thank you

:mryellow:


Page 1 of 1


  
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

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1452s (PHP: 14% SQL: 86%)
SQL queries: 14 - Debug Off - GZIP Enabled