News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How to no-follow the Website URL links in member's profiles?

Started by PatrickForum, November 20, 2011, 01:45:30 PM

Previous topic - Next topic

PatrickForum

If a new user creates a new registration on the forum, they often put their URL
in the profile. Since Google doesn't like websites who link to spammers, I want to nofollow
those Website URL links in members profiles. How do I do that? Is there a mod.

Currently I installed the "anti spam links" mod, but with this mod you can't nofollow links in profiles.

Sir Osis of Liver

Just remove the website profile fields from profile.

Admin -> Features and Options -> Profile Fields

You must have Advanced Profile Fields enabled in Core Features.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

PatrickForum

Yes, I know, thanks. But it would be nice for members if they can link to their websites, so I decided to keep this option enabled for members IF I can nofollow the links. I think about disabling this option, but I'd rather keep this option on for members so they have the benefit of it.

Sir Osis of Liver

Didn't try this, but give it a shot -

In Profile.template.php find this:



// Don't show an icon if they haven't specified a website.
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
echo '
<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';



Change it to this:



// Don't show an icon if they haven't specified a website.
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
echo '
<li><a rel="nofollow" href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

PatrickForum

No. I didn't work:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/*****/public_html/geldverdienenopinternetforum.nl/Themes/default/Profile.template.php on line 75

Maybe it's a good idea to do a mod request. I think this is a very useful mod for every SMF forum owner. Don't you think?

Sir Osis of Liver


If you edited the code correctly, it won't throw a parse error.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters



Web Help Forums

I had same problem and ended searching for 'website' through all source files and fix it here:

themes/core/Display.template.php
themes/default/Display.template.php
themes/default/Profile.template.php

a mod would be great!

Advertisement: