no-follow for flag links

soupp - September 18, 2008 - 11:05
Project:Flag content
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hey guys,

I thought it would be nice to have no-follow attribute for flag link to avoid excessive indexing by search engines.

This is the example (around lines 193-218):

<?php

   
if (is_numeric($eid)) {
     
$options = array('class' => 'flag_content');
 
      if (!
_flag_content_check($eid, $type)) {
       
// Not already flagged, flag it for admin
       
$links['flag_content_add'] = array(
         
'title' => t('report this page'),
         
'href' => "flag_content/add/$eid/$type",
         
'attributes' => array(
           
'class' => 'flag_content',
           
'title' => t('Notify the administrators this posting is problematic'),
           
'rel' => 'nofollow' // added nofollow attribute
           
)
          );
      }
      else {
       
// If has admin privileges, show an unflag link
       
if (user_access(FLAG_CONTENT_PERM_MANAGE)) {
         
$links['flag_content_unflag'] = array(
           
'title' => t('unflag'),
           
'href' => "flag_content/unflag/$eid/$type",
           
'attributes' => array(
             
'class' => 'flag_content',
             
'title' => t('Remove flagged marking'),
             
'rel' => 'nofollow' //  added nofollow attribute
             
)
            );
        }
?>

#1

kbahey - September 18, 2008 - 15:20
Version:5.x-2.8» 5.x-2.x-dev
Status:active» needs work

Please create a patch against 5.x-2.x-dev using the info here http://drupal.org/patch

This will make it easier to review and commit so it is a base feature of the module.

#2

soupp - September 18, 2008 - 16:50
Status:needs work» needs review

The patch is attached now. Sorry that missed it.

AttachmentSize
flag_content-nofollow.diff 779 bytes

#3

kbahey - September 18, 2008 - 18:15
Status:needs review» fixed

Thank you .

Committed to 5.x-2.x and 6.x-1.x.

#4

Anonymous (not verified) - October 2, 2008 - 18:22
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.