Ignore:
Timestamp:
Nov 11, 2011, 7:11:38 PM (12 years ago)
Author:
mistic100
Message:

display thumbnails on mails and subscriptions list
fix misplaced field on comment form
move management link to profile page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/functions.inc.php

    r12600 r12607  
    5858   
    5959  $generic_content = '
     60<a href="'.$element['url'].'"><img src="'.$element['thumbnail'].'" alt="'.$element['name'].'"></a>
     61<br>
    6062<b>.'.trigger_event('render_comment_author', $comm['author']).'</b> wrote :
    6163
     
    7981
    8082
    81 /*
     83/**
    8284 * add an email to subscribers list
    8385 * @param int (image|category)_id
     
    155157}
    156158
    157 /*
     159
     160/**
    158161 * remove an email from subscribers list
    159162 * @param int (image|category)_id
     
    205208}
    206209
    207 /*
     210
     211/**
    208212 * validate a subscription
    209213 * @param int (image|category)_id
     
    243247}
    244248
     249
    245250/**
    246251 * create absolute url to subscriptions section
     
    284289}
    285290
     291
    286292/**
    287293 * get name and url of a picture
     
    297303    id,
    298304    name,
    299     file
     305    file,
     306    path,
     307    tn_ext
    300308  FROM '.IMAGES_TABLE.'
    301309  WHERE id = '.$image_id.'
     
    316324  $element['url'] = make_picture_url($url_params);
    317325 
     326  $element['thumbnail'] = get_thumbnail_url($element);
     327 
    318328  return $element;
    319329}
     
    326336function get_category_infos($cat_id)
    327337{
     338  global $conf;
     339 
    328340  $query = '
    329341SELECT
    330     id,
    331     name,
    332     permalink
    333   FROM '.CATEGORIES_TABLE.'
    334   WHERE id = '.$cat_id.'
     342    cat.id,
     343    cat.name,
     344    cat.permalink,
     345    img.id AS image_id,
     346    img.path,
     347    img.tn_ext
     348  FROM '.CATEGORIES_TABLE.' AS cat
     349    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc
     350      ON ucc.cat_id = cat.id AND ucc.user_id = '.$conf['guest_id'].'
     351    LEFT JOIN '.IMAGES_TABLE.' AS img
     352      ON img.id = ucc.user_representative_picture_id
     353  WHERE cat.id = '.$cat_id.'
    335354;';
    336355  $element = pwg_db_fetch_assoc(pwg_query($query));
     356  // we use guest_id for user_cache beacause we don't know the status of recipient
    337357 
    338358  $url_params['section'] = 'categories';
     
    340360  $element['url'] = make_index_url($url_params);
    341361 
     362  $element['thumbnail'] = get_thumbnail_url(array(
     363    'id' => $element['image_id'],
     364    'path' => $element['path'],
     365    'tn_ext' => $element['tn_ext'],
     366    ));
     367 
    342368  return $element;
    343369}
     370
    344371
    345372/**
Note: See TracChangeset for help on using the changeset viewer.