Upload image to member area, subject to admin approval - php

I'm trying to create a members site using php where they can upload images (dynamically create thumbnails) and comments for all members to see. I want all uploads to be published only after admin approval.
I can do quite a lot of this (registration, login, and even basic upload)but would be grateful if someone can provide a link to any lessons or videos of how to put it all together. I really would like to learn how to do it rather than configure someone's script.
I've checked YouTube but cannot find exactly what I'm looking for.
Thanks

In order to do an approval system, I think the most simple way to do it is to have a field in a DB, for each comment, image, etc, named "approved", which can take a 0,1 or 2 as value.s
If it's 0, it means it needs approval. 1 means it's approved. 2 means it is disapproved.
Note that 2 is not really necessary. It's just to distinguish new entries from old entries that weren't approved.
Then, on the backend, you can only give access to the approval system to the admin. You can use the same approach to define admins, users, moderators, etc...

Related

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.

Laravel 5 Application For More Than 1 Site

I'm not sure how to phrase my title so I had done the best I could.
I am putting together a Laravel 5 application to which multiple sites can pay to use for their company. This is an application that stores site related content in my database. So all data will be attached to a specific company (site).
Lets say there are 3 sites that want to use my application.
www.site1.com
www.site2.com
www.site3.com
When a user goes to either of those sites and wants to access lets say the name of my project lets say:
www.site1.com/projectname
www.site2.com/projectname
www.site3.com/projectname
It would then be sent to my site where they would log into my system and it would be able to grab the url and match it verify that it is a company that uses my system and then it would be able to keep separate the users and data separated from the other companies who use it.
Is this something that could be worked and if so any thoughts or ideas upon this.
I watched a series on this type of thing from net.tutsplus.com https://code.tutsplus.com/courses/building-multitenant-apps-in-laravel and have the basic idea however the video doesn't cover the situation like mine would with the other sites url coming into play.

How to create restricted and non restricted area same time in Symfony2

what i have to build is page that have some pages that are restricted and some are not on similar links. I`ll try to explain it on example:
Let's say that i have users in my system (based on FOSUserBundle), and each of them have own account that contains a Blog and Gallery (different controllers). Some of User want to give access to thier Blog and Gallery only for certain group of people (that are not stored in system), so they generate token (only one token, so whoever know token will be able to access area) and sends to Users. What i don`t want to do is to check it in each method of controllers.
So let`s say we have 2 users, steven and stan and first of them want to make his blog and gallery free to see, but second one want to be restricted based on token.
Link would be like this:
/steven/blog
/steven/gallery
/stan/blog
/stan/gallery
Could anybody recommend some solution or any idea how can i try to build it in Symfony2?
Why don't you want to check it into the controllers ? I don't see any others ways to do that, according you want it to be dynamic and possibly changing.

Can I store lists of permissions from Facebook etc?

I'm building an app, and I want to allow users to integrate it with various social platforms. One of the things users can do is post a link to something they created on our site to their Facebook wall. We want to let them specify who can see whatever they post. I think this can be done but using the Facebook dialog, yes? So they can check the names of people who should be allowed to see the link and then follow it to our site.
However, this is fine from the point of view of seeing it on their wall, but we don't necessarily want other people to stumble onto it by accident, or to share it with other people. For this reason, we want to make sure that the person looking at the stuff on our site is a friend of the person who created it.
My understanding is that we can't store friends IDs if they haven't authorised our app. Can we store the id of the post in a way that lets us figure out the friends IDs from that? E.g. user makes post 5678, and specifies that people A, B and C can see it; we store 5678 and then, as it's needed, we request that post from Facebook, check whether the user trying to view the content is either A, B or C and then act accordingly?
Will that work?
Or is there a better way of doing it?
Thanks!

Categories