auto group and cash mod please do something about it

You'll automatically gain access to this forum when you will post your first post in another forum. That way it will demonstrate how the Auto Group MOD works.
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

auto group and cash mod please do something about it

Postby darakhshan on Sun 21. Nov, 2004 21:10

Yes
I have a cash mod and I badly need an auto group based on credits and not merely posts

Whe is it possible please? :roll:
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Postby galixte on Mon 29. Nov, 2004 15:50

Hi,

any ideas for that request ?

En thanking you ;)

@+
User avatar
galixte
Poster
Poster
 
Posts: 16
Joined: Tue 27. Apr, 2004 15:14
Location: France

Postby Niels on Mon 29. Nov, 2004 22:46

should be faily easy...

open the how-to

make a search and replace

"user_posts" -> "user_credit"
do the same with the included files


then install the mod
depending on the cach/credit mod, you may need to use a different "replace value"
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby darakhshan on Tue 30. Nov, 2004 16:50

Niels wrote:should be faily easy...

open the how-to

make a search and replace

"user_posts" -> "user_credit"
do the same with the included files


then install the mod
depending on the cach/credit mod, you may need to use a different "replace value"


:lol: I worked perfect I suppose, I just temorarily did that and it seems I had no problem , I have to make some more changes in my forum policy before I am sure I use this but it is perfect

just to remind that It is not the user_credit which should be replaced
in cash mod it is user_points
so all user_posts in the MOD (only the mod) should be replaced with user_points and here we bo

thanks
I hope there will be no bugs
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Postby Niels on Tue 30. Nov, 2004 23:36

One thing to take in mind is:
the "find and replace" way. Should ONLY be carryed out for the ADD,AFTER/ ADD,BEFORE / REPLACE WITH
not into any FIND tags.

I hope you understand why....

Also be careful if a FIND tag holds a user_posts and is followed by a REPLACE tag witch also include "user_posts" - then you proberbly does NOT need to replace the user_posts.....or atleast need to look into this code for a potential bug.

I haven't looked into the how-to to see if this should be the case for this mod.....you may do so and post the result here (saving my time)
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby darakhshan on Wed 01. Dec, 2004 10:10

Thanks,

I am going to use this and get report if there is any bug , by the way I liked the snow on your furum so I got it for mine too
:D
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Postby darakhshan on Wed 01. Dec, 2004 11:31

Ok, this is the changes I made for installation

##############################################################
## MOD Title: Auto group with Cash Mod
## MOD Author: Niels < ncr@db9.dk > suggested and edited by Darakhshan internetbrother@yahoo.com
(Niels Chr. Rّd) http://mods.db9.dk

This is Autogroup mod made by Niels but have been edited by me to work for cash mod and is still in Beta

## MOD Description: This mod will make it posible to add member
## to a user group, depending on there credits working with cash mod
## MOD Version: 0.1.0
## Compatibility: 2.0.5->2.0.6
##
## Installation Level: Intermediate
## Installation Time: 10 Minutes
## Files To Edit: 8
## groupcp.php
## modcp.php
## admin/admin_groups.php
## include/functions_post.php
## include/usercp_register.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/admin/group_edit_body.tpl
##
## Included Files: 2
## auto_group_db_update.php
## tool/sync_postcount.php
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod will make it posible to add member to a user group,
## depending on there credits. This makes it posible to make a
## group "Everyone" (0 credits) where all members are members by default
## or a group like "credit holders" (1 credit) where all users witch have
## credits are a member.
## Now also support MAX post count, so the users will be removed
## if they have more credits than required
##
####
## 2. SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 3 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 4 Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=5639&highlight=

##############################################################
## MOD History:

##
## ????-??-?? - Version 0.1.0
## - initial BETA release 2004 November 30
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy auto_group_db_update.php to auto_group_db_update.php

#
# This MOD need a database update.
# Then, as you must have now copied the auto_group_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir ... update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#




#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
# NOTE, replace complete line of code....
#
$lang['This_closed_group']
$lang['This_hidden_group']

#
#-----[ REPLACE WITH ]------------------------------------------
#
$lang['This_closed_group'] = 'This is a closed group: %s';
$lang['This_hidden_group'] = 'This is a hidden group: %s';

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//added to autogroup mod
$lang['No_more'] = 'no more users accepted';
$lang['No_add_allowed'] = 'automatic user addition is not allowed';
$lang['Join_auto'] = 'You may join this group, since your credit count meet the group criteria';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php


#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// addded to Auto group mod
$lang['group_count'] = 'Number of required credits';
$lang['group_count_max'] = 'Number of max credits';
$lang['group_count_updated'] = '%d member(s) have been removed, %d members are added to this group';
$lang['Group_count_enable'] = 'Users automatic added when posting';
$lang['Group_count_update'] = 'Add/Update new users';
$lang['Group_count_delete'] = 'Delete/Update old users';
$lang['User_allow_ag'] = "Activate Auto Group";
$lang['group_count_explain'] = 'When users have had credits more than this value <i>(in any forum)</i> then they will be added to this usergroup<br/> This only applys if "'.$lang['Group_count_enable'].'" are enabled';

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_groups.php

#
#-----[ FIND ]------------------------------------------
#
'group_moderator' => '',

#
#-----[ AFTER, ADD ]------------------------------------------
#
'group_count' => '99999999',
'group_count_max' => '99999999',
'group_count_enable' => '0',

#
#-----[ FIND ]------------------------------------------
#
$group_hidden = ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$group_count_enable_checked = ( $group_info['group_count_enable'] ) ? ' checked="checked"' : '';

#
#-----[ FIND ]------------------------------------------
#
'GROUP_MODERATOR' => $group_moderator,

#
#-----[ AFTER, ADD ]------------------------------------------
#
'GROUP_COUNT' => $group_info['group_count'],
'GROUP_COUNT_MAX' => $group_info['group_count_max'],
'GROUP_COUNT_ENABLE_CHECKED' => $group_count_enable_checked,

'L_GROUP_COUNT' => $lang['group_count'],
'L_GROUP_COUNT_MAX' => $lang['group_count_max'],
'L_GROUP_COUNT_EXPLAIN' => $lang['group_count_explain'],
'L_GROUP_COUNT_ENABLE' => $lang['Group_count_enable'],
'L_GROUP_COUNT_UPDATE' => $lang['Group_count_update'],
'L_GROUP_COUNT_DELETE' => $lang['Group_count_delete'],

#
#-----[ FIND ]------------------------------------------
#
$delete_old_moderator = isset($HTTP_POST_VARS['delete_old_moderator']) ? true : false;

#
#-----[ AFTER, ADD ]------------------------------------------
#
$group_count = isset($HTTP_POST_VARS['group_count']) ? intval($HTTP_POST_VARS['group_count']) : 0;
$group_count_max = isset($HTTP_POST_VARS['group_count_max']) ? intval($HTTP_POST_VARS['group_count_max']) : 0;
$group_count_enable = isset($HTTP_POST_VARS['group_count_enable']) ? true : false;
$group_count_update = isset($HTTP_POST_VARS['group_count_update']) ? true : false;
$group_count_delete = isset($HTTP_POST_VARS['group_count_delete']) ? true : false;

#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . GROUPS_TABLE . "
SET group_type =
WHERE

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$group_moderator

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
# *
, group_count='$group_count', group_count_max='$group_count_max', group_count_enable='$group_count_enable'

#
#-----[ FIND ]------------------------------------------
#
# this line must be found rigth below the abouve find tag, as this line are pressent 2 places
message_die(GENERAL_ERROR, 'Could not update group', '', __LINE__, __FILE__, $sql);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
if ($group_count_delete)
{
//removing old users
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE group_id=$group_id
AND user_id NOT IN ('$group_moderator','".ANONYMOUS."')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);
}
$group_count_remove=$db->sql_affectedrows();
}
if ( $group_count_update)
{
//finding new users
$sql = "SELECT u.user_id FROM " . USERS_TABLE . " u
LEFT JOIN " . USER_GROUP_TABLE ." ug ON u.user_id=ug.user_id AND ug.group_id='$group_id'
WHERE u.user_points>='$group_count' AND u.user_points<'$group_count_max'
AND ug.group_id is NULL
AND u.user_id NOT IN ('$group_moderator','".ANONYMOUS."')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $sql.'Could not select new users, group count', '', __LINE__, __FILE__, $sql);
}
//inserting new users
$group_count_added=0;
while ( ($new_members = $db->sql_fetchrow($result)) )
{
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES ($group_id, " . $new_members['user_id'] . ", 0)";
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error inserting user group, group count', '', __LINE__, __FILE__, $sql);
}
$group_count_added++;
}
}


#
#-----[ FIND ]------------------------------------------
#
$message = $lang['Updated_group'] . '<br />

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$lang['Updated_group'] .

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
# *
'<br />'.sprintf($lang['group_count_updated'],$group_count_remove,$group_count_added).

#
#-----[ FIND ]------------------------------------------
#
else if( $mode == 'newgroup' )
{
$sql = "INSERT INTO " . GROUPS_TABLE . " (
VALUES (

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, group_moderator

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
# *
, group_count,group_count_max,group_count_enable

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $group_moderator

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
# *
, '$group_count','$group_count_max','$group_count_enable'

#
#-----[ FIND ]------------------------------------------
#
message_die(GENERAL_ERROR, 'Could not insert new user-group info', '', __LINE__, __FILE__, $sql);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
if ($group_count_delete)
{
//removing old users
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE group_id=$new_group_id
AND user_id NOT IN ('$group_moderator','".ANONYMOUS."')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);
}
$group_count_remove=$db->sql_affectedrows();
}
if ( $group_count_update)
{
//finding new users
$sql = "SELECT u.user_id FROM " . USERS_TABLE . " u
LEFT JOIN " . USER_GROUP_TABLE ." ug ON u.user_id=ug.user_id AND ug.group_id='$new_group_id'
WHERE u.user_points>='$group_count' AND u.user_points<'$group_count_max'
AND ug.group_id is NULL
AND u.user_id NOT IN ('$group_moderator','".ANONYMOUS."')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $sql.'Could not select new users, group count', '', __LINE__, __FILE__, $sql);
}
//inserting new users
$group_count_added=0;
while ( ($new_members = $db->sql_fetchrow($result)) )
{
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES ($new_group_id, " . $new_members['user_id'] . ", 0)";
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error inserting user group, group count', '', __LINE__, __FILE__, $sql);
}
$group_count_added++;
}
}


#
#-----[ FIND ]------------------------------------------
#
$message = $lang['Added_new_group'] . '<br />

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$lang['Added_new_group'] .

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
'<br />'.sprintf($lang['group_count_updated'],$group_count_remove,$group_count_added).

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
return;
}

//
// Delete a post/poll

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$sql = "SELECT ug.user_id, g.group_id as g_id, u.user_points, g.group_count, g.group_count_max FROM " . GROUPS_TABLE . " g, ".USERS_TABLE." u
LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id
WHERE u.user_id=$user_id
AND g.group_single_user=0
AND g.group_count_enable=1
AND g.group_moderator<>$user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);
}
while ($group_data = $db->sql_fetchrow($result))
{
$user_already_added = (empty($group_data['user_id'])) ? FALSE : TRUE;
$user_add = ($group_data['group_count'] == $group_data['user_points'] && $user_id!=ANONYMOUS) ? TRUE : FALSE;
$user_remove = ($group_data['group_count'] > $group_data['user_points'] || $group_data['group_count_max'] < $group_data['user_points']) ? TRUE : FALSE;
if ($user_add && !$user_already_added)
{
//user join a autogroup
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES (".$group_data['g_id'].", $user_id, '0')";
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);
}
} else
if ( $user_already_added && $user_remove)
{
//remove user from auto group
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE group_id=".$group_data['g_id']."
AND user_id=$user_id";
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);
}
}
}


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$email_template = 'user_welcome';
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "SELECT ug.user_id, g.group_id as g_id, g.group_name , u.user_points, g.group_count FROM " . GROUPS_TABLE . " g, ".USERS_TABLE." u
LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id
WHERE u.user_id=$user_id
AND ug.user_id is NULL
AND g.group_count=0
AND g.group_single_user=0
AND g.group_moderator<>$user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);
}
while ($group_data = $db->sql_fetchrow($result))
{
//user join a autogroup
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES (".$group_data['g_id'].", $user_id, 0)";
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error inserting user group, group count', '', __LINE__, __FILE__, $sql);
}
}

#
#-----[ OPEN ]------------------------------------------
#
modcp.php

#
#-----[ FIND ]------------------------------------------
#
$count_sql = array();

#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_updated = array();

#
#-----[ FIND ]------------------------------------------
#
WHERE user_id = " . $row['poster_id'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_updated [] = "SELECT ug.user_id, g.group_id as g_id, u.user_points, g.group_count, g.group_count_max, ".$row['poster_id']." as u_id FROM " . GROUPS_TABLE . " g, ".USERS_TABLE." u
LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=".$row['poster_id']."
WHERE u.user_id=".$row['poster_id']."
AND g.group_single_user=0
AND g.group_count_enable=1
AND g.group_moderator<>".$row['poster_id'];

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT post_id

#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ( sizeof($user_updated) )
{
for($i = 0; $i < sizeof($user_updated); $i++)
{
if ( !($result = $db->sql_query($user_updated[$i])) )
{
message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $user_updated[$i]);
}
while ($group_data = $db->sql_fetchrow($result))
{
$user_already_added = (!empty($group_data['user_id']) || $group_data['u_id']==ANONYMOUS) ? TRUE : FALSE;
$user_add = ($group_data['group_count'] == $group_data['user_points'] && $group_data['u_id']!=ANONYMOUS) ? TRUE : FALSE;
$user_remove = ($group_data['group_count'] > $group_data['user_points'] && $group_data['u_id']!=ANONYMOUS) ? TRUE : FALSE;
if ($user_add && !$user_already_added)
{
//user join a autogroup
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES (".$group_data['g_id'].", ".$group_data['u_id'].", '0')";
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);
}
} else
if ( $user_already_added && $user_remove)
{
//remove user from autogroup
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE group_id=".$group_data['g_id']."
AND user_id=".$group_data['u_id'];
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);
}
}
unset ($group_data);
}
$db->sql_freeresult($result);
}
}

#
#-----[ OPEN ]------------------------------------------
#
groupcp.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ug.user_id, g.group_type
FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE g.group_id = $group_id
AND
AND

#
#-----[ IN-LINE FIND ]------------------------------------------
#
ug.user_id, g.group_type

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, group_count, group_count_max

#
#-----[ IN-LINE FIND ]------------------------------------------
#
AND g.group_type <> " . GROUP_HIDDEN . "

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
AND ( g.group_type <> " . GROUP_HIDDEN . " OR (g.group_count <= '".$userdata['user_points']."' AND g.group_count_max > '".$userdata['user_points']."'))

#
#-----[ FIND ]------------------------------------------
#
if ( $row = $db->sql_fetchrow($result) )
{
if ( $row['group_type'] == GROUP_OPEN )

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $row = $db->sql_fetchrow($result) )
{
$is_autogroup_enable = ($row['group_count'] <= $userdata['user_points'] && $row['group_count_max'] > $userdata['user_points']) ? true : false;
if ( $row['group_type'] == GROUP_OPEN || $is_autogroup_enable)

#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES ($group_id, " . $userdata['user_id'] . ", 1)";

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 1

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
,'".(($is_autogroup_enable)? 0 : 1)."'



#
#-----[ FIND ]------------------------------------------
#
$moderator = $db->sql_fetchrow($result);

#
#-----[ AFTER, ADD ]------------------------------------------
#
if (!$is_autogroup_enable)
{

#
#-----[ FIND ]------------------------------------------
#
$emailer->reset();

$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$emailer->reset();

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
}

#
#-----[ FIND ]------------------------------------------
#
$message = $lang['Group_joined'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$lang['Group_joined']

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
($is_autogroup_enable) ? $lang['Group_added'] : $lang['Group_joined']



#
#-----[ FIND ]------------------------------------------
#
$is_group_pending_member = 0;

#
#-----[ AFTER, ADD ]------------------------------------------
#
$is_autogroup_enable = ($group_info['group_count'] <= $userdata['user_points'] && $group_info['group_count_max'] > $userdata['user_points']) ? true : false;

#
#-----[ FIND ]------------------------------------------
#
if ( $group_info['group_type'] == GROUP_CLOSED )
{
$group_details = $lang['This_closed_group'];
$s_hidden_fields = '';
}
else if ( $group_info['group_type'] == GROUP_HIDDEN )
{
$group_details = $lang['This_hidden_group'];
$s_hidden_fields = '';
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $group_info['group_type'] == GROUP_CLOSED )
{
if ($is_autogroup_enable)
{
$template->assign_block_vars('switch_subscribe_group_input', array());
$group_details = sprintf ($lang['This_closed_group'],$lang['Join_auto']);
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
} else
{
$group_details = sprintf ($lang['This_closed_group'],$lang['No_more']);
$s_hidden_fields = '';
}
}
else if ( $group_info['group_type'] == GROUP_HIDDEN )
{
if ($is_autogroup_enable)
{
$template->assign_block_vars('switch_subscribe_group_input', array());
$group_details = sprintf ($lang['This_hidden_group'],$lang['Join_auto']);
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
} else
{
$group_details = sprintf ($lang['This_closed_group'],$lang['No_add_allowed']);
$s_hidden_fields = '';
}
}

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT group_id, group_name, group_type
FROM " . GROUPS_TABLE . " g
WHERE group_single_user <> " . TRUE . "
$ignore_group_sql

#
#-----[ IN-LINE FIND ]------------------------------------------
#
group_type

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, group_count , group_count_max

#
#-----[ FIND ]------------------------------------------
#
$s_group_list_opt = '';
while
{

#
#-----[ AFTER, ADD ]------------------------------------------
#
$is_autogroup_enable = ($row['group_count'] <= $userdata['user_points'] && $row['group_count_max'] > $userdata['user_points']) ? true : false;

#
#-----[ FIND ]------------------------------------------
#
if ( $row['group_type'] != GROUP_HIDDEN || $userdata['user_level'] == ADMIN )

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$userdata['user_level'] == ADMIN

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
|| $is_autogroup_enable

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/group_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{L_GROUP_HIDDEN}</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_GROUP_COUNT}:<br/>{L_GROUP_COUNT_MAX}:</span><br/>
<span class="gensmall">{L_GROUP_COUNT_EXPLAIN}</span></td>
<td class="row2" width="62%"><input type="text" class="post" name="group_count" maxlength="12" size="12" value="{GROUP_COUNT}" /><br/><input type="text" class="post" name="group_count_max" maxlength="12" size="12" value="{GROUP_COUNT_MAX}" />
<br/>&nbsp;&nbsp; <span class="gen"></span><input type="checkbox" name="group_count_enable" {GROUP_COUNT_ENABLE_CHECKED} >&nbsp;{L_GROUP_COUNT_ENABLE}
<br/>&nbsp;&nbsp; <input type="checkbox" name="group_count_update" value="0"/>&nbsp;{L_GROUP_COUNT_UPDATE}
<br/>&nbsp;&nbsp; <input type="checkbox" name="group_count_delete" value="0"/>&nbsp;{L_GROUP_COUNT_DELETE}</span>
</td>
</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

# EoM




Please see it is right
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Postby darakhshan on Wed 01. Dec, 2004 11:32

Oh man I can not edit my post
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Next

Return to Auto group [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron