vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Show number of days since forum came online! (https://vborg.vbsupport.ru/showthread.php?t=137197)

KingPuyol 01-21-2007 10:00 PM

Show number of days since forum came online!
 
This is an idea I got from somewhere.
It will show the number of days, hours, minutes and seconds since your forum came online in the forum statistics area below.


First open counter.txt, and change the date you opened the forum from the setcountup, and change all what you want until by following all what's written on the counter.txt file.

After that you will need to edit 1 templates:

In FORUMHOME, find:
Code:

                        <div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
After if add:
Code:

[THE CONTENT OF counter.txt]

Then click save and your done.

KingPuyol 01-22-2007 05:07 AM

Show your support so that I can make some real mods.

Feckie (Roger) 01-22-2007 05:39 AM

This Post Shows The Years As Well As Accounts for leap Years,

Here :rolleyes:

KingPuyol 01-22-2007 07:22 AM

Hehe, I didn't know you posted. :)

tekstylez 01-23-2007 02:24 PM

mind telling me where to upload counter.txt

Feckie (Roger) 01-23-2007 02:59 PM

Quote:

Originally Posted by tekstylez (Post 1165776)
mind telling me where to upload counter.txt

In Forum Home Template Find
Code:

<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
Add The Following After


Code:

<script type="text/javascript" language="JavaScript">

//modified by Feckie December 10th 2005 (to show years)

//modified by Feckie Jan 18th 2006
        //fixed years problem
        //rewrite math
        //account for leapyear
        //account for year/years text




/* ?![CDATA[ */
function setcountup(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}
//////////CONFIGURE THE countup SCRIPT HERE//////////////////
//STEP 1: Configure the date to count up from, in the format year, month, day:
//This date should be less than today

setcountup(2004,10,24)

//STEP 2: Configure text to be attached to count up
var displaymessage="since $vboptions[bbtitle] - Forums came online!"
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
var countupwidth='95%'
var countupheight='20px' //applicable only in NS4
var countupbgcolor='alt1'
var opentags='<span class="smallfont">'
var closetags='</span>'
//////////DO NOT EDIT PASS THIS LINE//////////////////
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countup(){
if (document.layers)
document.countupnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
countup()
}
if (document.all||document.getElementById)
document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
window.onload=start_countup
function countup(){
var today=new Date()

var todayy=today.getYear()

if (todayy < 1000)
todayy+=1900

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec       

paststring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(todaystring)-Date.parse(paststring)

        var daysInYear

        if ((todayy % 4)==0)
        {
                daysInYear=366;
        }
        else
        {
                daysInYear=365;
        }

years=Math.floor(((((dd/1000)/60)/60)/24)/daysInYear)
compDays=Math.floor((((dd/1000)/60)/60)/24)
days=Math.floor(((((dd/1000)/60)/60)/24)-(years*daysInYear))
compHours=Math.floor(((dd/1000)/60)/60)
hours=Math.floor((((dd/1000)/60)/60)-(compDays*24))
compMinutes=Math.floor((dd/1000)/60)
minutes=Math.floor(((dd/1000)/60)-(compHours*60))
compSeconds=Math.floor(dd/1000)
seconds=Math.floor((dd/1000)-(compMinutes*60))

        var yearText=""

        if (years > 1 || years < 1)
        {
                yearText="years";
        }
        else
        {
                yearText="year";
        }

if (document.layers){
document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+years+ " "+yearText+", "+days+ " days, "+hours+" hours, "+minutes+" minutes, and "+seconds+" seconds "+displaymessage+closetags
setTimeout("countup()",1000)
}
/* ]]? */
</script>


theFAILURE 01-23-2007 03:28 PM

Works great, i'd rather it says the days instead of years myself ;)

arena 01-23-2007 09:01 PM

The Tukish for phrase please?
2 Years, 1 days, 0 hours, 43 minutes, and 54 seconds since :: Forum :: - Forums came online

Replace The code

harmor19 01-24-2007 06:00 AM

Thanks for the hack.

o0Hubba0o 01-24-2007 07:30 PM

Quote:

Originally Posted by theFAILURE (Post 1165806)
Works great, i'd rather it says the days instead of years myself ;)

This one has it as days, it's a product and you can put it where ever you like.

Great work none the less on the hack, not my prefered style though.


All times are GMT. The time now is 06:54 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.01080 seconds
  • Memory Usage 1,748KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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