Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-29-2012, 09:25 PM
Floyd R Turbo Floyd R Turbo is offline
 
Join Date: Sep 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Detailed Datestamp Display Option AND Timestamp on posts for VB4.2

I found this thread that answered the question of "is it possible"

https://www.vbulletin.com/forum/show...display+option

But that thread is outdated.

I wish to be able to have each post display the detailed info (23 minutes ago, 3 days ago, 2 weeks ago, etc) AND the "normal" date/time stamp on each post. I like the former function, but when you get past 7 days everything is lumped into "1 week ago" etc and I hate that. Hybrid/dual functionality is what I want and you can't have both without making a plugin.

I know there is probably a solution out there, can someone point me to it?

Thanks
Reply With Quote
  #2  
Old 11-30-2012, 01:35 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The link you posted doesn't work, and I'm not sure I understand. Are you looking for a way to do it without using a plugin, or do you need the plugin updated for vb4?
Reply With Quote
  #3  
Old 11-30-2012, 01:44 AM
Floyd R Turbo Floyd R Turbo is offline
 
Join Date: Sep 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry try it now.

This thread describes exactly what I want to do - be able to have posts display both the "detailed" and "normal" time stamp at the same time.
Reply With Quote
  #4  
Old 11-30-2012, 02:25 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, if you create a plugin using hook postbit_display_complete and code like this:
Code:
$this->post['postdate_normal'] = vbdate($this->registry->options['dateformat'], $this->post['dateline']);

Then you can use {vb:raw post.postdate_normal} and it will always be the "actual" (normal) date. As you can probably see by looking at the existing template, {vb:raw post.postdate} will be the "detailed" date (if you have that set in the options), and {vb:raw post.posttime} will contain the time.
Reply With Quote
  #5  
Old 11-30-2012, 04:24 AM
Floyd R Turbo Floyd R Turbo is offline
 
Join Date: Sep 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. You are talking to a complete newbie to vBulletin though so I will try to see if I can get this figured out...but be prepared for stupid questions!!!

--------------- Added [DATE]1354253981[/DATE] at [TIME]1354253981[/TIME] ---------------

Alright. I tried it and it did not work. I went to Plugins & Products -> Add New Plugin
Product: vBulletin
Hook Location: postbit_display_complete
Execution order: 5 (default, did not change)
Code: as stated
Pluging Active: yes
Save and reload clicked

No change on forum.
i went into Setting -> Options -> Date and Time and toggled back and forth between 'normal' and 'detailed' and it just works as if the plugin is not there, so what was that plugin supposed to do or what am I missing?
Reply With Quote
  #6  
Old 11-30-2012, 01:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The plugin just makes the "normal" date available even if you have "detailed" selected. To see any change you need to edit your postbit or postbit_template and insert {vb:raw post.postdate_normal} where you want the normal date to appear.

So if you're using postbit_legacy (post info on the left side) then you could edit that template and find this section:

Code:
<vb:else />
	<span class="date">{vb:raw post.postdate}<vb:if condition="!$show['detailedtime']">,&nbsp;<span class="time">{vb:raw post.posttime}</span></vb:if></span>
</vb:if>
and maybe change it to this:

Code:
<vb:else />
	<span class="date">{vb:raw post.postdate}<vb:if condition="!$show['detailedtime']">,&nbsp;<span class="time">{vb:raw post.posttime}</span><vb:else /><vb:if condition="isset($post[postdate_normal])"><vb:if condition="$post[postdate_normal] !== $post[postdate]">&nbsp;{vb:raw post.postdate_normal}</vb:if>,&nbsp;<span class="time">{vb:raw post.posttime}</span></vb:if></vb:if></span>
</vb:if>
Reply With Quote
  #7  
Old 11-30-2012, 01:58 PM
Floyd R Turbo Floyd R Turbo is offline
 
Join Date: Sep 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet, I think that worked!!

I replaced that code section, turned the plugin on, and set the date/time to detailed and they both show up!

One odd thing I did notice is that the detailed stamp disappears off all posts that 2 weeks or older, and just the normal date/time stamp shows up. Odd.
Reply With Quote
  #8  
Old 11-30-2012, 02:05 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Floyd R Turbo View Post
One odd thing I did notice is that the detailed stamp disappears off all posts that 2 weeks or older, and just the normal date/time stamp shows up. Odd.
The function that does the yesterday, one week ago, etc, seems to only go to 5 weeks, then it just displays the normal date. If you're seeing a cutoff of 2 weeks, I can't explain that. Are you sure it's 2 weeks?
Reply With Quote
  #9  
Old 11-30-2012, 02:35 PM
Floyd R Turbo Floyd R Turbo is offline
 
Join Date: Sep 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh I know why. I installed the forum and started some posts under moderator forums to test things out, then made the site live to the public just over a week ago. So there are no posts that are equal to or greater than 2 weeks old, except for a handful of threads that are greater than 5 weeks old. So the 5+ wk old thread just show the time/date. Of note, the "detailed" datestamp function for posts over 5 weeks old defaults to only the date, and leaves off the time of the post. I don't like that function either, this fix solves that as well

Thanks so very much!!!
Reply With Quote
  #10  
Old 11-30-2012, 02:49 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Floyd R Turbo View Post
Of note, the "detailed" datestamp function for posts over 5 weeks old defaults to only the date, and leaves off the time of the post. I don't like that function either, this fix solves that as well
Yeah, I changed that on purpose because otherwise the time just "disappeared" when the date was 5 weeks old, and it looked strange. The default code didn't display the time at all if you had "detailed" selected, which seemed odd.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:24 AM.


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.04375 seconds
  • Memory Usage 2,272KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete