Advertisement:
2by2host

Author Topic: Live clock in header  (Read 57914 times)

Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,151
  • Gender: Male
Re: Live clock in header
« Reply #80 on: December 04, 2010, 05:12:56 AM »
yes silent wave is awailable for rc4 they have same code for both but only changed the name i think lolz
Can you show me the link.

Mod package:

removed

Install using the Package Manager.
Only works on 2.0 RC#.

Must install in every theme.
And who gave you the permission to convert it into a mod ? ?
I made this very clear in my very first post that no one is going to convert this into mod as the code is made with the help of one of my friend.
Please remove the package link.
Ah ok sorry, didn't read the post very well...
My Mods / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #81 on: December 04, 2010, 07:20:00 AM »
Ah ok sorry, didn't read the post very well...
Also the edit is very simple, so this should be done manually.

If we serve everything in plate users will become more lazy and will not be able to learn much ;).
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,151
  • Gender: Male
Re: Live clock in header
« Reply #82 on: December 04, 2010, 07:32:44 AM »
Ah ok sorry, didn't read the post very well...
Also the edit is very simple, so this should be done manually.

If we serve everything in plate users will become more lazy and will not be able to learn much ;).
Yes that also is true ;)
My Mods / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline Idiotji

  • Jr. Member
  • **
  • Posts: 173
    • Every Thing Can Be Customized
Re: Live clock in header
« Reply #83 on: December 04, 2010, 11:47:08 PM »
@joker bro here is the link for silent wave for rc4 http://dzinerstudio.com/index.php?action=downloads;sa=downfile&id=87;t=1291524283
i tried all hehehe but all in vain.
http://tekloverz.com
This Time Every Thing Is Customized

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #84 on: December 05, 2010, 12:10:01 AM »
@joker bro here is the link for silent wave for rc4 http://dzinerstudio.com/index.php?action=downloads;sa=downfile&id=87;t=1291524283
i tried all hehehe but all in vain.
The clock is shown to guests only as per the theme  coding, you just have to get the clock code out of that guest loop.

Find:
Code: [Select]
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

echo '
<br />', $context['current_time'],'<br />';
}


Replace it with:
Code: [Select]
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);
}
echo '
',timeformat(time(),'%B, %d, %Y'), '
                                                                      <font id="clock">Loading...</font>
                                                                      <script type="text/javascript">
                                                                      function refrClock()
                                                                      {
                                                                       var d=new Date();
                                                                       var s=d.getSeconds();
                                                                       var m=d.getMinutes();
                                                                       var h=d.getHours();
                                                                       var am_pm;
                                                                       if (s<10) {s="0" + s}
                                                                       if (m<10) {m="0" + m}
                                                                       if (h>12) {h-=12;am_pm = "pm"}
                                                                       else {am_pm="am"}
                                                                       if (h<10) {h="0" + h}
                                                                       document.getElementById("clock").innerHTML=h + ":" + m + ":" + s + am_pm;
                                                                       setTimeout("refrClock()",1000);
                                                                       }
                                                                       refrClock();
                                                                      </script>';
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline Idiotji

  • Jr. Member
  • **
  • Posts: 173
    • Every Thing Can Be Customized
Re: Live clock in header
« Reply #85 on: December 06, 2010, 12:14:41 AM »
Thanks joker bro you are such a great coder  ;)
Even though you are not fast now days you are the best ;D ;D ;D ;D
http://tekloverz.com
This Time Every Thing Is Customized

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #86 on: December 06, 2010, 05:05:24 AM »
Even though you are not fast now days
Work pressure my friend work pressure ;)
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline DSK-Googler

  • Semi-Newbie
  • *
  • Posts: 47
Re: Live clock in header
« Reply #87 on: December 18, 2010, 07:41:32 AM »
 i cant find this in silent wave theme/index.template.php


 echo '
               <li>', $context['current_time'], '</li>
            </ul>';


Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,151
  • Gender: Male
Re: Live clock in header
« Reply #88 on: December 18, 2010, 07:49:11 AM »
i cant find this in silent wave theme/index.template.php


 echo '
               <li>', $context['current_time'], '</li>
            </ul>';
Search for $context['current_time'] .
My Mods / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #89 on: December 18, 2010, 07:58:12 AM »
i cant find this in silent wave theme/index.template.php


 echo '
               <li>', $context['current_time'], '</li>
            </ul>';


Solution is just 2 posts above you
http://www.simplemachines.org/community/index.php?topic=398860.msg2871706#msg2871706
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline DSK-Googler

  • Semi-Newbie
  • *
  • Posts: 47
Re: Live clock in header
« Reply #90 on: December 18, 2010, 08:11:35 AM »
works :) thanks

Offline jekwumoore

  • Semi-Newbie
  • *
  • Posts: 53
Re: Live clock in header
« Reply #91 on: December 19, 2010, 04:24:02 AM »
This is good code,thanks for the info
we rule the world

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #92 on: January 09, 2011, 07:50:18 AM »
I've made a minute change in the code to make it compatible with "W3C Markup Validation" and original post code has been modified accordingly. New code can be found here;
Original post
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline beast44

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
  • So What?
    • stumpburner.com
Re: Live clock in header
« Reply #93 on: January 20, 2011, 05:21:01 PM »
This code is new to me. I'm working with it and learning a little at a time. I will get it right, down the road a ways. Hey! I'm a 67 year old man, that didn't even know what a PC was till about 10 years ago. I'm learning  :D ;D

 :D ;D

Don't have one, Don't want one, Not gona get one

Offline hcfwesker

  • SMF Hero
  • ******
  • Posts: 2,022
  • Gender: Male
  • SMF 2.0.4
Re: Live clock in header
« Reply #94 on: January 21, 2011, 12:46:44 AM »
Works brilliantly, as do all your modifications, Joker™!

thanx a lot! :)

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #95 on: January 21, 2011, 02:14:55 AM »
This code is new to me. I'm working with it and learning a little at a time. I will get it right, down the road a ways. Hey! I'm a 67 year old man, that didn't even know what a PC was till about 10 years ago. I'm learning  :D ;D

 :D ;D
If you require any assistance with the code do post here. (I myself using PC on a serious note from past 3 yrs only :P)

Works brilliantly, as do all your modifications, Joker™!

thanx a lot! :)
Your welcome :).
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline beast44

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
  • So What?
    • stumpburner.com
Re: Live clock in header
« Reply #96 on: January 21, 2011, 07:44:38 AM »
Ok Joker. Please bear with me. I'm not the sharpest nail in the sack. I tried installing what you said and I'm doing something wrong
I'm running SMF 2.0 RC3
 I went in and found

  echo '
            ', $context['current_time'], '.
         </div>';

What part of that do I delete and replace with what? 

 This Is what I would like to show

<iframe src="http://free.timeanddate.com/clock/i2fagq4u/n184" frameborder="0" width="82" height="18"></iframe>

Is that Possable?

 :-[ :-[
« Last Edit: January 21, 2011, 08:11:42 AM by beast44 »

Don't have one, Don't want one, Not gona get one

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #97 on: January 21, 2011, 08:04:15 AM »
Try this code

Find (the code you typed above):
Code: [Select]
  echo '
            ', $context['current_time'], '.
         </div>';

Replace it with:
Code: [Select]
  echo '
            ', timeformat(time(),'%B, %d, %Y'), '
<li id="clock">Loading...</li>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=h + ":" + m + ":" + s + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
// ]]></script></div>';
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.

Offline beast44

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
  • So What?
    • stumpburner.com
Re: Live clock in header
« Reply #98 on: January 21, 2011, 08:19:53 AM »
HEY!!! IT WORKS Thank you, thank you, I'm like a kid with a new bag of candy. With your help I finely did something right

 :D ;D

Don't have one, Don't want one, Not gona get one

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,549
  • Gender: Male
Re: Live clock in header
« Reply #99 on: January 21, 2011, 08:25:43 AM »
Glad it got sorted for you :P.
My Mods
How to enable Post Moderation


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM gets microwaved.