Jump to content

Need help with website timezone converter for events


Gilera

Recommended Posts

Greetings All

Let me begin by saying I am quite new to development and this is my first website. I have learnt a bit of html and css which i have used for the site.
I plan on trying to take on some more languages, to delevop my site further in the future, But would like any advice or feedback which could help me with this problem or point me in the right direction.

Basically the issue is A part of my site has got a events schedule. The Problem has been the time for the events. i would like to set the time of each event to the Users timezone automatically. Below is basic code of what i have been using. which has been doing this using the scirpt in the

<li class="time">

but i need to change the scripts time for every event... The issue being to me


1) Would this not load the script for each event? Slowing down the site loading?

2)How could i possibly tweak the code to remove the script from the

<li class="time">

and put it on the page to only load once. Then change it to ie.

<li class="time">4:45pm</li>

and that automatically changes to the users time from whats entered to there own Timezone from the script being loaded once on the page at the top of the page?
 

<div class="programme">

             <ul class="guides">

                <a href="domain/xxxxx.php" class="guides" style="display : block; color: black; background-color: transparent;">

                    <li class="icon"><img src="images/event/????.png" alt="Schedule" width="26" height="27" class="icon"/></li>

                    <li class="time"><script>"src="http://www.thetimezoneconverter.com/js/ttzc.js"></script><script>new TTZC.Widget({  version:'inline',  t:'4:45 PM',tz:'London'}).display();</script></li>

                    <li class="game">Team A vs Team B</li>

                    <li class="location">Venue</li>

              </a>

         </ul>

</div>

If that doesnt seem possible, is there some where i can be pointed in to find out more or learn about what languages would be needed to be able to just write out the info in a database like this below which the website can pull down the info and place each variable in the correct place in the html code and css. Basically making it a bit more automated that the code is there and i just need to provide the info.


Info(a href),    Event             Time            Game                       Location
xxxxx.php      ????.png        06:00pm     Team A vs Team B          Field B
yyyy.php       ????.png        07:30pm     Player A vs Player B        Table 1
zzzz.php        ????.png        07:30pm     Player A vs Player B        Table 2
hhhh.php       ????.png        07:30pm     Player A vs Player B        Table 3



Any help will be greatly appreciated, And being new to this any thing i dont understand in your replies i will try research more info on so i may provide you with the info or understand what you saying.

Thank you
Kind Regards

 

Link to comment
Share on other sites

the <script ... tag, which loads the external javascript, is only needed once (usually in the <head></head> of the HTML document.) the correct syntax should be -

<script type='text/javascript' src='http://www.thetimezoneconverter.com/js/ttzc.js'></script>

you can then put any number of instances of the widget on your page - 

<script>new TTZC.Widget({  version:'inline',  t:'4:45 PM',tz:'London'}).display();</script>

the point of php (or any other server side language) is to dynamically produce and output the markup/content that makes up a web page. wherever your source time data is stored, you would retrieve it, loop over it, and echo the above line of markup, replacing the static time in the  t:'4:47 PM' parameter with each successive value from your data.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.