PDA

View Full Version : Show number of days since forum came online!


KingPuyol
01-21-2007, 10:00 PM
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:
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>

After if add:
[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 (https://vborg.vbsupport.ru/showpost.php?p=876445&postcount=24) :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
mind telling me where to upload counter.txt

In Forum Home Template Find
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>

Add The Following After


<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.docum ent.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.docum ent.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
Works great, i'd rather it says the days instead of years myself ;)

This one (https://vborg.vbsupport.ru/showthread.php?t=122991) 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.

Deadly Assassin
02-04-2007, 05:54 PM
This is great, thanks :up:

KingPuyol
02-07-2007, 09:03 AM
Thanks and remember to click INSTALL please!

Deadly Assassin
02-10-2007, 03:54 AM
thanks

Excellent stuff

http://www.game-image.com/uploads/0af008520e.jpg

MPDesignZ
02-12-2007, 02:41 AM
Thanks cool :D

MP

pollon
02-13-2007, 06:05 AM
after editing e copying conter.txt in forumhome i get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in D:\Inetpub\webs\funforumit\forum\index.php(539) : eval()'d code on line 134

Rickeo
02-13-2007, 10:41 PM
Sweet thanks

Works fine on this end

masterme
03-01-2007, 02:26 PM
I have a strange prob. It worked fine all the time, but now I get this:
NaN dagen, NaN uren, NaN minuten, etc etc

Any idea what is wrong?

Edit: I probaly found the reason. I updated my Java.
Maybe there is a way to also update this hack so it works for all?

edit2: maybe not the java, because some members claim not to have an update/done nothing and it still is disfunctional. I did not do/add any mods/hacks which can cause this.

clicks uninstall till it has been solved... :(

Dotara
06-13-2007, 10:32 PM
If I add this code to FORUMHOME then vbTrends is not working.

wickedstangs
06-14-2007, 10:06 PM
works on 3.6.7.PL1 (installed)

turbo.:R
06-24-2007, 01:24 AM
i luv this hack...

Kaycee123
07-13-2007, 06:35 AM
I like this - easy to install. Thanks!

bazzup
07-13-2007, 10:35 AM
i have this on the end of mine

forums came online!__________________

how do loose the line bit?

aakhan136
07-14-2007, 06:12 PM
thanks

SliceofLife
07-19-2007, 01:11 AM
Thank you! Even a complete loser like me could do it! Thanks!

Free-D
07-21-2007, 02:41 AM
This one (https://vborg.vbsupport.ru/showthread.php?t=122991) 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.

Less products - less troubles :p

Free-D
07-21-2007, 02:48 AM
Great mod :up:
But I want display only days since forum came online without hours, minutes and seconds.
I just removed hours, minutes and seconds forum this code
if (document.layers){
document.countupnsmain.document.countupnssub.docum ent.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.docum ent.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags

setTimeout("countup()",1000)
}
/* ]]? */
</script></div>


So now it's look like

if (document.layers){
document.countupnsmain.document.countupnssub.docum ent.write(opentags+dday+ " days "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.docum ent.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " days "+displaymessage+closetags

setTimeout("countup()",1000)
}
/* ]]? */
</script></div>


Is it correct? I this not exactly because counter is refreshing one time per secound :confused: What code modifications I also have to do is I want to dislay only since forum came online without hours, minutes and seconds.

BigDog56
07-24-2007, 10:58 AM
Got it installed, works great! I thank you Roger for the update on this mod.

JadedSouls
07-24-2007, 12:11 PM
I did the changes and template edit and it didn't work for me. Nothing showed up :(

Free-D
07-28-2007, 08:19 AM
I did the changes and template edit and it didn't work for me. Nothing showed up :(
Have you enabled JavaScript?

ComputerVitals
05-08-2008, 04:05 AM
How would I make it so it would display years?

example:
4 years, 356 days, 23 hours...

DianaDiana
05-14-2008, 01:21 AM
vBulletin Message
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/content/c/h/r/christee19/html/includes/adminfunctions_template.php(3596) : eval()'d code on line 150

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

militarytuners
05-29-2008, 04:10 AM
In Forum Home Template Find
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>

Add The Following After


<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.docum ent.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.docum ent.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>



Thanks. It works great on my site.

GuaRRand
06-04-2008, 01:30 PM
workx great!

GuaRRand
06-05-2008, 10:06 AM
K, found one thing wrong.

Threads: 1,206, Posts: 26,221, Members: 105, Active Members: 41
Welcome to our newest member, kuip50
1 year, 181 days, 12 hours, 5 minutes, and 1 seconds since GLCOTI.COM came online!
It should show the last 3 members... and we already have new members..they dont show.
The new members registered AFTER i installed the counter thing...

BigDog56
06-15-2008, 02:33 PM
Just reinstalled this in 3.7.1 with TMS and it works like a charm!

PoetJA-1975
06-29-2008, 06:28 AM
Yes! Still works - Thanx again for sharing!
/me Already Clicked Install :P

Jacquii.

Mr. Burns
03-31-2014, 08:11 PM
Anyone know of a version that works in v4.2

Braders
10-03-2014, 07:52 AM
Anyone know of a version that works in v4.2

I just installed it using the code in post #32 by Feckie (Roger) on 4.2.2 and it works like a charm !

akz645
01-07-2016, 12:32 AM
Feckie's code still works on vBulletin 4.2.3!

AdminCP -> Styles & Templates -> Style Manger (http://i.imgur.com/iXCi07K.png) -> Forum Home Templates -> FORUMHOME (edit) (http://i.imgur.com/mb7EAJb.png):

Find:
<p>{vb:rawphrase welcome_to_our_newest_member_x, {vb:link member, {vb:raw newuserinfo}}, {vb:raw newuserinfo.username}}</p>


Add The Following After:
<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.docum ent.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
document.countupnsmain.document.countupnssub.docum ent.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>


Note:
You can edit that parts in red. You can edit more than that, but I wouldn't recommend it if you don't know what you're doing.