![]() |
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. |
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. |
Quote:
|
Hmm, also caused the server to crash. :)
|
Quote:
Quote:
|
Quote:
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:
|
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. |
Quote:
|
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).
|
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?). |
Yes, please don't mistake my query for insult, I was wondering why I saw this trend pop up recently and now that I know its in the manual, it's not surprising!
|
All times are GMT. The time now is 05:05 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|