View Full Version : Random Threads On Index Page
jly2klee
04-07-2002, 10:00 PM
YAY! My Third hack!
Basically what this does is displays a different Thread Name and how many posts are in it on the index page, EVERYTIME you refresh.
Its very easy to install and stuff.
So Have Fun!
BTW: IF you install it, please click the install button. Thanks.
EDIT: Everybody keeps asking what this does! So i'll try and explain a little better.
When you refresh the FORUMS INDEX PAGE, it will display a TITLE of a THREAD and HOW MANY REPLIES THERE IS. Now do you guys get it?
wooolF[RM]
04-08-2002, 10:03 PM
]one more query, right?
btw, great idea :)
Nemesis77
04-08-2002, 10:10 PM
it will display a TITLE of a THREAD and HOW MANY REPLIES THERE IS.
It displays it where on the index page?
Do you have a screen shot?
Freddie Bingham
04-08-2002, 10:13 PM
Yes it adds one query but it does not take permissions into consideration.
jly2klee
04-08-2002, 10:20 PM
@Nemesis77
It can display wherever you want it to. Just take the HTML code for FORUMHOME and out it wherever.
@freddie
Oops. My bad. I'll fix that up!
- jly2klee
The s=21b8b4a0b40923653dfa7e4e2d49d791 is not required as it is a Session ID and will vary with each user.
inetd
04-12-2002, 07:09 PM
don't work. not show how many replies and don't show thread when click on random thread name
:(
help me
jly2klee
04-12-2002, 11:58 PM
did you put the code in ROOT/index.php?
inetd
04-14-2002, 06:18 AM
yes.
|GMK|PlaTooN
04-15-2002, 01:48 AM
Screenshot?
jly2klee
04-17-2002, 11:44 PM
I'll get a screenshot right now.
inetd
04-18-2002, 05:56 PM
jly2klee, please help me in my trouble... :(
julius
04-21-2002, 10:15 AM
Thanks jly2klee, it's really I was looking for!
inetd, I found this that I believe it's an error:
<a href="showthread.php?s=$sessionhash[session]threadid=$randthreadid">
and changed with
<a href="showthread.php?s=$session[sessionhash]&threadid=$randthreadid">
and now it works fine.
inetd
04-21-2002, 11:08 AM
julius, don't work for me! And i don't see quantity replies in random thread.
julius
04-21-2002, 11:12 AM
I didn't care about it because I only put the thread title.
The Piper
06-20-2002, 06:39 PM
This is exactly what I was looking for, except that I would like to get a few random threads (around 5) from a few specific forums (say, forumids 30, 31 and 32). Is there any way to do this?
Also, could I get them in a nice table that shows the thread title and the forum they're in or something like that?
Thanks.
dadymac
07-24-2002, 09:46 AM
the thread count doesnt work because its wrong in the code:
after installing, find:
$randthreadreply = $randthread[replies];
and replace with
$randthreadreply = $randthread[replycount];
:)
yay, go me
Boofo
07-24-2002, 09:57 AM
Did you get the permissons problem taken care of yet? I'd hate to see one of my private forums threads show up there. :)
The Piper
10-03-2002, 04:44 AM
Ok, I'm still looking for a way to do this:
I have three forums, one for guitar tabs, one for guitar chords and the last for bass tabs. What I wanted to do is pull a random thread from each one of those forums, so I could feature a "random guitar tabs", a "random guitar chords" and a "random bass tabs" threads.
Any help would be greatly appreciated.
Kars10
12-08-2002, 10:44 AM
How can i display a Random-Thread from a forum of my choice not from all forums???
Help please... ;)
tkeil69575
01-10-2003, 10:12 PM
hi kars,
well i can tell you a primitive method to exclude certain forums, maybe that will help you ;)
just replace:
$randthread = $DB_site->query_first("SELECT threadid,title,replycount
FROM thread
ORDER BY RAND() LIMIT 1");
with
$forumexclude="AND forumid!=8 AND forumid!=34"; // modify to suit
$randthread = $DB_site->query_first("SELECT threadid,title,replycount
FROM thread
WHERE thread.open!=10 $forumexclude
AND visible
ORDER BY RAND() LIMIT 1");as you can see ive also added so that moved threads will not be selected and only visible threads are shown.
greets
tina
ps. if anyone knows are more elegant way for this, please feel free to correct me :D
Kars10
01-11-2003, 05:34 AM
Thanks Tina!!
Works like a charm.... :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.