Ignore:
Timestamp:
Mar 8, 2013, 1:36:37 AM (12 years ago)
Author:
mistic100
Message:

unused option 'show_admin_buttons' on LastComs module

File:
1 edited

Legend:

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

    r21345 r21346  
    213213        )
    214214      );
     215     
     216    // author
     217    if (empty($comment['author']))
     218    {
     219      $comment['author'] = l10n('guest');
     220    }
    215221
    216222    $tpl_comment = array(
     
    220226      'ALT' => $name,
    221227      'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
    222       'DATE'=>format_date($comment['date'], true),
    223       'CONTENT'=>trigger_event('render_comment_content',$comment['content']),
     228      'DATE' => format_date($comment['date'], true),
     229      'CONTENT' => trigger_event('render_comment_content',$comment['content']),
    224230      'WIDTH' => $datas[3],
    225231      'HEIGHT' => $datas[4],
    226232      );
    227233
    228     if (can_manage_comment('delete', $comment['author_id']))
     234    if ($datas[1] == 'on')
    229235    {
    230236      $url =
     
    232238        .'index.php'
    233239        .get_query_string_diff(array('edit_comment', 'delete_comment','validate_comment', 'pwg_token'));
    234 
    235       $tpl_comment['U_DELETE'] = add_url_params(
    236         $url,
    237         array(
    238           'delete_comment' => $comment['comment_id'],
    239           'pwg_token' => get_pwg_token(),
    240           )
    241         );
    242     }
    243 
    244     if (can_manage_comment('edit', $comment['author_id']))
    245     {
    246       $url =
    247         get_root_url()
    248         .'index.php'
    249         .get_query_string_diff(array('edit_comment', 'delete_comment','validate_comment', 'pwg_token'));
    250 
    251       $tpl_comment['U_EDIT'] = add_url_params(
    252         $url,
    253         array(
    254           'edit_comment' => $comment['comment_id'],
    255           'pwg_token' => get_pwg_token(),
    256           )
    257         );
    258 
    259       if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment))
    260       {
    261         $tpl_comment['IN_EDIT'] = true;
    262         $key = get_ephemeral_key(2, $comment['image_id']);
    263         $tpl_comment['KEY'] = $key;
    264         $tpl_comment['IMAGE_ID'] = $comment['image_id'];
    265         $tpl_comment['CONTENT'] = $comment['content'];
    266         $tpl_comment['PWG_TOKEN'] = get_pwg_token();
    267       }
    268     }
    269 
    270     if (can_manage_comment('validate', $comment['author_id']))
    271     {
    272       if ('true' != $comment['validated'])
    273       {
    274         $tpl_comment['U_VALIDATE'] = add_url_params(
     240       
     241      if (can_manage_comment('delete', $comment['author_id']))
     242      {
     243        $tpl_comment['U_DELETE'] = add_url_params(
    275244          $url,
    276245          array(
    277             'validate_comment'=> $comment['comment_id'],
     246            'delete_comment' => $comment['comment_id'],
    278247            'pwg_token' => get_pwg_token(),
    279248            )
    280249          );
    281250      }
    282     }
     251
     252      if (can_manage_comment('edit', $comment['author_id']))
     253      {
     254        $tpl_comment['U_EDIT'] = add_url_params(
     255          $url,
     256          array(
     257            'edit_comment' => $comment['comment_id'],
     258            'pwg_token' => get_pwg_token(),
     259            )
     260          );
     261
     262        if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment))
     263        {
     264          $tpl_comment['IN_EDIT'] = true;
     265          $key = get_ephemeral_key(2, $comment['image_id']);
     266          $tpl_comment['KEY'] = $key;
     267          $tpl_comment['IMAGE_ID'] = $comment['image_id'];
     268          $tpl_comment['CONTENT'] = $comment['content'];
     269          $tpl_comment['PWG_TOKEN'] = get_pwg_token();
     270        }
     271      }
     272
     273      if (can_manage_comment('validate', $comment['author_id']))
     274      {
     275        if ('true' != $comment['validated'])
     276        {
     277          $tpl_comment['U_VALIDATE'] = add_url_params(
     278            $url,
     279            array(
     280              'validate_comment'=> $comment['comment_id'],
     281              'pwg_token' => get_pwg_token(),
     282              )
     283            );
     284        }
     285      }
     286    }
     287   
    283288    array_push($block['comments'], $tpl_comment);
    284289  }
Note: See TracChangeset for help on using the changeset viewer.