Add & Create Social Media Icons To Profiles

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

Previous topic - Next topic

TheListener

@liv42dayOK can we see a link to your forum please.

Fat_Man

Quote from: Kindred on June 28, 2013, 09:20:27 AM
probably another mod which incorrectly changed something like the ?> at the end of the file...

your modifications file should end with ?> on a line by itself, with nothing after it.

Thanks Kindred. That was the problem.
Was missing <?php at the beginning and ?> at the end of the files.

i_fiorentino

Hi guys,
i've tried to install this mod but i've an error like the image below:



I'm using 2.0.4 smf version.

Thanks in advance for any help,

Alessandro

Quackles

Quote from: hcfwesker on April 18, 2013, 02:48:44 PM
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.

I've installed your mod and it works perfectly, however I still want to add other icons like TwitchTV and Steam. So I followed the instructions in the quoted post. But unlike the Facebook, Twitter etc icons it doesn't open the link in a new tab. How would I go about doing this?

Thank you.

Mark S

Quote from: Old Fossil on June 28, 2013, 11:52:14 PM
@liv42dayOK can we see a link to your forum please.

www.classicwinnebagos.com

Checking my error log, I'm getting tens of thousands of errors per day since I added the mod.  They occur everywhere on the forum.

Here's an example:

http://www.classicwinnebagos.com/forum/index.php?topic=5137.0;prev_next=prev

8: Undefined index: customsmiicon

File: /home/classig8/public_html/forum/Sources/Load.php
Line: 1329

Attached is a screen shot of line 1329 area from the error log

* come to think of it, the view profile, email, website, and PM icons aren't showing up on the mini-profile either...

hcfwesker

Quote from: Quackles on June 30, 2013, 08:48:28 AMBut unlike the Facebook, Twitter etc icons it doesn't open the link in a new tab. How would I go about doing this?

kinda embarassed seeing how I too am picky when I want off-site links to open in new tabs lol .... can't believe I forgot to add that.  the fix is simple though, which I'll add in a future update.

In the files for :::

Display.template.php &  PersonalMessage.template.php

Find
<a href="', $custom['value'], '" title="', $custom['title'], ' - ', $custom['value'], '" />
Replace with
<a href="', $custom['value'], '" title="', $custom['title'], ' - ', $custom['value'], '" target="blank" />


Profile.template.php
Find
<a href="', $field['output_html'], '" title="', $field['name'], ' - ', $field['value'], '" />
Replace with
<a href="', $field['output_html'], '" title="', $field['name'], ' - ', $field['value'], '" target="blank" />

UltimateProfile.template.php (<-- if installed)
Find
<a href="', $field['output_html'], '" title="', $field['name'], ' - ', $field['value'], '" />
Replace with
<a href="', $field['output_html'], '" title="', $field['name'], ' - ', $field['value'], '" target="blank" />

hcfwesker

@Liv42dayOK , it may take some time, because if I can't see your site files then I have to goto my test site and duplicate the error myself that is happening before I can suggest any fixes.  I'm sure you have already, but in case not, can you go through files and make sure everything got added correctly.

And also check your database under smf_custom_fields , and make sure the column with the header labeled "customsmiicon" was added.

Mark S

The dbase field "customsmiicon" is there, but all the fields are the ones I made and added using the custom profile field mod.  Nothing from this mod.

I'll send you a PM with Temp logon and Password so you can view the files.  That should be easier for you.

TheListener

Liv the details you sent me should be sent to Wesky as he is the mods author and knows more than I do about the ins and outs.

:)

hcfwesker

In addition, I never asked for them, but if you trust me (which I'm sure most here can defend for me I can be trusted) I'll definitely look into it for ya.  Just may not be tonight.  Tomorrow may be more free for me.

Quote from: Liv42dayOK on June 30, 2013, 06:48:19 PM
The dbase field "customsmiicon" is there, but all the fields are the ones I made and added using the custom profile field mod.  Nothing from this mod.

That field is only used for your custom added social media icons image path being used; it shouldn't have anything from the default profile fields feature in the column.

Mark S

That's what I thought about that db field.

I'll send you a PM w/logon info.  No need to convince me on the trust issue.  The way you've supported this mod is proof enough of your committment and willingness to help.


CheeseHead05

hcfwesker,

Quote from: hcfwesker on June 24, 2013, 08:24:21 PM
Quote from: CheeseHead05 on June 23, 2013, 08:47:08 PMI've tried all of that still no resolution...

Then you didn't install the MOd correctly or some edits failed on install and you installed the mod anyways.

Instead of replying with "none of that worked ...."  Let's make a checklist for each item.  Answer EACH question individually with your findings because obviously you haven't, yet.  Saying "I tried that and it didn't work"  tells me nothing.

1. Do the icons appear anywhere else besides not showing on the profile page.  ( Seriously, check all pages they're suppose to display on).  PM, posts, profile, ultimate profile.
2.  Do ANY of the default social media icons show, like facebook or youtube?
3.  Have you checked the SMF Default Curve theme? 
4.  Have you checked the php files relating to profiles to confirm edits were added correctly?
5.  Go through the parse page on the MOD download page and check ALL edits were added correctly, and for files on your custom theme.
6.  Did you upload your image to the default AND custom theme's images folder?

I'm sorry dude, I'm just getting more on edge asking questions for details but i get a short generic response in return.  This is going to be an issue with coding most likely.  Problem is I can't hop on your databse and site and do the searching myself, so we have to narrow down the problem to decide what files to check.  You're the only one having this issue so it obviously has to be an install/coding issue on your part.

I viewed the Mod download page, clicked on my custom theme and I also attempted to make edits in the core folder, like the "test failed" section asks but my notepad++ cant find what the "failed section" asks me to find and replace, or add after/before. I attached a screenshot. I added the image file to both custom and default theme. Ive check the default curve and it still didnt show up, no the icons do not show anywhere else other than the edit profile field section and yes facebook, deviant, and youtube shows up in multiple areas such as forum profile and when you send pm's ect..I just dont know what is wrong....

hcfwesker

Quote from: CheeseHead05 on June 30, 2013, 09:04:42 PMI viewed the Mod download page, clicked on my custom theme and I also attempted to make edits in the core folder, like the "test failed" section asks but my notepad++ cant find what the "failed section" asks me to find and replace, or add after/before. I attached a screenshot. I added the image file to both custom and default theme. Ive check the default curve and it still didnt show up, no the icons do not show anywhere else other than the edit profile field section and yes facebook, deviant, and youtube shows up in multiple areas such as forum profile and when you send pm's ect..I just dont know what is wrong....

IFFFF you don't use the 'core' theme, I recommend deleting it from your theme settings in admin menu.  so many MODs fail on install and members ask for help when they dont even use the theme.  It's just an SMF1 style theme on SMF2.  Now, the SMF Default Curve theme ... NEVER delete that one lol.

Honestly, i'm trying to help, but it HAS to be an issue with codes being installed incorrectly or not at all.  don't wwoory ablout the "find & replace" code instructions, just goto the files and search for "smi" which will lead you to find anything in the file with "smiicon" if you dont find anything like that then the code was not added correctly.

Also, in the Create/Edit page for your custom icon, did you select the option up top to "Show On Topic View"?

I don't know what files you're attaching to your post.  what am i suppose to be looking for?

Do this for me, download and attach your Display.template.php file from your default theme, and we'll go from there.



hcfwesker

Quote from: Liv42dayOK on June 30, 2013, 08:14:59 PMI'll send you a PM w/logon info.  No need to convince me on the trust issue.  The way you've supported this mod is proof enough of your committment and willingness to help.

I really appreciate that.  I've looked into it a bit but all I can see are Theme files from the admin menu.  I guess what I could use is if you could attach both Load.php & ManageSettings.php from your Sources folder and Display.template.php in your next post.  I'm wondering if it has to do with you shifting the code around to make your default custom profile fields align; I never tested that so it doesn't surprise me it glitched a tad on ya so I want to look into that and fixing it.  May explain some of the issues.

Quackles

Thanks for the open in new tab fix.

However, I still have another problem.



When the person only has the Twitch and Steam icon in their profile it becomes all weird. If they add just one more from the original like YouTube or Twitter it becomes normal. How do I fix this?

Thanks.

hcfwesker

thats a bug Ive already noted.  just havent had any free time to correct it and supply the edits.  not sure about the issues with it not displaying on your profile pages.  unless a conflicting MOD is installed?

hcfwesker

Quote from: Quackles on July 03, 2013, 01:55:18 AMWhen the person only has the Twitch and Steam icon in their profile it becomes all weird. If they add just one more from the original like YouTube or Twitter it becomes normal. How do I fix this?

Thanks.

Try making these changes to BOTH Display.template.php & PersonalMessage.templete.php ... strangely I had it right on the Profiletemplate ???

Find
if ($shown)
echo '
</ul>
</li>';
}

// Show the profile, website, email address, and personal message buttons.


Replace with
if ($shown)
echo '';
}

// Show the profile, website, email address, and personal message buttons.


I tested this in every way possible, but it's members like yourself that help test in every way imaginable :)  So let me know what you find.  I tested with only default SMI icons, only custom SMI icons, Both, and then each with some custom profile options as well. 


Quackles

Thanks for the reply. That did fix the problem with the bullet points showing and other icons.

Only problem is the icons go on top of one another instead of side by side.



Yet again, this problem only occurs when the user has the extra fields in their profile. But is perfectly fine alongside the default Twitter, Facebook etc.

Thank you.

hcfwesker

Man, I suck lol.  I'll retest with more than one custom icon later when I get a chance.

EDIT:::

For right now, try this temp fix til I make a better IF statement for an update ...

Find
// This shows the social media icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="im_icons">
<ul>


Replace With
// This shows the social media icons.
                                 echo '
<li class="im_icons">
<ul>';
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '





Then, that same line from above posts, replace that with this
if ($shown)
echo '</ul>';
}

// Show the profile, website, email address, and personal message buttons.


Reverse the above edit if other problems persist.  but from my short testing all options with different icons active this seems to rid of all the previous issues.



Quackles


Advertisement: