vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   it doesnt make sense... (https://vborg.vbsupport.ru/showthread.php?t=39140)

TECK 05-28-2002 10:58 AM

it doesnt make sense...
 
this is part of the vbHome lite hack i started. i use this code to pull the threads from a news forum. i have no idea why it's adding an extra query every time i post a new thread:
Code:

// ######################################################################
// ## NEWS ARTICLES #####################################################

$getnewsids=$DB_site->query("SELECT thread.threadid
                            FROM thread
                            WHERE thread.forumid=$newsforum
                            AND thread.visible=1
                            ORDER BY threadid DESC
                            LIMIT $newsposts");
$newsids='thread.threadid IN (0';
while ($article=$DB_site->fetch_array($getnewsids)) {
  $newsids .= ",".$article['threadid'];
}
$newsids.=')';

$getnews=$DB_site->query("SELECT thread.title,thread.dateline,forumid,postusername,postuserid,post2.pagetext as pagetext
                          FROM thread
                          LEFT JOIN post AS post2 ON (thread.articleid=post2.postid)
                          WHERE $newsids
                          ORDER BY dateline DESC");
unset($newsbits);
while ($news=$DB_site->fetch_array($getnews)) {
  $newstitle=$news[title];
  $newstime=vbdate($timeformat,$news[dateline]);
  $newsdate=vbdate($dateformat,$news[dateline]);
  $newsusername=$news[postusername];
  $newsuserid=$news[postuserid];
  $newstext=bbcodeparse($news[pagetext],$newsforum,$allowsmilies);

  // if you use html code, uncomment the line below
  // $newstext=str_replace("<br />","",$newstext);

  $newsavatarurl=getavatarurl($newsuserid);
  if ($newsavatarurl=='') {
    $newsavatarurl='{imagesfolder}/clear.gif';
  }

  eval("\$newsavatar = \"".gettemplate('home_avatar')."\";");
  eval("\$newsbits .= \"".gettemplate('home_newsbits')."\";");
}
$DB_site->free_result($getnews);
unset($news);

// ## END NEWS ARTICLES #################################################
// ######################################################################

can you help me out and explain why is constantly adding an extra query, with every new post i make? it doesnt make sense to me.

thanks.

Admin 05-28-2002 11:19 AM

Closed by request of nakkid.


All times are GMT. The time now is 10:00 PM.

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.01038 seconds
  • Memory Usage 1,716KB
  • 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_code_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