Gilera Posted October 10, 2013 Share Posted October 10, 2013 Greetings AllLet 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 me1) 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 Locationxxxxx.php ????.png 06:00pm Team A vs Team B Field Byyyy.php ????.png 07:30pm Player A vs Player B Table 1zzzz.php ????.png 07:30pm Player A vs Player B Table 2hhhh.php ????.png 07:30pm Player A vs Player B Table 3Any 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 youKind Regards Quote Link to comment https://forums.phpfreaks.com/topic/282855-need-help-with-website-timezone-converter-for-events/ Share on other sites More sharing options...
mac_gyver Posted October 10, 2013 Share Posted October 10, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282855-need-help-with-website-timezone-converter-for-events/#findComment-1453366 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.