Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
669 views
in Plugins by
It is easy to remove the nofollow from links throughout Q2A and this has been answered before on this site, but I'm wondering if you can allow nofollow for other links but just remove nofollow from the signature plugin, so that the people you allow to have signatures get the benefit of a URL link to their website.

I looked at the code for the signature plugin, but didn't see where I could add this in. Presumably I do an override of the URL function in Q2A in qa-app-format.php - but how would I target the override to only work when the system is analyzing URL's from the signature plugin?

1 Answer

+2 votes
by

Adding a line like this to qa-sig-layer.php should work:

        function signature_output($uid) {
            if(qa_opt('signatures_html'))
                $sig = $this->signatures['user'.$uid];
            else
                $sig = strip_tags($this->signatures['user'.$uid]);
            
            $sig = preg_replace('/nofollow/','',$sig);
                
            return qa_opt('signatures_header').$sig.qa_opt('signatures_footer');
        }

by
Thanks. This worked. I actually replaced the nofollow with an author tag, as follows: $sig = preg_replace('/nofollow/','author',$sig);

Any ideas on how we could add a target=_blank to the URL also? I'm sure this is simple php, but I can't figure it out.
by
you could look for the href tag and just add it before or after with preg_replace.
by
edited by
Thanks. for this plugin
How I can add href tag before or after with preg_replace ?
...