News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Live clock in header

Started by Joker™, September 02, 2010, 10:47:59 AM

Previous topic - Next topic

NanoSector

Quote from: Joker™ on December 04, 2010, 05:07:26 AM
Quote from: Idiotji on December 04, 2010, 04:25:40 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.

Quote from: Yoshi2889 on December 04, 2010, 04:43:49 AM
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 / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Joker™

Quote from: Yoshi2889 on December 04, 2010, 05:12:56 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 ;).
Github Profile
Android apps
Medium

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's get microwaved

NanoSector

Quote from: Joker™ on December 04, 2010, 07:20:00 AM
Quote from: Yoshi2889 on December 04, 2010, 05:12:56 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 / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Idiotji

@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

Joker™

Quote from: Idiotji 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.
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:
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

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



Replace it with:
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>';
Github Profile
Android apps
Medium

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's get microwaved

Idiotji

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

Joker™

Quote from: Idiotji on December 06, 2010, 12:14:41 AM
Even though you are not fast now days
Work pressure my friend work pressure ;)
Github Profile
Android apps
Medium

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's get microwaved

DSK-Googler

 i cant find this in silent wave theme/index.template.php


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

Be my friend on facebook 


   
http://facebook.com/profile.php?id=100001290082093

NanoSector

Quote from: sureshdsk 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>';
Search for $context['current_time'] .
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Joker™

Quote from: sureshdsk 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>';


Solution is just 2 posts above you
http://www.simplemachines.org/community/index.php?topic=398860.msg2871706#msg2871706
Github Profile
Android apps
Medium

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's get microwaved

DSK-Googler

Be my friend on facebook 


   
http://facebook.com/profile.php?id=100001290082093

jekwumoore

This is good code,thanks for the info
we rule the world

Joker™

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
Github Profile
Android apps
Medium

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's get microwaved

beast44

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

hcfwesker

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

thanx a lot! :)

Joker™

Quote from: beast44 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
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)

Quote from: hcfwesker on January 21, 2011, 12:46:44 AM
Works brilliantly, as do all your modifications, Joker™!

thanx a lot! :)
Your welcome :).
Github Profile
Android apps
Medium

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's get microwaved

beast44

#96
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?

:-[ :-[

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

Joker™

Try this code

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


Replace it with:
  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>';
Github Profile
Android apps
Medium

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's get microwaved

beast44

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

Joker™

Glad it got sorted for you :P.
Github Profile
Android apps
Medium

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's get microwaved

Advertisement: