Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 



       myfreeforum.org Forum Index -> Portal components
Alz

Javascript Clock (Portal) (In 20 steps!)

To get a clock like this: http://artsofwarforums.myfreeforum.org/index.php (Just above "Topic Title") follow these instructions:

1) Go to your Admin Panel -> 3. Styles -> Portal Settings
2) Click on the portal named: BLANK
3) Change the name to: JSCLOCK or CLOCK
4) Change the title to: Clock
5) On the Show Title bit, tick the No radio box
6) Click on "Create New Portal"
7) Go to Admin Panel -> 3. Styles -> Edit Templates/Logos
8. Click on your template, and press Submit
9) Go down to the bottom of the page to: Choose Portal template File to Edit
10) Find "cms_jsclock.tpl" or "cms_clock.tpl"
11) Click Submit
12) Replace ALL the code with:
Code:
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<tr>
<td class="row1" align="center">
<span id="tP">&nbsp;</span>
<script type="text/javascript">
function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+0); return x; }
function tN(){ return new Date(); }
function lZ(x){ return (x>9)?x:'0'+x; }
function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; }
function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; }
function dT(){ document.title=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }
function aP(x){ return (x>11)?'PM':'AM'; }
function y4(x){ return (x<500)?x+1900:x; }
var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),oT="dN[tS().getDay()]+' '+tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+y4(tS().getYear())+' '+':'+':'+' '+lZ(tH(tS().getHours()))+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+aP(tS().getHours())";
if(!document.all){ window.onload=dT; }else{ dT(); }
</script>
</td>
</tr>
</table>

13) Press submit
14) Go to: Admin Panel -> 3. Styles -> Edit Templates/Logos
15) Click on your template and press Submit
16) Find "index_body.tpl" press Submit
17) Find this:
Code:
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
   <th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>
   <th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
   <th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_POSTS}&nbsp;</th>
   <th class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
  </tr>.....

18. Put before it: {MYFF.JSCLOCK} or {MYFF.CLOCK}
19) Press submit
20) Your done!
Nick(NR)

We have a live clock and the days date is on the forum?

absolutely pointless.
Alz

And? The otherone looks rubbish! And its harder to edit the code...

Nick(NR)

how is it harder, you go and find the forumlink class definition in either the overall header or the css file and change or create a new one and as for looking rubbish it's set to look like the forum category titles

It's completely editable, not that I think you bothered to find out by tweaking.

Anyone with an ounce of css knowledge can change it's appearance, I chose to make it look like the forum categories to tie it in with the forums chosen template, rather than have them not see it because it's black text on a black background.
Alz

But what if someone doesn't know CSS?
Nick(NR)

Then they can request a new color from me on portalogy, I would be more than happy to do it with a guide on changing it.

       myfreeforum.org Forum Index -> Portal components
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum