4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Cimmerio on February 04, 2009, 10:46:50 PM
-
Hello.
I wish to do this in my web. exit any mod like this?
A greeting.
-
... all these users into the same usergroup ... ?
PS: ... I have also a very long wishlist ... :mrgreen:
-
... all these users into the same usergroup ... ?
PS: ... I have also a very long wishlist ... :mrgreen:
Yes, in the same group jeje.
Sorry for my bad english, i'm spanish :P
-
... so let's try this ...
... in member.php in section "if ($action == "uploadimage")" find two times ...
$result = $site_db->query($sql);
1.time for "if ($direct_upload)" ...
2.time for "else" ...
... and add each time after ... *)
//--- start --- user-ID in "uploader_group" ---
$uploader_group_id = "XX"; // here the number of the group_id of your "uploader_group"
if ($user_info['user_level'] > GUEST)
{
$sql = "SELECT group_id
FROM ".GROUP_MATCH_TABLE."
WHERE group_id = ".$uploader_group_id." AND user_id = ".$user_info['user_id'];
$result = $site_db->query_firstrow($sql);
if (!$result)
{
$sql = "INSERT INTO ".GROUP_MATCH_TABLE."
(group_id, user_id, groupmatch_startdate, groupmatch_enddate)
VALUES
($uploader_group_id, ".$user_info['user_id'].", ".time().", 0)";
$result = $site_db->query($sql);
}
}
//--- end --- user-ID in "uploader_group" ---
*) for simplifying see V@nos post ...
... and ofcourse replace XX with the number of the group_id of your "uploader_group" ...
... and every upload-user is added only one time in your "uploader_group" ...
... not tested and can certainly be optimized ...
-
To simplify the instructions, insert the code
above
$sql = "INSERT INTO ".IMAGES_TABLE."
and
above
$sql = "INSERT INTO ".IMAGES_TEMP_TABLE."
-
@V@no ...
1. thanks for optimizing ... ;)
2. to simplify ... ofcourse, above is the simplier way ... ;)
3. for "groupmatch_startdate" and "groupmatch_enddate" ... ?
... are you shure about that ... ".time()."and "0" ... ?
... and what about if this dates are already exist for the existing "uploader_group" ... ?
... or are this dates individual dates for every user ... ?
edit :
3. for "groupmatch_startdate" and "groupmatch_enddate" ...
... I checked these dates in ACP ... they are individual dates for every user ... !
... as always ... you are right ... :mrgreen:
-
Yes, these dates individual for each match (member + group).
Using groupmatch_startdate and groupmatch_enddate you can control when the group for this user will be activated and when it will expire. When groupmatch_enddate is to "0" - it means no expiration, the user will stay in that group forever.
(btw, I just learned about this feature myself..didn't know it existed. Very useful feature!)
P.S.
Because groupmatch table doesn't have "unique" attribute in the fields you can insert as many entries with identical data as you wish, with no error.
-
Thank you very much for your effort and your help.
The code is working fine.
You rock! 8)
-
Please if anyone knows to put this at the time validate images and If it is possible for instance to 5 uploads. Thanks :D