Find / Replace template help
#1
I'm having trouble getting it to do a match and replace. This is what I have, but it isn't working.

find_replace_templatesets("member_profile", "#".preg_quote("<td class=\"{\$bgcolors['msn']}\"><strong>{\$lang->msn}</strong></td>
<td class=\"{\$bgcolors['msn']}\"><a href=\"javascript:;\" onclick=\"MyBB.popupWindow('misc.php?action=imcenter&amp;imtype=msn&amp;uid={$uid}', 'imcenter', 450, 300);\">{\$memprofile['msn']}</a></td>
</tr></table>")."#i", "<td class=\"{\$bgcolors['msn']}\"><strong>{\$lang->msn}</strong></td>
<td class=\"{\$bgcolors['msn']}\"><a href=\"javascript:;\" onclick=\"MyBB.popupWindow('misc.php?action=imcenter&amp;imtype=msn&amp;uid={$uid}', 'imcenter', 450, 300);\">{\$memprofile['msn']}</a></td>
</tr></table><br /><!--Social Groups-->{\$socialgroups}<!--Social Groups-->");

Basically I'm trying to create a new table that lists the social groups a member is in. I know how to manually add them, but the plugin should do it automatically.
Reply
#2
What is the problem? Any error message or something?
Reply
#3
The problem is it doesn't always change the template.
Reply
#4
Try this and see if it works:

find_replace_templatesets("member_profile", "#".preg_quote("<td class=\"{\$bgcolors['msn']}\"><strong>{\$lang->msn}</strong></td>
<td class=\"{\$bgcolors['msn']}\"><a href=\"javascript:;\" onclick=\"MyBB.popupWindow('misc.php?action=imcenter&amp;imtype=msn&amp;uid={\$uid}', 'imcenter', 450, 300);\">{\$memprofile['msn']}</a></td>
</tr></table>")."#i", "<td class=\"{\$bgcolors['msn']}\"><strong>{\$lang->msn}</strong></td>
<td class=\"{\$bgcolors['msn']}\"><a href=\"javascript:;\" onclick=\"MyBB.popupWindow('misc.php?action=imcenter&amp;imtype=msn&amp;uid={\$uid}', 'imcenter', 450, 300);\">{\$memprofile['msn']}</a></td>
</tr></table><br /><!--Social Groups-->{\$socialgroups}<!--Social Groups-->"); 
Reply
#5
(2012-04-04, 06:04 PM)dragonexpert Wrote: The problem is it doesn't always change the template.

That's a common problem with the current method MyBB uses. It just sometimes doesn't work. MyBB should simplify this function imho.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)