Add & Create Social Media Icons To Profiles

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

Previous topic - Next topic

Kindred

fodun a minor bug when tied in with the Ultimate profile mod...

the UP mod adds a function template_buddies() with this line
      foreach ($context['member']['buddies_data'] as $buddy_id => $data) {

This mod then adds the buddy social media stuff a little bit into the function.
HOWEVER, this mod calls them
            <td align="center">', $buddy['facebook']['link'], ' ', $buddy['myspace']['link'], ' ', $buddy['twitter']['link'], ' ', $buddy['googleplus']['link'], ' ', $buddy['linkedin']['link'], ' ', $buddy['youtube']['link'], ' ', $buddy['deviantart']['link'], ' ', $buddy['pinterest']['link'], '</td>



see the problem? The foreach is loading the buddy info into a variable array called $buddy_id, but this mod is calling for a variable array called $buddy

easy fix...   eithe rupdate buddy_id to read buddy or vice versa
Слова
Украина

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

Bob Perry of Web Presence Consulting

Quote from: Arantor on February 20, 2013, 02:55:13 PM
QuoteYea a youngster like you

I'm 30 this year.

Some of these other module authors are much younger than you, but I have two sons that are older than them and only a couple years younger than you (chuckle)

Thanks for posting that code, it's going to help me immensely to streamline my own structure of manipulating those damn arrays, man I thought I'd never get it working without getting a new php coding reference book, my copy is for PHP 4... do you do freelance work? I have a project.
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Arantor

I do do freelance work but 1) only if SMF is not involved and 2) I'm pretty backed up at the moment :(

There is a vast amount to pick up on in PHP 5 if you really want to get into it - while the core language remains much the same, the rewritten OOP model plus all the other improvements mean it really is worth investing in the time to understand what you can do and how the language will help you. :)

(Mind you, remember that PHP 5 itself is now something like 8 years old, even PHP 5.3 is not the current release branch any more)

Bob Perry of Web Presence Consulting

Quote from: Arantor on February 20, 2013, 07:22:29 PM
I do do freelance work but 1) only if SMF is not involved and 2) I'm pretty backed up at the moment :(

There is a vast amount to pick up on in PHP 5 if you really want to get into it - while the core language remains much the same, the rewritten OOP model plus all the other improvements mean it really is worth investing in the time to understand what you can do and how the language will help you. :)

(Mind you, remember that PHP 5 itself is now something like 8 years old, even PHP 5.3 is not the current release branch any more)

Dern shame, can you refer me to anyone who may have time for a new project that might be quite lucrative?
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

hcfwesker

Quote from: Kindred on February 20, 2013, 04:11:21 PMsee the problem? The foreach is loading the buddy info into a variable array called $buddy_id, but this mod is calling for a variable array called $buddy

easy fix...   eithe rupdate buddy_id to read buddy or vice versa

Thanx alot for the find.  I've honestly just wanted to do away with the icons on the buddies list page, since they really seem useless there.  Plus the add-on Im working on for members to add and create their own, it'll get messy with overcrowding plus calling the array of the created icons there. 

Bob Perry of Web Presence Consulting

#225
Quote from: hcfwesker on February 21, 2013, 07:43:58 PM
Plus the add-on Im working on...   

How's the update coming? Have you taken a peek at my stats page lately? Only a couple more minor tweaks left to do on your section of it before I call it finished.
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

ummizu

I run a craft forum. How easy would it be to change some of the profiles I don't need, like LinkedIn, to ones I want like Etsy and Ravelry?

Kindred

that would involve changing the code in several places, including text, names and regex design of the urls
Слова
Украина

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

hcfwesker

Quote from: ummizu on February 23, 2013, 04:05:00 PM
I run a craft forum. How easy would it be to change some of the profiles I don't need, like LinkedIn, to ones I want like Etsy and Ravelry?

You can try, if you know what you're doing.  Though sometime in the next couple of weeks I'll have it where you can create your own icons to go along side the social media ones.

If you wanna take a stab at it.  And, actually, LinkedIn is the only one that is the easiest to do, since it asks for the entire URL, and not just the username.  So, in the case, all you would have to do is ::

languages/Modifications.english.php

Reword LinkedIn to the site you want to use, for the title and description

$txt['smi_linkedin_title'] = 'LinkedIn';
$txt['smi_linkedin_desc'] = 'Copy & Paste your LinkedIn profile link.';

then goto your theme's images folder, and overwrite the smilinkedin.png image to the image you want to use, and make sure it keeps the same image name.


Quote from: bperry921 on February 21, 2013, 08:08:40 PMHow's the update coming? Have you taken a peek at my stats page lately? Only a couple more minor tweaks left to do on your section of it before I call it finished.

I just did, and that's pretty slick!

ummizu

Quote from: hcfwesker on February 24, 2013, 05:05:55 PM
Quote from: ummizu on February 23, 2013, 04:05:00 PM
I run a craft forum. How easy would it be to change some of the profiles I don't need, like LinkedIn, to ones I want like Etsy and Ravelry?

You can try, if you know what you're doing.  Though sometime in the next couple of weeks I'll have it where you can create your own icons to go along side the social media ones.

If you wanna take a stab at it.  And, actually, LinkedIn is the only one that is the easiest to do, since it asks for the entire URL, and not just the username.  So, in the case, all you would have to do is ::

languages/Modifications.english.php

Reword LinkedIn to the site you want to use, for the title and description

$txt['smi_linkedin_title'] = 'LinkedIn';
$txt['smi_linkedin_desc'] = 'Copy & Paste your LinkedIn profile link.';

then goto your theme's images folder, and overwrite the smilinkedin.png image to the image you want to use, and make sure it keeps the same image name.



I actually figured it out, removing myspace and deviant art and replaced them with the sites I wanted. I used the sites' favicons as the profile image. Took me a while to get it right, but I'm very happy now.
Great mod, thanks!

ummizu

How can I get the buttons to show if someone is browsing as a guest?

Kindred

You really don't want to do that?

You would not want to expose all of your users' information to spambots and site scrapers!
Слова
Украина

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

Mick.


lurkalot

Quote from: Mick. on March 03, 2013, 04:10:07 PM
Awesome mod. Just started using it.  :P

I agree.  I'm using it on both my sites atm.  Would be even better if it would let you add a couple of custom media sites, as an option.

I'd like to be able to add, reverbnation and soundcloud to the list, it would be great addition for music sites / forums.

Example: http://www.reverbnation.com/ukblackwolf And Example: http://soundcloud.com/euphymis

Any chance for the next release please.  ;)

Arantor

Or, of course, you could just use the built in facility for custom profile fields instead of clogging up the members table...

lurkalot

Quote from: Arantor on March 04, 2013, 12:52:26 PM
Or, of course, you could just use the built in facility for custom profile fields instead of clogging up the members table...

I could, but don't you have to be employed by NASA to use it?  ;D I did try using it once.  That's why I like this mod. 8)   

Arantor

There was even a tutorial around here somewhere for it. (It's only the crazy folk like Sinan, Nathaniel and me who modified it to be more awesome in our own little ways)

OK, you can't reorder them, you don't get them on the member list and you don't get them premade out of the box. But the first and second are fixable with mods, the third just requires a little effort.

ApplianceJunk

Quote from: ummizu on February 25, 2013, 02:24:49 PM
How can I get the buttons to show if someone is browsing as a guest?

Quote from: Kindred on February 25, 2013, 02:31:44 PM
You really don't want to do that?

You would not want to expose all of your users' information to spambots and site scrapers!

I was just looking for how to do this myself after seeing how the facebook and twitter member icons show up for guest on SMF.
Why does SMF allow it if it's something you really don't want to do?

Kindred

because, the way SM.org(this site) does these, there is no permission to restrict them from showing to guests....

it is a bad practice and exposes your user's details to spammers and other collection routines.
Слова
Украина

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

ApplianceJunk

Ok, I understand that SMF has no permission to restrict them, but don't understand why if it's such a bad practice.

I do agree with you though and was looking to do it just so my social media profile icons would be shown to guest.

Instead I have placed our social icons in a couple other places in our index.template.php so our guest could view them.

Thanks,

Advertisement: