// ###################### Start makeusergroupcode #######################
function print_usergroup_row($usergroup, $options)
{
global $usergroupleaders, $vbphrase, $promotions, $vbulletin;
if ($promotions["$usergroup[usergroupid]"])
{
$options['promote'] .= " (${promotions[$usergroup[usergroupid]]})";
}
$cell = array();
$cell[] = "<b>$usergroup[title]" . iif($usergroup['canoverride'], '*') . "</b>" . iif($usergroup['ispublicgroup'], '<br /><span class="smallfont">' . $usergroup['description'] . '</span>');
$cell[] = iif($usergroup['count'], vb_number_format($usergroup['count']), '-');
$cell[] = iif($usergroup['secondarycount'], vb_number_format($usergroup['secondarycount']), '-');
if ($usergroup['ispublicgroup'])
{
$cell[] = iif($usergroup['requests'], vb_number_format($usergroup['requests']), '0');
}
if ($usergroup['ispublicgroup'])
{
$cell_out = '<span class="smallfont">';
if (is_array($usergroupleaders["$usergroup[usergroupid]"]))
{
foreach($usergroupleaders["$usergroup[usergroupid]"] AS $usergroupleader)
{
$cell_out .= "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=$usergroupleader[userid]\"><b>$usergroupleader[username]</b></a>" . construct_link_code($vbphrase['delete'], "usergroup.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeleader&usergroupleaderid=$usergroupleader[usergroupleaderid]") . '<br />';
}
}
$cell[] = $cell_out . '</span>';
}
$options['edit'] .= " (id: $usergroup[usergroupid])";
$cell[] = "\n\t<select name=\"u$usergroup[usergroupid]\" onchange=\"js_usergroup_jump($usergroup[usergroupid]);\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_usergroup_jump($usergroup[usergroupid]);\" />\n\t";
print_cells_row($cell);
}
print_form_header('usergroup', 'add');
$options_default = array(
'edit' => $vbphrase['edit_usergroup'],
'promote' => $vbphrase['edit_promotions'],
'list' => $vbphrase['show_all_primary_users'],
'list2' => $vbphrase['show_all_additional_users'],
'reputation' => $vbphrase['view_reputation']
);
$options_custom = array(
'edit' => $vbphrase['edit_usergroup'],
'promote' => $vbphrase['edit_promotions'],
'kill' => $vbphrase['delete_usergroup'],
'list' => $vbphrase['show_all_primary_users'],
'list2' => $vbphrase['show_all_additional_users'],
'reputation' => $vbphrase['view_reputation']
);
$options_public = array(
'edit' => $vbphrase['edit_usergroup'],
'promote' => $vbphrase['edit_promotions'],
'kill' => $vbphrase['delete_usergroup'],
'list' => $vbphrase['show_all_primary_users'],
'list2' => $vbphrase['show_all_additional_users'],
'reputation' => $vbphrase['view_reputation'],
'leader' => $vbphrase['add_usergroup_leader'],
'requests' => $vbphrase['view_join_requests']
);
print_table_header($vbphrase['default_usergroups'], 5);
print_cells_row(array($vbphrase['title'], $vbphrase['primary_users'], $vbphrase['additional_users'], $vbphrase['controls']), 1);
foreach($usergroups['default'] AS $usergroup)
{
print_usergroup_row($usergroup, $options_default);
}
if (is_array($usergroups['custom']))
{
print_table_break();
print_table_header($vbphrase['custom_usergroups'], 5);
print_cells_row(array($vbphrase['title'], $vbphrase['primary_users'], $vbphrase['additional_users'], $vbphrase['controls']), 1);
foreach($usergroups['custom'] AS $usergroup)
{
print_usergroup_row($usergroup, $options_custom);
}
}
if (is_array($usergroups['public']))
{
print_table_break();
print_table_header($vbphrase['public_joinable_custom_usergroup'], 9);
print_cells_row(array($vbphrase['title'], $vbphrase['primary_users'], $vbphrase['additional_users'], $vbphrase['join_requests'], $vbphrase['usergroup_leader'], $vbphrase['controls']), 1);
foreach($usergroups['public'] AS $usergroup)
{
print_usergroup_row($usergroup, $options_public);
}
print_description_row('<span class="smallfont">' . $vbphrase['note_groups_marked_with_a_asterisk'] . '</span>', 0, 6);
}
print_table_break();
print_submit_row($vbphrase['add_new_usergroup'], 0);
}
// ###################### Start modify promotions #######################
if ($_REQUEST['do'] == 'modifypromotion')
{
$vbulletin->input->clean_array_gpc('r', array(
'returnug' => TYPE_BOOL
));
$title = $db->query_first("SELECT title FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$promotions = array();
$getpromos = $db->query_read("
SELECT userpromotion.*, joinusergroup.title
FROM " . TABLE_PREFIX . "userpromotion AS userpromotion
LEFT JOIN " . TABLE_PREFIX . "usergroup AS joinusergroup ON (userpromotion.joinusergroupid = joinusergroup.usergroupid)
" . iif($vbulletin->GPC['usergroupid'], "WHERE userpromotion.usergroupid = " . $vbulletin->GPC['usergroupid']) . "
");
while ($promotion = $db->fetch_array($getpromos))
{
$promotions["$promotion[usergroupid]"][] = $promotion;
}
unset($promotion);
$db->free_result($getpromos);
print_form_header('usergroup', 'updatepromotion');
if (isset($vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"]))
{
construct_hidden_code('usergroupid', $vbulletin->GPC['usergroupid']);
}
if ($vbulletin->GPC['returnug'])
{
construct_hidden_code('returnug', 1);
}
foreach($promotions AS $groupid => $promos)
{
print_table_header("$vbphrase[promotions]: <span style=\"font-weight:normal\">" . $vbulletin->usergroupcache["$groupid"]['title'] . ' ' . construct_link_code($vbphrase['add_new_promotion'], "usergroup.php?" . $vbulletin->session->vars['sessionurl'] . "do=updatepromotion&usergroupid=$groupid" . ($vbulletin->GPC['returnug'] ? '&returnug=1' : '')) . "</span>", 7);
print_cells_row(array(
$vbphrase['usergroup'],
$vbphrase['promotion_type'],
$vbphrase['promotion_strategy'],
$vbphrase['reputation_level'],
$vbphrase['days_registered'],
$vbphrase['posts'],
$vbphrase['controls']
), 1);
foreach($promos AS $promotion)
{
$promotion['strategy'] = iif(($promotion['strategy'] > 7 AND $promotion['strategy'] < 16) OR $promotion['strategy'] == 24, $promotion['strategy'] - 8, $promotion['strategy']);
if ($promotion['strategy'] == 16)
{
$type = $vbphrase['reputation'];
}
else if ($promotion['strategy'] == 17)
{
$type = $vbphrase['posts'];
}
else if ($promotion['strategy'] == 18)
{
$type = $vbphrase['join_date'];
}
else
{
$type = $vbphrase['promotion_strategy' . ($promotion['strategy'] + 1)];
}
print_cells_row(array(
"<b>$promotion[title]</b>",
iif($promotion['type']==1, $vbphrase['primary_usergroup'], $vbphrase['additional_usergroups']),
$type,
$promotion['reputation'],
$promotion['date'],
$promotion['posts'],
construct_link_code($vbphrase['edit'], "usergroup.php?" . $vbulletin->session->vars['sessionurl'] . "userpromotionid=$promotion[userpromotionid]&do=updatepromotion" . ($vbulletin->GPC['returnug'] ? '&returnug=1' : '')) . construct_link_code($vbphrase['delete'], "usergroup.php?" . $vbulletin->session->vars['sessionurl'] . "userpromotionid=$promotion[userpromotionid]&do=removepromotion" . ($vbulletin->GPC['returnug'] ? '&returnug=1' : '')),
));
}
}
print_submit_row($vbphrase['add_new_promotion'], 0, 7);
}
entra a www/admincp/usergroup.php
y postea las lineas que tienes.
A partir de que parte necesitas???
asi posteo directo...