php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58112 Multiple arguments in BBCodes
Submitted: 2008-03-21 20:02 UTC Modified: 2017-04-01 19:29 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: hubert dot roksor at gmail dot com Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
3 + 25 = ?
Subscribe to this entry?

 
 [2008-03-21 20:02 UTC] hubert dot roksor at gmail dot com
Description:
------------
It would be really nice if it was possible to specify multiple arguments for a BBCode. For example, we could use something like
[url href="http://example.com" title="Example page"]...text...[/url]

The implementation should allow arguments to be specified in any order. The user would need to indicate the name of the default argument. For instance, if the name of the default argument is "href", those should be identical:
[url="http://example.com"]...[/url]
[url href="http://example.com"]...[/url]

Thanks for reading ;)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-22 05:48 UTC] xdecock at gmail dot com
What will you see as replacement syntax?
It would also be usefull to put a list of argument and define the default argument...

What about a 

'url' => array(

replacement => 
   '<a {href="{title_val%html_quote}"} {title="{title_val%html_quote}"}>{content}</a>',

validation_callback =>
   array('href'=>array('Validator','url')),
arguments=>
   array(
      'href'=>
      array(
        'default_val'=>'{content}',
        'validation'=>array('Validator','url'),
        'forced'=>true
      )
      'title',
      'default'=>'href'
    )
),


If you have a better Idea for declaration, i'm listening, because the current syntax is already quite complex. and my current idea for your suggestion make it even more complex.

But it must be done only one time :)
 [2008-03-22 05:50 UTC] xdecock at gmail dot com
Oups, done an error on the replacement syntax:

here is the correction:

'replacement' => 
   '<a {href="{href_val%html_quote}"}
{title="{title_val%html_quote}"}>{content}</a>',
 [2008-11-20 12:56 UTC] martinrhill2000 at yahoo dot co dot uk
I would also like to show my utmost support for this feature.

It would be great if a "BBCODE_TYPE_MULTIARG" flag would allow multiple arguments without them needing to be predefined. The arguments could be passed to callback functions as an array similar to call_user_func_array().
 [2009-08-31 07:27 UTC] miksir at maker dot ru
I'm starting development of multi argument, but need testers. Already rewrited some part of code - test passed ok, but need real testing (better under high load), because i'm not very familiar with c =)
 [2017-04-01 19:29 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:29 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2010, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Aug 04 15:01:25 2020 UTC