2016-07-22, 11:14 PM
Hi everyone,
upon developing a plugin for my member_profile I've run into a problem with find_replace_templatesets in the install bit. The problem is that I can't find the correct code for the replacement as I already know that I will have two more plugins (number 1 and 3 down below) that might interfere here. I want to find a solution where it does not matter in which order the 3 plugins are installed and I want them to stay separated.
In the end it all will look something like this:
So to place the code for plugin 2 I cannot say "Put something behind the signature table bit" because if plugin1 is already installed it will not work. And I can not say "Put something before modoptions" because Plugin3 might interfere.
I've tried to do something like this:
The preg_quote idea is from here.
However this does not work at all. (Maybe just because I'm not really good at regular expressions :/ )
Do you have any suggestions?
Thanks in advance!
Senya
upon developing a plugin for my member_profile I've run into a problem with find_replace_templatesets in the install bit. The problem is that I can't find the correct code for the replacement as I already know that I will have two more plugins (number 1 and 3 down below) that might interfere here. I want to find a solution where it does not matter in which order the 3 plugins are installed and I want them to stay separated.
In the end it all will look something like this:
{$signature}
{$plugin1}
</td>
</tr>
</table>
{$plugin2} <- That's the one I'm talking about
{$plugin3}
{$modoptions}
So to place the code for plugin 2 I cannot say "Put something behind the signature table bit" because if plugin1 is already installed it will not work. And I can not say "Put something before modoptions" because Plugin3 might interfere.
I've tried to do something like this:
find_replace_templatesets('member_profile', '#'.preg_quote("{$signature}.*</table>").'#i', '{\$signature}.*</table>\n {$plugin2}');
The preg_quote idea is from here.
However this does not work at all. (Maybe just because I'm not really good at regular expressions :/ )
Do you have any suggestions?
Thanks in advance!
Senya