Extension talk:SocialProfile

About this board

Previous discussion was archived at Extension talk:SocialProfile/Archive 8 on 2017-12-22.

Please post new topics here, with the newest posts being at the bottom of the page. Discussions are archived gradually, so please check the archives to make sure that your question hasn't been answered already!

DoctorIGP (talkcontribs)

Greetings. The extension has been successfully uploaded, but when I try to upload a pfp, it gives me an error. /avatars belongs to apache and is within the images directory. The only other extensions I have (apart from prepackaged extensions) are WikiForum and SkinPerPage.

Reply to "PFPs not uploading"

delete profile sections

Lmdg2000 (talkcontribs)

Hi there, how to delete two sections from "social profile" ?

namely: I want to delete "other information" and "custom information"

meaning that I don't want users of my wiki to see such sections in their profile

Thank you !

Jack Phoenix (talkcontribs)

There isn't a built-in, clean way to do that currently. You could mess around with CSS and/or JS to try to achieve the desired effect, but...judging from a quick look at the HTML output, I guess that won't be very easy, because profile page section titles nor the sections have any unique classes or IDs, so you can't blindly hide all elements which have e.g. the class user-section-heading or profile-info-container. :-(

Just out of general curiosity, why do you desire to do this? Most sites repurpose these fields for site-specific information, e.g. Brickipedia, the LEGO wiki has repurposed the "Custom information" section as "Favorites", allowing registered users to display stuff like their favorite LEGO theme or minifigure on their profiles.

Lmdg2000 (talkcontribs)

Thank you Jack, I would be more than happy to have profiles looking like the Brickipedia ones... Any suggestion on how to get there? We probably need a WikiMedia developer willing to contribute to a non-profit project..Let me know if you have any idea on how to find him/her..Thank you !

Jack Phoenix (talkcontribs)

As a quick terminological clarification: the software is called MediaWiki, whereas the Wikimedia Foundation, Inc. (no capital M there :-) is the US-based non-profit hosting Wikipedia and several other wiki sites using the MediaWiki engine. The page Differences between Wikipedia, Wikimedia, MediaWiki, and wiki should hopefully provide a more useful, in-depth look into all the similar-looking yet distinct words that start with or contain "wiki" in them.

As for customizing the profile sections' names, it's deceptively simple, even. Just edit the pages called MediaWiki:Custom-info-field1, MediaWiki:Custom-info-field2, MediaWiki:Custom-info-field3 and MediaWiki:Custom-info-field4. (To do this, you need to have the editinterface user right; by default the "interface editors" group should have this right...but also by default nobody is in that brand new group, so you may need to add your user account to that group via Special:UserRights.) For example, on Brickipedia MediaWiki:Custom-info-field1 has been set to "Favorite Set".

More in-depth customization can be done; for example, Halopedia, the Halo wiki has a social "Accounts" section for Xbox gamer ID, Twitter account, etc. In the past, the Xbox gamer ID was implemented as described on Extension:SocialProfile/Developer information but Halopedia's current implementation is neither FOSS nor supported out-of-the-box by SocialProfile. (Just to clarify, while I have an account on Halopedia and I use the site often as an example, I haven't been actively involved with its development in ages and I'm generally speaking extremely critical of tivoization. That said, perhaps the current site tech admin is willing to share their modifications if you ask him nicely. Personally I think it would've made a lot more sense for everyone to have Halopedia implement the accounts section and whatnot in a lot more structured, forwards-compatible way. Still, should you want something similar and should Halopedia not be willing to share, I'm sure it's easy enough to reimplement that.)

Lmdg2000 (talkcontribs)

Thank you very much @Jack Phoenix for your extensive explanation !

Reply to "delete profile sections"

User avatar in the moustache skin

Антаркт (talkcontribs)

Hello, how to add user profile avatar to the navigation menu of my moustache skin?

Jack Phoenix (talkcontribs)

The Mustache skin system is so new that I personally haven't tried it out yet, even. That said, I have some experience with Mustache in general inside MediaWiki and skinning, so I'm guessing that as explained at Manual:How to make a MediaWiki skin/en#Extending data, you need to create a PHP class which, at minimum, sets a variable that you can use in your Mustache template(s) which contains the avatar HTML markup. Maybe something like this:


class MySkin extends SkinMustache {

	 * Extends the getTemplateData function to add a template key 'html-user-avatar'
	 * which can be rendered in skin.mustache using {{{html-user-avatar}}}
	public function getTemplateData() {
		$data = parent::getTemplateData();
		// Note that:
		// 1) you may wish to use class_exists( 'wAvatar' ) prior to invoking the class
		// to check whether SocialProfile is installed at all or not
		// 2) you can pass custom attributes (e.g. "class" etc.) to getAvatarURL(); the Refreshed skin, for example, does this
		$data['html-user-avatar'] = ( new wAvatar( $this->getUser()->getId(), 'l' ) )->getAvatarURL();
		return $data;

Антаркт (talkcontribs)

I looked at some of the documentation on this site, tried to search the web, and even researched the Vector skin source code a bit, but still didn't figure out how to include the php file to my mustache skin. I can coding with python and javascript and work with html, css, but mediawiki skin development is new for me, sorry.

Reply to "User avatar in the moustache skin"

a problem related to the level name

멍한오리 (talkcontribs)

Hello, I'd like to ask for help. When naming a level using the $wgUserLevels variable, there is a problem that when using English, it is displayed well on the wiki, but when using Korean, it is not displayed and only appears as "()". Is there a good way to solve this problem? Thank you.

Ciencia Al Poder (talkcontribs)

Looking at the code, I couldn't find any reason for it to not display the correct name when the user chooses another language.

The user levels aren't translatable, though. All languages will display the same names (the ones defined at $wgUserLevels)

Jack Phoenix (talkcontribs)

SocialProfile and other social tools should be more than i18n-friendly; supporting a wide variety of languages is a source of joy for us. :-) As Ciencia Al Poder noted above, it should work. Please double-check that the LocalSettings.php file uses UTF-8 encoding. Additionally, you may wish to ensure that you're running the latest version of SocialProfile on MediaWiki 1.35 (or newer; but support for newer versions of MediaWiki is more coincidental than tested by me or other developers/users of social tools).

Finally, if you have a link to the web site (i.e. if it is a public wiki), I could certainly take a look myself and see if I can spot anything that seems immediately off.

Reply to "a problem related to the level name"

mw1.37.2 SocialProfile->user->preferences not saving

Proactive programming (talkcontribs)

UserProfile->includes->specials->SpecialUpdateProfile.php -- $userOptionsManager = $this->getUserOptionsManager();

(no function called "getUerOptionsManager()")

Jack Phoenix (talkcontribs)

Thanks for the report! I was able to confirm the presence of the bug on MW 1.35 as well; please update your copy of SocialProfile to the master version to incorporate this fix, which gets rid of that bug.

Reply to "mw1.37.2 SocialProfile->user->preferences not saving"

Avatars don't work with private wikis using image_auth.php

Revansx (talkcontribs)

MW 1.35

SocialProfile 1.14 (fdafe9e) 23:59, 19 December 2021

Avatars don't work with private wikis using image_auth.php

I have verified that the web-server has read/write access to the folders and images, but still get the "Access denied - You are not allowed to execute the action you have requested." from the browser.. please advise

Ref: https://phabricator.wikimedia.org/T163529

Ciencia Al Poder (talkcontribs)

If you inspect the URL of the avatar, where does it point to? To image_auth.php? or directly to the images folder?

Revansx (talkcontribs)
Ciencia Al Poder (talkcontribs)

This would be doable if the extension implements $wgImgAuthUrlPathMap and a custom file backend, which currently doesn't.

Revansx (talkcontribs)

Cool. Maybe someday, but all I really wanted from SocialProfile was the avatar capability. No biggie. Maybe someone in the SocialProfile dev community will read your last comment and add the capability.. but it's no longer on my radar. Cheers!

Revansx (talkcontribs)

Wait.. are you saying it could as simple as adding:

$wgImgAuthUrlPathMap['/avatars/'] = 'mwstore://mediawiki/images/avatars/';

to LocalSettings.php .. assuming SocialProfile is using a folder in the standard wiki upload directory? (which it is)

Ciencia Al Poder (talkcontribs)
Revansx (talkcontribs)

Ok. Thanks for clarifying.

Jack Phoenix (talkcontribs)

This is a known issue (https://phabricator.wikimedia.org/T163529 ; also see https://phabricator.wikimedia.org/T88033) and there's a work-in-progress patch (which is outdated and not yet working nor being actively worked on) at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SocialProfile/+/444441 ; any and all contributions are more than welcome as img_auth.php related stuff is likely to be super low priority otherwise. It's certainly not something I'm testing, unfortunately, so I'm relying on the community for such patches! (SocialProfile and others social tools were written over 15 years ago and the wikis that initially ran the tools were 100% public; as such, it's not that hard to imagine why there'd be bugs with non-public setups.)

Reply to "Avatars don't work with private wikis using image_auth.php"
Megacane (talkcontribs)

Hello, I'm pretty sure this hasn't been covered here before. I am wondering how to share avatars with this extension cross-wiki. We use different upload directories though for each wiki, is this a roadblock or is there another way to achieve this? I know something with $wgSharedDB should work but I am having no luck with that. Thanks.

Jack Phoenix (talkcontribs)

@Megacane: Although it hasn't been touched in a while, the Extension:SocialProfile/Developer information page, especially the "Uploads" section there, is somewhat accurate in this regard. As per that page, by default user avatars use the naming convention $wgDBname_USERID_SIZE.EXTENSION (i.e. testwiki_1_l.png; size can be l for large, ml for medium-large, s for small) but luckily this is just the default, and you can configure a more static prefix by setting the $wgAvatarKey variable to something static; this string will then be used in the avatar file names instead of $wgDBname.

Having said that...SocialProfile and other social tools are not that well tested with various shared setups, as the extensions were originally written by and for a single wiki and thus there are certain assumptions the code makes. Some of these issues are known and tracked (e.g. T144466) but many probably aren't. Please do report any and all such inconsistencies, bugs and other quirks you may run into!

The $wgAvatarKey variable was originally introduced in commit bbb405a0a208a915c0f746b4c501ab6a8d9d86c9 back in late 2014 for Brickimedia, which was then a wiki farm consisting of several wikis (using shared uploads). Images were stored in the meta-wiki and shared from there to other wikis. These days the meta-wiki is gone and Brickipedia is basically just a single wiki, but regardless that particular setup has thus been tested on a production wiki, albeit a while ago.

That said, at a glance it looks like the code in wAvatar#getAvatarImage uses $wgUploadDirectory...perhaps the aforementioned $wgAvatarKey variable will do the trick, perhaps you may need to hack around limitations with symlinks or perhaps it's not doable without tweaking SocialProfile; either way, do give it a try and let me know how it goes!

Megacane (talkcontribs)

Your suggestion for making $wgAvatarKey be set to a random string (for example) worked just fine! I just literally got my problem resolved so I don't know of any bugs just yet. However, if I run across some I'll be sure to let you know. Thank you.

remove (delete , hide) the Update profile /personal sections

Mdyug (talkcontribs)

MW 1.35.0 How to remove (delete , hide) the Update profile /personal sections in personal account for all ?

Pneuma01 (talkcontribs)

I want this too

Reply to "remove (delete , hide) the Update profile /personal sections"

Add and edit existing fields

4 (talkcontribs)

Is there any way to edit the fields to be filled in by the user, or even add new fields?

NOTE: I'm using Miraheze for mediawiki.

Best regards, Virgil

Jack Phoenix (talkcontribs)

Do you mean the "Custom information" snippets shown on social profile pages? They are customizable by editing MediaWiki:Custom-info-field1, MediaWiki:Custom-info-field2, MediaWiki:Custom-info-field3 and MediaWiki:Custom-info-field4. For example, Halopedia, the Halo wiki uses these fields for Xbox gamer tag and favorite/worst favorite Halo moment.

Krabina (talkcontribs)

Is it also possible to remove or change the existing snippets? e. g. if I want to remove the "Movies" field completely.

Jack Phoenix (talkcontribs)

There's no proper, native support for removing the built-in fields. If you want to hide them on Special:UpdateProfile, you can probably hack something together with CSS, but it seems to be a bit more complicated than I initially thought.

If you visit the Special:UpdateProfile special page and append ?uselang=qqx to the URL, you'll see what MediaWiki: interface messages/message keys the page uses. So to rename the "movies" field, for example, you could edit MediaWiki:User-profile-interests-movies to repurpose it to something more fitting for your site. (Of course that field will still continue to be internally called "movies" by the SocialProfile codebase, but that's probably of little to no relevance to you.)

Reply to "Add and edit existing fields"
Mdyug (talkcontribs)

Hi, my MW 1.36.1 When I tried to update /mw-config/ during installation, these lines appeared:

[YR64okI6arQg2ZzT9fMgxQAByRs] /mw-config/?page=ExistingWiki Exception: Unable to open file /home/bh458/public_html/extensions/SocialProfile/extension.json: filemtime(): stat failed for /home/bh458/public_html/extensions/SocialProfile/extension.json Backtrace: from /home/bh458/public_html/includes/registration/ExtensionRegistry.php(176)

  1. 0 /home/bh458/public_html/includes/GlobalFunctions.php(52): ExtensionRegistry->queue(string)
  2. 1 /home/bh458/public_html/LocalSettings.php(194): wfLoadExtension(string)
  3. 2 /home/bh458/public_html/includes/installer/Installer.php(669): require(string)
  4. 3 /home/bh458/public_html/includes/installer/WebInstallerExistingWiki.php(29): Installer::getExistingLocalSettings()
  5. 4 /home/bh458/public_html/includes/installer/WebInstaller.php(269): WebInstallerExistingWiki->execute()
  6. 5 /home/bh458/public_html/mw-config/index.php(82): WebInstaller->execute(array)
  7. 6 /home/bh458/public_html/mw-config/index.php(40): wfInstallerMain()
  8. 7 {main}

Please tell me what could be the problem? I write in Localsettings.php wfLoadExtension( 'SocialProfile' );

Ciencia Al Poder (talkcontribs)
Mdyug (talkcontribs)

This can be converted to: ... Here Sorry, MW 1.36.1work (!)with require_once "$IP/extensions/SocialProfile/SocialProfile.php"; Thank you ! I'm a newbie...

Return to "SocialProfile" page.