Hello,
This is not a PHP support question as I am great with PHP and have been doing it for a few years now but more like A quick question.
I am creating a group feature similar to the one facebook has.
What I am programming is a feature where the clan owners/administrators can write statuses and comment as the clan's name.
There is one bug I am fixing which if a user creates a account as the clans name so for example if the clan was called Spud Gaming then a user creates an account called spud gaming then they can delete any posts made by that name on the clan.
The solution I have find or I should say method I am using is create a table in the posts section of the database called "page_post" so basically determining if the post is from the official clan or normal user (Set to Yes = that the owner or a admin of the clan created the post and Set to blank or No means A normal user created the post then I do a few other things [Look below I explain more there]
I do a few other things this statement will explain more
This is only debugging code so I can get the structure
Only thing I am worried about is if somehow the value of a certain post gets set to No
I now ask my question after all that explaining:
Is this the best way to do this or do you guys have a better way?
Once again i'm not dumb at PHP I am good to get this far but I will not say I am some super hero at it either
When the user selects to post as the clan it does not set a session being the clans name it just simply fetches the clans name and inserts it as who posted it. (Better then creating a whole new session in my opinion]
-- August 16th, 2014, 10:21 am --
Um..
This is not a PHP support question as I am great with PHP and have been doing it for a few years now but more like A quick question.
I am creating a group feature similar to the one facebook has.
What I am programming is a feature where the clan owners/administrators can write statuses and comment as the clan's name.
There is one bug I am fixing which if a user creates a account as the clans name so for example if the clan was called Spud Gaming then a user creates an account called spud gaming then they can delete any posts made by that name on the clan.
The solution I have find or I should say method I am using is create a table in the posts section of the database called "page_post" so basically determining if the post is from the official clan or normal user (Set to Yes = that the owner or a admin of the clan created the post and Set to blank or No means A normal user created the post then I do a few other things [Look below I explain more there]
I do a few other things this statement will explain more
Code:
//if this is set to yes and then if the session is the post | then if the session is the name
if(($page_post=='yes') && ($mybb_username==$posted_by) && ($mybb_username==$clan_name)) {
die("You cannot delete this");
} else {
die("you have rights to delete this");
}
This is only debugging code so I can get the structure
Only thing I am worried about is if somehow the value of a certain post gets set to No
I now ask my question after all that explaining:
Is this the best way to do this or do you guys have a better way?
Once again i'm not dumb at PHP I am good to get this far but I will not say I am some super hero at it either
When the user selects to post as the clan it does not set a session being the clans name it just simply fetches the clans name and inserts it as who posted it. (Better then creating a whole new session in my opinion]
-- August 16th, 2014, 10:21 am --
Um..







