vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Postbit last date and time online (https://vborg.vbsupport.ru/showthread.php?t=300025)

justicechick 07-11-2013 10:00 PM

Postbit last date and time online
 
1 Attachment(s)
Postbit last date and time online


This is a simple mod that will place the last date and time online in the postbit.

Installation:

(1) Product To Upload Via:
Acp > Plugins & Products > Manage Products > Add/Import Product
(1) Simple Template To Edit Via:
Acp > Styles & Templates > postbit or postbit_legacy template


This works on 4.0.0 up to 4.2.1 (see attached pics of 4.2.1)

https://vborg.vbsupport.ru/external/2013/07/2.jpg?2Date and time in postbit

https://vborg.vbsupport.ru/external/2013/07/1.jpg?1 Date only in postbit


If you wish to only use the last date online in the postbit, without the time, use the XML titled LastdatePB

DemOnstar 07-12-2013 11:26 AM

That did the trick.....

One question, is it possible to take out the time of day? Currently it reads

Last Online:1 Minute Ago @ 12:24

How do I change it to read Last Online:1 Minute Ago

Thanks for all you have done....

Edit: Nevermind, common sense really, I figured it out...

Cheers...

justicechick 07-12-2013 01:37 PM

Quote:

Originally Posted by DemOnstar (Post 2433318)
That did the trick.....

One question, is it possible to take out the time of day? Currently it reads

Last Online:1 Minute Ago @ 12:24

How do I change it to read Last Online:1 Minute Ago


Thanks for all you have done....

Edit: Nevermind, common sense really, I figured it out...

Cheers...

Great! Im glad it worked for you. :)

goxy63 07-12-2013 04:16 PM

Any ideas how much this will slow down page load?

Also how to show just today, yesterday,... 100days ago?

Thank you

justicechick 07-12-2013 04:37 PM

Quote:

Originally Posted by goxy63 (Post 2433369)
Any ideas how much this will slow down page load?

Also how to show just today, yesterday,... 100days ago?

Thank you

This is the first modification I have attempted, and its a pretty simple modification. Im sorry though that option isnt available with this modification. As far as slowing down the page load , there has been none noticed since the installation of this on my board.

justicechick 07-12-2013 11:28 PM

For those that may have already installed this , have updated the zipfile. If you only want to use the last date online in the postbit please use the following code.

<!-- LAST ONLINE DATE START -->
<vb:if condition="$post['lastactivity']">
<dt>{vb:rawphrase last_online_activity}</dt><dd>{vb:raw post.lastactivity_date} </dd>
</vb:if>
<!-- / LAST ONLINE DATE END -->

DemOnstar 07-13-2013 03:39 AM

Good job justicechick... Keep it up..

Jonm 07-16-2013 02:37 PM

done...

Jonm 07-16-2013 02:38 PM

But how can I remove the AM/PM part?

justicechick 07-20-2013 11:39 PM

Quote:

Originally Posted by Jonm (Post 2433955)
But how can I remove the AM/PM part?

Use the "LastdatePB" XML that is included in the zip

and use the following when modifying your template.

<!-- LAST ONLINE DATE START -->
<vb:if condition="$post['lastactivity']">
<dt>{vb:rawphrase last_online_activity}</dt><dd>{vb:raw post.lastactivity_date} </dd>
</vb:if>
<!-- / LAST ONLINE DATE END -->

Spangle 09-08-2013 08:17 AM

Good little snippet this

Bubble #5 09-20-2013 01:56 AM

Where do we shorten the phrase "minutes" to "min" ?

It is too long and breaking up. Thanks :)

Adam Wood 09-24-2013 02:41 AM

The examples are in the legacy postbit. Anyone know if this works in the horizontal postbit?

justicechick 09-25-2013 11:06 PM

Quote:

Originally Posted by Bubble #5 (Post 2446816)
Where do we shorten the phrase "minutes" to "min" ?

It is too long and breaking up. Thanks :)

This is something that is actually done within vbulletin itself and not it the plugin.

The steps to do so are as follows.

Admincp> Styles and Templetes> Replacement Variable > add new variable.

You would then select the style theme you want to change the variable in (change each one you use if you want consistency) Enter The text to be searched : Minutes
Enter Text to replace: Mins

You might also want to create one for the word Minute to replace Min

Submit and check your postbit then. Thanks

ozzy47 09-25-2013 11:08 PM

Only problem with that is anywhere the word Minutes shows up, even in posts, it will be changed to Mins.

justicechick 09-25-2013 11:20 PM

Quote:

Originally Posted by ozzy47 (Post 2448007)
Only problem with that is anywhere the word Minutes shows up, even in posts, it will be changed to Mins.

True Ozzy....I meant to include that . Thanks for catching it.

ozzy47 09-25-2013 11:30 PM

What you could do is create a new plugin.
  1. Log into the ACP.
  2. On the side menu expand "Products & Plugins"
  3. Click on "Plugin Manager"
  4. At the very bottom there is a link to "Add New Plugin"
  5. On that page put in the following information-

    Product: vBulletin (this should be default)
    Title: Replace Minutes In Postbit
    Hook: postbit_display_complete (from a drop-down list)
    Execution Order: 5 (default value)
Code:

$vbulletin->templatecache['postbit_legacy'] = str_replace('Minutes','Mins',$vbulletin->templatecache['postbit_legacy']);
I tested this with the word Minutes directly in the postbit, and it works, I did not test it with this mod, but it should work.

justicechick 09-26-2013 12:42 AM

Quote:

Originally Posted by Adam Wood (Post 2447611)
The examples are in the legacy postbit. Anyone know if this works in the horizontal postbit?

Here is the proof for horizontal postbit. https://vborg.vbsupport.ru/external/2013/09/19.png

Bubble #5 09-26-2013 01:24 AM

Quote:

Originally Posted by ozzy47 (Post 2448007)
Only problem with that is anywhere the word Minutes shows up, even in posts, it will be changed to Mins.

DOH!!! Now I've got to change it back :p

ozzy47 09-26-2013 01:26 AM

Quote:

Originally Posted by Bubble #5 (Post 2448025)
DOH!!! Now I've got to change it back :p

You can use this method instead, https://vborg.vbsupport.ru/showpost....9&postcount=17

Bubble #5 09-26-2013 01:37 AM

THANKS Ozzy, appreciate you taking the time to write that up :up:

ozzy47 09-26-2013 01:39 AM

Not a problem, glad to help. :)

justicechick 09-27-2013 06:50 AM

Quote:

Originally Posted by ozzy47 (Post 2448009)
What you could do is create a new plugin.
  1. Log into the ACP.
  2. On the side menu expand "Products & Plugins"
  3. Click on "Plugin Manager"
  4. At the very bottom there is a link to "Add New Plugin"
  5. On that page put in the following information-

    Product: vBulletin (this should be default)
    Title: Replace Minutes In Postbit
    Hook: postbit_display_complete (from a drop-down list)
    Execution Order: 5 (default value)
Code:

$vbulletin->templatecache['postbit_legacy'] = str_replace('Minutes','Mins',$vbulletin->templatecache['postbit_legacy']);
I tested this with the word Minutes directly in the postbit, and it works, I did not test it with this mod, but it should work.

Thanks for taking the time to do that Ozzy. When I posted this I thought that I had warned users this was my first attempt at anything like this. :confused: Looking back now, I see that I seems to have not included that warning ....LOL

Thanks for looking out and lending a helping hand to us all... :up: Much appreciated!

I did check this out though with and without the code you supplied and I couldnt get it to change it. Im sure that I must be missing something.
https://vborg.vbsupport.ru/external/2013/09/15.png

ozzy47 09-27-2013 09:23 AM

I dunno, as I said I did not try this with your mod, I will a bit later today when I get home from work and see what's going on.

Bubble #5 09-27-2013 04:12 PM

Quote:

Originally Posted by justicechick (Post 2448308)
I did check this out though with and without the code you supplied and I couldnt get it to change it. Im sure that I must be missing something.

I don't think it's on your end justicechick. It's not working here either. I eventually changed the phrase but not sure if that's the safe thing to do :cool: I'm sure ozzy will figure it out.

ozzy47 09-27-2013 07:47 PM

Yeah I will look into it, it may be how the plugins run in order. I will look somtime either tonight, or tomorrow, got alot going on ATM.

justicechick 10-01-2013 07:56 PM

Quote:

Originally Posted by Bubble #5 (Post 2448379)
I don't think it's on your end justicechick. It's not working here either. I eventually changed the phrase but not sure if that's the safe thing to do :cool: I'm sure ozzy will figure it out.

Thanks Bear lol...just making sure,


All times are GMT. The time now is 06:28 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.01245 seconds
  • Memory Usage 1,779KB
  • 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
  • (2)bbcode_code_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete