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!

upload avatar does not work

11
Openn1 (talkcontribs)

first thanks for all the hard work what you doing.

We have installed MediaWiki 1.40.1 everything is working exept the upload avatar from SocialProfile

Olso works other uploader for placing images to a blog stories etc olso thumbs works, exept SocialProfile upload does not work

we getting: [21b068a135179427fe87c0fa] 2023-12-06 19:27:04: Fatal exception of type "Error"

Ciencia Al Poder (talkcontribs)
Openn1 (talkcontribs)

Thanks for your respons we have add $wgShowExceptionDetails to true

/index.php?title=Special:UploadAvatar

[0c434d423bdba7ce92964dd4] /index.php?title=Special:UploadAvatar Error: Call to undefined function imagecreatefrompng()

Backtrace:

from E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\avatar\UploadAvatarTrait.php(121)

#0 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\avatar\UploadAvatarTrait.php(231): UploadAvatar->createThumbnail()

#1 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specials\SpecialUpload.php(568): UploadAvatar->performUpload()

#2 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specials\SpecialUpload.php(232): SpecialUpload->processUpload()

#3 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\specials\SpecialUploadAvatar.php(69): SpecialUpload->execute()

#4 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specialpage\SpecialPage.php(701): SpecialUploadAvatar->execute()

#5 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specialpage\SpecialPageFactory.php(1475): SpecialPage->run()

#6 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(327): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#7 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(923): MediaWiki->performRequest()

#8 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(576): MediaWiki->main()

#9 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\index.php(50): MediaWiki->run()

#10 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\index.php(46): wfIndexMain()

#11 {main)

Ciencia Al Poder (talkcontribs)

imagecreatefrompng is a PHP function, available when PHP has been compiled with GD support.

It looks like you'll need to install the php-gd package and/or enable it in php.ini

Openn1 (talkcontribs)
Product Version
MediaWiki 1.40.1
PHP 8.1.13 (cgi-fcgi)
ICU 70.1
MySQL 5.5.28

We have php version 8.1.13

In PHP 8.1, there’s a new lossless WebP encoding support for the GdImage object. It can be enabled using GD extension and libwebp version 0.2.0. The new PHP constant to declare the lossless WebP encoding is

IMG_WEBP_LOSSLESS

IMG_WEBP_LOSSLESS, along with

imagewebp

imagewebp function. In a PHP code, it looks like this:

Plain text

Copy to clipboard

Open code in new window

EnlighterJS 3 Syntax Highlighter

$image = imagecreatefromjpeg('image.jpg');

imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

$image = imagecreatefromjpeg('image.jpg'); imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

$image = imagecreatefromjpeg('image.jpg');
imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

So, how can it work with upload avatar? If we do a normal upload the Thumbs are vissable and uploading works. Only not for the avatar on the SocialProfile. And we use the latest version from your SocialProfile.

Ciencia Al Poder (talkcontribs)

Wiki uploads use imagemagick for thumbnailing. SocialProfile, however, does not and uses PHP GD instead. That may be a reason of why wiki uploads work without errors but avatars don't.

See Manual:Php.ini, create a file in your webserver to display the php information as described on that page, and see if gd is listed as a loaded PHP extension module. Install or enable it and try again until it's listed as enabled.

Openn1 (talkcontribs)

thats not possible , i use a webhosting , other way? Maby a alternative plugin extension for the upload possible to direct upload for the image/avatar map ?

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

So what the sollution ?

Ciencia Al Poder (talkcontribs)

Ask your hosting provider to enable GD. Or get a better hosting provider.

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

becourse everything works ecept your extension for upload you gonna advise change hosting ?

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

problem solved we are back on the version php and now works.

Reply to "upload avatar does not work"

User Profile's first heading not correctly hidden with Timeless in 1.40.1

3
Lakejason0 (talkcontribs)
Jack Phoenix (talkcontribs)

First off, the mandatory disclaimer: only the latest LTS release (1.39) is truly tested and supported, support for any and all other versions is coincidental at best. :-)

Now...

This looks like it might've been caused by commit e733d2624a03eb05c19240e6302939a2c288dbfb on the Timeless repository, which for sure overrides the .firstHeading rule from SocialProfile's /extensions/SocialProfile/UserProfile/resources/css/UserProfile.css. Maybe something like .skin-timeless h1.firstHeading, in addition to the existing .firstHeading rule in that file, would do the trick? Let me know and I'll be happy to amend the file accordingly. (Although I'm not fond of skin-specific hacks, I'm hoping that there won't be too many such similar cases; but as of MW 1.39 pretty much all skins, even Timeless, behave as expected, so...hard to tell, really.)

Lakejason0 (talkcontribs)

@Jack Phoenix Welp, as long as you could manage to manage the whole project structure more stable and easy to maintain, a fix on your side would be preferred. For now I'm using a pretty bad way to detect whether the user profile ResourceLoader module is loaded and then load a fix style accordingly if yes, and I must say that I'm not satisfied with this https://lakeus.xyz/wiki/MediaWiki:Gadget-userprofile-fix.js. I must say though, why not just add an !important to display: none ? There are already some of these for some unknown reason to me anyway.

Reply to "User Profile's first heading not correctly hidden with Timeless in 1.40.1"

Conflicts with RevisionSlider when $wgUserProfileAvatarsInDiffs enabled

3
Summary by Jack Phoenix

Patch was merged, issue is now resolved

Lakejason0 (talkcontribs)

In UserProfileHooks.php, the function onDifferenceEngineOldHeader() and onDifferenceEngineNewHeader(), the $oldHeader and $newHeader construct the header with <h4> instead of <strong> (MediaWiki default behavior), causing RevisionSlider fails to select the element.

Jack Phoenix (talkcontribs)

Thanks for the very useful bug report and research! :) I've submitted a patch based on the information provided to gerrit; give it a spin and let me know if it fixes the issue and I'll be happy to +2 the patch and have it land on master to fix the issue for all users.

Lakejason0 (talkcontribs)

That's exactly what I've done to my installation. It works.

install SocialProfile failed

3
Yuht0111 (talkcontribs)

Hi sir, I installed this extension as procedure said,put require_once "$IP/extensions/SocialProfile/SocialProfile.php"; into localsetting.php,and then run update.php,but it doesn't work when i open special:version.

I am confused ,it seems only me have this problem.

BTW,is it conflict with semanticMW,because each time I will run rebuildData.php in SMW/mainteinence after update.php done.

My MW version is 1.39.3,and SMW is 4.1.1

Or maybe I should set $wgUploadDirectory?I didn't add this code in localsetting.php.

Can anyone help me ,i am a greenfinger about this mediawiki and try to learn about this.Thank you very much at all.

Ciencia Al Poder (talkcontribs)

What does this mean? "but it doesn't work when i open special:version"

Do you get an error? Or does it not list the extension?

Yuht0111 (talkcontribs)

Hi Ciencia Al Poder

sry for my expression,I mean it didn't install into the MW,and I have re-install my mediawiki ,and then succeed to install this extension,wired,maybe the database problem i guess? Thank you for your reply.

Reply to "install SocialProfile failed"

mw 1.39 Error: Call to undefined method Title::getContext()

1
Summary by Gzombiejun

When I use the master version, everything works fine.

Gzombiejun (talkcontribs)

I have installed SocialProfile on my MediaWiki 1.39 instance. When I click on the "Use Social Profile User Page" button on my user page (which is currently a wiki user page), nothing happens. Then, when I click on the "Yes" button on the "Special:ToggleUserPage" page, it throws an error: "Error: Call to undefined method Title::getContext()".

Mwssnov (talkcontribs)

SocialProfile.php (from 104):

// Prefix SocialProfile will use to store avatars

// for global avatars on a wikifarm or groups of wikis,

// set this to something static.

$wgAvatarKey = $wgDBname;


but, RandomUsersWithAvatars.php (from 47):

if ( !$data ) {

$files = glob( $wgUploadDirectory . "/avatars/{$wgDBname}_*_{$size}.*" );


(72): preg_match( "/{$wgDBname}_(.*)_/i", $avatarName, $matches );

Jack Phoenix (talkcontribs)

Thanks for the report, this is now fixed!

If you're curious about the history: the $wgAvatarKey patch in SocialProfile (commit bbb405a0a208a915c0f746b4c501ab6a8d9d86c9) took place years before phab:T195173 was resolved; because RandomUsersWithAvatars was, at the time, a separate extension, nobody thought of updating it. Oops. :) Glad you caught the bug now and reported it!

Reply to "wgAvatarKey"

incorrect fields preview

2
Summary by Jack Phoenix
Mwssnov (talkcontribs)

after saving the text in custom fields, all fields have the same text

SpecialUpdateProfile.php: from 913: ( isset( $custom2 ) && $custom2 ? htmlspecialchars( $custom1, ENT_QUOTES ) : ) ( isset( $custom3 ) && $custom3 ? htmlspecialchars( $custom1, ENT_QUOTES ) : ) ( isset( $custom4 ) && $custom4 ? htmlspecialchars( $custom1, ENT_QUOTES ) : )

everything okay?

and here 776: ( isset( $snacks ) ? htmlspecialchars( $tv, ENT_QUOTES ) : )

Jack Phoenix (talkcontribs)

exception when creating a page

5
Mwssnov (talkcontribs)

mw_1.38 && (sp_1.38 || sp_master) if i want to create a page in the user namespace eg user:user\newpage get exception MediaWiki internal error.

Original exception: [7ed5ff5d67faf0f3f8fe2f13] /page/User:Root/dsf Error: Call to a member function getName() on bool Backtrace: from \w\extensions\SocialProfile\UserProfile\includes\UserProfile.php(85)

  1. 0 \w\extensions\SocialProfile\UserProfile\includes\UserProfileHooks.php(118): UserProfile->__construct()
  2. 1 \w\includes\HookContainer\HookContainer.php(338): UserProfileHooks::onArticleFromTitle()
  3. 2 \w\includes\HookContainer\HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()

...

lines from 117 in UserProfileHooks.php: if ( $wgUserPageChoice ) { $profile = new UserProfile( $pageTitle ); $profile_data = $profile->getProfile();

i can catch the exception and redirect to main page, but is not good solution

Ciencia Al Poder (talkcontribs)
Mwssnov (talkcontribs)

I added: $wgNamespacesWithSubpages = [ NS_MAIN => true, NS_USER => true ]; And cutback my exception catch ) It works. Add this to description page.

Jack Phoenix (talkcontribs)

MediaWiki 1.38 isn't a Long-Term Support (LTS) release of MediaWiki anyway so it hasn't ever been tested and any and all support for it has been and remains coincidental at best; refer to social tools/MediaWiki compatibility, but basically always use master version of SocialProfile and other social tools with the latest LTS release of MediaWiki, that's something that's actually tested and supported.

Mwssnov (talkcontribs)

pf) I have no doubt that all the same would be in 1.39 )

Reply to "exception when creating a page"
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

5
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"
Return to "SocialProfile" page.