vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Forum online since... (https://vborg.vbsupport.ru/showthread.php?t=102363)

funinthesun 12-06-2005 06:08 PM

Forum online since...
 
I've done a search but can't seem to find what I'm looking for? Perhaps it's because I'm not sure what I should be looking for! ;)

It's a simple forum home mod that shows a counter of how long your forum has been online. I've seen it on a couple of vb forums and would like to have it on mine.

Thanks :)

Nakor 12-06-2005 08:32 PM

When you say online do you mean since it was installed or since it last went down/crashed?

Feckie (Roger) 12-06-2005 09:33 PM

Try This In Your Body Section

Code:

<html>

<head>
<title>Test Site</title>
<meta name="generator" content="Namo WebEditor v6.0">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

<CENTER>


<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<TABLE border=2 cellspacing=0 cellpadding=3>
<TR><TD bgcolor="#000044">
<FONT color="#4400ff" face=georgia,arial size=+1>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(document.title);
//-->
</SCRIPT>
</TD></TR>
<TR><TD bgcolor="#440000">
<FONT size=-1 color="#ff0000" face="trebuchet MS","arial">
<FONT color="#ff8800">Page Created:</font>

<!-- Put the page creation date, here.  -->

October 5, 2005

<BR>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie(name) {
var exp = new Date();
FixCookieDate (exp);
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
if (cval != null)
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var cookie_date=new Date(document.lastModified);
var expdate = new Date();
expdate.setTime(expdate.getTime()+(5*24*60*60*1000));
document.write("<Font color=ff8800>" + "Last updated: "+ "</font>" +document.lastModified);
document.write("");
if (!(cookie_date == GetCookie("cookie_date"))){
SetCookie("cookie_date",cookie_date,expdate);
document.write("<font color='yellow'><br>Site has changed since last visit!</font><br>");
}
// End -->
</SCRIPT>
</FONT>
</TD></TR>
</TABLE>
</CENTER>


<!-- Script Size:  2.64 KB  -->

</body>

</html>


Andreas 12-06-2005 09:37 PM

As the data is kinda static:
Why not just put it is as "Online since xx/xx/xxxx"?

funinthesun 12-06-2005 09:48 PM

THIS is a forum that has what I'm looking for :)

peterska2 12-06-2005 10:03 PM

that works ok, but it doesn't look so great when you get to over a year.

funinthesun 12-06-2005 10:13 PM

Lol, no true but my forum is new and has only been online for approx 6 weeks :)

peterska2 12-06-2005 10:17 PM

I'll see if I can improve the code I've got at all to take into account months and years, and release it sometime in the next few days.

funinthesun 12-06-2005 10:26 PM

Thanks for the code Feckie (it does work) but it's most definately not what I was looking for! Look at the link to the forum and you will see what I mean. It's at the bottom of the page :)

Thanks peterska, I love all of your mods! :D

Boofo 12-06-2005 11:25 PM

That's a javascript mod that I had on my old vb 3.0 site that I haven't added to the new site. I'll hunt it down and get it released somehow. :(

Oblivion Knight 12-07-2005 06:45 AM

Quote:

Originally Posted by funinthesun
THIS is a forum that has what I'm looking for :)

http://rainbow.arch.scriptmania.com/...s/countup.html

:)

funinthesun 12-07-2005 02:39 PM

How would I intergrate that code to make it look like the counter on the forum I posted a link to above? I've seen a couple of vb forums with this counter so I know it's out there somewhere!

Feckie (Roger) 12-07-2005 03:41 PM

Quote:

Originally Posted by funinthesun
THIS is a forum that has what I'm looking for :)


Yep try Kal's styles it in the plugin

Here

funinthesun 12-07-2005 08:16 PM

Ah, yes that is it but how do I take just that part of the code and put it on my forum?

Feckie (Roger) 12-07-2005 09:11 PM

Quote:

Originally Posted by funinthesun
Ah, yes that is it but how do I take just that part of the code and put it on my forum?


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:

<div>
<script type="text/javascript" language="JavaScript1.2">
/* ?![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(2005,10,24)

//STEP 2: Configure text to be attached to count up
var displaymessage="since $vboptions[bbtitle] 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)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)

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+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags

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

</div>

Find In Above
Code:

//////////CONFIGURE THE countup SCRIPT HERE//////////////////
?kall


To Set Your Start Date

Works For Me

peterska2 12-07-2005 09:48 PM

Ok then, to save me a job, can you possibly tell me how to add years to the display? I've put it on mine but it shows obseen amounts of days as my sites been up over 2 years.

Feckie (Roger) 12-08-2005 05:25 AM

1 Attachment(s)
it only shows days.

Unless You Know Javascript ?

peterska2 12-08-2005 09:14 PM

Nope, that's why I'm asking if you do.

Feckie (Roger) 12-10-2005 04:08 PM

Quote:

Originally Posted by peterska2
Nope, that's why I'm asking if you do.

OK in that case..

Code:

<div>
<script type="text/javascript" language="JavaScript1.2">

//modified by FECKIE December 10th 2005

/* ?![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,2)
//STEP 2: Configure text to be attached to count up
var displaymessage="since $vboptions[bbtitle] 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)
dyear=todayy-yr;
dday=Math.floor((dd/(60*60*1000*24)*1)%365)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)

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+dyear+ " year, "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags

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

</div>

Now That Took Me All Day he he

peterska2 12-10-2005 04:24 PM

Much better. Many thanks :)

brunod76 12-12-2005 01:54 AM

Quote:

As the data is kinda static:
Why not just put it is as "Online since xx/xx/xxxx"?
lol, why do it static when you can do it with a bloated / complicated / javascript hack / script? ;)

Especially for a piece of info that never changes....

kall 12-12-2005 03:17 AM

Quote:

Originally Posted by funinthesun
THIS is a forum that has what I'm looking for :)

Thanks for the link, always good to know where the dirty thieves that remove copyright information are. :)

@Feckie: Thank you very much for the Yearly code. It's really much better for those forums over a year old. :D

peterska2 01-07-2006 07:39 PM

Quote:

Originally Posted by Feckie (Roger)
OK in that case..

Code:

<div>
<script type="text/javascript" language="JavaScript1.2">

//modified by FECKIE December 10th 2005

/* ?![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,2)
//STEP 2: Configure text to be attached to count up
var displaymessage="since $vboptions[bbtitle] 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)
dyear=todayy-yr;
dday=Math.floor((dd/(60*60*1000*24)*1)%365)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)

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+dyear+ " year, "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags

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

</div>

Now That Took Me All Day he he


erm..... it works great but the year increased on 01 Jan and it's not supposed to to that till July.

Any ideas?

Feckie (Roger) 01-18-2006 07:29 PM

Quote:

Originally Posted by peterska2
erm..... it works great but the year increased on 01 Jan and it's not supposed to to that till July.

Any ideas?

Ok I Fixed It Phew

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>


peterska2 01-18-2006 09:15 PM

Much better. Many thanks.

rareclownfish 04-05-2006 11:55 PM

Any screen shots of this?

kall 04-06-2006 03:55 AM

Quote:

Originally Posted by kall
Thanks for the link, always good to know where the dirty thieves that remove copyright information are. :)

@Feckie: Thank you very much for the Yearly code. It's really much better for those forums over a year old. :D

DAMN! Now they have the Smooth Blue style.

@rareclownfish: http://www.nzboards.com/forums .. look in the Whats Going On area.

Feckie (Roger) 04-06-2006 05:26 AM

1 Attachment(s)
Quote:

Originally Posted by rareclownfish
Any screen shots of this?


Yep
No Probs

Skavenger 07-28-2007 09:51 AM

is there any way to add months too?
I only want to display years, months and days

desirulez 11-30-2008 04:17 PM

wheres this script go ?

mystikdrmz 11-30-2008 07:26 PM

There is a mod on here in the mod section that adds that to your forum and tells how long your forum has been up and has the date and everything.

fattony69 11-30-2008 08:00 PM

Quote:

Originally Posted by mystikdrmz (Post 1675962)
There is a mod on here in the mod section that adds that to your forum and tells how long your forum has been up and has the date and everything.

T'was taken down because the mod creator got mad.

mystikdrmz 12-01-2008 01:48 AM

oh i see

well i found this one and it still looks up so im not really sure if it is but i suppose its worth checking out and it seems to be what the person wants..

https://vborg.vbsupport.ru/showthread.php?t=177944


All times are GMT. The time now is 05:03 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.01734 seconds
  • Memory Usage 1,849KB
  • 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
  • (7)bbcode_code_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (33)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