I would like to disable the edit-function (postings only, commentary doesn´t matter) in one of my groups (for example group 001).
The function could be hardcoded and there need not to be a difference between users and admins.
I think I have to change something in components/ossnwall/ossn_com.php at line 251ff case 'edit' but don´s know how to read the group number.
if($post->poster_guid == $user->guid || $user->canModerate()) {
Finally, I think the group-number is $post > owner_guid:
This works for me:
$post = ossngetobject($pages[1]);
if($post->type = "group"){
if($post->owner_guid == xxx) // xxx = group-id
{ }
}
Thank you for your help!
You can get something like this:
$post = ossn_get_object($pages[1]);
if($post->type = 'group'){
if($post->guid == xxxx){
}
}
if($owner == yougroupid){
redirect(REF);
}
As I understand, this line will only allow the group-owner to post a message. That´s not what I mean, sorry!
Example: I am the owner of the group "Prediction" (for example groupid = 1)
Now the User -1-, User -2-, User -3- and so on can post a prediction to the wall. But the users are not allowed to change their prediction/post afterwards. The edit function should be disabled.
The script should be something like this:
components/ossnwall/ossn_com.php at line 251ff
if($post->poster_guid == $user->guid || $user->canModerate()) {
if ( *groupid* == "1")
{return; // leave edit-function}
Now I need to know how to get the groupid
Please see: \components\OssnWall\actions\wall\post\group.php
You need to add code something like,
if($owner == yougroupid){
redirect(REF);
}
Arsalan Sha: exactly. It´s for a kind of game where the users have to leave a prediction (stock market quotes). And there should be no possibility to change an entry afterwards.
Do you wanted to disable post editing for certain group?
P.S. there is no need of an error-Message for the user. The users of this group will know that there is no possibility to edit a postings.
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)