[Note: the following question was by pm but I am quoting it here so others can get the benefit of the answer]
RaoulDuke wrote:
I run a film forum that I would like to use the tabulated survey mod for my users to get feedback on their scripts. Obviously, the clone posts mod would make this awesome, since they could just use the pre-existing "template" of the survey that we've already made...
great idea!
RaoulDuke wrote:
...What I'm wondering is:
1. Is there a way to use the clone post mod so that only surveys can be cloned? In other words, not posts or polls, just surveys?
2. Is there any way to only allow specific surveys to be cloned? In other words, I want this script review survey to be easily duplicatible, but I don't want the list to get junked up by other surveys.
Thanks for your help!
Yes, that would be easy to do. There is a place in the clone mod with the following instructions:
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------------
#
// start mod clone posts
if ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $is_auth['auth_pollcreate'] )
{
$temp_url = append_sid("clone.$phpEx?" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$clone_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_clone'] . '" alt="' . $lang['Clone_post'] . '" title="' . $lang['Clone_post'] . '" border="0" /></a>';
}
else $clone_img = '';
// end mod clone posts
All you would need to do is to tinker with that if statement. Here are some possibilities for how to restrict people so that they can clone only a single post that has your script template in it (xyz in each case is the post_id of the post that has your script template in it)::
1. If you want admins or moderators to be able to clone anything and other users who are authorized to post polls to be able to clone only the post with your script template, use this:
Code: Select all
if ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || ($is_auth['auth_pollcreate'] && $postrow[$i]['post_id'] == xyz) )
2. If you want admins or moderators to be able to clone anything and all other users to be able to clone only the post with your script template, use this:
Code: Select all
if ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $postrow[$i]['post_id'] == xyz )
3. If you want admins to be able to clone anything and other users who are authorized to post polls to be able to clone only the post with your script template, use this:
Code: Select all
if ( $userdata['user_level'] == ADMIN || ($is_auth['auth_pollcreate'] && $postrow[$i]['post_id'] == xyz) )
4. If you want admins to be able to clone anything and all other users to be able to clone only the post with your script template, use this:
Code: Select all
if ( $userdata['user_level'] == ADMIN || $postrow[$i]['post_id'] == xyz )
5. If you want all users (regardless of whether they are admins) to be able to clone only the post with your script template, use this:
Code: Select all
if ( $postrow[$i]['post_id'] == xyz )
Obviously there are other permutations as well.
Make sure you carefully read the author's notes to this mod, since there are special things you need to do to make this mod work properly with my tabulated surveys mod.