Friday, 28 June 2013

Added Add Spot Form and Functionality to client.

We came to consensus as to where user will be able to add a new spot, we decided to place that ability within the map view as it gave a visual representation of there current location so as to not place a spot in a area that is not there actual current location.

When the add spot button is clicked a popup container will appear that will contain a text field to enter the spots name, a camera button to add a photo of the spot and add button to submit the form. When user clicks add it will check that the text field is not empty and that a spot image has been selected before adding it the server.

Images are uploaded to our cloudinary cloud storage and returns a JSON object of the images URL when it is complete, using that URL we submit a POST to add a new spot to our servers DB.

FlashBuilder ArrayCollection Errors

Originally the data returned could be passed to into an arraycollection directly, but we discovered that if the returned data is only 1 object the collection will complain, that it is not an array collection.

To resolve this issue we changed the data format retured from XML to JSON, as it provided a better means to iterate through the data and provide type definition. as we iterate through the list we add each Object into the ArrayColection one by one, instead of passing just the XML data into the collection.

Thursday, 27 June 2013

Server Security

Okay since the project is officially submitted all of the security measures have been turned on the server. Most of the security was turned off during development. Hopefully this won't break overnight. Will double check the server in the morning...

Photo Upload

I haven't posted in a while but a lot of features have been implemented. Uploading photos to the Cloudinary api and updating our server database works!! I think that is definitely the main feature as our app is content driven and the photos are the main user submitted content.

Wednesday, 26 June 2013

Improved getting spot data

Now when getting spot data it will return the usual spot data plus an extra field that specifies if the user has added this spot to their favored spot list.

Using this query :
$q = "select *,(select COUNT(*) from favourites f  where f.userID='".$this->db->escape_str($ID)."' AND f.PlaceID=p.ID) as fav from place p order by p.DateFound desc";

it will return spot data plus create a new field that will compare the spots with the favorites table checking that certain user has liked this spot. it will set the fav filed to 0 if not added to their list or 1 if they have liked it.

This has now been applied to the Client and the appropriate action and icon will appear depending on the fav field of the spot data returned.

Likes and Dislikes added to client

Liking and disliking has been incorporated into the client, and user are able to like and dislike spots.
Also the api calls to like and dislike ahve an added features, where ater the call has been made it will return total likes and dislikes of that spot at that moment of time, these numbers are displayed next to the icons and will update when there is a refresh or the user likes/dislikes a certain spot.a

Monday, 24 June 2013

Likes and Favourites

-Added Functional Like/Dislike options for each Spot.
There is now a table that stores all data relating to what spots that a has either liked or disliked, and based on this data a user will only be able to like or dislike and not both. If u user previously liked a spot but now decides to dislike it will decrements the total likes in the spot data and increment the dislike value, this works in vice versa. This data is stored in the votes table which stores the SpotID, UserID Like and dislike boolean  fields.

-Add a favorites list, now users can add and remove spots from their favorites list.
There is now a favorites tables that stores the UserUD, and PlaceID, this table represents all the spots favourited by users. Using this table we can determine which spots have been liked by the user.