Jump to content

Kibit

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by Kibit

  1. Ok don't matter, I have sussed it.... <?php $now = date("D_H:00"); *SNIP* $shows['Sat_15:00']['title']= file_get_contents('/home/*****/public_html/*****/data/sat-1500-1600.txt'); $shows['Sat_16:00']['title']= file_get_contents('/home/*****/public_html/*****/data/sat-1600-1700.txt'); $shows['Sat_17:00']['title']= file_get_contents('/home/*****/public_html/*****/data/sat-1700-1800.txt'); *SNIP* ECT ETC every hour for 7 days *SNIP* echo $shows[date("D_H:00")]['title']; ?> Is working exactly as I wanted.
  2. OK I'll Try.... I have several files (database may well be better but this is what's already in place and working) Each file is just simply a plain text document example structure of these files... sun-0000-0100.txt sun-0100-0200.txt sun-0200-0300.txt and so on, a file for every hour of everyday for 7 days These files are editable via an already in place php script so I can allow others (other admins and its in a protected area of the site) to edit online the content of each file. Then lets say I wanted to display the contents of sunday-0000-0100.txt on 2 seperate pages of the site, no problem I simply add <php> <?php $point = file_get_contents('/home/*****/public_html/*****/data/sunday-0000-0100.txt'); echo $point; ?> </php> In the place I want the content to show on any of my pages and as its a plain text file the formatting does follow that of the page I inserted the above code into. That is all in place and working exactly as I need/want it to. Now on another part of the site we have timed content using the code I provided above, here it is again... <php> <?php $now = date("D_H:00"); *SNIP* $shows['Sat_15:00']['title']="15:00 - 16:00 SHOW INFO"; $shows['Sat_16:00']['title']="16:00 - 17:00 SHOW INFO"; $shows['Sat_17:00']['title']="17:00 - 18:00 SHOW INFO"; *SNIP* ECT ETC every hour for 7 days *SNIP* echo $shows[date("D_H:00")]['title']; ?></php> So when the visitor comes to the site they are displayed correct info for that hour, this is refreshed to keep the content the correct hour when a user saying on the same page over an hour using ajax but I digress, this part is also already up and running as needed. What I want to do for a differant area of the site is combine the 2, so the end user is delivered the content of the relivant txt file instead of the ['title']="INFO HERE" information. Make sense?
  3. but the "file_get_contents('/home/*****/public_html/*****/data/sat-1500-1600.txt'));" will be differant for each hour I know this is not going to work in my example but you should get the idea.... <?php $now = date("D_H:00"); *SNIP* $shows['Sat_15:00']['title']="<?php $point = file_get_contents('/home/*****/public_html/*****/data/sat-1500-1600.txt'); echo $point; ?>"; $shows['Sat_16:00']['title']="<?php $point = file_get_contents('/home/*****/public_html/*****/data/sat-1600-1700.txt'); echo $point; ?>"; $shows['Sat_17:00']['title']="<?php $point = file_get_contents('/home/*****/public_html/*****/data/sat-1700-1800.txt'); echo $point; ?>"; ETC ETC *SNIP* echo $shows[date("D_H:00")]['title']; ?> Remember this is just a small snippet where is says etc etc the same code continues for on the hour 7 days a week. The idea being that I can edit the individual txt files and the info will change across the site at any point I decide to insert any particular "edit point" Hope that makes sense
  4. I currently use this time related content php script... <?php $now = date("D_H:00"); *SNIP* $shows['Sat_15:00']['title']="15:00 - 16:00 SHOW INFO"; $shows['Sat_16:00']['title']="16:00 - 17:00 SHOW INFO"; $shows['Sat_17:00']['title']="17:00 - 18:00 SHOW INFO"; *SNIP* echo $shows[date("D_H:00")]['title']; ?> What I want/need to add is this line <?php $point = file_get_contents('/home/*****/public_html/*****/data/sat-1500-1600.txt'); echo $point; ?> I have tried this.... <?php $now = date("D_H:00"); *SNIP* $shows['Sat_15:00']['title']="<?php $point = file_get_contents('/home/*****/public_html/*****/data/sat-1500-1600.txt'); echo $point; ?>"; $shows['Sat_16:00']['title']="16:00 - 17:00 SHOW INFO"; $shows['Sat_17:00']['title']="17:00 - 18:00 SHOW INFO"; *SNIP* echo $shows[date("D_H:00")]['title']; ?> Which does not work! now as you've prob guessed by the fact I even tried that I'm not very good at this php! So what do I need to change to make it show the info from the .txt files?
  5. Kibit

    Is this possible?

    DnB = Drum and Bass (Music Genre) Its simply a webpage (using a mixture of HTML/PHP/JavaScript/Flash) with a chatroom on it, I have full control over the website. Basically press the button on one page and be alerted on another. Any Ideas?
  6. Kibit

    Is this possible?

    What I want to do is have a "Reload/Rewind" Button on a DnB radio chatroom page. When someone presses said button I'd like a small alert somehow on the DJ Only Page that all DJ's log into when playing live. That's the basic principle and I'd be happy with that, things that would be nice; 1)To have some kind of flood control (like MSN nudges can't be sent to often) 2)When more than one person presses it the alert would display a count 3)To have the alert disappear after a set amount of time. Is this even possible?
  7. Can anyone tell me what I need to add where in the following JavaScript to add +6 Hours onto the time It displays please... <script type="text/javascript"> var currenttime = '<? print date("F d, Y H:i:s", time())?>' var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December") var serverdate=new Date(currenttime) function padlength(what){ var output=(what.toString().length==1)? "0"+what : what return output } function displaytime(){ serverdate.setSeconds(serverdate.getSeconds()+1) var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear() var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds()) document.getElementById("servertime").innerHTML=datestring+" "+timestring } window.onload=function(){ setInterval("displaytime()", 1000) } </script> <p><b>Current Server Time (+6 hours):</b> <span id="servertime"></span></p>
  8. I've created a form and need help getting it to actually work. Here is what I have done so far... http://www.kibit.co.uk/form.html Thanks in advance to anyone who offers help.
  9. I currently using this code to display timed content... <?php $now = date("D_H:00"); //Sun $shows['Sun_18:00']['title']="Bla Bla Bla"; $shows['Sun_19:00']['title']="Bla Bla Bla"; ***SNIP*** echo $shows[date("D_H:00")]['title']; ?> Since I'm already calling the server time and on the hour as well I was wondering if there was anything I could add to this to make the page reload on the hour so even if a visitor stays on the site during change they are allways delivered the correct content?
  10. Wonder if any of you kind people could help me please... I currently have this code... <?php $now = date("D_H:00"); //snip $shows['Thu_04:00']['title']="4am till 5am Show"; $shows['Thu_05:00']['title']="<img src="/images/now%20playing%20scroller%20images/auto_gman_next.gif" width="150" height="30" />"; //snip echo $shows[date("D_H:00")]['title']; ?> Which works fine for the 4am line as its plain text, but gives me a parse error for the 5am line as I've tried to insert some simple html to show an image. Is there a bit of php code I can use instead of the html line so i don't get this parse error?
  11. Thanks for the help. Gone with this... <html> <head><title>Test PHP Script</title></head> <body> <?php $shows['Thu_14:00']['title']="8pm till 9pm Show"; $shows['Thu_15:00']['title']="9pm till 10pm Show"; $shows['Thu_16:00']['title']="10pm till 11pm Show"; $shows['Thu_17:00']['title']="11pm till 12am Show"; //etc echo $shows[date("D_H:00")]['title']; ?> </body> </html> Which is working well, but! Is there anyway to do an else echo to echo a $shows['Anytime I've not specified']['title']="Now playing: Auto Pilot Next Live show Thursday 8pm"; EDIT: BTW: The times are offset to account for the server time being -6hrs!
  12. I want to be able to display basic html formatted text at certain times of certain days. This will be displaying currently playing information for a radio website. So what I need is the ability to display.. say.. Monday @ 8pm "DJ Bla Bla" Monday @ 9pm "DJ XYZ" I'm hopeing to simply use the server time (+6hrs) to achive this and also that its written in something like php/html (anything that does not require java or any other non standard plugin to be installed) Can anyone help with this? I've been given this reply to start with from a friend of mine... But how do I include day of the week? I dont really need the full date just day of the week and time.
  13. Bump, Can anyone offer me any further help on this please.
  14. I now have a basic working page using the following code... <?php $xml = simplexml_load_file("http://www.wsad.co.uk/tm/ajax.php?plugin=Website&autologin=true&server_id=1"); echo $xml->getName() . "<br />"; foreach($xml->children() as $child) { echo $child->getName() . ": " . $child . "<br />"; } ?> The page is here.. http://www.wsad.co.uk/tm/test.php But as you can see that just outputs everything and I only want to show a couple of the details as outlined in the first post, Also where there are more than 1 result (I think its called an "array") such as... <players> − <item> <span class='tm-b'>[WSAD]<span style='color:#0f0'>Harding</span></span> </item> </players> Its not returning any results. Any further help would be very gratefully received and since I noticed your on a donation drive I could be convinced to donate ;-)
  15. Assuming your using windows a great starting point for you would be to take a look at xampp Not sure on the rules of linking to external sites on these forums and since I'm new here I don't want to be seen to be spamming so I won't link you to it just google "xampp" and you'll be on your way.
  16. Thanks for the quick reply, that clears the error but I now just get a plain white page, How do I now tell it what info I want to display?
  17. Thanks but it seems not simple enough for a n00b like me.. Here is what I've done.. <?php $xml = http://www.wsad.co.uk/tm/ajax.php?plugin=Website&autologin=true&server_id=1; echo $xml->name[0]->plot; // "So this language. It's like..." ?> And I get If someone could just get me started with a basic working bit of php I'm sure I'll be able to work it out.
  18. I have to be honest, I have absolutely no idea how to go about this but I think for someone who's done this sort of thing before I'd be a 2 sec doddle of a job. I want to pull some info (but not all) out of an XML file Here is the file.. http://www.wsad.co.uk/tm/ajax.php?plugin=Website&autologin=true&server_id=1 And all I wanna pull out is <name> <type> <currentchallenge> <players> If someone could code that in php with a plain text output I would be extremely grateful.
×
×
  • 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.