Version: 1.0.4, by Boofo
Developer Last Online: Jun 2012
Category: Forum Home Enhancements -
Version: 3.7.x
Rating:
Released: 03-27-2008
Last Update: 05-15-2008
Installs: 240
DB Changes Uses Plugins Template Edits Auto-Templates
Additional Files
No support by the author.
Site Life Status for vB3.7
Version 1.0.4
(By Boofo)
What does this product do?
This product will add a Site Life Status info area, including Site Startup Date, Site Age and a Pagehits counter to your forumhome What's Going On box.
NOTE: The maximum counter value will depend on your system. The maximum signed integer value for 32 bit systems is 2147483647 (or 2,147,483,647), while the maximum signed integer value for 64 bit systems is 9223372036854775807 (or 9,223,372,036,854,775,807). These are the highest numbers this counter will be able to count to, depending on your system.
Version Information:
Version 1.0.1 --Initial release for vB3.7
Version 1.0.2 --Fixed changed variable in the template manual edit code.
Version 1.0.3 --Added phrases for counter. Now fully phrased.
Version 1.0.4 --Counter moved to the datastore. Added setting for the page views start count.
NOTE: You will need to uninstall any previous version and do a clean install of 1.0.4 to upgrade. You will also need to delete the forumhome_pagehits.txt file as it is no longer needed.
Credits:
A big thank you goes out to Shawn Dean for supplying the javascript code for the Site Age counter.
Installation overview:
Products to install: (1)
Templates to edit: (1) - Optional
Files to edit: (1)
Files to Upload: (2)
Images to upload (1)
Installation Instructions:
1. Upload life_status.gif to the images/misc folder on your site.
2. Upload site_life.js to the clientscript folder on your site.
-------------------------------
4. Go to your Admin CP
Scroll down to 'Plugin System'
Click 'Manage Products'
Click 'Add/Import Product'
Click the 'Browse' button, and locate the product-site_lifestatus.xml file on your computer
5. Go to your Admin CP -> vBulletin Options -> Help Site Life Status and set the following options:
--Site Life Status Enable: Enable/Disable the Site Life Status.
--Site Life Status Startup Date: Enter your site startup date.
--Site Life Status Automatic Template Replace: Click yes to have the template automatically edited.
--Update the page views counter to the value below? If you want to change the current page views counter value on forumhome to the value provided below, set this to "Yes" - it will automatically be reset to "No" once the new value has been set (at the next page view).
--Site Life Status Forumhome Page Views Counter: Enter the number of page views, without commas, to start the page views count at. (Example: 16897)
NOTE: You are done unless you opted to do the manual template install. If you chose Site Life Status Automatic Template Replace, there is no need to do the manual template edit in the install file.
Done!
Enjoy!
NOTE: If you do not click install, you do not need support.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
if ($vbulletin->options['site_lifestatus_enable'] AND THIS_SCRIPT == 'index') { $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "datastore SET data = data + 1 WHERE title = 'boofocounter' "); }
Why not
PHP Code:
$db->shutdown_query(" UPDATE " . TABLE_PREFIX . "datastore SET data = data + 1 WHERE title = 'boofocounter' ");
on forumhome_complete?
=> Less code to process less often, yet same result (if you also remove the unnecessary option to turn off the feature -> if users want to turn it off they will simply disable the product).
OK, here's what you do. You go to user id 1's account and look at their join date. Use that as the site start date. Then calculate how many hits you "think" you've had and enter that in the hits setting. This is not rocket science.
if ($vbulletin->options['site_lifestatus_enable'] AND THIS_SCRIPT == 'index') { $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "datastore SET data = data + 1 WHERE title = 'boofocounter' "); }
Why not
PHP Code:
$db->shutdown_query(" UPDATE " . TABLE_PREFIX . "datastore SET data = data + 1 WHERE title = 'boofocounter' ");
on forumhome_complete?
=> Less code to process less often, yet same result (if you also remove the unnecessary option to turn off the feature -> if users want to turn it off they will simply disable the product).
How it that going to process less often? It will still run on every page refresh, right? I am running that in the global_shutdown hook already.
Currently the code is on global_shutdown, eg. being executed on every page.
But due to the condition it does the query only when the current script is index.php (forumhome).
So why not execute it just for index.php and avoid the condition on all other pages?
I don't see a reason for putting the code in a global place when there is an appropriate hook forumhome_complete that has exactly the context you want
I'd remove that from frontend code and handle it completely within ACP:
Make appropriate plugins for the misc.php ACP script and let the user set the start there - no need for an option.
Site Startup Date: January 21, 2008
Site Age: 117 days, 11 hours, 3 minutes and 9 seconds
There have been 17,909 visitors to this page.
Average visits to this page: Hourly: 6, Daily: 152, Weekly: 1,067
Hey Boofo have you tested that average count yet......................it seems a great idea !