MyBB Community Forums

Full Version: Table Generator plugin issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi getting errors with this plug in please see link to my other post which is why I'm now posting in this section.
https://community.mybb.com/thread-235358.html

As I'm not sure what would to be changed for this plugin to work without errors.

I'm not sure if I can post the .php file in here so will wait.

Any help please?
If you're using https://community.mybb.com/mods.php?action=view&pid=276, note the [TABLE] replacement code already begins with width::
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:$1%;">$2</table>
which is also used in posts you included. The quotation marks " are also added to the output, which may result in e.g.:
<table border="0" cellspacing="1" cellpadding="3" class="tborder" style="width:"width: 98%, align: center"%;">

Other than mangled output, this may also lead to a security issue (users may be able to set attributes other than style).

Try changing this MyCode in the ACP (Configuration → MyCode) like so:
  • Regular Expression:
    \[TABLE="?([^"]*?)"?\](.*?)\[/TABLE\]
    
  • Replacement:
    <table border="0" cellspacing="1" cellpadding="3" class="tborder" style="$1">$2</table>