PDA

View Full Version : Forum Home Enhancements - Posts Last X Hours


Dismounted
01-04-2007, 10:00 PM
Posts Last X Hours

Description:
This mod shows the number of posts created in the last X hours. 'X' is user-specified in the options.

Request Thread:
https://vborg.vbsupport.ru/showthread.php?t=135557

Installation:
All the installation information is in the package.

Changes:
1 Template Edit
1 Plugin
6 Phrases

Change Log:
19/09/2007 - Version 1.1
- Automatic Template Edits
- Updated ReadMe

5/01/2007 - Version 1.0
- Initial Release

Dismounted
01-05-2007, 08:42 AM
/me Reserves

buileminh
01-05-2007, 10:25 AM
Nice! Thanks :)! I am the first, right?

Snake
01-05-2007, 03:00 PM
Thanks for creating this hack. I was hoping if someone could make this. :)

Bounce
01-05-2007, 06:27 PM
Nice one - Installed :cool:

Artificial_Alex
01-05-2007, 08:11 PM
Thank you for fulfilling my request :P

lovelypk
01-06-2007, 12:24 AM
thanks for this kool hack.

Devil Woman
01-06-2007, 05:07 AM
Thanks for this, have been looking for something like this as it can determine how much your site is being used in a way I suppose.

Thanks again

BoYagoob
01-06-2007, 04:23 PM
installed

AdamB
01-10-2007, 04:11 AM
Works great, thank you!

red-dna
01-10-2007, 12:06 PM
Installed.

One question, is it possible to have it in another page e.g. online.php ?

Dismounted
01-11-2007, 03:47 AM
Yes, just do the following.

1) Change the location of the plugin 'Get Info' to global_start.
2) Add the following code where you want it displayed.
<!-- Start Posts Last X Hours Hack -->
<if condition="$vboptions['posts_last_x_hours_enabled'] == 1">
<div>
$posts_last_x_hours
</div>
</if>
<!-- End Posts Last X Hours Hack -->

Done! :)

jarosciak
01-12-2007, 01:47 AM
I changed it just a little bit on my forum, so it shows something like this:

There have been x posts in the last 24 hours, which resolves in estimated average of x posts/month or x posts/year.

Check it out live at: www.goldenretrieverforum.com, at the bottom of the front page.

All I added was this line to xml, right above where it say: $posts_last_x_hours = construct_phrase....:

$in_one_month = $posts_last_x_hours * 30;
$in_one_year = $posts_last_x_hours * 365;

and changed the line below to:

$posts_last_x_hours = construct_phrase($vbphrase['posts_last_x_hours'], $posts_last_x_hours, $vbulletin->options['posts_last_x_hours_numhours'], $in_one_month, $in_one_year);

And then on a display line, again in the same product xml I changed it to:

<phrase name="posts_last_x_hours" date="0" username="" version=""><![CDATA[There have been {1} posts in the last {2} hours, which resolves in estimated average of {3} posts/month or {4} posts/year.]]></phrase>

This change will only work assuming you will always use 24 hour config setting.
Joe

Dismounted
09-19-2007, 06:40 AM
Hack Updated!

19/09/2007 - Version 1.1
- Automatic Template Edits
- Updated ReadMe

glorify
09-13-2008, 12:54 AM
Works in 3.7 :)

RedTrinity
02-16-2009, 10:30 AM
Thanks for a great hack Dismounted!

Could you please tell me how I could position this in another place ie. the template code edit? I'd prefer not to have it done automatically as our forum stats are custom-made to appear in the header instead with the template we are using.

Cheers in advance :)

Dismounted
02-17-2009, 05:23 AM
You will need to change the plugin to run at global_start, and then place this into your header template:
<phrase 1="$posts_last_x_hours" 2="$vboptions[posts_last_x_hours_numhours]">$vbphrase[posts_last_x_hours]</phrase>

ericgray
05-19-2010, 04:25 PM
please invent for 4.0.3!!!

RedTrinity
08-21-2010, 01:43 AM
please invent for 4.0.3!!!

+1... for all versions of 4.0 :)

RedTrinity
09-30-2011, 11:44 PM
BUMP! Still waiting for a re-release for 4.0+ :)