Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 205

Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
09/10/17 04:54 AM (6 years ago)

Advanced Dataurl

Hello everyone. I'm starting to experiment with my apps a bit and am interested in the Advanced Dataurl to load screens from a database. I just want a bunch of Advanced Menu with Image plugin screens to have a lists of restaurants and when a name is clicked it loads a food menu which is an HTML url on my server. The food menus are all built and currently being accessed via document url on my server using the HTML doc plugin for around 300 menus. This means that I have 30-40 Advanced menu plugin screens leading to the mentioned 300 HTML documents so I currently have around 340 individual screens built in my app. It works fine but again, I'm experimenting and and want to streamline the app if possible. Could someone tell me how the Advanced Dataurl works and what kind of database I would have to build. I presume that its basically a bunch of sql tables but I can't picture the whole setup in my head. I don't want all 300 food menus to be in one table/document and when a name is clicked, it brings me to that section of one large document like an anchor in an html page. I haven't been able to find a tutorial on BT. Thanks in advance Dave
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/10/17 02:40 PM (6 years ago)
Hey Dave, Have you looked at Susan's 'WB Add Ons' ? It's a basic set of databases and php templates to jump start using a database to dynamically populate a BT app, in a few different ways. I keep a copy at https://www.marianasgps.com/sharedfiles/wb_addons.zip and I also did a little youtube tutorial on how to use it here: https://www.youtube.com/watch?v=7s2h9x30loc&t=302s I hope that's what you mean by 'advanced dataurl'. Cheers! -- Smug
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/10/17 02:49 PM (6 years ago)
Thanks Smug. I'll check it out Dave
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/10/17 06:57 PM (6 years ago)
Hey Smug, I think we've talked about this before now that I'm looking at it again. I've got everything installed When I manually add data via the control panel screen, it adds the data to my database but it does not show up on the screen. It seems like its not generating the JSON. I dropped the data url into a browser and all I got was-- {"childItems":[ ]} Any thoughts? Thanks Dave
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/11/17 03:09 AM (6 years ago)
I'd want to see the query, and the error log, if any. (look in the directory where you run your scripts, if there is a problem, it create an file named 'error_log'.) If the appID is different, it may not show either. Whatever it ends up being, it's not going to be a big problem. Cheers! -- Smug
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/11/17 05:58 AM (6 years ago)
So here's what the error log says— this happens upon launch of the screen in my control panel and every time I return to the screen after creating an entry [11-Sep-2017 05:49:41 America/Los_Angeles] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, object given in /xxxxxx/xxxxxx/xxxxxxxx/BT-server/wb_addons/narrative/narratives.php on line 394 [11-Sep-2017 05:49:41 America/Los_Angeles] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in /xxxxxx/xxxxxx/xxxxxxxx/BT-server/wb_addons/narrative/narratives.php on line 396 Heres lines 394 to 397 $numRows = mysql_num_rows($res); $cnt = 0; while($row = mysql_fetch_array($res)){ $cnt++; Haven't had time to dig yet as my regular job is interfering with my fun job! Thanks Dave
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/11/17 10:39 AM (6 years ago)
Well, I'd say something is up with $res. I'll look closer tomorrow; it's early morning and I should have been in bed long ago. Cheers! -- Smug
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/11/17 11:24 AM (6 years ago)
Haha thanks Smug.
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/11/17 05:20 PM (6 years ago)
Hey Smug, Hope you're well rested. I found this post- https://www.buzztouch.com/forum/thread.php?tid=97E0DEB217B5233E054278A&fid=06DB0BCB08E6666&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 I added the i to all instances of mysql in each php page for narrative. 4 pages and 2 instances per page. I did not add the i to the beginning of the pages where it uses fnMySqlNow. I thought I'd try this because I'm using PHP 5.6 on my server. It works. It now posts to the page and adds it to the database. And there were no errors! If you want to double check to make sure that I didn't miss something I would appreciate it. Thanks for your help. Dave
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
09/16/17 03:04 PM (6 years ago)
Fixed this problem. I'm using PHP 5.6 on my server. By adding an i after mysql (mysqli) in the two lines above, it worked fine. Evidently, the newer versions of PHP use the i. It stands for improved according to the PHP website. Dave
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/16/17 03:08 PM (6 years ago)
Glad it worked out. I'm certain you're going to love the results of the automated data. 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.