Changeset 18950 for trunk


Ignore:
Timestamp:
Nov 6, 2012, 9:46:56 PM (11 years ago)
Author:
rvelices
Message:
  • fill add comment form fields only if the input comment has been rejected
  • simplify templates
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r18747 r18950  
    139139      'COMMENTS_ORDER_TITLE' => $comments_order == 'ASC' ? l10n('Show latest comments first') : l10n('Show oldest comments first'),
    140140      ));
    141        
     141
    142142    $query = '
    143143SELECT
     
    168168        $row['author'] = l10n('guest');
    169169      }
    170      
     170
    171171      $email = null;
    172172      if (!empty($row['user_email']))
     
    174174        $email = $row['user_email'];
    175175      }
    176       else if (!empty($row['email']))
     176      elseif (!empty($row['email']))
    177177      {
    178178        $email = $row['email'];
     
    221221      {
    222222        $tpl_comment['EMAIL'] = $email;
    223        
     223
    224224        if ($row['validated'] != 'true')
    225225        {
     
    251251  {
    252252    $key = get_ephemeral_key(3, $page['image_id']);
    253    
    254     $template->assign('comment_add',
    255         array(
    256           'F_ACTION' =>         $url_self,
    257           'KEY' =>              $key,
    258           'CONTENT' =>          stripslashes(@$_POST['content']),
    259           'SHOW_AUTHOR' =>      !is_classic_user(),
    260           'AUTHOR_MANDATORY' => $conf['comments_author_mandatory'],
    261           'AUTHOR' =>           stripslashes(@$_POST['author']),
    262           'WEBSITE_URL' =>      stripslashes(@$_POST['website_url']),
    263           'SHOW_EMAIL' =>       !is_classic_user() or empty($user['email']),
    264           'EMAIL_MANDATORY' =>  $conf['comments_email_mandatory'],
    265           'EMAIL' =>            stripslashes(@$_POST['email']),
    266         ));
     253
     254    $tpl_var =  array(
     255        'F_ACTION' =>         $url_self,
     256        'KEY' =>              $key,
     257        'CONTENT' =>          '',
     258        'SHOW_AUTHOR' =>      !is_classic_user(),
     259        'AUTHOR_MANDATORY' => $conf['comments_author_mandatory'],
     260        'AUTHOR' =>           '',
     261        'WEBSITE_URL' =>      '',
     262        'SHOW_EMAIL' =>       !is_classic_user() or empty($user['email']),
     263        'EMAIL_MANDATORY' =>  $conf['comments_email_mandatory'],
     264        'EMAIL' =>            '',
     265      );
     266
     267    if ('reject'==@$comment_action)
     268    {
     269      foreach( array('content', 'author', 'website_url', 'email') as $k)
     270      {
     271        $tpl_var[strtoupper($k)] = htmlspecialchars( stripslashes(@$_POST[$k]) );
     272      }
     273    }
     274    $template->assign('comment_add', $tpl_var);
    267275  }
    268276}
  • trunk/themes/default/template/index.tpl

    r18712 r18950  
    168168{if !empty($CATEGORIES)}{$CATEGORIES}{/if}
    169169{if !empty($cats_navbar)}
    170   {assign var=navbar value=$cats_navbar}
    171   {include file='navigation_bar.tpl'|@get_extent:'navbar'}
     170        {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$cats_navbar}
    172171{/if}
    173172
     
    178177{/if}
    179178{if !empty($thumb_navbar)}
    180   {assign var=navbar value=$thumb_navbar}
    181   {include file='navigation_bar.tpl'|@get_extent:'navbar'}
     179        {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$thumb_navbar}
    182180{/if}
    183181
  • trunk/themes/default/template/picture.tpl

    r18757 r18950  
    33*}
    44{if isset($MENUBAR)}{$MENUBAR}{/if}
    5 <div id="content" {if isset($MENUBAR)}class="contentWithMenu"{/if}>
     5<div id="content"{if isset($MENUBAR)} class="contentWithMenu"{/if}>
    66{if isset($errors) or not empty($infos)}
    77{include file='infos_errors.tpl'}
Note: See TracChangeset for help on using the changeset viewer.