Ignore:
Timestamp:
Jun 12, 2011, 12:29:11 AM (13 years ago)
Author:
mistic100
Message:

correct link in notification mail, add album thumbnail on comments list (both public and admin side)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/include/coa_comments_page.php

    r11267 r11327  
    197197    com.validated
    198198  FROM '.COA_TABLE.' AS com
    199   LEFT JOIN '.USERS_TABLE.' As u
    200     ON u.'.$conf['user_fields']['id'].' = com.author_id
     199    LEFT JOIN '.USERS_TABLE.' As u
     200      ON u.'.$conf['user_fields']['id'].' = com.author_id
    201201  WHERE '.implode('
    202202    AND ', $page['where_clauses']).'
     
    234234    cat.permalink,
    235235    cat.uppercats,
    236     com.id as comment_id
     236    com.id as comment_id,
     237    img.id AS image_id,
     238    img.path,
     239    img.tn_ext
    237240  FROM '.CATEGORIES_TABLE.' AS cat
    238   LEFT JOIN '.COA_TABLE.' AS com
    239     ON cat.id=com.category_id
     241    LEFT JOIN '.COA_TABLE.' AS com
     242      ON com.category_id = cat.id
     243    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc
     244      ON ucc.cat_id = cat.id AND ucc.user_id = '.$user['id'].'
     245    LEFT JOIN '.IMAGES_TABLE.' AS img
     246      ON img.id = ucc.user_representative_picture_id
    240247  '.get_sql_condition_FandF(
    241248    array(
     
    251258    foreach ($comments as $comment)
    252259    {
    253       // category
    254       $name = $categories[$comment['comment_id']]['name'];
    255       $url = duplicate_index_url(
     260      // category url
     261      $comment['cat_url'] = duplicate_index_url(
    256262        array(
    257263          'category' => array(
     
    263269          )
    264270        );
     271       
     272      // category thumbnail
     273      $comment['thumb'] = get_thumbnail_url(
     274        array(
     275          'id' => $categories[$comment['comment_id']]['image_id'],
     276          'path' => $categories[$comment['comment_id']]['path'],
     277          'tn_ext' => @$categories[$comment['comment_id']]['tn_ext'],
     278          )
     279       );
    265280     
    266281      // comment content
    267282      $tpl_comment = array(
    268283        'ID' => $comment['comment_id'],
    269         'CAT_URL' => $url,
    270         'CAT_NAME' => $name,
     284        'U_PICTURE' => $comment['cat_url'],
     285        'ALT' => trigger_event('render_category_name', $categories[$comment['comment_id']]['name']),
     286        'TN_SRC' => $comment['thumb'],
    271287        'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
    272288        'DATE' => format_date($comment['date'], true),
     
    341357 
    342358  function coa_change_comments_list($content, &$smarty) {
    343     $search = '<div class="description"{if isset($comment.IN_EDIT)} style="height:200px"{/if}>';
    344 
    345     $replacement = '<div class="category-title">
    346   <a href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
    347 </div>
    348 '.$search;
    349 
     359    $search = '<img src="{$comment.TN_SRC}" alt="{$comment.ALT}">';
     360    $replacement = $search.'<br/>{$comment.ALT}';
    350361    return str_replace($search, $replacement, $content);
    351362  }
Note: See TracChangeset for help on using the changeset viewer.