Posted on: 03/14/05 07:23am
By: LWC
I don't understand how to do this.
Let's say I want group X to be able to post stories only in topic Y.
At first I thought I just need to give group X "edit" rights over topic Y.
But then I saw that it only meant they could edit/remove topic Y itself - it has nothing to do with topic Y's stories!
Submit stories only in certain topics
Posted on: 03/15/05 07:31am
By: LWC
I see this has been
discussed before.
I guess it can't be done...but shouldn't giving story rights over certain topics be one of the main reasons for permission rights in the first place?
Submit stories only in certain topics
Posted on: 03/17/05 05:27am
By: LWC
I have to ask - how hard would it be to just look if user X has edit rights in a given topics?
After all, topics' read rights not only control the topics, but also influence the relationship between stories and users (as a middleman).
Why shouldn't topics' edit rights influence that relationship too?
Submit stories only in certain topics
Posted on: 03/20/05 12:08pm
By: averageyoungman
Hi LWC,
I think that the following post is what you want:
Topic Hack[*1]
This is a link to a forum post that contains a hack. What the hack does is limit the topics shown for "regular" users when they visit the story submission page. It uses a modified sql query to check for permissions and then displays which topics are "open" based on those permissions. Look at the bottom of the post. There you will find the hack in quote boxes. You need to add a custom COM_topicList function to lib-custom.php in /your geeklog version/system. Once you do that, you have to change some calls in two core files to call the custom function instead of the original COM_topicList function.
After you have changed the calls, you then need to change ownership rights to the topics you want "locked". You can do so by creating new groups for those topics, and then setting the ownership rights to the related topic to the new group you have created. The topic ownership rights are set in the topic admin page for each topic. Once you create the new group(s) they will show up in the dropdown for topic ownership rights.
The post explains all of this. But it's very important to remember the ownership rights for the topic, otherwise it won't work.
GL developers have noted that a malicious user (with knowledge of GL) could modify the vars being sent to change what topics get shown on the story submission page, but this hack works. I have used it with no problems so far.
There is also a small hack that will allow you to prevent regular logged in users from posting to the front page or featuring their story. It's a simple if{} statement that checks for group membership and formats an sql query based on that access. Let me know if you'd like to know how to do that as well.
I hope this is what you wanted.
Submit stories only in certain topics
Posted on: 03/21/05 06:03pm
By: Anonymous (guest)
Like you said, that check is done before they send the stories.
That's only for convenience. It's much more important to do it after the submission.
How hard can it be to do something like:
(sorry for the made up parameters - but I hope you get the point...)
$cansubmit = false;
for (each group in user_groups($uid))
if (group == $topics[$tid['the group with edit rights']]) {
$cansubmit = true;
break;
}
if ($cansubmit == true)
...submit story...
else
if ($conf['storysubmission'] == 0)
$echo "Sorry, you have no permission
to submit to topic " . $topics[$tid[name]];
else {
$echo "Your story was queued for inspection by an admin.";
...send to queue...
}
?
Submit stories only in certain topics
Posted on: 03/21/05 06:12pm
By: Anonymous (averageyoungman)
True. It's not my hack, and from what i gathered the guy who did it was in a rush, but it works. And i suppose that before/after is a UI preference as well, considering checking before omtis a potential step from the process.
Perhaps there is a sequential or placement issue with the way the code is structured at the moment. I'm sure if you dug hacked hard enough you could rig it. I, unfortunately, don't currently have the time (nor the PHP experience) to do so. It would take me a longg time because I would be learning as i went. Please let me know if you come up with something. It surely does seem simple enough.