Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2005, 01:44 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Weird request - Pull Thread titles

ok have this forum and i want any thread made in that section to have its title (the name of the thread) pulled to a seperate page so i can see every title in alphabet mode with a link back to the orginal thread.

Any one up for this ?
Reply With Quote
  #2  
Old 04-04-2005, 02:15 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
SELECT threadid, title FROM thread WHERE forumid = X ORDER BY title ASC
All you need, really
Reply With Quote
  #3  
Old 04-04-2005, 02:30 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

from a novice point of view - how cinq

How do i ake this run in a php file or whatever ?
Reply With Quote
  #4  
Old 04-04-2005, 03:16 AM
twoseven twoseven is offline
 
Join Date: Jan 2004
Location: in floris' pants
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

from the vbulletin manual appendix 4
PHP Code:
$results $DB_site->query("
    SELECT field_one, field_two
    FROM " 
TABLE_PREFIX "table AS table
    WHERE field_one IN(3,4,5)
        AND field_two <> ''
        AND field_three = 'something'
    ORDER BY field_one
"
); 
so with the modified query it owuld be something like
PHP Code:
$results $DB_site->query("
   SELECT threadid, title FROM " 
TABLE_PREFIX " thread WHERE forumid = X ORDER BY title ASC
"
); 
hope that helps
Reply With Quote
  #5  
Old 04-04-2005, 03:20 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sort of helps but it dont help me in displaying the results

i make a php file with your query above as follows :
PHP Code:
<?php 
$results 
$DB_site->query(
   SELECT threadid, title FROM " 
TABLE_PREFIX " thread WHERE forumid = 213 ORDER BY title ASC 
"
); 


?>
Fatal error: Call to a member function on a non-object in /home2/ on line 2

i need to know how i can call this info back in a seperate page so i can view the entire list as that querie aint working
Reply With Quote
  #6  
Old 04-04-2005, 03:48 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your custom page ( assuming in your forum dir ) should look something like this :

PHP Code:
<?php
require_once('./global.php');

$results $DB_site->query("
   SELECT threadid, title FROM " 
TABLE_PREFIX " thread WHERE forumid = 213 ORDER BY title ASC
"
);

while (
$row $DB_site->fetch_Array($results))
{
    
$id $row['threadid'];
    
$title $row['title'];
    eval(
'$threadbits .= "' fetch_template('mypage_threadbits') . '";');


eval(
'print_output("' fetch_template('mypage_main') . '");');
?>
Now create 2 templates: mypage_main and mypage_threadbits.
The mypage_main will be the main page layout, and where you want the thread titles to show, put a $threadbits in the mypage_main template.

The mypage_threadbits is the template in which the titles are shown.
Use $title to display the title and link to the thread by using $id as the threadid.
Reply With Quote
  #7  
Old 04-04-2005, 09:56 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works perect so far - cant get an active link back to the real thread though
got the threads showing on a page but the names aitn clickable and ive followed the code above exactly as you have put it m8 ?

here is what shows :

Eastern Front Map 21306

just need the actual text to be clickable to go back to the actual thread
Reply With Quote
  #8  
Old 04-04-2005, 10:01 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just add
PHP Code:
<a href="showthread.php?t$id">$title</a
To the template
Reply With Quote
  #9  
Old 04-04-2005, 10:06 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working now thanks a lot (thanks death and cinq)

one last thing - at moment in cinq code its set to show the maps from one section only (forumid 213)

how can i get it to say show from more than one section as altoogether i need it for 4 ids
Reply With Quote
  #10  
Old 04-04-2005, 11:01 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace this code:
PHP Code:
$results $DB_site->query("
   SELECT threadid, title FROM " 
TABLE_PREFIX " thread WHERE forumid = 213 ORDER BY title ASC
"
); 
with:
PHP Code:
$results $DB_site->query("
   SELECT threadid, title FROM " 
TABLE_PREFIX " thread WHERE (forumid=XXX OR forumid=XXX OR forumid=XXX OR forumid=XXX) ORDER BY title ASC
"
); 
You can add more OR's, or remove a couple, it's up to you
Dont forget to replace the XXX's though.
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 10:54 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.04758 seconds
  • Memory Usage 2,284KB
  • 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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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