- Timestamp:
- Mar 10, 2013, 5:12:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Subscribe_to_comments/include/functions.inc.php
r21340 r21441 66 66 AND email != "'.$exclude.'" 67 67 '; 68 $subscriptions = hash_from_query($query, 'email'); 68 $subscriptions = hash_from_query($query, 'id'); 69 70 if (count($subscriptions)==0) return; 69 71 70 72 set_make_full_url(); … … 551 553 function get_picture_infos($image_id, $with_thumb=true) 552 554 { 555 if (empty($image_id)) return array(); 556 553 557 $query = ' 554 558 SELECT … … 584 588 * @return: array (id, name, url, thumbnail) 585 589 */ 586 function get_category_infos($cat_id, $with_thumb=true )590 function get_category_infos($cat_id, $with_thumb=true, $user_id=null) 587 591 { 588 592 global $conf; 593 594 if ($user_id===null) $user_id = $conf['guest_id']; 589 595 590 596 $query = ' … … 593 599 cat.name, 594 600 cat.permalink, 601 ucc.count_images, 602 cat.uppercats, 595 603 img.id AS image_id, 596 604 img.path 597 605 FROM '.CATEGORIES_TABLE.' AS cat 598 606 LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 599 ON ucc.cat_id = cat.id AND ucc.user_id = '.$ conf['guest_id'].'607 ON ucc.cat_id = cat.id AND ucc.user_id = '.$user_id.' 600 608 LEFT JOIN '.IMAGES_TABLE.' AS img 601 609 ON img.id = ucc.user_representative_picture_id … … 603 611 ;'; 604 612 $element = pwg_db_fetch_assoc(pwg_query($query)); 605 // we use guest_id for user_cache because we don't know the status of recipient606 613 607 614 $element['url'] = make_index_url(array( … … 612 619 if ($with_thumb) 613 620 { 614 $element['thumbnail'] = DerivativeImage::thumb_url(array( 615 'id'=>$element['image_id'], 616 'path'=>$element['path'], 617 )); 621 if (empty($element['image_id']) and $conf['allow_random_representative']) 622 { 623 $image = get_picture_infos(get_random_image_in_category($element)); 624 $element['thumbnail'] = $image['thumbnail']; 625 } 626 else 627 { 628 $element['thumbnail'] = DerivativeImage::thumb_url(array( 629 'id'=>$element['image_id'], 630 'path'=>$element['path'], 631 )); 632 } 618 633 } 619 634
Note: See TracChangeset
for help on using the changeset viewer.