Ignore:
Timestamp:
Jan 26, 2013, 2:50:41 PM (11 years ago)
Author:
mistic100
Message:

option to save website URL in photo description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/url_uploader/include/ws_functions.inc.php

    r19804 r20407  
    1818        'maxValue' => $conf['available_permission_levels']
    1919        ),
     20      'url_in_comment' => array('default' => true),
    2021      ),
    2122    'Add image from remote URL.'
     
    8485    );
    8586 
     87  $updates = array();
    8688  if (!empty($params['name']))
    8789  {
    88     single_update(
    89       IMAGES_TABLE,
    90       array('name'=>$params['name']),
    91       array('id' => $image_id)
    92       );
     90    $updates['name'] = $params['name'];
    9391  }
     92  if ($params['url_in_comment']=='true')
     93  {
     94    $url = parse_url($params['file_url']);
     95    $url = $url['scheme'].'://'.$url['host'];
     96    $updates['comment'] = '<a href="'. $url . '">'. $url .'</a>';
     97  }
     98 
     99  single_update(
     100    IMAGES_TABLE,
     101    $updates,
     102    array('id' => $image_id)
     103    );
    94104 
    95105 
Note: See TracChangeset for help on using the changeset viewer.