Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 98

peter777
Aspiring developer
Profile
Posts: 13
Reg: Sep 27, 2013
Pasadena
1,780
11/13/13 05:02 PM (10 years ago)

Location Map Data URL example

Hi everyone, I am wanting to access the usefulness of the Data URL but I can't seem to format the JSON file right. Well I think I can do the JSON... but I am not sure how to format the php file that you link to it. Does anyone have a sample php file that I can take look at... sometimes I just need to see it and have that epiphany moment- that is such a joy! Thanks so much...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/13/13 06:58 PM (10 years ago)
https://dl.dropboxusercontent.com/u/115208762/loadScreenObject.zip Snoop around that for a bit, and when you have a question, just yell. Cheers! -- Smug
 
peter777
Aspiring developer
Profile
Posts: 13
Reg: Sep 27, 2013
Pasadena
1,780
like
11/13/13 07:38 PM (10 years ago)
Will do... thanks much Smug... Here's hoping for that epiphany!
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
11/14/13 12:45 AM (10 years ago)
Smug's code is worth gold, or at least it was for me (thank you, Smug!). Without it I would have never hoped to do this: https://www.buzztouch.com/forum/thread.php?tid=C346AE4EC91567700728BEC You'll have to pay attention to the server address though and change all of his addresses to yours. The key to generating proper PHP code for JSON is to start from the JSON that you want to emulate. For instance, here is JSON for the HTML Doc plugin: { "itemId":"343434", "itemType":"BT_screen_htmlDoc", "navBarTitleText":"HTML Doc", "localFileName":"sample.html" } Here is my PHP code for that: $loadScreen .= "{"; $loadScreen .= "\"itemId\":\"" . $first_part_name . $i . "\", "; $loadScreen .= "\"itemType\":\"BT_screen_htmlDoc\", "; $loadScreen .= "\"itemNickname\":\"" . $name . "\", "; $loadScreen .= "\"navBarTitleText\":\"" . $name . "\", "; $loadScreen .= "\"backgroundColor\":\"" . "#ffffff" . "\", "; $loadScreenStub = strtolower($baseDirOnServer . $myFileName); $loadScreen .= "\"dataURL\":\"" . $loadScreenStub . '"' ; $loadScreen .= "}"; This is taken from the middle of the code which turns one large HTML file into chapter (smaller files), which are then becoming a part of the app, each to be called from one option of the menu. (If you enter this as it stands, it will produce errors and you'll have to add more strings to $loadScreen, to close the JSON properly.) The purpose here is to show how unforgiving PHP can be when you need to enter strings that will be reproduced later. If you have more question, I'd like to hear them. Dusko http://www.duskosavic.com
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
11/14/13 12:57 AM (10 years ago)
Peter -- After investigating Smug's code, if you have trouble, lets get together at a local joint. -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.