vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Display recent posts on external vb page (https://vborg.vbsupport.ru/showthread.php?t=92075)

boske 07-13-2005 01:46 AM

Display recent posts on external vb page
 
I just put together a select from the database, here is what it looks like:

PHP Code:

 $result = mysql_query("SELECT * FROM vb3_thread WHERE forumid != 23 ORDER BY lastpost DESC LIMIT 0,10");


while($r=mysql_fetch_array($result)){

$threadid=$r["threadid"];
$title=$r["title"];
$postusername=$r["postusername"];
$forumid=$r["forumid"];
$replycount=$r["replycount"];
$posterid=$r["postuserid"];
$views=$r["views"];


?>
<tr align="middle">
            <td class="alt2" align="left"><a href="http://www.example.com/forums/showthread.php?t=<? echo $threadid; ?>"><? echo $title; ?></a></td>
            <td class="alt1Active" id="f44" align="center"><? echo $replycount; ?></td>
            <td class="alt2" noWrap width="32"><? echo $views; ?></td>
            <td class="alt1"><a href="http://www.example.com/forums/member.php?u=<? echo $posterid ?>"><? echo $postusername; ?></a></td>
        </tr>
<?
}
?>

The problem is, it takes about 3-4 seconds to load those 10 posts, when its faster to load the whole vb website...

Any suggestions?

Steve

boske 07-14-2005 02:06 AM

_________________
well I kind of figured out why it was slow...anways I setup a cron job to run the file because I think the query was just way to big, so the cron job will run a file with all the stuff I would like to query, and then I setup another script the query a smaller database with the stuff I need...

Result: Instant feed...


All times are GMT. The time now is 09:17 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.00969 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete