The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi
LATEST PROBLEM I was able to replace the code between my custom tags using... Code:
$text = preg_replace("/\[flow-rtmp\](.*)\[\/flow-rtmp\]/Usi", $replacement, $text); Any suggestion? Lux I need to replace a custom bbcode on the page NOT in the custom bb page. The code I'm putting in will be re-generated every time the page is loaded with different return values each time. I've started writing a simple plugin that will replace the custom bbcode but the problem I'm having is how to identify the tag by name, extract it's param and then replace it with new code. If anybody has an example of doing something like this it would be great. I've bee looking at loads of articles and other plugins for hours but no luck. All the code I've found so far relates to changing the bbcode when users are posting and not when the post is displayed which is what i'm trying to do. Thanks Lux --------------- Added [DATE]1345885381[/DATE] at [TIME]1345885381[/TIME] --------------- I came up with a solution in the end but I'm sure it's not the most elegant way of doing it. If anybody does have the correct solution please let me know. I ended up doing this to find the tag and extract the param/text Code:
foreach($this->tag_list as $tag_item => $tag){ if($tag['flow-rtmp']){ preg_match('/\[flow-rtmp\](.*?)\[\/flow-rtmp\]/i',$text,$match); if($match){ Like I said it's not the best solution but it's all I could come up with. Hopefully somebody has a more elegant/correct solution. Thanks Lux --------------- Added [DATE]1345945424[/DATE] at [TIME]1345945424[/TIME] --------------- Well while my solution seemed to have worked I noticed some problem with it. The code replaces ALL the text in the post and not just the text in between the custom bbcode which is not really what I want. I'll continue trying to find a solution but if anybody can shed some light on this I'd appreciate it. Thanks Lux |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|