Craig Hopson Posted October 31, 2012 Share Posted October 31, 2012 Hi guys I have been playing with the new windows 8 metro system and tiles i created this test file but cant get it to work as anyone had any dealings with this <?phpif($_GET['id'] == ''){?><!DOCTYPE html><html><head> <meta charset="utf-8" /> <META name="msapplication-badge" content="frequency=30; polling-uri=http://chsites.co.uk/test.php?id=1"/> <title>Test Site</title></head><body> <h1>TwitterRooms</h1> <p>Some content here</p></body></html><?php}else{header("Content-type: text/xml");$xml_output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";$xml_output .= "<badge value="newMessage"/>\n";echo $xml_output;?><?php} Link to comment Share on other sites More sharing options...
niche Posted November 2, 2012 Share Posted November 2, 2012 Why isn't DOCTYPE at the top of your script. Link to comment Share on other sites More sharing options...
thescientist Posted November 2, 2012 Share Posted November 2, 2012 Why isn't DOCTYPE at the top of your script.because he has it in a conditional statement. I assume he only want to output the HTML under the condition that $_GET['id'] is equal to an empty string. to the OP, could you please specify your problem and expectations? Just saying it doesn't work isn't very helpful. You have a conditional. is one part working and one part not? What debugging haver you tried? What about checking for errors? There's not much to go on with what you've given us. Link to comment Share on other sites More sharing options...
niche Posted November 2, 2012 Share Posted November 2, 2012 Point. Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 2, 2012 Author Share Posted November 2, 2012 I can't get it to update on the tile but saying that I tried the Microsoft demo tile and that don't work either so maybe it windows problem Link to comment Share on other sites More sharing options...
thescientist Posted November 2, 2012 Share Posted November 2, 2012 I still have no idea which part of the code is causing you problems. It might be helpful to point us to some documentation, and reference whatever tutorials, references you are using so we can follow along. Does the code work in just a regular browser environment? Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 2, 2012 Author Share Posted November 2, 2012 This is what I was following http://msdn.microsoft.com/en-gb/library/ie/hh880842(v=vs.85).aspx basically if you put meta tages on your site with a polling URL then windows will check your site for updates every 30min looking for XML output I just wanted to test it to see if it would work so I wrote the script above to test it but it didn't work so I post here Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 2, 2012 Author Share Posted November 2, 2012 (edited) https://www.google.co.uk/search?q=windows+8+badge+notifications&ie=UTF-8&oe=UTF-8&hl=en-gb&client=safari#sclient=tablet-gws&hl=en&client=safari&tbo=d&q=windows+8+html+badge+notifications&oq=windows+8+html+badge+notifications&gs_l=tablet-gws.3..35i39j0i22.10501.12309.0.13108.5.5.0.0.0.1.420.1236.0j3j0j1j1.5.0.les%3B..0.0...1ac.1.rPYfJaOPReM&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.&fp=e0bfb33bf2a89ab&bpcl=37189454&biw=1024&bih=644THE TOP HIT Edited November 2, 2012 by Craig Hopson Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2012 Share Posted November 2, 2012 The code you posted has a syntax error in the XML part. Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 2, 2012 Author Share Posted November 2, 2012 That may be the problem then can you repost the script and ill up date it on my server http://chsites.co.uk/test.php Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2012 Share Posted November 2, 2012 Check the quotes in those XML lines, they aren't escaped. Link to comment Share on other sites More sharing options...
thescientist Posted November 2, 2012 Share Posted November 2, 2012 it goes back to the basics.... What debugging haver you tried? What about checking for errors? Does the code work in just a regular browser environment? Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 2, 2012 Author Share Posted November 2, 2012 Feel free to try the script at http://chsites.co.uk/test.php I haven't done any debugging cos I don't see any errors in my script (above) and I there are no errors in my script then it must be a windows problem????? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2012 Share Posted November 2, 2012 I haven't done any debugging cos I don't see any errors in my script (above) and I there are no errors in my script then it must be a windows problem?????Or your script is doing just what you told it to, but you told it to do the wrong thing. Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 3, 2012 Author Share Posted November 3, 2012 Or your script is doing just what you told it to, but you told it to do the wrong thing.Maybe I don't know that's why I posted here for help!!! Link to comment Share on other sites More sharing options...
thescientist Posted November 3, 2012 Share Posted November 3, 2012 https://www.google.c...iw=1024&bih=644 THE TOP HITWhat about adding the META tag? It seems like that's important. They give you a checklist of things to do right at the top. You must provide several pieces of information to correctly implement pinned site notifications in Windows 8 The location of the web service to poll for notifications An up-to-date XML file that reflects the current badge state The frequency with which updates should occur looks you are only implementing 1 of 3. Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 3, 2012 Author Share Posted November 3, 2012 I have the meta tags in the script Link to comment Share on other sites More sharing options...
thescientist Posted November 3, 2012 Share Posted November 3, 2012 (edited) I have the meta tags in the scripttechnically. you have the meta tag in the if clause. your XML output is in the else clause. Are you familiar with how control structures work? Do you know exactly how your code is working? This is why you have to debug. Use it to prove that your code works, or use it to figure out why it isn't. I can prove my point simply by looking at the source of your page when I add ?id=somevalue to your url. All you get is the XML output. i.e http://chsites.co.uk/test.php?id=test (view source)<?xml version="1.0" encoding="utf-8"?><badge value="newMessage"/> If that's not what you intended, then you need to debug and figure out why. Edited November 3, 2012 by thescientist Link to comment Share on other sites More sharing options...
boen_robot Posted November 5, 2012 Share Posted November 5, 2012 Ahhh.... Just... replace header("Content-type: text/xml");$xml_output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";$xml_output .= "<badge value="newMessage"/>\n";echo $xml_output; with header("Content-type: application/xml");$xml_output = '<?xml version="1.0" encoding="utf-8"?><badge value="newMessage"/>';echo $xml_output; And retry it. You may need to re-pin the site before the changes take effect.@thescientist While I can see you're trying to teach a man to fish, rather than giving him fish, which is all well and good... I think after the first failure, you may've wanted to postpone the fishing lesson, figuratively speaking. Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 5, 2012 Author Share Posted November 5, 2012 thanks for that i will try it right now and post back with results Link to comment Share on other sites More sharing options...
Craig Hopson Posted November 6, 2012 Author Share Posted November 6, 2012 Still not updating the tile... Does anyone else use windows 8? could you try it on yours? i think it might me my computer Link to comment Share on other sites More sharing options...
thescientist Posted November 6, 2012 Share Posted November 6, 2012 (edited) again, the source of http://chsites.co.uk/test.php?id=test <?xml version="1.0" encoding="utf-8"?><badge value="newMessage"/> doesn't show any of the other requirements from the link/spec you posted What about adding the META tag? It seems like that's important. They give you a checklist of things to do right at the top. looks you are only implementing 1 of 3. Edited November 6, 2012 by thescientist Link to comment Share on other sites More sharing options...
boen_robot Posted November 8, 2012 Share Posted November 8, 2012 There is a meta tag at http://chsites.co.uk/test.php*. And with a frequency specified too. With the syntax error in the XML part now fixed, and http://chsites.co.uk/test.php?id=3 now pointing to a valid (according to the MSDN page) XML file, that's now 3 out of 3.If you're trying to give a different kind of hint, he's not getting it, and neither am I.* Unless what you're trying to say is that THAT page needs to be pinned, and not the XML file, or anything else with "?id" attached. Craig, you are doing that, right? You are not trying to pin the XML file? Link to comment Share on other sites More sharing options...
thescientist Posted November 8, 2012 Share Posted November 8, 2012 (edited) There is a meta tag at http://chsites.co.uk/test.php*. And with a frequency specified too. With the syntax error in the XML part now fixed, and http://chsites.co.uk/test.php?id=3 now pointing to a valid (according to the MSDN page) XML file, that's now 3 out of 3. If you're trying to give a different kind of hint, he's not getting it, and neither am I. * Unless what you're trying to say is that THAT page needs to be pinned, and not the XML file, or anything else with "?id" attached. Craig, you are doing that, right? You are not trying to pin the XML file? I'm just going by what the OP has provided for documentation. https://www.google.c...iw=1024&bih=644 THE TOP HITwhere at the time the top link gave clear instructions on what needed to be doneYou must provide several pieces of information to correctly implement pinned site notifications in Windows 8 The location of the web service to poll for notifications An up-to-date XML file that reflects the current badge state The frequency with which updates should occur His code has an if/else statement, where the if shows the meta tag, and the else shows the xml. Those two can't happen at the same time. My impression was that the XML output was relevant to the badge showing. Edited November 8, 2012 by thescientist Link to comment Share on other sites More sharing options...
boen_robot Posted November 10, 2012 Share Posted November 10, 2012 My impression was that the XML output was relevant to the badge showing.You're right. It is. However, if you look carefully at the "if" section, you'll see the URL being pointed at the meta tag is that exact same PHP file, except with an "?id" attached, which in turn triggers the XML file to show.With the XML's MIME type and syntax error fixed, I'm personally out of ideas, given the docs. I don't yet use Windows 8, so I can't debug this personally. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now