News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Add & Create Social Media Icons To Profiles

Started by hcfwesker, January 30, 2012, 10:06:52 AM

Previous topic - Next topic

Darkorical

for my own usage I made a mod that adds twitch.tv, I included code that checks their API and changes between two different icons depending if you are streaming or not. I used your mod for a template to make it. If you would like the code I would happily give it to you so you could include a twitch /streaming indicator to your mod.

NekoJonez

I don't get this working when I have a Gamers ID mod installed.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

hcfwesker

Quote from: JonezJeA on April 09, 2013, 05:01:17 AM
I don't get this working when I have a Gamers ID mod installed.

If files fail on the installation of the MOD then you're going to have to manually edit those files

hcfwesker

Just to update:  I'm just about prepared to release the update to this MOD that will allow users to add Custom social media icons alongside the default ones.  It's been a very long and grueling process, to say the least.  Here's some sample pics of what will be added and how this will work.

NOTE:  I'm using a GameSpot profile as an example of a custom created social media icon.

The Modification will add a couple of new options to the Custom Profile Fields admin menu. (must be activated for this to work)



1.  A 4th selection for custom fields to be shown with Social Media icons.
2. A separate set of 'enclosed' instructions for custom Social Media Icons.
3. For this to be compatible with Ultimate Profile's icons, an image needs to be added. (otherwise the text wouldn't show as a link)
4. Supply the image name, after saving your image will be added here, as confirmation & previewing.

I've also rearranged how profile modify options are displayed for default Social Media Icons, placing them at the bottom to align with other custom profile fields option.  I just can't get rid of that horizontal line in between.



This works even better along with the Order Custom Profile Fields MOD, allowing you to arrange all Custom Profile Fields to display in the order you choose, naturally placing all your custom Social Media profiles at the top.

I'm removing displaying Social Media on the Who's Online page, and Buddies page ... after a few attempts I just didn't want to get too wrapped up in them and maybe will add them back at a later date.  Personally I feel they don't serve that great deal of purpose since most times members will see these directly from the profile or post profile of the member.

I'm working on an Upgrade file (which is what's currently holding me back), with so many code changes I'm just not sure if it's going to be worth the trouble.

Also to note, profile fields you have created previously, that you want added along the social Media default icons, can be done so just by modifying the field just a bit to meet the requirements for this custom option. (adding an image; a little rewrite for the enclosed portion, and selecting the option to display with SM Icons)

Attached below are a few sample pics just to show how the custom made icons (GameSpot) align with the default icons.





hcfwesker

v1.1.0 Released!

Added admin settings to add their own Custom Social Media icons to display with default icons (See above post!)
Removed Display from Buddies & Who's Online page


Sorry, there is no upgrade package available!  I honestly tried but there were too many edits to make a clean jump from 1.0.8 to 1.1.0; that when uninstalling after the upgraded package, would fail on many installs.  I tried, and I at least got it this far with Upgrade packages lol.


TheListener

Is there a lot of difference between the new or just what you mentioned?


hcfwesker

Pretty much a complete rewrite for Adding custom ones, which each spot the defaults were added previously, another code had to be added to display the option 4 Custom Fields setting added in as well.  But if you don't want to create and add your own to be displayed along side with the default ones, then no need to upgrade.

This was mainly for members requesting so many new ones to be added, this takes all that pressure off me :D

TheListener

Quote from: hcfwesker on April 18, 2013, 06:44:34 PM

This was mainly for members requesting so many new ones to be added, this takes all that pressure off me :D

Some people would probably request every single one there is.

:D

hcfwesker

No doubt, lol, I'm expecting it.  I get many request in PMs too. 

Now, I'm more than happy to explain how to do any custom ones ( like how to make the proper URL + {INPUT} in settings depending on sites they want to add ) that they need, but the coding aspect of it all has been dealt with, at least. 

TheListener

Quote from: hcfwesker on April 18, 2013, 06:49:25 PM
No doubt, lol, I'm expecting it.  I get many request in PMs too. 

Now, I'm more than happy to explain how to do any custom ones ( like how to make the proper URL + {INPUT} in settings ) they need, but the coding aspect of it all has been dealt with, at least. 

Wanna borrow a certain part of my sig?  ;D

FragaCampos

Great job, hcfwesker!

Thanks a lot for your constant efforts on this must have mod.

hcfwesker

Thanx, FragaCampos!  :)  I tested and tested for errors under just about any condition so just let me know how it's working for ya :)

PatternInChaos

Hi! First, thanks for all the work you put into this. =)

I have a problem, maybe you can help, I tried to add a custom field (basically facebook but with a note that it will only be visible to registeres users). When I added it with the shown settings I get a weird output on posts, the profile page looks fine:


hcfwesker

I don't have that going on for me on my test site, but i'll look into it, can you attach your Display.template.php file for me

Just to note ... NONE of the social Media icons will show for guests by default.

Also, you can goto languages/Modifications.english.php, and reword the default text for members when they fill out each field for the default icons.

$txt['smi_facebook_desc'] = 'Input your Facebook username.';

From what I can tell just by a glance, Custom Icons are meant to display WITH at least 1 of the default Social Media Icons. which I see you only have your custom FB one showing. (otherwise a different Profile Field display option would do what you want.)  That 4th option was meant for custom ones to display along with at least 1 of the defaults.  Activate 1 of the defaults and see if it still gives you the same problem  (EDIT::  Just tested, and thats what's causing the problem.  I'll see if I have a work around, but as mentioned this addition to the MOD was intended for a specific purpose.)


hcfwesker

This will fix the issue whether you chose to display a custom by ityself or with default SM icons.

Display.template.php

Find
// Any custom fields with Social Media?
if (!empty($message['member']['custom_fields']))
{
$shown = false;
foreach ($message['member']['custom_fields'] as $custom)
{
if ($custom['placement'] != 3 || empty($custom['value']))
continue;
if (empty($shown))
{
$shown = true;
}
echo '
<li><a href="', $custom['value'], '" title="', $custom['title'], ' - ', $custom['value'], '" /><img src="', $settings['images_url'], '/', $custom['customsmiicon'], '" /></a></li>';
}
if ($shown)
echo '
</ul>
</li>';
}


Remove this from the above portion (towards bottom)
</ul>

And, since Personal Message uses the same coding from display template, if you plan to do this you may want to make the same change in PersonalMessage.template.php as well.  Unless you've checked there and it was normal.

NekoJonez

Two questions.

1) Is it possible that in the feature, the icons will also be displayed in the topics? Nvm, fixed this because I had another mod installed that edited a file and so this mod wasn't able to edit the file.

2) How can I add another network like eg Tumblr? -> Did that myself.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

nax

I am thinking this mod would be a good addition to my site but it fails on the PersonalMessage.template.php See attachment. Is the best way to get around this to install the mod then try to manually edit the PersonalMessage.template.php with what I can see in the parsed code for this .php file ?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Because that takes more effort than starting a new topic and feeling entitled to an answer.

hcfwesker

Thanx for the help, fellas.  always appreciated :)

Quote from: nax on April 29, 2013, 10:33:01 AMIs the best way to get around this to install the mod then try to manually edit the PersonalMessage.template.php with what I can see in the parsed code for this .php file ?

yes, you can make the edit either before or after you install the mod.

Quote from: JonezJeA on April 29, 2013, 09:32:59 AMHow can I add another network like eg Tumblr? -> Did that myself.

you mean you already figured it out or need help adding Tumblr?


Advertisement: