Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to user contributions from their profile #387

Open
danieltj27 opened this issue May 25, 2024 · 1 comment
Open

Add link to user contributions from their profile #387

danieltj27 opened this issue May 25, 2024 · 1 comment

Comments

@danieltj27
Copy link
Contributor

As it currently stands, there is no way to quick go from a users main profile on the forum (phpbb/community) to their list of customisations. You could copy and paste their name into the URL structure for the listing page:

https://www.phpbb.com/customise/db/author/danieltj/contributions

Taking me as an example here... however, most users probably don't have that URL to hand.

I'm simply proposing that there is a link added to the users main profile somewhere that includes the total number of validated contributions to the database. I'm not sure where it'd go, but I made a quick example from messing around in dev tools.

phpbb-user-profile-customs-stat

If I can get the database set up properly I can submit a PR, but what are your thoughts?

@iMattPro
Copy link
Member

You could start with a php event core.memberlist_prepare_profile_data with a function in the listener like:

$user_contribs = $this->controller_helper->route('phpbb.titania.author', array(
    'author'  => urlencode($event['data']['user_id']),
    'page'    => 'contributions',
));

$event->update_subarray(
    'template_data,
    'U_USER_CONTRIBUTIONS,
    $this->controller_helper->get_real_url($user_contribs)
);

And then the template event memberlist_view_user_statistics_after for the HTML stuff

Of course you'll also need to get the count of their approved contributions if you want to use the number. Otherwise it could just also be generic text, like danieltj27's contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants