• Welcome to Simple Machines Community Forum. Please login or sign up.
November 28, 2021, 12:46:00 PM

News:

Join the Facebook Fan Page.


Extra Links In Profile

Started by mickjav, September 04, 2021, 05:30:58 AM

Previous topic - Next topic

mickjav

Hi Been trying to add some links to my profile As Below

I can get the bookmarks to show but not the gallery, I do have another to add for Downloads

I Am trying to add the 3 links below the badge awards link

Even thought the Bookmarks shows it keep getting altered by the profile_areas Array

Any help would be appreciated

// End Badge Awards
'bookmarks' => array(
'title' => $txt['bookmarks'],
'href' => $scripturl . '?action=bookmarks',
'show' => allowedTo('make_bookmarks'),
'permission' => array(
'own' => 'profile_view_own',
'any' => 'profile_view_any',
),
),
'gallery' => array(
'title' => 'Gallery',
'href' => $scripturl . 'index.php?action=gallery;su=user;u=' && $context['id_member'],
'show' => true,
),
Database Dreams - music and charts, Home of Chart Tracker Elite, Apollo & DJ 2020.
Coming soon The Librarian.

Arantor

You need to set some permissions for it like the bookmarks one does, no permissions set means the system thinks you don't have permission to see it.
No good deed goes unpunished
All helpful urges should be circumvented

mickjav

Quote from: Arantor on September 04, 2021, 05:37:49 AMYou need to set some permissions for it like the bookmarks one does, no permissions set means the system thinks you don't have permission to see it.

Thanks Done That but it's still not showing.

The problem I'm having with the Bookmarks is the link keeps being altered from:
?action=bookmarks to ?action=profile;area=bookmarks;u=1
I receive error warning "You are not allowed to access this section"

// End Badge Awards
                'bookmarks' => array(
                        'title' => $txt['bookmarks'],
                        'href' => $scripturl . '?action=bookmarks',
                        'show' => allowedTo('make_bookmarks'),
                        'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                        ),
                    ),
                'gallery' => array(
                        'title' => 'Gallery',
                        'href' => $scripturl . 'index.php?action=gallery;su=user;u=' && $context['id_member'],
                        'show' => true,
                        'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                        ),
                    ),
Database Dreams - music and charts, Home of Chart Tracker Elite, Apollo & DJ 2020.
Coming soon The Librarian.

Arantor

Ah, I forgot, the menu system isn't *really* designed to do what you're trying to do because it's designed to generate the menu and links automatically based on the sections defined - and is pointedly not the same as the main menu.

However... there is a way to override it explicitly, which should be the following:

// End Badge Awards
                'bookmarks' => array(
                        'title' => $txt['bookmarks'],
                        'custom_url' => $scripturl . '?action=bookmarks',
                        'show' => allowedTo('make_bookmarks'),
                        'permission' => array(
                                'own' => 'profile_view_own',
                                'any' => 'profile_view_any',
                        ),
                    ),
                'gallery' => array(
                        'title' => 'Gallery',
                        'custom_url' => $scripturl . 'index.php?action=gallery;su=user;u=' && $context['id_member'],
                        'show' => true,
                        'permission' => array(
                                'own' => 'profile_view_own',
                                'any' => 'profile_view_any',
                        ),
                    ),
No good deed goes unpunished
All helpful urges should be circumvented

mickjav

Thanks The Bookmarks link works great the only item of interest is the user ID is tagged on the end ";u=1" but does not seem an issue but I only have my data at the moment so will wait till more data available to see if it's going to be a problem.

I am unable to display the gallery link I have edited the links for $txt[] and added a value in the profile.English file as wasn't sure if the 'Gallery' was causing a problem.

'gallery' => array(
                        'title' => $txt['gallery_title'],
                        'custom_url' => $scripturl . 'index.php?action=gallery;su=user;u=' && $context['id_member'],
                        'show' => true,
                        'permission' => array(
                                'own' => 'profile_view_own',
                                'any' => 'profile_view_any',
                        ),
                    ),

Database Dreams - music and charts, Home of Chart Tracker Elite, Apollo & DJ 2020.
Coming soon The Librarian.

mickjav

I have edited link as the default seems to add U=I on end

'gallery' => array(
                        'title' => $txt['gallery_title'],
                        'custom_url' => $scripturl . 'index.php?action=gallery;su=user',
                        'show' => true,
                        'permission' => array(
                                'own' => 'profile_view_own',
                                'any' => 'profile_view_any',
                        ),
                    ),

Database Dreams - music and charts, Home of Chart Tracker Elite, Apollo & DJ 2020.
Coming soon The Librarian.

Advertisement: