Changeset 15948 for extensions


Ignore:
Timestamp:
Jun 22, 2012, 4:10:24 PM (12 years ago)
Author:
mistic100
Message:

-add option to remove rating
-improve message header

Location:
extensions/GuestBook
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/GuestBook/admin/config.php

    r15940 r15948  
    99    'email_admin_on_comment_validation' => isset($_POST['email_admin_on_comment_validation']),
    1010    'nb_comment_page' => $_POST['nb_comment_page'],
     11    'activate_rating' => isset($_POST['activate_rating']),
    1112    );
    1213   
  • extensions/GuestBook/admin/template/config.tpl

    r15940 r15948  
    1313        <b>{'Number of comments per page'|@translate}</b>
    1414        <input type="text" size="3" maxlength="4" name="nb_comment_page" id="nb_comment_page" value="{$nb_comment_page}">
     15      </label>
     16    </li>
     17
     18    <li>
     19      <label>
     20        <input type="checkbox" name="activate_rating" {if ($activate_rating)}checked="checked"{/if}>
     21        <b>{'Activate rating'|@translate}</b>
    1522      </label>
    1623    </li>
  • extensions/GuestBook/include/guestbook.inc.php

    r15940 r15948  
    111111    'content' => trim( $_POST['content'] ),
    112112    'website' => trim( $_POST['website'] ),
    113     'rate' => $_POST['score'],
     113    'rate' => @$_POST['score'],
    114114   );
    115115
     
    228228        'CONTENT' => trigger_event('render_comment_content',$row['content']),
    229229        'WEBSITE' => $row['website'],
    230         'WEBSITE_NAME' => preg_replace('#^(https?:\/\/)#i', null, $row['website']),
    231         'STARS' => get_stars($row['rate'], GUESTBOOK_PATH .'template/jquery.raty/'),
    232         'RATE' => $row['rate'],
    233230      );
     231     
     232    if ($conf['guestbook']['activate_rating'])
     233    {
     234      $tpl_comment['STARS'] = get_stars($row['rate'], GUESTBOOK_PATH .'template/jquery.raty/');
     235    }
    234236     
    235237    if (is_admin() and !empty($row['email']))
     
    310312        'WEBSITE' => $website ,
    311313        'EMAIL' => $email ,
     314        'ACTIVATE_RATING' => $conf['guestbook']['activate_rating'],
    312315      ));
    313316}
  • extensions/GuestBook/language/en_UK/plugin.lang.php

    r15940 r15948  
    99$lang['* : mandatory fields'] = '* : mandatory fields';
    1010$lang['There are %d messages'] = 'There are %d messages';
     11$lang['Activate rating'] = 'Activate rating';
     12$lang['%s says on %s :'] = '%s says on %s :';
    1113
    1214?>
  • extensions/GuestBook/language/fr_FR/plugin.lang.php

    r15940 r15948  
    99$lang['* : mandatory fields'] = '* : champs obligatoires';
    1010$lang['There are %d messages'] = 'Il y a %d messages';
     11$lang['Activate rating'] = 'Activater la notation';
     12$lang['%s says on %s :'] = '%s a dit le %s :';
    1113
    1214?>
  • extensions/GuestBook/maintain.inc.php

    r15940 r15948  
    88  'email_admin_on_comment_validation' => false,
    99  'nb_comment_page' => 15,
     10  'activate_rating' => true,
    1011)));
    1112
  • extensions/GuestBook/template/comment_list.tpl

    r15940 r15948  
    2727                </div>
    2828                {/if}
     29   
     30    {if $comment.WEBSITE}
     31      {assign var="author" value='<span class="commentAuthor"><a href="'|@cat:$comment.WEBSITE|@cat:'">'|@cat:$comment.AUTHOR|@cat:'</a></span>'}
     32    {else}
     33      {assign var="author" value='<span class="commentAuthor">'|@cat:$comment.AUTHOR|@cat:'</span>'}
     34    {/if}
     35    {assign var="date" value='<span class="commentDate">'|@cat:$comment.DATE|@cat:'</span>'}
     36   
    2937
    3038    <div class="commentHeader">
    31       <span class="commentAuthor">{$comment.AUTHOR}</span>
    32       {if $comment.WEBSITE} - <a href="{$comment.WEBSITE}">{$comment.WEBSITE_NAME}</a>{/if}
    33       {if $comment.EMAIL} - <a href="mailto:{$comment.EMAIL}">{$comment.EMAIL}</a>{/if}<br>
    34       <span class="commentDate">{$comment.DATE}</span>
    35       {if $comment.RATE}{$comment.STARS}{/if}
     39      {'%s says on %s :'|@translate|@sprintf:$author:$date}<br>
     40      {if $comment.STARS}{$comment.STARS}{/if}
     41      {if $comment.EMAIL} <a href="mailto:{$comment.EMAIL}">{$comment.EMAIL}</a>{/if}
    3642    </div>
    3743                {if isset($comment.IN_EDIT)}
  • extensions/GuestBook/template/guestbook.tpl

    r15940 r15948  
    11{combine_css path=$GUESTBOOK_PATH|@cat:"template/style.css"}
    2 {combine_script id="jquery.raty" path=$GUESTBOOK_PATH|@cat:"template/jquery.raty/jquery.raty.min.js"}
     2
     3{if $comment_add.ACTIVATE_RATING}
     4  {combine_script id="jquery.raty" path=$GUESTBOOK_PATH|@cat:"template/jquery.raty/jquery.raty.min.js"}
     5  {footer_script}
     6  $("#comment_rate").raty({ldelim}
     7    path: "{$GUESTBOOK_PATH}template/jquery.raty/",
     8    half: true
     9  });
     10  {/footer_script}
     11{/if}
    312
    413{$MENUBAR}
    514
    615{footer_script}
    7 $("#comment_rate").raty({ldelim}
    8   path: "{$GUESTBOOK_PATH}template/jquery.raty/",
    9   half: true
    10 });
    1116$("#expandForm").click(function() {ldelim}
    1217  $("#guestbookAdd").animate({ldelim}"width": "500px"}, function() {ldelim}
     
    4853  {/if}
    4954    <tr>
     55  {if $comment_add.ACTIVATE_RATING}
    5056    <td>
    5157      <p>{'Rate'|@translate} :</p>
    5258      <p><span id="comment_rate"></span></p>
    5359    </td>
     60  {/if}
    5461    <td>
    5562      <p><label for="website">{'Website'|@translate} :</label></p>
  • extensions/GuestBook/template/style.css

    r15940 r15948  
    1818  margin:0;
    1919  cursor:pointer;
    20   border-bottom-width:1px;
    21   border-bottom-style:dotted;
    2220  text-align:center;
    2321}
     
    5250  list-style:none;
    5351}
    54 
    55 .commentElement .description {
    56   padding:7px !important;
    57 }
    58 
    59 .commentElement .commentHeader  {
    60   background:#444;
    61   margin:-7px;
    62   margin-bottom:0;
    63   padding:3px;
    64   color:#ddd;
    65   border-radius:5px 5px 0 0;
    66 }
    67 
    68 .commentElement .commentHeader a {
    69   color:#FFE093;
    70 }
     52  .commentElement .description {
     53    padding:7px !important;
     54  }
     55  .commentHeader  {
     56    background:#444;
     57    margin:-7px;
     58    margin-bottom:0;
     59    padding:6px;
     60    color:#ddd;
     61    border-radius:5px 5px 0 0;
     62  }
     63  .commentAuthor {
     64    font-size:1.1em;
     65  }
     66  .commentDate {
     67    font-size:0.9em;
     68  }
     69  .commentHeader a {
     70    color:#FFE093;
     71  }
Note: See TracChangeset for help on using the changeset viewer.