vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Insert Thread Date into threadbit - for knowing when thread was originally posted (https://vborg.vbsupport.ru/showthread.php?t=136551)

SiMateoAko 01-14-2007 10:00 PM

Insert Thread Date into threadbit - for knowing when thread was originally posted
 
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.

TTG 01-15-2007 09:50 AM

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

Quote:

Originally Posted by sensimilla (Post 1159636)
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 and here for alternatives. Just an FYI IIRC, date-in-threadbit originally came as part of Kirby's hack here.

KURTZ 01-15-2007 02:00 PM

<font color="SeaGreen">UPDATED!</font>

SiMateoAko 01-15-2007 02:35 PM

Quote:

Originally Posted by calorie (Post 1159771)
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 and here for alternatives. Just an FYI IIRC, date-in-threadbit originally came as part of Kirby's hack here.

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

Quote:

Originally Posted by Smoothie (Post 1159751)

yeah, but this one doesnt require file edits.

Smoothie 01-15-2007 09:13 PM

Quote:

Originally Posted by sensimilla (Post 1159998)
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

Quote:

Originally Posted by Smoothie (Post 1160167)
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

Quote:

Originally Posted by SiMateoAko (Post 1160340)
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....3&postcount=22

Kadi 01-17-2007 07:45 AM

Great hack. Thanks.

Quote:

Originally Posted by TTG (Post 1159686)
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

Quote:

Originally Posted by Kadi (Post 1161261)
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:

Code:

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:


Code:

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']
                  );
}


Kadi 01-18-2007 06:56 AM

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

Quote:

Originally Posted by Kadi (Post 1161989)
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:

Code:

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

Quote:

Originally Posted by Eq4bits (Post 1162430)
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

Eric 04-03-2007 11:03 PM

Display how many days old the thread is:

Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:

PHP Code:

$startparts explode('/'vbdate('m/d/Y'$thread['dateline'], true));
$endparts   explode('/'vbdate('m/d/Y'TIMENOWtrue));
$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";



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

Quote:

Originally Posted by SecondV (Post 1219339)
Display how many days old the thread is:

Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:

PHP Code:

$startparts explode('/'vbdate('m/d/Y'$thread['dateline'], true));
$endparts   explode('/'vbdate('m/d/Y'TIMENOWtrue));
$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

Code:

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

Quote:

Originally Posted by SecondV (Post 1219339)
Display how many days old the thread is:

Edit the "fix thread dates" plugin in "threadbit_process", replace everything with:

PHP Code:

$startparts explode('/'vbdate('m/d/Y'$thread['dateline'], true));
$endparts   explode('/'vbdate('m/d/Y'TIMENOWtrue));
$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

Code:

http://forums.digitalpoint.com/forumdisplay.php?f=5


All times are GMT. The time now is 05:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01521 seconds
  • Memory Usage 1,852KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete