Rating and Like System Managment - php

I'm trying to integrate a rating and like system as part of a package to send to the end user (with unknown progamming skill).
My problem is how to manage the users (registered or not) that have already done an action.At this moment I'm using PHP session to keep stored for a week the information, but this isn't a good solution.Is it a good solution creating 2 tables (one for rating and one for like) to store the information? If I use this solution what's the most useful and "correct" information to retrieve if the user is not registered? And is it user-friendly?I have thought to store: username and the ip

I would extend the members's table with at least two new columns, likes and rating or create a new table (as you said) including the memberID with a reference(and an index) to store and select the data. I believe it's the best way. Unfortunately, in this case non-members cannot press like or rate, but it is a good reason for one to register. –

Related

How do you handle multiple user in queuing system?

please click this link to show picture Im having a hard time analyzing on how I will create a queuing system where there is multiple user. Let us say that there is 2 user that is using a system how will i implement it? i dont get the logic on how it will be implemented. Like if the first user will tap the next button how will I update it as well that the queue number is update with the other user
Sounds like you need to use a database such as MySQL or MariaDB.
You would store the activity of each user's session in database tables. Of course, I could give you a more specific answer if your question were more specific.

General questions about database

I would like to create e-learning platform. So users will have a lot of things to choose (mostly available to view only for them) like:
add note
add movies to favorite
rate the instructor
And few options that auto save for each user like:
unanswered questions
wrong answer questions
movies in progress (user saw only 2 min from 5)
So what database or method I schould use for store that kind of data?
I do not want to use cookies because it needs to be save on user account and not on browser. User need to have that all on every browser or mobile device.
I wondering about json but...if I do so each user I'd will be available to view...so schould I use MySQL?
I would recommend that you build your own data logger, what i mean by this is build yourself a place to store every users data like an eManager if you would like.
Once this has been built you can then assign the eLearning courses using an ID to each of the users profile on your "eManager". Allowing you too keep track of each users progress etc.
The "eManager" could also save the users notes/wrong answers/unanswered questions, you could create surveys with a slider rating to rate the user. Honestly the limit is endless.
You can receive the data in two different ways:
(Personal) Either you can request that your users email you requesting a username and you generate a password and send it out to the user.
(Commercial) You build your eManager to recieve the data from the website which isnt too difficult to do.
It will be a long process and to answer your question in a different view practice SQL/PHP that would be your base make sure you can run more advanced query's and can confidently edit your DB etc.
Anymore questions just let me know, thanks.

How to build chat rooms attached for a single user profile?

I have a simple php user profile system that works like this: When user is registered he gets a specific url ?user. Therefore, other visitors can access his page.
What I want it to include chat application on users profile pages. But, every single user should have its own chat.
Which approach is the best, as I am a beginner in this? Should I put the messages from chat into the database or should I work with some log.txt files?
Any good tutorial for this would be helpful.
I found some tutorial for you: http://tutorialzine.com/2010/10/ajax-web-chat-php-mysql/
- looks like it could help you.
The only thing you need to adjust is to add room column in WEBCHAT_LINES table - that will be the unique name of the user, into which's chat room the chat line belongs. Then, when new chat line will be sent, you must save it to DB with apropriate room identificator. When you display the messages in chat, you must filter the results in each room to show only the lines for this particular room.
If you haven't use database before, there are plenty tutorials about mysql around the internet - it's not that difficult.
Good luck! And use Google when you'll have some doubts.

Forum thread subscription

I have written a really simply forum to integrate into a web app as I was struggling to find a lightweight and quick forum which allowed me to use my own authentication methods to decide who was or wasn't a valid users and which fitted into my application theme. Users are asking for the ability to subscribe to threads so they are notified of replies - what is the best way of doing this?
I could create a threads subscriptions table and enter a new row each time someone subscribes - this could involve lots of lookups for busy threads on every post and reply but would be pretty quick on new subscriptions with only one simple insert.
The other option I thought of was to have row per thread and to have a field where I can add (or read from) an array per thread which contains all the subscribed user id's. This strikes me as quicker for reading as there are less database calls (i.e. when a new reply has been made only one database call is needed to get all the user id's) but I think it might be slower for inserts when a new subscriber is added as I would have to find the row for the thread, get the existing array and then add the user id to the existing array.
A final option, very similar to the second one, would be to have a user subscription table where each row is a user id and then have an array of subscribed threads.
Which would be the best way? At the moment my only requirement is to email users on new posts and replies but in the future I may want to expand it to include the ability for users to list their subscribed threads etc like many mainstream forums do.
In my opinion, your two options are good, except for the array thing. You can simply go for a table which contains a unique id for a thread and if a user hit a subscribe button it can be added with his id and the thread id. You can call it, subscription table.
I think array might come handy if a user started subscribing much more threads. It depends on how big your forum is going to be.

Database / Schema structure to build a Wall system

I've been doing some researches about how to build a wall system similar to FB in PHP.
We planned to use an ODM (Mandango, MongoDB) instead of a regular ORM (MySQL) to achieve this. Some friend told me about inbox/outboxes system.
Inbox are all the messages that friends posts to your wall
Outbox are all the message you post
Why that ? Because it'll be simplier if you follow an user, you'll follow only his "outbox"
Each time i'll post something to my wall, this message will be duplicated to each of my followers (which will generate a lot of data).
But what about when a friend comments my post. On which entity is he going to comment my post ? Mine or his (because the content is duplicated) ?
What do you think ?
Have you already thought of this kind of question ? Have you any answers ?
Thanks
This is all about how you set up your database. I only have limited experience with MySql, so my answer relates to that. In this situation I would have at least these three tables:
-Users (with a unique id associated with each one)
-Messages: this includes both "inbox" and "outbox" messages. The reason you can put them all in one table is because if you're following someone, it will only pull those messages that have the (this is once column) "originating user id" and (this could be another column) "receiving user id" or some such thing. How you handle the data would all be done with php or asp or what have you.
-Comments: this holds all comments for all posts, and includes a column for the unique id of the message it relates to.
One thing to keep in mind when developing your system is that you never want to duplicate data. So, when you post to your wall, you don't want to actually create duplicate messages in your database for all the people who are following you, you want php to handle disseminating that information for you.

Categories