Ignore:
Timestamp:
Oct 10, 2011, 6:37:18 PM (13 years ago)
Author:
patdenice
Message:

Best rated module is now compatible with piwigo 2.3

Location:
extensions/PWG_Stuffs/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/trunk/main.inc.php

    r10298 r12401  
    3737function load_stuffs()
    3838{
    39   global $template;
     39  global $template, $conf;
    4040
    4141  include(STUFFS_PATH . 'class.inc.php');
     
    4444  $template->set_template_dir(STUFFS_PATH.'theme/template/');
    4545  $template->set_filename('stuffs', 'stuffs_blocks.tpl');
     46  $template->assign('SHOW_THUMBNAIL_CAPTION', $conf['show_thumbnail_caption']);
    4647
    4748  $stuffs = new stuffs();
  • extensions/PWG_Stuffs/trunk/modules/BestRated/main.inc.php

    r9581 r12401  
    2424  );
    2525
    26 $query ='
     26$query = '
    2727SELECT DISTINCT(i.id)
    2828  FROM '.IMAGES_TABLE.' AS i
    2929    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
    3030    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id
    31   WHERE i.average_rate IS NOT NULL';
     31  WHERE i.rating_score IS NOT NULL';
    3232
    3333if (isset($page['category']))
     
    4040$query .= '
    4141      '.$forbidden.'
    42       ORDER BY i.average_rate DESC, i.id ASC
    43     LIMIT 0, '.$datas['nb_images'].'
    44   ;';
     42  ORDER BY i.rating_score DESC, i.id DESC
     43  LIMIT 0, '.$datas['nb_images'].'
     44;';
    4545
    4646$pictures = array();
     
    127127    }
    128128
    129     if ($conf['show_thumbnail_caption'])
    130     {// name of the picture
    131       if (isset($row['name']) and $row['name'] != '')
    132       {
    133         $name = $row['name'];
    134       }
    135       else
    136       {
    137         $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    138       }
     129    if (isset($row['name']) and $row['name'] != '')
     130    {
     131      $name = $row['name'];
     132    }
     133    else
     134    {
     135      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
     136    }
    139137
    140       $tpl_var['NAME'] = '('.$row['average_rate'].') '.$name;
    141     }
     138    $tpl_var['NAME'] = '('.$row['rating_score'].') '.$name;
    142139
    143140    if ( isset($nb_comments_of) )
  • extensions/PWG_Stuffs/trunk/modules/FeaturedPhotos/main.inc.php

    r9581 r12401  
    108108    }
    109109
    110     if ($conf['show_thumbnail_caption'])
    111     {// name of the picture
    112       if (isset($row['name']) and $row['name'] != '')
    113       {
    114         $name = $row['name'];
    115       }
    116       else
    117       {
    118         $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    119       }
     110    if (isset($row['name']) and $row['name'] != '')
     111    {
     112      $name = $row['name'];
     113    }
     114    else
     115    {
     116      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
     117    }
    120118
    121       $tpl_var['NAME'] = $name;
    122     }
     119    $tpl_var['NAME'] = $name;
    123120
    124121    if ( isset($nb_comments_of) )
  • extensions/PWG_Stuffs/trunk/modules/MostVisited/main.inc.php

    r9581 r12401  
    127127    }
    128128
    129     if ($conf['show_thumbnail_caption'])
    130     {// name of the picture
    131       if (isset($row['name']) and $row['name'] != '')
    132       {
    133         $name = $row['name'];
    134       }
    135       else
    136       {
    137         $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    138       }
     129    if (isset($row['name']) and $row['name'] != '')
     130    {
     131      $name = $row['name'];
     132    }
     133    else
     134    {
     135      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
     136    }
    139137
    140       if ( !$user['show_nb_hits'])
    141       {
    142         $name = '('.$row['hit'].') '.$name;
    143       }
     138    if ( !$user['show_nb_hits'])
     139    {
     140      $name = '('.$row['hit'].') '.$name;
     141    }
    144142
    145       $tpl_var['NAME'] = $name;
    146     }
     143    $tpl_var['NAME'] = $name;
    147144
    148145    if ( isset($nb_comments_of) )
  • extensions/PWG_Stuffs/trunk/modules/Random/main.inc.php

    r9581 r12401  
    121121      );
    122122
    123     if ($user['show_nb_hits'])
     123  if ($user['show_nb_hits'])
     124  {
     125    $tpl_var['NB_HITS'] = $row['hit'];
     126  }
     127
     128    if (isset($row['name']) and $row['name'] != '')
    124129    {
    125       $tpl_var['NB_HITS'] = $row['hit'];
     130      $name = $row['name'];
     131    }
     132    else
     133    {
     134      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    126135    }
    127136
    128     if ($conf['show_thumbnail_caption'])
    129     {// name of the picture
    130       if (isset($row['name']) and $row['name'] != '')
    131       {
    132         $name = $row['name'];
    133       }
    134       else
    135       {
    136         $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    137       }
    138 
    139       $tpl_var['NAME'] = $name;
    140     }
     137    $tpl_var['NAME'] = $name;
    141138
    142139    if ( isset($nb_comments_of) )
  • extensions/PWG_Stuffs/trunk/modules/Recent/main.inc.php

    r9581 r12401  
    122122    }
    123123
    124     if ($conf['show_thumbnail_caption'])
    125     {// name of the picture
    126       if (isset($row['name']) and $row['name'] != '')
    127       {
    128         $name = $row['name'];
    129       }
    130       else
    131       {
    132         $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    133       }
     124    if (isset($row['name']) and $row['name'] != '')
     125    {
     126      $name = $row['name'];
     127    }
     128    else
     129    {
     130      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
     131    }
    134132
    135       $tpl_var['NAME'] = $name;
    136     }
     133    $tpl_var['NAME'] = $name;
    137134
    138135    if ( isset($nb_comments_of) )
Note: See TracChangeset for help on using the changeset viewer.