Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
trouble with forumdisplay.php Details »»
trouble with forumdisplay.php
Version: , by jsell jsell is offline
Developer Last Online: Sep 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-23-2002 Last Update: Never Installs: 0
 
No support by the author.

I hope someone can help me. I am trying to to figure out a way to pull a variable from a table seoperate from the threads table and have a value show in the forumdisplaybit. I try to place a query right after this code in forumdisplay.php

PHP Code:
while ($thread=$DB_site->fetch_array($threads)) { // and $counter++<$perpage) { 

but it doesn't seem to get the info from the DB is there i think i am placing this code incorrectly hope i explained this well enough
and that someone can help me

Thnaks in advance

jsell

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-23-2002, 10:08 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I make a Query to pull just the ReplyCount, The Thread Title, and then link it to the thread id?

Ive tried loads of queries, but i cant get it to work...

Could those queries be adapted?

If so, would you mind telling how?

Satan
Reply With Quote
  #13  
Old 10-23-2002, 10:35 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$threadquery=$DB_site->query("SELECT threadid,title,replycount FROM thread"); 
Then use $threadquery[threadid] for the threadid. The above query will return the values for all threads.
Reply With Quote
  #14  
Old 10-23-2002, 10:37 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool thanks

You wouldnt happen to know how I could get that to display in a table would you?

Satan
Reply With Quote
  #15  
Old 10-23-2002, 10:42 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Basicly have this PHP and then two templates, the bit, for each result and the mainone to house them all:

PHP Code:
$threadquery=$DB_site->query("SELECT threadid,title,replycount FROM thread");
while (
$threadinfo $DB_site->fetch_array($threadquery)) {

        
$title unhtmlspecialchars($threadinfo['title']);
        
$replycount $threadinfo['replycount'];
        
$threadid $threadinfo['threadid'];
        eval(
"\$threadbits .= \"".gettemplate('query_bit')."\";");
    }
eval(
"\$threads = \"".gettemplate('query')."\";"); 
Change query_bit and query in the eval statements to your template names
Reply With Quote
  #16  
Old 10-23-2002, 10:47 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks

Satan
Reply With Quote
  #17  
Old 10-23-2002, 11:08 PM
jsell jsell is offline
 
Join Date: Nov 2001
Location: South USA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesn't work right i'm sure i'm doing something wrong

here is what i changed the $threads Query to

PHP Code:
$threads=$DB_site->query("
SELECT 
$dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
    thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid,
    lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach,reqdata.threadid,reqdata.filler AS reqfiller
    FROM thread
    LEFT JOIN reqdata USING (threadid)
    "
.iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
    
$dotjoin
    WHERE 
$threadids
    ORDER BY sticky DESC, 
$sortfield $sqlsortorder
    "
); 
then below inside the while loop

PHP Code:
while ($thread=$DB_site->fetch_array($threads)) { // and $counter++<$perpage) { 
i put

PHP Code:
 //request hack
   
if ($threads[reqfiller]!='') {
       eval(
"\$filledby = \"".gettemplate('filledby')."\";");
   } else {
       
$filledby='';
      }
   
//request hack 
but it doesn't assign a value to the variable $threads[reqfiller]

any idea

Thanks

--jsell
Reply With Quote
  #18  
Old 10-23-2002, 11:13 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats because it would be :

PHP Code:
//request hack
   
if ($thread[reqfiller]!='') {
       eval(
"\$filledby = \"".gettemplate('filledby')."\";");
   } else {
       
$filledby='';
      }
   
//request hack 
You assigned the variable $thread to fetch the array of $threads, so you use $thread not $threads

Try that code, and $thread[reqfiller]

Satan
Reply With Quote
  #19  
Old 10-23-2002, 11:17 PM
jsell jsell is offline
 
Join Date: Nov 2001
Location: South USA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks i think my brain is fried

--jsell
Reply With Quote
  #20  
Old 10-24-2002, 04:41 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL! I see that you're getting support from the pros here. Sorry I didn't get back to this thread sooner, but it looks like things are under control.
Reply With Quote
  #21  
Old 10-24-2002, 09:03 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


you're welcome jsell

@Erwin: That thread is a good example:
So sees a problem and many users jump to it and try to solve
Reply With Quote
Reply


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 01:53 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.04768 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
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
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (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_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete