The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
PHP include triggers HTTP cascade
I followed this:
http://www.vbulletin.com/forum/showt...P-or-HTML-File And created a Plugin with: PHP Code:
This is the code: PHP Code:
Problem is when I refresh the page it spawns hundreds of httpd process in a loop that raises loads to 150+. Anyone have any ideas to what I'm doing wrong? I use teh same code to pull vbulletin titles to our blog footer and rest of the site, and wordpress titles to its own footer and other areas of the site. On VB it just goes ballistic. --------------- Added [DATE]1279536057[/DATE] at [TIME]1279536057[/TIME] --------------- Actually it was the vbulletin.php containing code that pulled titles from vBulletin that caused teh loop. I activated teh wordpress.php plugin and the server is fine. However it doesn't display anything. |
#2
|
|||
|
|||
I don't know why I've seen people in the habit of manually capturing an external PHP output rather than just putting the PHP code in the hook:
1.) Adapt and add the following code to Hook: parse_templates PHP Code:
and voila! None of this nasty ob_start() and ob_end() stuff, it's unnecessary! Adapt the code to your liking, I even used SimplePie for you. You'll want to edit the include director, the feed url, and probably make the formatting of $feed_html a little nicer. |
#3
|
|||
|
|||
Well, for one thing there's an example of how to do it in the vBulletin manual, and not everyone's a PHP programmer. But also if it's existing code or something obtained elsewhere, altering a copy of it can create a maintenance issue.
|
#4
|
||||
|
||||
Hmm, also caused the server to crash.
|
#5
|
|||
|
|||
Quote:
I need more information to see what wrong. I ran this on my test server with no problems. |
#6
|
|||
|
|||
http://www.vbulletin.com/docs/html/m..._externalfiles
Just to be clear, I'm not saying that it's always the best thing to do just because it's in the manual, I'm just saying that's probably one reason you see it so much. But I'm not a PHP expert - maybe you could elaborate on why you consider ob_start/ob_end "nasty". ETA: BTW, my guess would be that the above is crashing because this line PHP Code:
|
#7
|
|||
|
|||
Quote:
I think forum owners are using it as a quick means to modify their forums without understanding exactly what they are doing and how it works. The manual states "Including external files," but I am seeing people create external files just to use that generalized snippet of code. |
#8
|
|||
|
|||
Ah, I see. That makes sense. Carry on.
|
#9
|
||||
|
||||
I think I'll just give teh job to someone that understands vbulletin and php better than I (which is everyone over teh age of 3).
|
#10
|
|||
|
|||
Quote:
You could add some HTML comments to the output to see what's happening (e.g. is it not displaying because there's nothing for the foreach loop to do, or is it never getting there?). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|