vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Weird request - Pull Thread titles (https://vborg.vbsupport.ru/showthread.php?t=79299)

lasto 04-04-2005 01:44 AM

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 ?

cinq 04-04-2005 02:15 AM

Code:

SELECT threadid, title FROM thread WHERE forumid = X ORDER BY title ASC
All you need, really :)

lasto 04-04-2005 02:30 AM

from a novice point of view - how cinq

How do i ake this run in a php file or whatever ?

twoseven 04-04-2005 03:16 AM

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

lasto 04-04-2005 03:20 AM

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

cinq 04-04-2005 03:48 AM

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.

lasto 04-04-2005 09:56 AM

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

Deaths 04-04-2005 10:01 AM

You can just add
PHP Code:

<a href="showthread.php?t$id">$title</a

To the template :)

lasto 04-04-2005 10:06 AM

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

Deaths 04-04-2005 11:01 AM

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.


All times are GMT. The time now is 02:03 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.01368 seconds
  • Memory Usage 1,752KB
  • 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
  • (7)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete