Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-19-2010, 09:37 AM
NexDog's Avatar
NexDog NexDog is offline
 
Join Date: Mar 2002
Location: Lost in the Nexus
Posts: 388
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
ob_start();
   include(
'/path/to/forum/wordpress.php');
   
$includeVP ob_get_contents();
ob_end_clean(); 
wordpress.php is a file that calls SimplePie and pulls a feed from our blog and displays titles of the last 5 blog posts in the footer.

This is the code:

PHP Code:
<?php
 
// Make sure SimplePie is included. You may need to change this to match the location of simplepie.inc.
require_once('/home/httpd/vhosts/domain.com/httpdocs/include/simplepie.inc');
require_once(
'/home/httpd/vhosts/domain.com/httpdocs/include/shorten.inc');

// We'll process this feed with all of the default options.
$feed = new SimplePie();
$feed->set_feed_url(array('http://www.domain.com/forum/external.php?type=rss'));
//$feed->set_feed_url(array('http://www.domain.com/blog/category/status/feed/'));
$feed->init();
$feed->set_item_limit(5);
 
// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();
 
// Let's begin our XHTML webpage code.  The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag.

/*
Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
*/
foreach ($feed->get_items() as $item):
?>
<tr>
    <td align="left" width="13"><img src="../../../../images/site/thread.gif"></td>
    <td align="left" width="100%"><a class="feeds" href="<?php echo $item->get_permalink(); ?>"><?php echo shorten($item->get_title(), 35); ?></a><br /></td>
</tr>
<?php endforeach; ?>
shorten.inc is some extra code that shortens the char limit of the displayed title to 35 characters.

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.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:15 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
  • Page Generation 0.04484 seconds
  • Memory Usage 2,566KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (11)postbit
  • (7)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete