View Full Version : 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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
All you need, really :)
from a novice point of view - how cinq
How do i ake this run in a php file or whatever ?
twoseven
04 Apr 2005, 04:16
from the vbulletin manual appendix 4
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
so with the modified query it owuld be something like
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
hope that helps
sort of helps but it dont help me in displaying the results
i make a php file with your query above as follows :
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
Your custom page ( assuming in your forum dir ) should look something like this :
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
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
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
To the template :)
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
with:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You can add more OR's, or remove a couple, it's up to you :)
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now you can use $nummaps in your template.
adding that code gives me a parse error
he just missed a semi-colon at the end :p
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
:)
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
Sorry, only just read it.
Hold on, I'll give you the code.
Make this the main thread:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now, create this as bit template:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now, INSIDE the foreach tag, add this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Example:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now, in the bit template, to your td tag, add:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
So, like this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
That should color up the links' backgrounds :)
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') . '");');
?>
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.