Changeset 15922


Ignore:
Timestamp:
06/21/12 10:14:48 (7 years ago)
Author:
mistic100
Message:

-make the banner displaying if there is spaces in the name
-try to not have spaces in the name !

Location:
extensions/header_manager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/header_manager/admin/add.php

    r15854 r15922  
    6565  { 
    6666    $picture = pwg_db_fetch_assoc($result); 
     67    $picture['filename'] = basename($picture['path']); 
    6768     
    68     copy(PHPWG_ROOT_PATH . $picture['path'], HEADER_MANAGER_DIR . $picture['file']); 
     69    copy(PHPWG_ROOT_PATH . $picture['path'], HEADER_MANAGER_DIR . $picture['filename']); 
    6970     
    7071    define('IN_CROP', true); 
     
    8788  if (count($page['errors']) == 0) 
    8889  { 
    89     move_uploaded_file($file['tmp_name'], HEADER_MANAGER_DIR . $file['name']); 
     90    $file['filename'] = str2url(get_filename_wo_extension($file['name'])).'.'.get_extension($file['name']); 
     91    move_uploaded_file($file['tmp_name'], HEADER_MANAGER_DIR . $file['filename']); 
    9092     
    91     list($width, $height) = getimagesize(HEADER_MANAGER_DIR . $file['name']); 
     93    list($width, $height) = getimagesize(HEADER_MANAGER_DIR . $file['filename']); 
    9294    $picture = array( 
    9395      'file' => $file['name'], 
     96      'filename' => $file['filename'], 
    9497      'width' => $width, 
    9598      'height' => $height, 
     
    108111  conf_update_param('header_manager', serialize($conf['header_manager'])); 
    109112     
    110   $picture['banner_src'] = HEADER_MANAGER_DIR . $picture['file']; 
     113  $picture['banner_src'] = HEADER_MANAGER_DIR . $picture['filename']; 
    111114   
    112115  $template->assign(array( 
  • extensions/header_manager/admin/template/add.tpl

    r15854 r15922  
    5454  <input type="hidden" name="x2"> 
    5555  <input type="hidden" name="y2"> 
    56   <input type="hidden" name="picture_file" value="{$picture.file}"> 
     56  <input type="hidden" name="picture_file" value="{$picture.filename}"> 
    5757   
    5858  <input type="submit" name="submit_crop" value="{'Submit'|@translate}"> 
  • extensions/header_manager/include/header_manager.inc.php

    r15854 r15922  
    4444    $template->append('head_elements', 
    4545'<style type="text/css"> 
    46 #theHeader div.banner { background:transparent url('.$banner['PATH'].') center center no-repeat;height:'.$banner['SIZE'][1].'px;line-height:'.($banner['SIZE'][1]-12).'px;font-size:2.5em;color:#fff;text-shadow:0 0 5px #000; } 
     46#theHeader div.banner { background:transparent url(\''.$banner['PATH'].'\') center center no-repeat;height:'.$banner['SIZE'][1].'px;line-height:'.($banner['SIZE'][1]-12).'px;font-size:2.5em;color:#fff;text-shadow:0 0 5px #000; } 
    4747</style>' 
    4848      ); 
Note: See TracChangeset for help on using the changeset viewer.