Changeset 4539 for extensions/PWG_Stuffs


Ignore:
Timestamp:
12/21/09 13:58:00 (10 years ago)
Author:
patdenice
Message:

[Plugin] [PWG_Stuffs]
Add edit link (if Comment Editor is installed) on LastComs module.

Location:
extensions/PWG_Stuffs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/modules/LastComs/main.inc.php

    r3609 r4539  
    22 
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     4global $user, $conf; 
    45 
    56// +-----------------------------------------------------------------------+ 
     
    164165      } 
    165166    } 
     167 
     168    // Show comment editor link 
     169    if (defined('CE_PATH') and ((!is_a_guest() and ($user[$conf['user_fields']['username']] == $author)) or is_admin())) 
     170    { 
     171      load_language('plugin.lang', CE_PATH); 
     172      $tpl_comment['U_EDIT'] = add_url_params(get_root_url() . 'index.php', array( 
     173            CE_ACTION => CE_ACTION_EDIT, 
     174            CE_ID => $comment['comment_id'])); 
     175    } 
    166176    array_push($block['comments'], $tpl_comment); 
    167177  } 
  • extensions/PWG_Stuffs/template/LastComs.tpl

    r3609 r4539  
    3232      {/if} 
    3333      <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span> 
     34      {if !empty($comment.U_EDIT)}- <a href="{$comment.U_EDIT}">{'ce_edit_tool'|@translate}{/if} 
    3435      <blockquote>{$comment.CONTENT}</blockquote> 
    3536    </div> 
Note: See TracChangeset for help on using the changeset viewer.