View Full Version : Thread of the day
Kentaurus
02-06-2004, 10:00 PM
With this hack you can select a thread of the day
The thread of the day is a thread randomly picked from all threads STARTED
the day before. Then the thread of the day appears at your forumhome.
You can customize different options in the threadoftheday.php file, for the people that installed my member of the day hack this one is very similar, but it selects a thread instead of a member to show at the forum home.
*Update* For showing always the thread with most replies instead of a random thread: https://vborg.vbsupport.ru/showpost.php?p=476239&postcount=14
Info for hackers:
You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org (../) at least, there is no
need to pm me asking for permission
Some portions of the code are (c) Jelsoft Enterprises Ltd.
Kentaurus
02-07-2004, 12:17 AM
here are the options:
These are your private forums, you can set a comma separated list here to skip your private forums from being considered for thread of the day. Sorry about not using the permission code for the forums here, I don't think it is such a hassle to type your private forums here.
$restrictedForums = "0";
Only threads with these number of replies will be considered. Take in consideration that since you can only select newly created threads they might not have a lot of replies.
$replies = 0;
Thread of the day selects threads from yesterday (ie, 1 day ago), but you can change these to select threads from the last week, last month or whatever.
$dateline = 1;
In the front page a preview of the thread appears. By default I am using 200 characters (that is enough for filling the screen). You can set this number to anything (well, almost.. don't set it to a negative value)
$charspreview = 200;
Boofo
02-07-2004, 12:23 AM
Can we incorporate this into the member of the day so it will do it all in one shot? ;)
AN-net
02-07-2004, 12:33 AM
nice, hack
/me clicks install!
edit:
i typed in restricted forums and its still grabbing from there
Kentaurus
02-07-2004, 12:36 AM
nice, hack
* AN-net clicks install!edit the threadoftheday.php file to customize it, there are some variables you might want to change (they are detailed in the second post)
You are looking for this:
$restrictedForums = "0";
write a comma separated list of the forums that will be restricted, either because they are private or because you don't want them to be considered. For example:
$restrictedForums = "4,77,99";
that will skip forums with id 4, 77 and 99. If you don't know how to look for the forumid you can do so when you enter the forum, it appears at the top in the location bar of your browser. (forumid=xxx) or (f=xxx)
Um.. mysteriously your post changed ;)
Kentaurus
02-07-2004, 12:39 AM
nice, hack
* AN-net clicks install!
edit:
i typed in restricted forums and its still grabbing from thereRun the cron job again as it already selected the thread of the day
Can we incorporate this into the member of the day so it will do it all in one shot? Yes, but that would be merging the two php files and the two file edits at index.php.... almost the same as hacking them separately :) And maybe some people only want one of the hacks.
AN-net
02-07-2004, 12:53 AM
thanks alot:D
gmarik
02-07-2004, 11:01 AM
Yes, this one SHOULD be integrated in one hack.
Random attachemt, quote and photo would be perfect in one system!
Dean C
02-07-2004, 11:32 AM
Very nicely implemented making use of vB's datastore and schedule tasks :)!
Mike Gaidin
02-12-2004, 08:56 PM
Nice feature. I like it a lot.
/me clicks install.
Mike Gaidin
02-12-2004, 11:29 PM
Is there a way to add a feature to this that displays something like a Top New Thread of the Day? It might be a way to help encourage new threads to blossom instead of die out.
Chris-FH
02-13-2004, 01:58 AM
Nice hack...
BUT...
Is it possible, to show a random thread, so every refresh the thread changes?
C.
Kentaurus
02-13-2004, 01:58 PM
Is there a way to add a feature to this that displays something like a Top New Thread of the Day? It might be a way to help encourage new threads to blossom instead of die out.What is a top new thread of the day? Is it the thread created yesterday that had most posts?
Nice hack...
BUT...
Is it possible, to show a random thread, so every refresh the thread changes?
C.That would be another hack... this is a cached thread for optimal resource use, but I can write a random version also.
Kentaurus
02-13-2004, 02:10 PM
For showing always the thread with most replies instead of a random thread use this file instead of threadoftheday.php
Please note, this doesn't make a single thread to always appear in the top of the page because only threads started the day before are considered, so there is a new pool of threads each day.
Chris-FH
02-13-2004, 03:26 PM
That would be another hack... this is a cached thread for optimal resource use, but I can write a random version also.
That would be nice. My members will thank you... :)
C.
sabret00the
04-02-2004, 02:54 PM
ok not sure what's the easiest way to ask this so i'll just ask.
i'd like this to use only threads that have been active in the past 7 days but not a thread that has been chosen within the past 14 days, does this already do this?
RaZor Edge
04-02-2004, 03:08 PM
Would be great if we can actualy select the thread we like to show on the forum home page... (can be like this vb2 hack -- https://vborg.vbsupport.ru/showthread.php?t=53170)
James Collins
04-05-2004, 09:44 PM
I agree.
Is an avatar supposed to show up as well? If so is it restricted in size as your pic has one, yet I cant get one to show in our development forum.
Anyway also to make the horizontal size match so it takes up less space, and match with the default forum styles. Excellent hack just not keen on the size.
Nj?rd Eriksson
04-06-2004, 10:34 AM
It's a great hack.
Style improvement. Replace the threadoftheday template with:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onClick="return toggle_collapse('forumhome_threadoftheday')"><img id="collapseimg_forumhome_threadoftheday" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_threadoftheday].gif" alt="" border="0" /></a>
Top Thread of the Day
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_threadoftheday" style="$vbcollapse[collapseobj_forumhome_threadoftheday]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_link.gif" alt="Top Thread of the Day" border="0" /></td>
<td class="alt1" colspan="0"><div class="smallfont">
<table class="alt1" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td><img src="image.php?$session[sessionurl]u=$tday[postuserid]" height="100"></td>
<td>
<span class="smallfont"><b>Top Thread of the Day:</b> <a target="_top" href="showthread.php?$session[sessionurl]t=$tday[threadid]">$tday[title]</a><br/><br/>
<b>Posted by:</b> <a href="member.php?$session[sessionurl]u=$tday[postuserid]">$tday[postusername]</a><br/>
<b>Posted on:</b> $tday[dateline]<br/><br/>
<b>Preview:</b> $tday[pagetext]</span>
</td>
</tr>
</table>
</div></td>
</tr>
</tbody>
</table>
<br/>
This controls the size of the avatar, by the way:
<img src="image.php?$session[sessionurl]u=$tday[postuserid]" height="100">
Replace height="100" with the pixel height you want.
@Kentaurus: Can one actually get this thing somehow to parse URLs and smilies? :)
I agree that a possibility to select the thread of the day would be a good addition.
deaconxgp
04-06-2004, 03:49 PM
can you have more than one thread of the day?
deaconxgp
04-06-2004, 03:51 PM
oh wait..someone said you CAN NOT select what is Thread of the Day :(
James Collins
04-06-2004, 11:02 PM
Anyway also to make the horizontal size match so it takes up less space, and match with the default forum styles. Excellent hack just not keen on the size.
Nj?rd Eriksson! Your a star :D
Nj?rd Eriksson
04-10-2004, 07:59 PM
@Kentaurus: Your hack is not displaying selectable avatars (offered by the board), just those that have been uploaded by members.
It tries to load an image in that case but fails to do so. Also, if no avatar is selected, the hack tries to retrieve an image and fails to do so. Do you have a fix for this? :)
dreamhost
04-10-2004, 10:01 PM
could we please have a vs. where we could input the thread id# and have the admin choose the thread of the day?
deaconxgp
04-13-2004, 01:07 PM
^yeah what he said..even though the original poster said "You can choose thread of the day" ..my understanding is that you can't??? you might wanna change those words if this is just a random generator...
but i'd really like to be able to choose which thread is thread of the day.
NexVision
04-20-2004, 04:38 PM
k ran into one problem the avatars are not showing in the thread of the day any help would be appreciated
and i cant upload the screenshots its like its there but only shows a black box
NexVision
04-22-2004, 08:14 AM
k ran into one problem the avatars are not showing in the thread of the day any help would be appreciated
and i cant upload the screenshots its like its there but only shows a black box
ok did some more digging and realized that users who have uploaded there own avatars show on the thread of the day however if they r using one of the standard avatars I give them then it does not show the avatar
Edric
09-06-2004, 01:43 PM
I installed the hack, compliments to Kentaurus and Njörd Eriksson. Well done!
rex_b
09-06-2004, 03:17 PM
could we please have a vs. where we could input the thread id# and have the admin choose the thread of the day?
ditto!!!!!!
weaver
10-07-2004, 03:49 AM
Does this take into consideration usergroup permissions?
Neutral Singh
11-01-2004, 08:30 AM
can you have more than one thread of the day?
I am sure this will take a little SQL Query... Please could someone help me out.
Reeve of shinra
11-03-2004, 03:20 AM
Anyone made this into a cmps block yet?
index
01-04-2005, 11:55 AM
Hi there
I liked this hack a lot, but it'll work like this Hack (https://vborg.vbsupport.ru/showthread.php?t=53170) in old 2.3.x versions it'll very nice
this old hack works like this:
the Admin select how much threads he want to be the "Thread of the day", and it'll show in a table with all the selected Thread's it has been selected from the Admin
plus I did the timming of the selected Thread's OPEN so, it'll show as much as it have been selected from the Admin, with scrolling text not table
can it be done like that ??
waiting a reply
MauriceReed
01-25-2005, 03:48 PM
installed this one, yet im having the same problems with the avatars.....people who have uploaded their own get to see the avatar, but when selected from the boards own avatars, nothing shows up.....
My members just love this mod. Is it possible to choose the topic of the day based on the number of views versus the number of replies?
I noticed that when there is a smilie used in the topic of the day, the smilie does not show up only the name of the smilie. Is there a way to fix this?
It uses to much space... :(
Flow Fusion
02-26-2005, 03:55 AM
Is it a way to place this @ the bottom of your forum?
commTRU
08-10-2005, 04:37 PM
I too am having the same problem with the avatar.. If anyone knows how to fix it, it would be greatly appreciated :)
lewisbeech
08-11-2005, 01:30 PM
problem:
when i try to manually run the cron, i get this error:
threadoftheday
Warning: main(/includes/cron/threadoftheday.php): failed to open stream: No such file or directory in /admincp/cronadmin.php on line 56
Fatal error: main(): Failed opening required '/includes/cron/threadoftheday.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aq2zbea/public_html/admincp/cronadmin.php on line 56
why is this and how do i fix it?
Thanks
Lewis
p.s great hack!
Dreiko
12-04-2005, 06:32 PM
I would be nice if someone port this to 3.5 =)
McMendo
11-03-2006, 04:45 PM
Is there anything similar for 3.6?
Nordraserei
11-15-2006, 05:23 AM
Thread of the Day
Fatal error: Call to a member function on a non-object in /homepages/14/d156229142/htdocs/theoak/includes/cron/threadoftheday.php on line 23
Any ideas?
gastone_2005
03-07-2007, 08:04 PM
Thread of the Day
Fatal error: Call to a member function on a non-object in /homepages/14/d156229142/htdocs/theoak/includes/cron/threadoftheday.php on line 23
Any ideas?
Same problem! any ideas?
Is there still support for this hack or not?
If there is, plz help us!
Sparkey
05-03-2007, 11:00 AM
That would be another hack... this is a cached thread for optimal resource use, but I can write a random version also.
I would love you forever if you could do this. I've been looking for a hack like this for 6 months! Does anyone know of a hack that does this already?
Sparkey
05-03-2007, 08:09 PM
Same problem! any ideas?
Is there still support for this hack or not?
If there is, plz help us!
Same problem also could not find an answer to this but if anyone has any ideas I would really appreciate their help as I have to get this mod to work!!! Thanks.
Sparkey:confused:
Sparkey
05-04-2007, 07:03 AM
Please can anyone help. I have the following mod which is for version 3.0.0 of vBulletin, by my board is version 3.6.5. Can anyone convert it or explain how to convert it? This mod should do exactly what I want (if it works), it should show a random thread refreshing every minute from only 1 particular forum posted in the past 2 days. If anyone knows of a similar mod that would be easier than converting this code then Id be happy with that, but I cant find any! At the moment it gives me an error cron Fatal error: Call to a member function on a non-object in /**/**/**/**/includes/cron/threadoftheday.php on line 23.
All help will be much appreciated.
Thanks in advance
.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.