vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   function: construct_postbit (https://vborg.vbsupport.ru/showthread.php?t=74367)

sabret00the 01-14-2005 05:34 PM

function: construct_postbit
 
can someone tell me why this thing refuses to do it's job for me please

PHP Code:

    // ###################### query for posts
     
$posts $DB_site->query("
         SELECT grps_post.postid, grps_post.groupid, user.username AS poster, user.userid, grps_post.title AS posttitle, grps_post.dateline, grps_post.pagetext AS message, grps_post.iconid, icon.title AS icontitle, icon.iconpath, grps_post.visible, usertextfield.*
         FROM grps_post
         LEFT JOIN user ON (user.userid = grps_post.userid)
         LEFT JOIN usertextfield ON (usertextfield.userid = user.userid)
         LEFT JOIN grps ON (grps.groupid = grps_post.groupid)
         LEFT JOIN icon ON (icon.iconid = grps_post.iconid)
         WHERE grps_post.groupid = 
$groupid AND grps_post.visible != 0
         GROUP BY grps_post.groupid
         ORDER BY grps_post.dateline DESC
     "
);
 
     
$cell  0;
     if (
$DB_site->num_rows($posts))
     { 
// display the information
         
while ($post $DB_site->fetch_array($posts))
         {
             
$cell++;
             
$template iif($post['isdeleted'], "postbit_deleted""groups_viewthread_postbit");
             
$postbit construct_postbit($post$template);
         } 
//got all that info
     



Dean C 01-14-2005 06:31 PM

What doesn't work?

sabret00the 01-14-2005 07:18 PM

no template is echoing out

Dean C 01-14-2005 07:25 PM

Well it can't do anything, you have to put $postbit in a seperate template :)

sabret00the 01-14-2005 07:29 PM

wow what a rookie mistake that was, i forgot to call the postbit into the template, sorry dean.

Xenon 01-14-2005 11:47 PM

btw:
PHP Code:

if ($DB_site->num_rows($posts))
    { 
// display the information
        
while ($post $DB_site->fetch_array($posts))
        {
            
$cell++;
            
$template iif($post['isdeleted'], "postbit_deleted""groups_viewthread_postbit");
            
$postbit construct_postbit($post$template);
        } 
//got all that info
    


can be reduced to
PHP Code:

while ($post $DB_site->fetch_array($posts))
        {
            
$cell++;
            
$template iif($post['isdeleted'], "postbit_deleted""groups_viewthread_postbit");
            
$postbit construct_postbit($post$template);
        } 
//got all that info 

as the while contains the if condition already ;)

sabret00the 01-15-2005 02:20 PM

thanks stefan :)


All times are GMT. The time now is 05: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.02865 seconds
  • Memory Usage 1,732KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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