×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Database Querry

Database Querry 11 years 1 week ago #20369

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
Hey Daniel,

I had talked to you before about the hotspots only being able to be viewed if they have the option set to public. We have everything set up so far and we have it so you can choose public or private when you are creating the hotspot, the only thing we can't find is where the actual hotspot marker gets queried. We want to be able to put in an ". "AND" . "share = '1'"" or something like that to make it so it will only display the hotspot on the actual map if the share option is set to Yes which is'1'. We have been looking through file and can't seem to find exactly where the query for the actual hotspot marker is located. We found a lot of queries in the models/hotspot.php file, but we couldn't seem to find a spot to put that line of code that made it not display the marker on the map. We don't really care to much right now if this isn't the correct way to make something public and private, we just need it to only display if the option is yes which is '1' because we want to launch the site soon. If you would be able to tell me what file or files I will need to edit with that code and even possibly a line to start from, that would be great and really help us out.

Thank you,
Shaun

Database Querry 11 years 1 week ago #20371

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Shaun,
When you create a hotspot there is an option to set it to public, registered etc. Why are you trying to make a query that has "And share = 1" ? in it? I don't get it. If you use the access field -> if the user has only access to public -> he will see only the public hotspots, if he has access to the registered -> then he will see the hotspots in that group as well?

I'm not exactly sure what you are trying to do?
The queries are made in hotspot.php and json.php -> that is all.

Daniel

Database Querry 11 years 1 week ago #20373

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
We have it set up to where a normal user cannot see that option because it has all the publishing stuff, so we hid that from users. We basically want to do the same thing as that except it not show as many options as the standard one. So we have it set up where the user creates a hot spot and fills out the special information and then they have a drop down box where they choose to make it public or not. We want to use what they selected(Yes='1' and No='0') to generate the map. So if it is set to 1, we want it to display on the map and if it is set to 0, we don't want it to show up on the map. Since any registered user can plot a hotspot, we want to allow people to not share the hotspots they have plotted. Only registered users have access to the web site(besides the homepage) because we have it set up within Jomsocial.

So basically we are wanting to do exactly what the registered thing does except we are wanting to simplify it and have it display the markers based on share='1'. We have it all set up to where the user's choice in plotting the hotspot writes to the database already, we just need it to query the map markers based on if they have the share option set to '1'. Eventually we are going to change that share option to generate based on their jomsocial friends and from there they can choose what friends they want to share it with, but for now we just want it to display only markers with the share='1'.

We were looking in hotspots and saw multiple spots where we tried to put in the code, but it didn't work. Then we tried to change the built in published option to '0' in the hotspot.php file, but even changing it to zero still displayed the markers on the map. So we didn't know exactly what file we needed to edit to make it work. We really only want it to just not show the markers if share='0'. Would there be multiple spots that query the markers that display on the map or is it just one spot?

I might be making this more confusing that it really is lol we had spent an hour or so trying to change the query to make it display like that or even make it show changes. We even removed a couple sections of queries and the only thing that happened was it didn't display the info in the hotspot pop up box. But we don't want it to show the marker picture on the map at all if share='0'.

Thanks,
Shaun

Database Querry 11 years 1 week ago #20381

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Shaun,

If the access field is what you need -> why don't you create a template override and create an access field that has only 2 select options -> public and non-public. For the non-public you could then set the access to whatever access level you've defined.

this way you want have to make any db modifications and the component will automatically show all public hotspots to guests. And it will also show the private markers only to people that have the necessary rights.

If you create a template override and change the select field for the access, then everything should be solved? Or am I missing something?

Regards,
Daniel

Database Querry 11 years 1 week ago #20408

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
I will look into that to see how that will work. We already have the database modified because we had added 8 new input fields that write to the database, so modifying the database is no issue. We had looked at making it use the access field number '3' to hide it from everyone but it will only display to the admin. We want it to display it only to the user and the admin. So we basically want it to not show up on the map for any registered user unless they are the user who plotted it and admins lol. I don't know how to create access levels for just the "registered" user who plots the spot and admins. I know how to make it for a whole group of people but not just for a single person in a group and admins. If we can figure out that, then that would workout perfect. I don't know if you know how to do that or if it is even possible to do that lol

Thanks,
Shaun

Database Querry 11 years 1 week ago #20425

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
Hey Daniel,

Thanks for all your help over the past couple months. You have been really helpful with everything, including stuff that wasn't even your own product lol. I was able to get the map to generate based on the public and private setting I created. I found the spot where it actually generates the markers in the models/json.php file and in there I added 'AND share = 1', which made everything work exactly how we wanted it to. I would have never thought to look in the json.php. We had looked in the hotspot.php file and after a while, we realized that that file was just querying the information into the box that is on each hotspot. Right now we have it really simple. Now that we know where to do everything, we are going to have multiple options: public, private(just for the user), and friends(shares with just their friends). Then eventually we are going to make it generate a list of their friends and they can pick and choose what friends that want to share each hotspot with. That's the goal for the near future lol.

Thank you again for all of your help and I'm sure we will contact you again with some more questions in the future lol.

If you want to see what we did with the component you created, you can check it out on our fishing web site. www.fishjunkies.co (that isn't a misspelling, we are using the .co instead of the .com for now)

You can either register as a new member and use everything we have to offer if you do like fishing or you can log in with the test user information here:

user name: testuser
Password: test

Thank you again for all your help!!

Thanks,
Shaun
  • Page:
  • 1
Time to create page: 0.125 seconds