![]() |
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 ? |
Code:
SELECT threadid, title FROM thread WHERE forumid = X ORDER BY title ASC |
from a novice point of view - how cinq
How do i ake this run in a php file or whatever ? |
from the vbulletin manual appendix 4
PHP Code:
PHP Code:
|
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:
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 |
Your custom page ( assuming in your forum dir ) should look something like this :
PHP Code:
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. |
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 |
You can just add
PHP Code:
|
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 |
Replace this code:
PHP Code:
PHP Code:
Dont forget to replace the XXX's though. |
really chuffed with this code :0
one final thing is there a way for me to get it to display at the top of the page how many threads it has pulled altogether ?? so it shows like this Maps on server : (number) then displays results ? |
Add this to the file:
PHP Code:
|
adding that code gives me a parse error
|
he just missed a semi-colon at the end :p
PHP Code:
|
:)
perfect - shows 148 now excellant now its pulled the correct data i need is there anyway for me to make it use my boards colors or style as at moment its just text on a white background |
Ah, my bad.
|
read my last post PLZ
|
Sorry, only just read it.
Hold on, I'll give you the code. Make this the main thread: HTML Code:
$stylevar[htmldoctype] HTML Code:
<td class="alt1"><a href="showthread.php?t$id">$title</a> |
cheers m8 for your help
|
Did it work?
|
sort of
its useing the colors of my board but the box for the title appears at the bottom while the thread titles appear at the top |
Ni, by some title I ment the title which you want to give it, like "Total threads in forum XXX" ;)
|
yeah i know that :)
i gave it a title but what im saying is with the code you provided the title should appear in a box which it does,but it appears right at the bottom of the page and the titles from the threads appear before it. No worries though i can quite easy fix this bit - cheers again death. |
Ok :).
If you need any other help, just gimme a shout. |
1 Attachment(s)
will do m8 cheers
ok everything i have asked for has been completed and is working really well but id like to expand upon this if someone wants to help. So far it now pulls the threads titles and displays them in alphabet mode but id like the display to be made in boxes if possible to make it look more presentable. At moment it just shows the titles so how about a seperate column to show the author of the post ? |
is there anyway i can have the code tydied up - look in the post above for a pic of the display i see.I would like it to be in a sort of box or mouseover from when i go from one link to the next if possible.Anything but plain text on a white screen :)
|
Add this above your query:
PHP Code:
PHP Code:
PHP Code:
HTML Code:
class="alt$alt" HTML Code:
<td class="alt$alt">..... |
ok another thing - is there a way to get it to pull the date of the thread title with it so can see when it was made and very last thing to actually pull the size of the attachment so when viewing all the maps on a seperate page it will show the following info :
mapname1 05/05 127KB etc |
Fatal error: Call to a member function on a non-object in /home/custom/vb3/maps.php on line 4
does the above query work on vb3.5.4 as ive just upgraded the board and this no longer works. Here is the code in my php file <?php require_once('./global.php'); $results = $DB_site->query(" SELECT threadid, title FROM " . TABLE_PREFIX . " thread WHERE (forumid=82 OR forumid=83) ORDER BY title ASC "); while ($row = $DB_site->fetch_Array($results)) { $id = $row['threadid']; $title = $row['title']; eval('$threadbits .= "' . fetch_template('mypage_threadbits') . '";'); } $mapcount = $DB_site->query_first("SELECT count(threadid) AS maps FROM " . TABLE_PREFIX . "thread WHERE (orumid=82 OR forumid=83)"); $nummaps = $mapcount['maps']; eval('print_output("' . fetch_template('mypage_main') . '");'); ?> |
All times are GMT. The time now is 10:13 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|