Hello all,
I am new to Drupal and I need a bit of some guidance and perhaps a pointer to a tutorial or forum thread on what I need to know.
Firstly, I have very little experience with PHP. However, about 10 years ago, I did a lot of work with ASP and Microsoft SQL server so I do understand the basics of integrating a SQL server to a web interface. PHP seems familiar.
I did manage to get a complete Ubuntu server running mail, DNS, Apache2 and all the require PHP librarys going and have manage to develop a site with Wordpress and have got Drupal core installed on another dev site.
Admitting I was a bit confused on how Drupal all worked and had a big blank stare on my face, So I went and found a few PDFs floating around that and none of them seem to give me a good beginners steer in the right direction for what I would like to do.
What I would like to do is create a database that houses users (customers), retailers, products and perhaps other tables needed to house geo-tagging information. The products table will need to have child tables and relations so that options such as color and size can be referenced as well. Sounds like a simple deal however there is no centralized store. The products are static. Each store would need to have a geo tagged location. It would be more or less a locator service for products that are being sold. My web site would then grab the users current location and find that user the store closest to them. I would also be using that same database to interface with iOS and Android applications to query it in the same way.
Would anyone care to give me a steer in the right direction to information that would help me accomplish this creation and perhaps give me a brief explanation of how do I create a database and interface it to a Drupal front end. Obviously I should start with reading Drupal for Dummies ( ordering from amazon.com right now!) but I am eager, and I like to get on a fast track. I want to know specifically how do I create a database of my own in Drupal and query it and link tables. I would like to know how one would go about creating a web service to let iOS query the database and return the query to the app ( I just learned iOS does not have ODBC? )
I am not looking for in depth explanations here just come cliff notes and maybe some links to things i should be reading.
Thanks all!
Oh and forgive me if this is the wrong spot for n00bs to post. Mods please shuffle me to the proper n00b question arena =)
Comments
.
There's no need to create custom database tables for this. User management (including all necessary database tables) comes out of the box with Drupal. If you log in using your admin account (which already proves it's there ;) ), click on "people" in the black band at the top. That right there's your user management.
Your products are "nodes". Click on "structure" and create a new "content type", where you configure all fields you need for your products. It can be that you need to add info that's not in the options listed (like a Google Map or such). Most likely, you'll find a module that'll provide that for you. Just download that module and activate it through "modules" (in the black band at the top again) and you'll have those options available.
It'll prove useful to also install the Views module, as it'll permit you to easily create lists (through an interface, so no coding required).
The main thing your case requires, is thinking about how you'll implement the "store closest to the user" part, as the "closest to the user" is not exactly a true / false question and thus impossible for any program to do that without telling you how exactly to do it.
Good post.
Good post.
Jaypan We build websites
Thank you for your reply,
Thank you for your reply, Raf.
So would it be safe to say that I can build relational tables withing the content types and then use a views module to create an SQL query?
Another question about the users, I would need more info on users other than e mail address, also it would make sense that users and retailers be stored in the same table with a field that would differentiate them as either a customer or retailer. I take it there would probably be some sort of module for it. The users table would need to have relationships with other things such as favorites and last items viewed. I suppose I can set this with cookies perhaps but I would like something that is not volatile and would remain even if the customer came back a year later.
fr0stsp1re
This is my lame signature. One day it will read something cool. Until then you can have this virtual picture of a
bunny with a pancake on its head =)
The extra info for users can
The extra info for users can be added the same way you can define info for products. Same thing goes for that: If you need something out of the basic options provided, like a Google map, you'll need to install the module for it (which is the exact same one for Google maps for contents)
You can define different user "roles" and set each role's permissions, all out of the box. Doesn't even require any module. If you're on the user management page, you got a tab "Permissions". You can go from there ;)
Favorites is a separate module. You can use the Favorites module, or the Flags module for that. Same thing with last items viewed. Not sure which module that does, but there must be one out there doing exactly that. These things get stored in the database (with a relationship to the user), so no need to worry about cookies (which Drupal handles for you, anyways)
Thank you Raf, you are a rock
Thank you Raf, you are a rock star!
Can anyone chime in on how one does the math on geo tags for getting closest store based on location? Also is there anything like iOSs core location library for Drupal or PHP? I would like to get the users location based on some sort of location service instead of relying on a user input of a postal code or such.
I am also still needing a bit of some pointers towards how one interfaces an iOS or Android app to the content. I understand it is done with a web service but how does one create that, or is there a module for that somewhere?
fr0stsp1re
This is my lame signature. One day it will read something cool. Until then you can have this virtual picture of a
bunny with a pancake on its head =)
In all honesty, you are
In all honesty, you are putting the cart before the horse here. Get the rest of the site built up, then start a new thread on the geolocation search. But that is far off in the distance now. Same with the app integration. Just rest assured that they can both be done.
Jaypan We build websites
Not really, the geo location
Not really, the geo location search is a key element in the sites function. I would hate to have to build a db only to have to start from scratch because I could not add in the geo tagging later. Secondly, the app integration is more so of a key player in this whole site more than the actual web site. This project is primary aimed at mobile devices, however, since iOS has no native ODBC connectivity, nor would I want to store login information on an app that someone could decompile and risk someone compromising the database. It is my understanding that this sort of interfacing is done with a web service. I would need to construct a web interface or use a canned module to do so if one exists. My goal is to use Drupal as the main management for content in the database while the mobile apps are the main front ends. Even though the web site is fully functional for doing the same thing, the mobile application is really the core of the project.
I feel it is much easier to develop a project when you have all the required aspects of it planned out instead of building as you go. It would be a step backwards if I got it all built only to find out there was an easier way or the way I did it wont work at all if I wanted to integrate another feature.
fr0stsp1re
This is my lame signature. One day it will read something cool. Until then you can have this virtual picture of a
bunny with a pancake on its head =)
Fair enough. I guess my
Fair enough. I guess my comments were related to the fact that you were looking for a pointer in the right direction (which Ram did very well, and why I made the comment on his post being good), and now you are moving into specifics on how it can be done, for something that is still quite far down the line. I was trying to say 'don't worry, it can be done', but you are looking for how to actually do it.
Really, your best bet is to start a new thread on this subject, but here are some simple thoughts to give you a push in the right direction:
Basically, to do the geolocation and proximity search, you will need to give each shop (or person, or whatever it is you are geolocating) a field for location, or else two fields, one for latitude and one for longitude (there are always multiple ways of doing things in Drupal). Then you will use one of the google maps modules to show this location on a map. And finally, you can use webform to create a form that will allow users to enter a location (using their current location by default), and put together a backend that will triangulate in order to find the nearest shop(s) to the location given. For more specifics, you should google 'Drupal geolocation' or search on this site, and try to find any tutorials you can.
For the mobile Apps, you can use the Services module to create a backend that can be accessed by applications. This module is extendable, so that you can create your own methods in order to provide the data necessary, in the preferred format you want to use (JSON, XML, pLists etc). The rest of the magic happens on the device - you essentially re-create the front end of your Drupal site in an app, which communicates with the server using the Services module.
Hopefully that answers your questions.
Jaypan We build websites
It did. Thank you much. And
It did. Thank you much. And now armed with that information I have a rough draft of what material I need to reference to get the job done.
fr0stsp1re
This is my lame signature. One day it will read something cool. Until then you can have this virtual picture of a
bunny with a pancake on its head =)
Good luck!
Good luck!
Jaypan We build websites