Changeset 464 for trunk/comments.php


Ignore:
Timestamp:
Aug 5, 2004, 7:27:09 PM (20 years ago)
Author:
z0rglub
Message:
  • non picture files management
  • refactoring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r420 r464  
    160160    else                         $name.= str_replace( '_', ' ', $file );
    161161    $name.= ' [ '.$subrow['file'].' ]';
    162         // source of the thumbnail picture
    163     $src = $array_cat_directories[$subrow['cat_id']];
    164     $src.= 'thumbnail/'.$conf['prefix_thumbnail'];
    165     $src.= $file.'.'.$subrow['tn_ext'];
    166         // link to the full size picture
     162    // source of the thumbnail picture
     163    if (isset($subrow['tn_ext']) and $subrow['tn_ext'] != '')
     164    {
     165      $src = $array_cat_directories[$subrow['cat_id']];
     166      $src.= 'thumbnail/'.$conf['prefix_thumbnail'];
     167      $src.= $file.'.'.$subrow['tn_ext'];
     168    }
     169    else
     170    {
     171      $src = './template/'.$user['template'].'/mimetypes/';
     172      $src.= strtolower(get_extension($subrow['file'])).'.png';
     173    }
     174   
     175    // link to the full size picture
    167176    $url = PHPWG_ROOT_PATH.'picture.php?cat='.$category_id;
    168177    $url.= '&image_id='.$row['image_id'];
    169        
    170         $template->assign_block_vars('picture',array(
    171           'TITLE_IMG'=>$name,
    172           'I_THUMB'=>$src,
    173           'U_THUMB'=>add_session_id( $url )
    174           ));
    175 
     178   
     179    $template->assign_block_vars(
     180      'picture',
     181      array(
     182        'TITLE_IMG'=>$name,
     183        'I_THUMB'=>$src,
     184        'U_THUMB'=>add_session_id( $url )
     185        ));
     186   
    176187    // for each picture, retrieving all comments
    177188    $query = 'SELECT * FROM '.COMMENTS_TABLE;
    178189    $query.= ' WHERE image_id = '.$row['image_id'];
    179190    $query.= ' AND date > FROM_UNIXTIME('.$maxtime.')';
    180         if ( $user['status'] != 'admin' )
     191    if ( $user['status'] != 'admin' )
    181192    {
    182193      $query.= " AND validated = 'true'";
    183         }
     194    }
    184195    $query.= ' ORDER BY date DESC';
    185196    $query.= ';';
Note: See TracChangeset for help on using the changeset viewer.