×

Notice

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

TOPIC: "Friends" only view

"Friends" only view 11 years 2 months ago #19773

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

I was looking into seeing if it would be possible to only allow friends(in jomsocial) to view the hotspots if that hotspot was set up like that or even not allowing anyone to see it besides yourself. I would want to display the option to the users in the plotting page(which I know how to do already because I already customized it) and based on their decision of choosing: Public, friends, or private, I was wondering if it would be possible to add that into the database where their choice will turn on(with "1") one of the fields in the database. Would it then be possible to put in a line of code on the map page that will only display the public ones when a public user clicks the maps, the friends one when a user clicks on the map and displays their hotspots along with their friends, and then only display the "private" hotspots when the user views the map. This would also have a possible button on the map page to narrow it down to show the option the user selects. I am just wondering what files I would have to modify to allow it to show this. I guess I mainly just need to know where to place the code that would display this because I already know how to make it so the user chooses how it will be displayed when they create the hotspot.

Thanks,
Shaun

"Friends" only view 11 years 2 months ago #19779

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
How far are you with the joomla development tutorials.
Everything is possible...

What I would do -> create a new form field (jomsocial_friends) & render it in the form. Now I'm not really sure what to do with the db. Maybe the best thing would be to have a column for this field -> this way one can directly select the hotspots that one needs for the user. Another way would be to store the value in the params field, but then you'll need to grab all the hotspots and go over the params field which will be slow. So, most probably best will be to add a new field. Or is the public, friend & private status related to the joomla ACL in any way? If that was the case one could use the asset_id...

Once you have all this comes the funny part. You'll need to modify the queries. You'll need to modify the query that loads the hotspots (most probably in the hotspots model) & you'll also need to modify the tiles model.

Then you'll also need to modify the layout and add a button for the preferred privacy -> modify the js so that it knows what to do with the privacy and send correct requests to the server.

At the end - a lot of work :)

Regards,
Daniel

"Friends" only view 11 years 2 months ago #19795

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
I am hoping to be able to use the same public, friends, and private status that jomsocial uses because I am hoping that based on the selection of this option, it will not post on the news feed if it is private and not display anything to other users. This is something that is going to take a while to configure like that lol I can't seem to find the database that jomsocial uses to do the public, friends, or private feature. For now I am thinking about doing it either public or private because that was how I had it before on the old site. On the old site, I used variables at the beginning that were declared but on here I see that they are inline or something. Here is the code I need to edit to make a select menu of YES or NO.

<?php echo $this->form->getInput('share'); ?>

I don't know if I just need to change that getInput to something else, but I just want the user to be able to select YES or NO from a drop down menu.

Thank you,
Shaun

"Friends" only view 11 years 2 months ago #19797

  • Shaun Kehoe
  • Shaun Kehoe's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
This was how I got it to display the public or private hotspots before:

<? $exe1="SELECT lon,share,members.fname FROM catch,members WHERE members.member_id = user AND share ='YES'";
$result1 = mysql_query($exe1, $db)or die(mysql_error());
while(list($lat,$lon,$share,$fname) = mysql_fetch_row($result1)){
?>

I am guessing that the file I need to edit is views/hotspot/tmpl/default.php because it looks like it has the code that generates the map. I don't know if I have to do exactly what I did on the old one to make it show up like that since the code I used was very basic, there might be an easier way to do it with the code you created. It would be nice if all I would have to do is just do a "AND share = 'YES'" somewhere lol but I don't know if it will be that easy.

Thank you,
Shaun

"Friends" only view 11 years 2 months ago #19804

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
The locations on the map are loaded with an ajax requst.
so in hotspots/tmpl/default.php we just initialize the map - once the map has loaded we send a request to the server to give us the locations.

Look at this:
docs.joomla.org/Accessing_the_database_using_JDatabase/2.5

Then headup to the models folder and look at the code there.

Regards,
Daniel
  • Page:
  • 1
Time to create page: 0.116 seconds