Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_replace_templates() should accept a template SID #889

Closed
Sama34 opened this issue Jul 6, 2014 · 5 comments
Closed

find_replace_templates() should accept a template SID #889

Sama34 opened this issue Jul 6, 2014 · 5 comments
Assignees
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Milestone

Comments

@Sama34
Copy link
Contributor

Sama34 commented Jul 6, 2014

Reference: http://community.mybb.com/thread-110013.html

@Sama34 Sama34 added this to the 1.8 Beta 3 milestone Jul 6, 2014
@Sama34 Sama34 self-assigned this Jul 6, 2014
@ATofighi
Copy link
Contributor

ATofighi commented Jul 6, 2014

I think it's better if We can use array.
for example:

find_replace_templatesets('title', 'find', 'replace' , 1, array(1, 2));

@Sama34
Copy link
Contributor Author

Sama34 commented Jul 6, 2014

@ATofighi I thought about that, but the main point was to run this right after a theme was created/imported. You can't create/import multiple themes at the same time.

Also, this doesn't seem to work so feel free to provide a fix until I get the chance to fix it myself.

@DiogoParrinha
Copy link
Contributor

@Sama34 is this done? I mean, we have no PR for this, it was committed directly so it must get into Beta 3...

@Sama34
Copy link
Contributor Author

Sama34 commented Jul 19, 2014

There was some weird behavior with this. I fixed it now.

This may be considered finished, if you find a bug please review the guidelines for contributing to this repository.

@Sama34 Sama34 closed this as completed Jul 19, 2014
@Sama34 Sama34 added the fixed label Jul 19, 2014
@Sama34
Copy link
Contributor Author

Sama34 commented Jul 19, 2014

Just to make it clear, the following code will affect all template sets (1.6 and should work with 1.8 without issues):

find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}');

Now you can target spesific template sets:

//.. Last argument represents the template set SID.
$sid = 2;
find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$testing}', 1, $sid);

Should be useful when hooking at admin_style_themes_import_commit or any other part of the script that adds template sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

No branches or pull requests

3 participants