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!

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.

Reply to "Sharing avatars across wikis"

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"

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 ?

Reply to "remove (delete , hide) the Update profile /personal sections"
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...

User profile is empty on user page?

IlseMul (talkcontribs)

I think I'm missing something in the LocalSettings somewhere, cause my User profile shows absolutely nothing in the profile besides the edit profile, upload avatar, etc option, while I have filled out, for example, websites, movies, books, etc. It's just completely blank under the avatar and Social Profile menu options.

This is what I have in my localsettings:

require_once "$IP/extensions/SocialProfile/SocialProfile.php";

$wgUserProfileDisplay['board'] = true;

$wgUserProfileDisplay['foes'] = true;

$wgUserProfileDisplay['friends'] = true;

$wgUserProfileDisplay['avatar'] = true; // If set to false, disables both avatar display and upload

$wgUserBoard = true;

$wgFriendingEnabled = true;

$wgAvatarKey = $wgDBname;

$wgUserPageChoice = true;

$wgUserProfileAvatarsInDiffs = true;

$wgUserProfileDisplay = true;

$wgUserProfileDisplay['stats'] = true;

Copied straight from the page here.

I don't know why there's both "$wgUserProfileDisplay = true;" and a specific "$wgUserProfileDisplay['board'] = true;" for example, but I've included excatly as it is on the page here.

Thanks for the help!

IlseMul (talkcontribs)

Problem solved. In the above code the line "$wgUserProfileDisplay = true;" has to be removed. Then everything wil be displayed.

$wgUserProfileAvatarsInDiffs is not working

Lakejason0 (talkcontribs)

when I set $wgUserProfileAvatarsInDiffs to true, any diff pages become like this:

[0865c19ce26c9993f6baece7] /index.php?title=%E8%8C%B6%E9%A6%86%E5%91%A8%E6%8A%A5/%E8%8D%89%E7%A8%BF%E7%BA%B8&curid=673&diff=5695&oldid=5672&diffmode=source Error: Call to undefined method MediaWiki\Revision\RevisionStoreRecord::getUserText()
from /www/wwwroot/podcast/extensions/SocialProfile/UserProfile/includes/UserProfileHooks.php(207)
#0 /www/wwwroot/podcast/includes/HookContainer/HookContainer.php(338): UserProfileHooks::onDifferenceEngineOldHeader()
#1 /www/wwwroot/podcast/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#2 /www/wwwroot/podcast/includes/HookContainer/HookRunner.php(1455): MediaWiki\HookContainer\HookContainer->run()
#3 /www/wwwroot/podcast/includes/diff/DifferenceEngine.php(767): MediaWiki\HookContainer\HookRunner->onDifferenceEngineOldHeader()
#4 /www/wwwroot/podcast/includes/page/Article.php(931): DifferenceEngine->showDiffPage()
#5 /www/wwwroot/podcast/includes/page/Article.php(513): Article->showDiffPage()
#6 /www/wwwroot/podcast/includes/actions/ViewAction.php(74): Article->view()
#7 /www/wwwroot/podcast/includes/MediaWiki.php(531): ViewAction->show()
#8 /www/wwwroot/podcast/includes/MediaWiki.php(315): MediaWiki->performAction()
#9 /www/wwwroot/podcast/includes/MediaWiki.php(913): MediaWiki->performRequest()
#10 /www/wwwroot/podcast/includes/MediaWiki.php(546): MediaWiki->main()
#11 /www/wwwroot/podcast/index.php(53): MediaWiki->run()
#12 /www/wwwroot/podcast/index.php(46): wfIndexMain()
#13 {main}

is there a fix? Thanks.

Jack Phoenix (talkcontribs)

What version of MediaWiki are you using? It seems to work just fine on my local MW 1.35.2 install, the avatars are showing up as expected.

Lakejason0 (talkcontribs)

It’s 1.36.1

PeaceDeadC (talkcontribs)



Jack Phoenix (talkcontribs)
Reply to "$wgUserProfileAvatarsInDiffs is not working"
AtomicMario (talkcontribs)

I am a bureaucrat on Crappy Games Wiki and I am being flooded with spam. I want to restrict messaging to autoconfirmed/confirmed users. Will a messaging restriction be programmed in?

Jack Phoenix (talkcontribs)

@MarioMario456: Spambots using the UserBoard to send spam? That's...new.

There currently isn't a way to pre-emptively prevent that; blocking a user via the regular Special:Block interface prevents them from sending out UserBoard messages, among other things.

The $wgUserProfileThresholds variable can be used to restrict access to the Special:UpdateProfile page, which allows a user to update their social profile page; you could, for example, require users to have 10 edits or three friends or even both before they can do that. This configuration variable was introduced way back as a direct response to spambots who'd sign up and post their spammy links on their social profile page without making any "real" edits or other "regular" actions.

That said, while I don't think I can give you a definitive ETA, I'd certainly like to hear more about the situation in order to better understand it.

Ciencia Al Poder (talkcontribs)

Looking at the comments log of that wiki I don't see any spammy comments. That log displays created comments and deleted comments, but created comments displays the contents. This means a spammy message will still be visible in the log, even if deleted, right?

AtomicMario (talkcontribs)
Reply to "Messaging user right"
2001:569:BD17:9F00:F947:35A:154C:3018 (talkcontribs)

Whenever I try to upload an avatar, it says it successfully uploaded but does not display any images of the apparently resized avatar, and when I go back to my profile, I just get the default avatar still. When I look in the avatars folder, it didn't create any avatars for my account. (And yes, the images I'm uploading are smaller than the required size of 100 kb, and I have tried different image types).

I have both ImageMagick and PHP GD working, so I don't get why the extension seems unable to generate the avatars upon upload. Is it possible to manually put the avatars for my profile in the avatars folder? (Well, I tried this by using my username_l.gif but didn't make a difference, though I saw in the discussion someone mentioning user IDs?) Alternatively, is it possible to just use the Extension:Avatar in place of the avatar function on this extension?

Jack Phoenix (talkcontribs)

Two words: file permissions. Roughly 99,99% of the time these kind of issues are caused by file/folder permissions, i.e. the web server user account cannot write into the target directory ($IP/avatars). Triple-check that the permissions are correct and then try again.

Reply to "Avatars won't upload"
Lakejason0 (talkcontribs)

How does this user group work? I noticed that I was given this group after installing this extension, but I can't grant it to other people. I guess I had to use scripts in maintenance to do that, or am I wrong?

Just wonder how you write a user group that can't be granted by sysops and bureaucrats. My site also want this kinda group for site owners (can't be granted by sysops and bureaucrats) but I don't think it's that appropriate to just borrow this group tho.

Ciencia Al Poder (talkcontribs)
Reply to "About user group "staff""
Treinisch (talkcontribs)

the board is showing, but there is no button anywhere to send something? What did I miss during config?

Reply to "No Button to send message"
Return to "SocialProfile" page.