Hi all,
I've never programmed in PHP but I do have a lot of experience in VB.NET so I've been able to make a great many changes to my phpbb3 forum using common sense and my general programming knowledge.
I am stuck on two things however. I wish to change the way two of the BBCode tags work, but I cannot see how. Firstly is the QUOTE tags. At the moment you need to use the following tags for it to work:
but I want it to work as follows:
I've seen at least two forums that use this, but I can't believe that PHP would limit this so I think it must be possible. The only relevant lines I can find in the files are in the bbcode.php file:
and
Any idea how to make the quotation marks unnecessary (it would be nice if you could use both, but that is a luxury I can live without)? I've tried simply removing the """s but it did not change anything - quotation marks were still necessary when quoting someone.
The second tag is the bullet point one. Presently you have to do the following:
I would like the behaviour to be as follows:
Again, I have seen other forums where this is possible so unless it's a limitation of php/phpbb3 then it can be done. I have no idea where to start for this but here is the/some relevant code:
Does anyone have any ideas that might help me?
Thanks!
I've never programmed in PHP but I do have a lot of experience in VB.NET so I've been able to make a great many changes to my phpbb3 forum using common sense and my general programming knowledge.
I am stuck on two things however. I wish to change the way two of the BBCode tags work, but I cannot see how. Firstly is the QUOTE tags. At the moment you need to use the following tags for it to work:
Code:
[Quote="User name"]Stuff[/quote]
but I want it to work as follows:
Code:
[Quote=User name]Stuff[/quote]
I've seen at least two forums that use this, but I can't believe that PHP would limit this so I think it must be possible. The only relevant lines I can find in the files are in the bbcode.php file:
Code:
foreach ($bbcode_ids as $bbcode_id)
{
switch ($bbcode_id)
{
case 0:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
),
'preg' => array(
'#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
)
);
break;
.....
and
Code:
function bbcode_second_pass_quote($username, $quote)
{
// when using the /e modifier, preg_replace slashes double-quotes but does not
// seem to slash anything else
$quote = str_replace('\"', '"', $quote);
$username = str_replace('\"', '"', $username);
// remove newline at the beginning
if ($quote == "\n")
{
$quote = '';
}
$quote = (($username) ? str_replace('$1', $username, $this->bbcode_tpl('quote_username_open')) : $this->bbcode_tpl('quote_open')) . $quote;
return $quote;
}
Any idea how to make the quotation marks unnecessary (it would be nice if you could use both, but that is a luxury I can live without)? I've tried simply removing the """s but it did not change anything - quotation marks were still necessary when quoting someone.
The second tag is the bullet point one. Presently you have to do the following:
Code:
[list][*] Stuff 1
[*] Stuff 2
[*] Stuff 3[/list]
I would like the behaviour to be as follows:
Code:
[*] Stuff 1
[*] Stuff 2
[*] Stuff 3
Again, I have seen other forums where this is possible so unless it's a limitation of php/phpbb3 then it can be done. I have no idea where to start for this but here is the/some relevant code:
Code:
case 9:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
'#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1",
'#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
),
'str' => array(
'[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id),
'[/list:u:$uid]' => $this->bbcode_tpl('ulist_close', $bbcode_id),
'[/list:o:$uid]' => $this->bbcode_tpl('olist_close', $bbcode_id),
'[*:$uid]' => $this->bbcode_tpl('listitem', $bbcode_id),
'[/*:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id),
'[/*:m:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id)
),
);
break;
Does anyone have any ideas that might help me?
Thanks!