Discussion Forums  >  Self Hosted Control Panels

Replies: 12    Views: 72

Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
04/06/13 02:38 PM (12 years ago)

Custom Html Look for local?

I have over 500 custom html pages that reference to files online. They all can be found on my server. Lets say i put them in the project. Will the app find the local files first? Or do i have to RECREATE 500 ITEMS and menus????? Thanks! Also i am up for modding the custom html plugin to find local files!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 02:49 PM (12 years ago)
Hmm... You'll have to tell the app where the files are... if that means you have 500 'dataUrl' entries, you'll need to convert those into 'local file' entries. If you're self hosted, I would suggest making a backup of your database, and doing a bit of database massage to alleviate making all those edits. Basically you'll have to make a custom script to go through the database, seek out 'that' app id, 'that' screen id, and replace the 'dataURL' values with your local file values. If your dataurl json is something like this: "dataURL":"http://www.mycom.com/url.html" Then what you're going to want to do is some kind of search and replace. find "dataURL":"http://www.mycom.com/" and replace it with "localFileName":" so that the 'end result' is "localFileName":"url.html" It might take some testing. This all depends on if you are self hosted. If you're not, then you may end up doing it manually. Cheers! -- Smug
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 02:53 PM (12 years ago)
Im self hosted know little about php have ftp access, xcode, devices to test, and database access where do i start
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 02:59 PM (12 years ago)
send me a private message. include a dropbox or other public link to a copy of your config.txt file. Make sure you take the first 5-7 lines OUT of your config.txt file; it contains information I do not need to know, or want to know. Things like your API Secret numbers and stuff. Leave me the rest, and let me take a look at it. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 04:27 PM (12 years ago)
I'm going to have to ask for opinions on this; You've used the Custom HTML/Text plugin, which uses a different style than the other plugins. They're external and cached in the app. so you didn't 'name' them, BT did. So I'm not sure how this can be mitigated, or even if it should be. It might be fine on it's own. Cheers! -- Smug
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 04:29 PM (12 years ago)
So what do i do from here? Keep adding content and then a solution will pop up?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 04:42 PM (12 years ago)
Well, for the moment I'd do some testing, if you haven't already. Load your app. Turn off the networking. check your pages. If they're in the app, then no problems. If they're not in your app, we need to strategize a migration solution of some nature. Cheers! -- Smug Edit: Do the testing on a device, not connected to your computer. The Simulator won't give you the right results for this.
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 04:52 PM (12 years ago)
So copy the files into the documents folder (dont rename) so it is looking for the same file? offline mode
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 05:00 PM (12 years ago)
Nope
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 05:06 PM (12 years ago)
Maybe if i could add the files into the cache, and make it so the cache cannot be cleared or? overridden
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 05:23 PM (12 years ago)
I thought about that, but trying to 'populate the cache' would be about as much effort as redoing the pages; cached pages are given a different name too. The fact that you're self hosted is a good thing; with a good database backup you can try different things with the comfort of knowing you can put it all back if it doesn't work. But you need a migration plan of some sort. put your thoughts on paper before you start anything, because it's going to be tedious. 1) The Custom HTML/Text plugin doesn't allow for internal documents. 2) determine a plugin that 'can' allow for internal documents (like, HTML Doc) 3) figure out a way to 'pull' the URLs from the HTML5 plugin config 4) figure out a way to 'input' the localFileName data INTO the new plugin 5) figure out a way to update the menus to reflect the correct plugin 6) figure out a way to get it back into the database without error. Take that as a start, and start itemizing the tasks, and the internal steps that need to be performed to accomplish that task. It won't be easy, but if you can find ways to automate the steps, your manual intervention will be lowered dramatically. Ask questions if you have them, this is something you'll need to be careful with. before you do anything, back up your database. Cheers! -- Smug
 
Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
like
04/06/13 05:32 PM (12 years ago)
Holy crap it works! just use find and replace!!!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/06/13 06:19 PM (12 years ago)
Cool! I'm glad it turned out to be simple! The long and drawn out process was looking a bit complicated, lol! Good on ya! :) Cheers! -- Smug
 

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.