News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding Links in profile. With a new block?

Started by GC, March 19, 2006, 08:27:02 PM

Previous topic - Next topic

GC

Hi, i'm trying to get my newly added links in the correct spot, and allow the normal users to see it. Right know only admins can see the links. Page currently looks like:


the coding is:

In Profile.php
Find:
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),

Add after:
'clanInfo' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),
'clanRequest' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),
'clanStats' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),
'clanTime' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),
'clanMail' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),
'clanRosters' => array(array('profile_clan_wars_any', 'profile_clan_wars_own'), array('profile_clan_wars_own')),


Find:
elseif ((allowedTo('profile_remove_own') && $context['user']['is_owner']) || allowedTo('profile_remove_any'))
$_REQUEST['sa'] = 'deleteAccount';


Add After:
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanInfo';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanStats';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanRequest';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanRosters';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanMembers';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanTime';
elseif ((allowedTo('profile_clan_wars_own') && $context['user']['is_owner']) || allowedTo('profile-clan_wars_any'))
$_REQUEST['sa'] = 'clanMail';


Find:
// !!! I still don't think this warrants a new section by any means, but it's definitely not part of viewing a person's profile, if only the owner can do it.
if (!empty($modSettings['enable_buddylist']) && $context['user']['is_owner'] && allowedTo(array('profile_extra_own', 'profile_extra_any')))
$context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=editBuddies">' . $txt['editBuddies'] . '</a>';
}


Add After:
// Clans
if (($context['user']['is_owner'] && (allowedTo(array('profile_clan_wars_own')))) || allowedTo(array('profile_clan_wars_any')))
{
$context['profile_areas']['edit_clans'] = array(
'title' => $txt['clanwars_title'],
'areas' => array()
);

if (($context['user']['is_owner'] && allowedTo('profile_clan_wars_own')) || allowedTo('profile_clan_wars_any'))
{
$context['profile_areas']['edit_profile']['areas']['clanInfo'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanInfo">'. $txt['clanInfo']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanMembers'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanMembers">'. $txt['clanMembers']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanRequest'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanRequest">'. $txt['clanRequest']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanStats'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanStats">'. $txt['clanStats']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanTime'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanTime">'. $txt['clanTime']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanRosters'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanRosters">'. $txt['clanRosters']. '</a>';
$context['profile_areas']['edit_profile']['areas']['clanMail'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanMail">'. $txt['clanMail']. '</a>';



Any Idea's?

SleePy


// Clans
if (($context['user']['is_owner'] && (allowedTo(array('profile_clan_wars_own')))) || allowedTo(array('profile_clan_wars_any')))
{
$context['profile_areas']['edit_clans'] = array(
'title' => $txt['clanwars_title'],
'areas' => array()
);

if (($context['user']['is_owner'] && allowedTo('profile_clan_wars_own')) || allowedTo('profile_clan_wars_any'))
{
$context['profile_areas']['edit_clans']['areas']['clanInfo'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanInfo">'. $txt['clanInfo']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanMembers'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanMembers">'. $txt['clanMembers']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanRequest'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanRequest">'. $txt['clanRequest']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanStats'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanStats">'. $txt['clanStats']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanTime'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanTime">'. $txt['clanTime']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanRosters'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanRosters">'. $txt['clanRosters']. '</a>';
$context['profile_areas']['edit_clans']['areas']['clanMail'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=clanMail">'. $txt['clanMail']. '</a>';
}
}
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: