Add & Create Social Media Icons To Profiles

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

Previous topic - Next topic

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."

NekoJonez

Question to the mod author.

A time ago, I asked about how to hide the social icon stuff for guests. Maybe this is a nice idea as a feature request for an update...

A setting where you as admin can choose to either hide it or show it for guests? Or add that patch to the new version?
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Dzonny

@NekoJonez:
Display.template.php
Find:
// This shows the social media icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])

Replace with:
// This shows the social media icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'] && !$context['user']['is_guest'])


That should work for hiding social stuff from guests in topic display. You'd have to edit other template files in order to hide it in other parts of forum, for example in profile etc. Let us know if this works though, I didn't tested it.

hcfwesker

Thanx, Dzonny!  Though, Neko already got this fix a while back.  http://www.simplemachines.org/community/index.php?topic=467074.msg3598238#msg3598238

Not too many others have posted on this so didn't see it as an emergency to update it at the time. :D  One day when I get motivated to open up Notepad I'll try and update the mod with the fix.  Though I usually just update when there's a major addition of sorts to the mod.  A simple search with just the keyword "guests" will pull up that fix, in the meantime.


NekoJonez

If you feel too lazy to do it, I don't mind doing it for you and sending it over to you.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

PopUpSteve

Great mod, thanks.

If I could make one suggestion, it would be nice if you could check for and strip-out the social media's own URL when saving the info. Members tend to just copy and paste their pages URL and then the social media's URL gets doubled.

The member enters: https://twitter.com/username

which becomes: https://twitter.com/https://twitter.com/username

but should be: username

I know you have noted that in the instructions but when was the last time someone followed the instructions. :D
Steve
"Even a broken clock is right twice a day, unless it's digital."

Ground Zero

I love this mod although I have one small request though... How about adding Instagram? ;D

NekoJonez

Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

AngelVoices

Hi. I cannot get the mod to work. I installed and under Features and Options there is no config for this mod showing up. So I uninstalled and reinstalled and still can't get it to work. I have cleared cache and cookies and refreshed.  I am using default Curve theme 2.0.7.  What am I missing? URL is hxxp:www.voiceoftheangels.com/spiritualforum [nonactive] Thank you.

hcfwesker

Quote from: AngelVoices on May 24, 2014, 04:22:11 PM
Hi. I cannot get the mod to work. I installed and under Features and Options there is no config for this mod showing up. So I uninstalled and reinstalled and still can't get it to work. I have cleared cache and cookies and refreshed.  I am using default Curve theme 2.0.7.  What am I missing?

Did you install version 1.1.0 (most recent)

Did you activate "advanced profile fields"

QuoteAdvanced Profile Fields must be activated under 'Core Features' for this Mod to work

Once you have installed the MOD, activated 'Advanced Profile Fields' follow the instructions in this link, which is also in the MOD description page. Which explains how to add your own icons along with the default installed social icons.   http://www.simplemachines.org/community/index.php?topic=467074.msg3528592#msg3528592


AngelVoices

Yes, I have installed the most recent version. I don't seem to have a Custom Profile Fields option. Where is that located?

Arantor

Did you, as directed, go and turn Custom Profile Fields on first in Admin > Configuration > Core Features ?

AngelVoices

Ok, now the Custom Profile Field is activated. I don't see any extra profile fields, but I do see check boxes for Twitter, Google, FB, etc. All I have to do is check the boxes? Thank you.

Arantor

Yes, you have to tick the boxes under the 'Active' column to make them active...

AngelVoices

Yes, I get that part. The boxes are checked off and active. But what I'm saying is I do not see the icons showing up anywhere.

AngelVoices

Ok, I got it. You have to add it as a custom field. Done. Not sure if they are showing up yet, but it's all configed. Thank you.

hcfwesker

Quote from: AngelVoices on May 24, 2014, 08:44:30 PM
Ok, I got it. You have to add it as a custom field. Done. Not sure if they are showing up yet, but it's all configed. Thank you.

Actually, no, you don't have to add them as a custom field, if you just want to use the defaults that come installed (facebook, twitter, youtube, etc).  You just install the MOD, activate Custom Profile Fields ... then just fill out your information for each under your "Forum Profile" edit page.  The icons will display on forum pages as the MOD page explains.  The icons for each won't appear if members have not filled out info for them ... OR you're using a custom theme, then you'll have to add the images to those themes as well.

IF you want to ADD your own, then yes, activate Custom Profile Fields , then you'll have to add them under the Custom Profile Fields page, where the link I posted up above will explain how that is done.

AngelVoices

Ok, thank you. That's a good explanation. I do see they are showing up now. Perfect. Thanks!

vbgamer45

SEO tip if using this mod and a user has google plus

Find in sources/display.php after aound line 401

// Censor the title...
censorText($topicinfo['subject']);
$context['page_title'] = $topicinfo['subject'];

Add after


if (!empty($topicinfo['id_member_started']))
{
    global $memberContext, $user_profile;

if (empty($user_profile[$topicinfo['id_member_started']]))
loadMemberData($topicinfo['id_member_started']);

loadMemberContext($topicinfo['id_member_started']);
   
   if (!empty($memberContext[$topicinfo['id_member_started']]['googleplus']['href']))
        $context['html_headers'] .= '
<link rel="author" href="' .$memberContext[$topicinfo['id_member_started']]['googleplus']['href'].'" />';
}




Final revised version works thanks to Arantor.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

Two extra queries per page without even checking to see if the data is already loaded?

if (!empty($topicinfo['id_member_started']))
{
global $memberContext;
if (empty($memberContext[$topicinfo['id_member_started']]))
{
loadMemberData($topicinfo['id_member_started']);
loadMemberContext($topicinfo['id_member_started']);
}
$context['html_headers'] .= '
<link rel="author" href="' . $memberContext[$topicinfo['id_member_started']]['googleplus']['href'] . '" />';
}

Advertisement: