View Full Version : Forum Display Enhancements - Insert Thread Date into threadbit - for knowing when thread was originally posted
SiMateoAko
01-14-2007, 10:00 PM
We've all experienced it... that user who finds threads 3 years old and resurrects them by posting a bizarre reply.
Other users usually fall for it too, and suddenly this three year old discussion is back from the dead, causing all sorts of confusion.
This product will insert the date of the original thread date in the threadbit plugin. This means that it will show up during searches and while viewing all threads in a forum.
In theory this will remove some of the confusion.
Included:
1 product - 2 plugins
Import the product and you should be ready to roll.
This product is not supported, and will only be updated if a confirmed bug is reported. Tested on 3.6.4 using the default threadbit template.
Brought to you courtesy of the folks at www.igusto.net
Changes:
1-15-2007
Removed redundant plugin
used native vbulletin date formating instead of php date formatting.
bertwrld
01-15-2007, 04:44 AM
First Post
Installed
Distance
01-15-2007, 05:22 AM
Nice work
*clicks install*
trancetopia
01-15-2007, 06:43 AM
Very handy - thanks.
Barakat
01-15-2007, 06:47 AM
many thanks
Zagis
01-15-2007, 07:17 AM
Nice and simple!
Installed!
sensimilla
01-15-2007, 07:22 AM
I was wondering why theres no such hack already. It shopuld be default vbulletin option.
Thanks alot! clicks installed.
staff80
01-15-2007, 08:36 AM
/me installed
Thanks for job.
Changed one item in product to make it work on UK time ( = date('d-n-Y',)
clicked install
KURTZ
01-15-2007, 09:55 AM
INSTALLED!
anywares
01-15-2007, 09:58 AM
Might install this.......only time will tell...... >_>
Hornstar
01-15-2007, 11:56 AM
Could you upload the image else where because i cant seem to see it very clearly because of vb resizing it too small.
thanks.
Smoothie
01-15-2007, 12:51 PM
I was wondering why theres no such hack already.
There is:
https://vborg.vbsupport.ru/showthread.php?t=103430
rasp187
01-15-2007, 01:10 PM
Installed and working great. Thanks!
calorie
01-15-2007, 01:11 PM
Thanks SiMateoAko, but you don't need the search_results_query_threads plugin, and you can use vbdate($vbulletin->options['dateformat']... instead of date('n-d-Y'... for the date. See here (https://vborg.vbsupport.ru/showpost.php?p=1067977&postcount=2) and here (https://vborg.vbsupport.ru/showpost.php?p=858009&postcount=7) for alternatives. Just an FYI IIRC, date-in-threadbit originally came as part of Kirby's hack here (https://vborg.vbsupport.ru/showthread.php?t=93074).
KURTZ
01-15-2007, 02:00 PM
<font color="SeaGreen">UPDATED!</font>
SiMateoAko
01-15-2007, 02:35 PM
Thanks SiMateoAko, but you don't need the search_results_query_threads plugin, and you can use vbdate($vbulletin->options['dateformat']... instead of date('n-d-Y'... for the date. See here (https://vborg.vbsupport.ru/showpost.php?p=1067977&postcount=2) and here (https://vborg.vbsupport.ru/showpost.php?p=858009&postcount=7) for alternatives. Just an FYI IIRC, date-in-threadbit originally came as part of Kirby's hack here (https://vborg.vbsupport.ru/showthread.php?t=93074).
yeah, I realized I didn't need the search_results_query_threads plugin this morning, and i also utilized the vbdate function this morning too. Looks like you missed the update :)
I'm still learning all of the ins and outs of vbulletin functions.
NFLfbJunkie
01-15-2007, 03:08 PM
Very nice; installed.
AMG021
01-15-2007, 03:58 PM
nice hack i love it
sensimilla
01-15-2007, 05:34 PM
There is:
https://vborg.vbsupport.ru/showthread.php?t=103430
yeah, but this one doesnt require file edits.
Smoothie
01-15-2007, 09:13 PM
yeah, but this one doesnt require file edits.Read through the thread before speaking. That one doesn't either. :)
SiMateoAko
01-16-2007, 03:34 AM
Read through the thread before speaking. That one doesn't either. :)
it actually requires a template edit. This one doesn't. :)
sensimilla
01-16-2007, 12:12 PM
it actually requires a template edit. This one doesn't. :)
He was probably reffering to this post at the end of the thread.
https://vborg.vbsupport.ru/showpost.php?p=1125183&postcount=22
Great hack. Thanks.
Changed one item in product to make it work on UK time ( = date('d-n-Y',)
clicked install
What item did you change?
How do I change the color of just this date alone?
SiMateoAko
01-18-2007, 05:30 AM
Great hack. Thanks.
What item did you change?
How do I change the color of just this date alone?
It should work now with your native forum time.
To change the color, do the following.
Open the plugin entitled insert thread date into template
It should look like this:
if (THIS_SCRIPT == ('search' || 'forumdisplay')) {
$vbulletin->templatecache['threadbit'] = str_replace(
'$thread[postusername]</span>',
'$thread[postusername]</span> <span class=\"time\">($thread[threaddate])</span>',
$vbulletin->templatecache['threadbit']
);
}
As you can see, I use the "time" class to color code it. Change it to whichever class you want. If you want to make it a custom color, like RED, the code could look like this:
if (THIS_SCRIPT == ('search' || 'forumdisplay')) {
$vbulletin->templatecache['threadbit'] = str_replace(
'$thread[postusername]</span>',
'$thread[postusername]</span> <span style=\"color: #FF0000;\">($thread[threaddate])</span>',
$vbulletin->templatecache['threadbit']
);
}
Thanks SiMateoAko for the quick reply.
I have another question. :o
My forum is right to left so the brackets are messed up with members who use English names. Could you tell me how to remove them?
Eq4bits
01-18-2007, 07:38 PM
Installed and really like this, but, the date is BOLD, anyway to make it not bold? I haven't been able to locate it in the threadbit template at all, or anywhere else in the templates.
SiMateoAko
01-18-2007, 08:17 PM
Thanks SiMateoAko for the quick reply.
I have another question. :o
My forum is right to left so the brackets are messed up with members who use English names. Could you tell me how to remove them?
I'm assuming this is an example of what you're talking about?
http://www.ms-saudi.com/forum/forumdisplay.php?f=22
I have no idea how I so easily found that being as I cannot read Arabic (I assume it's arabic). I guess I'm just used to vbulletin.
Anyway, that'll be an easy fix.
in your insert thread date into template plugin, change the code to look like this:
if (THIS_SCRIPT == ('search' || 'forumdisplay')) {
$vbulletin->templatecache['threadbit'] = str_replace(
'$thread[postusername]</span>',
'<span class=\"time\">($thread[threaddate])</span> $thread[postusername]</span>',
$vbulletin->templatecache['threadbit']
);
}
of course, change your SPAN tags as needed as mentioned above.
SiMateoAko
01-18-2007, 08:22 PM
Installed and really like this, but, the date is BOLD, anyway to make it not bold? I haven't been able to locate it in the threadbit template at all, or anywhere else in the templates.
Look in your insert date into template plugin that is associated with this product. You can change your class there.
It currently uses the "time" class to format the text.
Eq4bits
01-18-2007, 10:11 PM
thanks! that did it, changed 'time' to 'smallfont'
looks much better :D
Display how many days old the thread is:
Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:
$startparts = explode('/', vbdate('m/d/Y', $thread['dateline'], true));
$endparts = explode('/', vbdate('m/d/Y', TIMENOW, true));
$startdate = gregoriantojd($startparts[0], $startparts[1], $startparts[2]);
$enddate = gregoriantojd($endparts[0], $endparts[1], $endparts[2]);
$days = ($enddate - $startdate == 0) ? '< 1' : $enddate - $startdate;
if ($thread['dateline'])
{
$thread['threaddate'] = vbdate($vbulletin->options['dateformat'], $thread['dateline'], 1);
$thread['threaddate'] = $thread['threaddate'] . " $days day(s) old";
}
(http://img390.imageshack.us/my.php?image=threaddateig6.gif)
NFLfbJunkie
08-03-2007, 03:13 AM
Is there a way to make the date a tad bit smaller font?
SuperTaz
08-03-2007, 03:19 AM
Installed. Good work
hugh_
08-15-2007, 10:03 AM
Is possible to do any of the following with this hack?
1. Show the thread age next to the thread title not the name of the person who started it.
2. Remove the brackets
3. Add it to the output of forumdisplay as well as the result of a search
Thanks...
Dave Hybrid
10-24-2007, 09:06 PM
Display how many days old the thread is:
Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:
$startparts = explode('/', vbdate('m/d/Y', $thread['dateline'], true));
$endparts = explode('/', vbdate('m/d/Y', TIMENOW, true));
$startdate = gregoriantojd($startparts[0], $startparts[1], $startparts[2]);
$enddate = gregoriantojd($endparts[0], $endparts[1], $endparts[2]);
$days = ($enddate - $startdate == 0) ? '< 1' : $enddate - $startdate;
if ($thread['dateline'])
{
$thread['threaddate'] = vbdate($vbulletin->options['dateformat'], $thread['dateline'], 1);
$thread['threaddate'] = $thread['threaddate'] . " $days day(s) old";
}
Could you explain how to do this better please.
I cannot find anywhere to edit this code, thread_bit process doesn't exist.
Thank you.
momo2
10-31-2007, 12:04 PM
Installed, this is very useful thanks...
KURTZ
12-25-2007, 07:55 PM
runs on 3.7.0B3 :D
realsumon
01-07-2008, 07:32 AM
is it possible like this
http://forums.digitalpoint.com/forumdisplay.php?f=5
Only Shows Thread age. Looks Nice. also it's shows after Thread. not after user name.
senaia
01-07-2008, 05:47 PM
Display how many days old the thread is:
Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:
$startparts = explode('/', vbdate('m/d/Y', $thread['dateline'], true));
$endparts = explode('/', vbdate('m/d/Y', TIMENOW, true));
$startdate = gregoriantojd($startparts[0], $startparts[1], $startparts[2]);
$enddate = gregoriantojd($endparts[0], $endparts[1], $endparts[2]);
$days = ($enddate - $startdate == 0) ? '< 1' : $enddate - $startdate;
if ($thread['dateline'])
{
$thread['threaddate'] = vbdate($vbulletin->options['dateformat'], $thread['dateline'], 1);
$thread['threaddate'] = $thread['threaddate'] . " $days day(s) old";
}
Working perfect but how to make it show "Today" instead of "< 1 days old" ?
Also "Yesterday" instead of "2 days old".
OR
Not to show anything if the thread was created today or yesterday.
realsumon
01-08-2008, 05:14 AM
Hi I'm afraid that's not a function. This would require custom code. For help with that, please search or ask on www.vbulletin.org. Best Regards, vBulletin Support Team
now who will help. i came vb.org..here nobody reply.. please refer me another website.
anybody here wanna help me i will pay.
i need same
http://forums.digitalpoint.com/forumdisplay.php?f=5
Hi I'm afraid that's not a function. This would require custom code. For help with that, please search or ask on www.vbulletin.org. Best Regards, vBulletin Support Team
now who will help. i came vb.org..here nobody reply.. please refer me another website.
anybody here wanna help me i will pay.
i need same
http://forums.digitalpoint.com/forumdisplay.php?f=5
I will help. Get in touch.
Dave Hybrid
01-18-2008, 04:42 PM
I will help. Get in touch.
PM me if you can do this too please.
realsumon
01-18-2008, 07:02 PM
Thanks Everybody - i paid one coder - he solved my problem.
Dave Hybrid
01-18-2008, 07:34 PM
Thanks Everybody - i paid one coder - he solved my problem.
Can you PM me, share the wealth! :D
ctfortner
02-05-2008, 03:11 PM
so far so good on 3.6.8
LouiseWilson
02-05-2008, 04:19 PM
installed thanks :)
Bubble #5
02-14-2008, 08:32 PM
3.7 compatible?:confused:
Boofo
02-14-2008, 10:11 PM
Yep. ;)
I have even updated it on my site to show 1 day old and 2 days old, etc. after the thread title. ;)
Bozza
02-18-2008, 02:08 PM
Very helpful - thanks!
chaser.nl
04-16-2008, 06:33 PM
verry nice !
/me clicks install
Paul Stenning
06-01-2008, 04:03 PM
Works fine in 3.7.1 - thanks
Sonyuserforum
01-12-2009, 05:26 AM
What about vB 3.8.0 Gold? Anyone installed this successfully?
KEKforce
01-15-2009, 10:06 PM
What about vB 3.8.0 Gold? Anyone installed this successfully?
Yes works with 3.8.0 gold
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.