plugins/gallery/browser.php
changeset 4 ad3b061a1c76
parent 2 88c954d2846c
child 9 ebd7003e73c6
equal deleted inserted replaced
3:10d663f5ed88 4:ad3b061a1c76
    84       // It's an image, show a thumbnail
    84       // It's an image, show a thumbnail
    85       $image_link = makeUrlNS('Gallery', $row['img_id']);
    85       $image_link = makeUrlNS('Gallery', $row['img_id']);
    86       $image_url  = makeUrlNS('Special', 'GalleryFetcher/thumb/' . $row['img_id']);
    86       $image_url  = makeUrlNS('Special', 'GalleryFetcher/thumb/' . $row['img_id']);
    87     }
    87     }
    88     
    88     
       
    89     if ( isset($row['score']) )
       
    90     {
       
    91       $row['score'] = number_format($row['score'], 2);
       
    92     }
       
    93     
    89     $image_url_js = addslashes($image_link);
    94     $image_url_js = addslashes($image_link);
    90     $jsclick = ( $session->user_level < USER_LEVEL_ADMIN ) ? ' onclick="window.location=\'' . $image_url_js . '\'"' : '';
    95     $jsclick = ( $session->user_level < USER_LEVEL_ADMIN ) ? ' onclick="window.location=\'' . $image_url_js . '\'"' : '';
    91     
    96     
    92     $out .= '<td style="text-align: center;">
    97     $out .= '<td style="text-align: center;">
    93             <div class="gallery_icon"' . $jsclick . '>';
    98             <div class="gallery_icon"' . $jsclick . '>';
    94     
    99     
    95     $out .= '<a href="' . $image_link . '"><img alt="&lt;Thumbnail&gt;" class="gallery_thumb" src="' . $image_url . '" /></a>';
   100     $out .= '<a href="' . $image_link . '"><img alt="&lt;Thumbnail&gt;" class="gallery_thumb" src="' . $image_url . '" /></a>';
    96     
   101     
    97     if ( $session->user_level < USER_LEVEL_ADMIN )
   102     if ( $session->user_level < USER_LEVEL_ADMIN )
    98     {
   103     {
    99       $out .= $title_safe;
   104       $out .= $title_safe . ( isset($row['score']) ? "<br /><small>Relevance: {$row['score']}</small>" : '' );
   100     }
   105     }
   101     else if ( $session->user_level >= USER_LEVEL_ADMIN )
   106     else if ( $session->user_level >= USER_LEVEL_ADMIN )
   102     {
   107     {
   103       $out .= '<div class="menu_nojs" style="text-align: center;"><a href="#" onclick="return false;" style="margin: 0 auto;">' . $title_safe . '</a>';
   108       $out .= '<div class="menu_nojs" style="text-align: center;"><a href="#" onclick="return false;" style="width: 74px;">' . $title_safe . ( isset($row['score']) ? "<br /><small>Relevance: {$row['score']}</small>" : '' ) . '</a>';
   104       
   109       
   105       $url_delete = makeUrlNS('Special', 'GalleryUpload', 'rm=' . $row['img_id'], true);
   110       $url_delete = makeUrlNS('Special', 'GalleryUpload', 'rm=' . $row['img_id'], true);
   106       $url_edit   = makeUrlNS('Special', 'GalleryUpload', 'edit_img=' . $row['img_id'], true);
   111       $url_edit   = makeUrlNS('Special', 'GalleryUpload', 'edit_img=' . $row['img_id'], true);
   107       
   112       
   108       // Tools menu
   113       // Tools menu