SMFHacks.com

SMF Gallery Pro => Support => Topic started by: Jonas1975 on July 12, 2014, 05:41:52 am

Title: Adding Social Networks from Profile to show on comments
Post by: Jonas1975 on July 12, 2014, 05:41:52 am
I'm using a social networks mod that shows on the profile and in posts and I wanted to add to the gallery comments.

What is showing on Topics is this: http://themobilephotographyblog.com/windows-phone-photography-apps/timelapse-pro-windows-phone-8-app-review/

While is blank on Gallery comments: http://themobilephotographyblog.com/gallery/macro/flower-and-fly/4421#c8349

I know I have to add this (code used on topics):
Code: [Select]
// This shows the social media icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="im_icons">
<ul>
', !isset($context['disabled_fields']['facebook']) && !empty($message['member']['facebook']['link']) ? '<li>' . $message['member']['facebook']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['myspace']) && !empty($message['member']['myspace']['link']) ? '<li>' . $message['member']['myspace']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['twitter']) && !empty($message['member']['twitter']['link']) ? '<li>' . $message['member']['twitter']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['googleplus']) && !empty($message['member']['googleplus']['link']) ? '<li>' . $message['member']['googleplus']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['linkedin']) && !empty($message['member']['linkedin']['link']) ? '<li>' . $message['member']['linkedin']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['youtube']) && !empty($message['member']['youtube']['link']) ? '<li>' . $message['member']['youtube']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['deviantart']) && !empty($message['member']['deviantart']['link']) ? '<li>' . $message['member']['deviantart']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['pinterest']) && !empty($message['member']['pinterest']['link']) ? '<li>' . $message['member']['pinterest']['link'] . '</li>' : '', '';

// 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'], '" target="_blank" /><img src="', $settings['images_url'], '/', $custom['customsmiicon'], '" /> </a></li>';
}
if ($shown)
echo '
</ul>
</li>';
}
Just need to understand where to add it, so can anyone help me on this?
Title: Re: Adding Social Networks from Profile to show on comments
Post by: SMFHacks on July 12, 2014, 11:35:50 am
The $message variable isn't loaded in the gallery. You would need to load the members information into the message variable or create a new varaible to load it.
Title: Re: Adding Social Networks from Profile to show on comments
Post by: Jonas1975 on July 12, 2014, 02:44:10 pm
The $message variable isn't loaded in the gallery. You would need to load the members information into the message variable or create a new varaible to load it.
Ok...  that's too "heavy" for me. I thought I would only had to copy/paste a part of the code to somewhere.